~mfisch/brasero/update-to-3.8.0

« back to all changes in this revision

Viewing changes to libbrasero-burn/brasero-track-data-cfg.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2009-09-08 09:33:41 UTC
  • mfrom: (1.1.29 upstream)
  • Revision ID: james.westby@ubuntu.com-20090908093341-jh02q5ba0q8jyu9l
Tags: 2.27.92-0ubuntu1
* New upstream release (LP: #425998)
  - Some improvements when handling DVD-RW sequential
  - #593829 - Brasero gets stuck in a loop at "Getting size" while burning another session on a multi-session disk
  - #578466 - Unable to overburn
  - #593314 - Brasero is failing to burn from sftp
  - #593492 - Compilation must be ordered by file name
  - #587122 - Copying DVD - "Error while reading video DVD (no error)"
  - #592026 - brasero crashes when eject a medium
  - #592025 - brasero crashes on detecting src images on a NFS path when preparing burning an image
  - #591880 - Image checksumming causes internal error (LP: #354995)
  - #591397 - Brasero Main window pops up after exiting from Image Burning window.
  - Translation updates
  - lots of small fixes and improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
924
924
        return path;
925
925
}
926
926
 
927
 
BraseroFileNode *
 
927
static BraseroFileNode *
928
928
brasero_track_data_cfg_path_to_node (BraseroTrackDataCfg *self,
929
929
                                     GtkTreePath *path)
930
930
{
1754
1754
}
1755
1755
 
1756
1756
static void
1757
 
brasero_track_data_cfg_finalize (GObject *object)
1758
 
{
1759
 
        BraseroTrackDataCfgPrivate *priv;
1760
 
 
1761
 
        priv = BRASERO_TRACK_DATA_CFG_PRIVATE (object);
1762
 
 
1763
 
        brasero_track_data_clean_autorun (BRASERO_TRACK_DATA_CFG (object));
1764
 
        brasero_track_data_cfg_clean_cache (BRASERO_TRACK_DATA_CFG (object));
1765
 
 
1766
 
        if (priv->shown) {
1767
 
                g_slist_free (priv->shown);
1768
 
                priv->shown = NULL;
1769
 
        }
1770
 
 
1771
 
        if (priv->tree) {
1772
 
                g_object_unref (priv->tree);
1773
 
                priv->tree = NULL;
1774
 
        }
1775
 
 
1776
 
        G_OBJECT_CLASS (brasero_track_data_cfg_parent_class)->finalize (object);
1777
 
}
1778
 
 
1779
 
static void
1780
1757
brasero_track_data_cfg_iface_init (gpointer g_iface, gpointer data)
1781
1758
{
1782
1759
        GtkTreeModelIface *iface = g_iface;
1855
1832
 * Track part
1856
1833
 */
1857
1834
 
 
1835
/**
 
1836
 * brasero_track_data_cfg_add:
 
1837
 * @track: a #BraseroTrackDataCfg
 
1838
 * @uri: a #gchar
 
1839
 * @parent: a #GtkTreePath or NULL
 
1840
 *
 
1841
 * Add a new file (with @uri as URI) under a directory (@parent).
 
1842
 * If @parent is NULL, the file is added to the root.
 
1843
 * Also if @uri is the path of a directory, this directory will be explored
 
1844
 * and all its children added to the tree.
 
1845
 *
 
1846
 * Return value: a #gboolean. TRUE if the operation was successful, FALSE otherwise
 
1847
 **/
 
1848
 
1858
1849
gboolean
1859
1850
brasero_track_data_cfg_add (BraseroTrackDataCfg *track,
1860
1851
                            const gchar *uri,
1880
1871
        return (brasero_data_project_add_loading_node (BRASERO_DATA_PROJECT (BRASERO_DATA_PROJECT (priv->tree)), uri, parent_node) != NULL);
1881
1872
}
1882
1873
 
 
1874
/**
 
1875
 * brasero_track_data_cfg_add_empty_directory:
 
1876
 * @track: a #BraseroTrackDataCfg
 
1877
 * @name: a #gchar
 
1878
 * @parent: a #GtkTreePath or NULL
 
1879
 *
 
1880
 * Add a new empty directory (with @name as name) under another directory (@parent).
 
1881
 * If @parent is NULL, the file is added to the root.
 
1882
 *
 
1883
 * Return value: a #GtkTreePath which should be destroyed when not needed; NULL if the operation was not successful.
 
1884
 **/
 
1885
 
1883
1886
GtkTreePath *
1884
1887
brasero_track_data_cfg_add_empty_directory (BraseroTrackDataCfg *track,
1885
1888
                                            const gchar *name,
1934
1937
        return path;
1935
1938
}
1936
1939
 
 
1940
/**
 
1941
 * brasero_track_data_cfg_remove:
 
1942
 * @track: a #BraseroTrackDataCfg
 
1943
 * @treepath: a #GtkTreePath
 
1944
 *
 
1945
 * Removes a file or a directory (as well as its children) from the tree.
 
1946
 * NOTE: some files cannot be removed like files from an imported session.
 
1947
 *
 
1948
 * Return value: a #gboolean. TRUE if the operation was successful, FALSE otherwise
 
1949
 **/
 
1950
 
1937
1951
gboolean
1938
1952
brasero_track_data_cfg_remove (BraseroTrackDataCfg *track,
1939
1953
                               GtkTreePath *treepath)
1951
1965
        return TRUE;
1952
1966
}
1953
1967
 
 
1968
/**
 
1969
 * brasero_track_data_cfg_rename:
 
1970
 * @track: a #BraseroTrackDataCfg
 
1971
 * @newname: a #gchar
 
1972
 * @treepath: a #GtkTreePath
 
1973
 *
 
1974
 * Renames the file in the tree pointed by @treepath.
 
1975
 *
 
1976
 * Return value: a #gboolean. TRUE if the operation was successful, FALSE otherwise
 
1977
 **/
 
1978
 
1954
1979
gboolean
1955
1980
brasero_track_data_cfg_rename (BraseroTrackDataCfg *track,
1956
1981
                               const gchar *newname,
1967
1992
                                                 newname);
1968
1993
}
1969
1994
 
 
1995
/**
 
1996
 * brasero_track_data_cfg_reset:
 
1997
 * @track: a #BraseroTrackDataCfg
 
1998
 *
 
1999
 * Completely empties @track and unloads any currently loaded session
 
2000
 *
 
2001
 * Return value: a #gboolean. TRUE if the operation was successful, FALSE otherwise
 
2002
 **/
 
2003
 
1970
2004
gboolean
1971
2005
brasero_track_data_cfg_reset (BraseroTrackDataCfg *track)
1972
2006
{
2007
2041
        return TRUE;
2008
2042
}
2009
2043
 
 
2044
/**
 
2045
 * brasero_track_data_cfg_get_filtered_model:
 
2046
 * @track: a #BraseroTrackDataCfg
 
2047
 *
 
2048
 * Gets a GtkTreeModel which contains all the files that were
 
2049
 * automatically filtered while added directories were explored.
 
2050
 *
 
2051
 * Return value: a #GtkTreeModel. Unref when not needed.
 
2052
 **/
 
2053
 
2010
2054
GtkTreeModel *
2011
2055
brasero_track_data_cfg_get_filtered_model (BraseroTrackDataCfg *track)
2012
2056
{
2020
2064
        return model;
2021
2065
}
2022
2066
 
 
2067
/**
 
2068
 * brasero_track_data_cfg_restore:
 
2069
 * @track: a #BraseroTrackDataCfg
 
2070
 * @treepath: a #GtkTreePath
 
2071
 *
 
2072
 * Removes a file from the filtered file list (see brasero_track_data_cfg_get_filtered_model ())
 
2073
 * and re-adds it wherever it should be in the tree.
 
2074
 * @treepath is a #GtkTreePath associated with the #GtkTreeModel which holds the
 
2075
 * filtered files not the main tree.
 
2076
 *
 
2077
 **/
 
2078
 
2023
2079
void
2024
2080
brasero_track_data_cfg_restore (BraseroTrackDataCfg *track,
2025
2081
                                GtkTreePath *treepath)
2038
2094
        g_free (uri);
2039
2095
}
2040
2096
 
 
2097
/**
 
2098
 * brasero_track_data_cfg_dont_filter_uri:
 
2099
 * @track: a #BraseroTrackDataCfg
 
2100
 * @uri: a #gchar
 
2101
 *
 
2102
 * Prevents @uri to be filtered while automatic exploration
 
2103
 * of added directories is performed.
 
2104
 *
 
2105
 **/
 
2106
 
2041
2107
void
2042
2108
brasero_track_data_cfg_dont_filter_uri (BraseroTrackDataCfg *track,
2043
2109
                                        const gchar *uri)
2053
2119
        brasero_data_project_restore_uri (BRASERO_DATA_PROJECT (priv->tree), uri);
2054
2120
}
2055
2121
 
 
2122
/**
 
2123
 * brasero_track_data_cfg_get_restored_list:
 
2124
 * @track: a #BraseroTrackDataCfg
 
2125
 *
 
2126
 * Gets a list of URIs (as #gchar *) that were restored with brasero_track_data_cfg_restore ().
 
2127
 *
 
2128
 * Return value: a #GSList; free the list and its contents when not needed anymore.
 
2129
 **/
 
2130
 
2056
2131
GSList *
2057
2132
brasero_track_data_cfg_get_restored_list (BraseroTrackDataCfg *track)
2058
2133
{
2066
2141
        return brasero_filtered_uri_get_restored_list (filtered);
2067
2142
}
2068
2143
 
 
2144
/**
 
2145
 * brasero_track_data_cfg_load_medium:
 
2146
 * @track: a #BraseroTrackDataCfg
 
2147
 * @medium: a #BraseroMedium
 
2148
 * @error: a #GError
 
2149
 *
 
2150
 * Tries to load the contents of the last session of @medium so all its files will be included in the tree
 
2151
 * to perform a merge between files from the session and new added files.
 
2152
 * Errors are stored in @error.
 
2153
 *
 
2154
 * Return value: a #gboolean. TRUE if the operation was successful, FALSE otherwise
 
2155
 **/
 
2156
 
2069
2157
gboolean
2070
2158
brasero_track_data_cfg_load_medium (BraseroTrackDataCfg *track,
2071
2159
                                    BraseroMedium *medium,
2080
2168
                                              error);
2081
2169
}
2082
2170
 
 
2171
/**
 
2172
 * brasero_track_data_cfg_unload_current_medium:
 
2173
 * @track: a #BraseroTrackDataCfg
 
2174
 *
 
2175
 * Unload the contents of the last session of the currently loaded medium.
 
2176
 * See brasero_track_data_cfg_load_medium ().
 
2177
 *
 
2178
 **/
 
2179
 
2083
2180
void
2084
2181
brasero_track_data_cfg_unload_current_medium (BraseroTrackDataCfg *track)
2085
2182
{
2090
2187
        brasero_data_session_remove_last (BRASERO_DATA_SESSION (priv->tree));
2091
2188
}
2092
2189
 
 
2190
/**
 
2191
 * brasero_track_data_cfg_get_current_medium:
 
2192
 * @track: a #BraseroTrackDataCfg
 
2193
 *
 
2194
 * Gets the currently loaded medium.
 
2195
 *
 
2196
 * Return value: a #BraseroMedium. NULL if no medium are currently loaded.
 
2197
 * Do not unref when the #BraseroMedium is not needed anymore.
 
2198
 **/
 
2199
 
2093
2200
BraseroMedium *
2094
2201
brasero_track_data_cfg_get_current_medium (BraseroTrackDataCfg *track)
2095
2202
{
2100
2207
        return brasero_data_session_get_loaded_medium (BRASERO_DATA_SESSION (priv->tree));
2101
2208
}
2102
2209
 
 
2210
/**
 
2211
 * brasero_track_data_cfg_get_available_media:
 
2212
 * @track: a #BraseroTrackDataCfg
 
2213
 *
 
2214
 * Gets a list of all the media that can be appended with new data and which have a session that can be loaded.
 
2215
 *
 
2216
 * Return value: a #GSList of #BraseroMedium. Free the list and unref its contents when the list is not needed anymore.
 
2217
 **/
 
2218
 
2103
2219
GSList *
2104
2220
brasero_track_data_cfg_get_available_media (BraseroTrackDataCfg *track)
2105
2221
{
2794
2910
        brasero_track_changed (BRASERO_TRACK (self));
2795
2911
}
2796
2912
 
 
2913
/**
 
2914
 * brasero_track_data_cfg_span:
 
2915
 * @track: a #BraseroTrackDataCfg
 
2916
 * @sectors: a #goffset
 
2917
 * @new_track: a #BraseroTrackData
 
2918
 *
 
2919
 * Creates a new #BraseroTrackData (stored in @new_track) from the files contained in @track. The sum of their sizes
 
2920
 * does not exceed @sectors. This allows to burn a tree on multiple discs. This function can be
 
2921
 * called repeatedly; in this case if some files were left out after the previous calls, the newly created BraseroTrackData
 
2922
 * is created with all or part of the remaining files.
 
2923
 *
 
2924
 * Return value: a #BraseroBurnResult. BRASERO_BURN_OK if there is not anymore data.
 
2925
 * BRASERO_BURN_RETRY if the operation was successful and a new #BraseroTrackDataCfg was created.
 
2926
 * BRASERO_BURN_ERR otherwise.
 
2927
 **/
 
2928
 
2797
2929
BraseroBurnResult
2798
2930
brasero_track_data_cfg_span (BraseroTrackDataCfg *track,
2799
2931
                             goffset sectors,
2820
2952
        return BRASERO_BURN_RETRY;
2821
2953
}
2822
2954
 
 
2955
/**
 
2956
 * brasero_track_data_cfg_span_again:
 
2957
 * @track: a #BraseroTrackDataCfg
 
2958
 *
 
2959
 * Checks whether some files were not included during calls to brasero_track_data_cfg_span ().
 
2960
 *
 
2961
 * Return value: a #BraseroBurnResult. BRASERO_BURN_OK if there is not anymore data.
 
2962
 * BRASERO_BURN_RETRY if the operation was successful and a new #BraseroTrackDataCfg was created.
 
2963
 * BRASERO_BURN_ERR otherwise.
 
2964
 **/
 
2965
 
2823
2966
BraseroBurnResult
2824
2967
brasero_track_data_cfg_span_again (BraseroTrackDataCfg *track)
2825
2968
{
2829
2972
        return brasero_data_project_span_again (BRASERO_DATA_PROJECT (priv->tree));
2830
2973
}
2831
2974
 
 
2975
/**
 
2976
 * brasero_track_data_cfg_span_possible:
 
2977
 * @track: a #BraseroTrackDataCfg
 
2978
 * @sectors: a #goffset
 
2979
 *
 
2980
 * Checks if a new #BraseroTrackData can be created from the files remaining in the tree 
 
2981
 * after calls to brasero_track_data_cfg_span ().
 
2982
 *
 
2983
 * Return value: a #BraseroBurnResult. BRASERO_BURN_OK if there is not anymore data.
 
2984
 * BRASERO_BURN_RETRY if the operation was successful and a new #BraseroTrackDataCfg was created.
 
2985
 * BRASERO_BURN_ERR otherwise.
 
2986
 **/
 
2987
 
2832
2988
BraseroBurnResult
2833
2989
brasero_track_data_cfg_span_possible (BraseroTrackDataCfg *track,
2834
2990
                                      goffset sectors)
2845
3001
                                                   sectors);
2846
3002
}
2847
3003
 
 
3004
/**
 
3005
 * brasero_track_data_cfg_span_stop:
 
3006
 * @track: a #BraseroTrackDataCfg
 
3007
 *
 
3008
 * Resets the list of files that were included after calls to brasero_track_data_cfg_span ().
 
3009
 **/
 
3010
 
2848
3011
void
2849
3012
brasero_track_data_cfg_span_stop (BraseroTrackDataCfg *track)
2850
3013
{
2855
3018
}
2856
3019
 
2857
3020
/**
 
3021
 * brasero_track_data_cfg_span_max_space:
 
3022
 * @track: a #BraseroTrackDataCfg
 
3023
 *
 
3024
 * Returns the maximum required space (in sectors) 
 
3025
 * among all the possible spanned batches.
 
3026
 * This means that when burningto a media
 
3027
 * it will also be the minimum required
 
3028
 * space to burn all the contents in several
 
3029
 * batches.
 
3030
 *
 
3031
 * Return value: a #goffset.
 
3032
 **/
 
3033
 
 
3034
goffset
 
3035
brasero_track_data_cfg_span_max_space (BraseroTrackDataCfg *track)
 
3036
{
 
3037
        BraseroTrackDataCfgPrivate *priv;
 
3038
 
 
3039
        priv = BRASERO_TRACK_DATA_CFG_PRIVATE (track);
 
3040
        return brasero_data_project_get_max_space (BRASERO_DATA_PROJECT (priv->tree));
 
3041
}
 
3042
 
 
3043
/**
2858
3044
 * This is to handle the icon for the image
2859
3045
 */
 
3046
 
 
3047
/**
 
3048
 * brasero_track_data_cfg_get_icon_path:
 
3049
 * @track: a #BraseroTrackDataCfg
 
3050
 *
 
3051
 * Returns a path pointing to the currently selected icon file.
 
3052
 *
 
3053
 * Return value: a #gchar or NULL.
 
3054
 **/
 
3055
 
2860
3056
gchar *
2861
3057
brasero_track_data_cfg_get_icon_path (BraseroTrackDataCfg *track)
2862
3058
{
2871
3067
        return g_file_get_path (priv->image_file);
2872
3068
}
2873
3069
 
 
3070
/**
 
3071
 * brasero_track_data_cfg_get_icon:
 
3072
 * @track: a #BraseroTrackDataCfg
 
3073
 *
 
3074
 * Returns the currently selected icon.
 
3075
 *
 
3076
 * Return value: a #GIcon or NULL.
 
3077
 **/
 
3078
 
2874
3079
GIcon *
2875
3080
brasero_track_data_cfg_get_icon (BraseroTrackDataCfg *track)
2876
3081
{
2911
3116
        return path;
2912
3117
}
2913
3118
 
 
3119
/**
 
3120
 * brasero_track_data_cfg_set_icon:
 
3121
 * @track: a #BraseroTrackDataCfg
 
3122
 * @icon_path: a #gchar
 
3123
 * @error: a #GError
 
3124
 *
 
3125
 * Sets the current icon.
 
3126
 *
 
3127
 * Return value: a #gboolean. TRUE if the operation was successful, FALSE otherwise
 
3128
 **/
 
3129
 
2914
3130
gboolean
2915
3131
brasero_track_data_cfg_set_icon (BraseroTrackDataCfg *track,
2916
3132
                                 const gchar *icon_path,
3158
3374
}
3159
3375
 
3160
3376
static void
 
3377
brasero_track_data_cfg_finalize (GObject *object)
 
3378
{
 
3379
        BraseroTrackDataCfgPrivate *priv;
 
3380
 
 
3381
        priv = BRASERO_TRACK_DATA_CFG_PRIVATE (object);
 
3382
 
 
3383
        brasero_track_data_clean_autorun (BRASERO_TRACK_DATA_CFG (object));
 
3384
        brasero_track_data_cfg_clean_cache (BRASERO_TRACK_DATA_CFG (object));
 
3385
 
 
3386
        if (priv->shown) {
 
3387
                g_slist_free (priv->shown);
 
3388
                priv->shown = NULL;
 
3389
        }
 
3390
 
 
3391
        if (priv->tree) {
 
3392
                /* This object could outlive us just for some time
 
3393
                 * so we better remove all signals.
 
3394
                 * When an image URI is detected it can happen
 
3395
                 * that we'll be destroyed. */
 
3396
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3397
                                                      brasero_track_data_cfg_node_added,
 
3398
                                                      object);
 
3399
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3400
                                                      brasero_track_data_cfg_node_changed,
 
3401
                                                      object);
 
3402
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3403
                                                      brasero_track_data_cfg_node_removed,
 
3404
                                                      object);
 
3405
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3406
                                                      brasero_track_data_cfg_node_reordered,
 
3407
                                                      object);
 
3408
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3409
                                                      brasero_track_data_cfg_size_changed_cb,
 
3410
                                                      object);
 
3411
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3412
                                                      brasero_track_data_cfg_session_available_cb,
 
3413
                                                      object);
 
3414
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3415
                                                      brasero_track_data_cfg_session_loaded_cb,
 
3416
                                                      object);
 
3417
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3418
                                                      brasero_track_data_cfg_project_loaded,
 
3419
                                                      object);
 
3420
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3421
                                                      brasero_track_data_cfg_activity_changed,
 
3422
                                                      object);
 
3423
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3424
                                                      brasero_track_data_cfg_deep_directory,
 
3425
                                                      object);
 
3426
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3427
                                                      brasero_track_data_cfg_2G_file,
 
3428
                                                      object);
 
3429
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3430
                                                      brasero_track_data_cfg_unreadable_uri_cb,
 
3431
                                                      object);
 
3432
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3433
                                                      brasero_track_data_cfg_unknown_uri_cb,
 
3434
                                                      object);
 
3435
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3436
                                                      brasero_track_data_cfg_recursive_uri_cb,
 
3437
                                                      object);
 
3438
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3439
                                                      brasero_track_data_cfg_image_uri_cb,
 
3440
                                                      object);
 
3441
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3442
                                                      brasero_track_data_cfg_virtual_sibling_cb,
 
3443
                                                      object);
 
3444
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3445
                                                      brasero_track_data_cfg_name_collision_cb,
 
3446
                                                      object);
 
3447
                g_signal_handlers_disconnect_by_func (priv->tree,
 
3448
                                                      brasero_track_data_cfg_joliet_rename_cb,
 
3449
                                                      object);
 
3450
 
 
3451
                g_object_unref (priv->tree);
 
3452
                priv->tree = NULL;
 
3453
        }
 
3454
 
 
3455
        G_OBJECT_CLASS (brasero_track_data_cfg_parent_class)->finalize (object);
 
3456
}
 
3457
 
 
3458
static void
3161
3459
brasero_track_data_cfg_class_init (BraseroTrackDataCfgClass *klass)
3162
3460
{
3163
3461
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
3322
3620
                          G_TYPE_NONE);
3323
3621
}
3324
3622
 
 
3623
/**
 
3624
 * brasero_track_data_cfg_new:
 
3625
 *
 
3626
 * Creates a new #BraseroTrackDataCfg.
 
3627
 *
 
3628
 * Return value: a new #BraseroTrackDataCfg.
 
3629
 **/
 
3630
 
3325
3631
BraseroTrackDataCfg *
3326
3632
brasero_track_data_cfg_new (void)
3327
3633
{