~mfisch/brasero/update-to-3.8.0

« back to all changes in this revision

Viewing changes to libbrasero-burn/brasero-image-properties.c

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Moya
  • Date: 2011-05-18 17:53:39 UTC
  • mfrom: (1.1.47 upstream) (1.4.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20110518175339-so6a6fejezs5i1pc
Tags: 3.0.0-1ubuntu1
* Rebase from Debian and GNOME3 PPA. Remaining Ubuntu changes:
* debian/control:
  - Build-Depend on dh-autoreconf, libappindicator3-dev and
    liblaunchpad-integration-3.0-dev
  - Recommends: brasero-cdrkit
  - libbrasero-media3-1 Depends on dvd+rw-tools not growisofs and
    Suggests rather than Recommends gstreamer plugin packages
* debian/patches/010_lpi.patch:
  - Launchpad integration patch
* debian/patches/012_appindicator.patch:
  - Use application indicators
* debian/rules:
  - Include autoreconf.mk
* debian/watch:
  - Watch unstable releases also

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
static gchar *
90
90
brasero_image_properties_get_path (BraseroImageProperties *self)
91
91
{
92
 
        BraseroImagePropertiesPrivate *priv;
93
 
 
94
 
        priv = BRASERO_IMAGE_PROPERTIES_PRIVATE (self);
95
92
        return gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (self));
96
93
}
97
94
 
99
96
brasero_image_properties_set_path (BraseroImageProperties *self,
100
97
                                   const gchar *path)
101
98
{
102
 
        BraseroImagePropertiesPrivate *priv;
103
 
 
104
 
        priv = BRASERO_IMAGE_PROPERTIES_PRIVATE (self);
105
99
        if (path) {
106
100
                gchar *name;
107
101
 
118
112
                                                     g_get_home_dir ());
119
113
}
120
114
 
 
115
static gchar *
 
116
brasero_image_properties_get_output_path (BraseroImageProperties *self)
 
117
{
 
118
        gchar *path = NULL;
 
119
        BraseroImageFormat format;
 
120
        BraseroImagePropertiesPrivate *priv;
 
121
 
 
122
        priv = BRASERO_IMAGE_PROPERTIES_PRIVATE (self);
 
123
 
 
124
        format = brasero_burn_session_get_output_format (BRASERO_BURN_SESSION (priv->session));
 
125
        switch (format) {
 
126
        case BRASERO_IMAGE_FORMAT_BIN:
 
127
                brasero_burn_session_get_output (BRASERO_BURN_SESSION (priv->session),
 
128
                                                 &path,
 
129
                                                 NULL);
 
130
                break;
 
131
 
 
132
        case BRASERO_IMAGE_FORMAT_CLONE:
 
133
        case BRASERO_IMAGE_FORMAT_CDRDAO:
 
134
        case BRASERO_IMAGE_FORMAT_CUE:
 
135
                brasero_burn_session_get_output (BRASERO_BURN_SESSION (priv->session),
 
136
                                                 NULL,
 
137
                                                 &path);
 
138
                break;
 
139
 
 
140
        default:
 
141
                break;
 
142
        }
 
143
 
 
144
        return path;
 
145
}
 
146
 
121
147
static void
122
148
brasero_image_properties_format_changed_cb (BraseroImageTypeChooser *chooser,
123
149
                                            BraseroImageProperties *self)
146
172
        if (!priv->edited) {
147
173
                /* not changed: get a new default path */
148
174
                g_free (image_path);
149
 
                image_path = brasero_image_format_get_default_path (format);
 
175
                image_path = brasero_image_properties_get_output_path (self);
150
176
        }
151
 
        else if (image_path) {
 
177
        else {
152
178
                gchar *tmp;
153
179
 
154
180
                tmp = image_path;
155
181
                image_path = brasero_image_format_fix_path_extension (format, FALSE, image_path);
156
182
                g_free (tmp);
157
183
        }
158
 
        else {
159
 
                priv->edited = FALSE;
160
 
                image_path = brasero_image_format_get_default_path (format);
161
 
        }
162
184
 
163
185
        brasero_image_properties_set_path (self, image_path);
164
186
 
342
364
        }
343
365
}
344
366
 
345
 
static gchar *
346
 
brasero_image_properties_get_output_path (BraseroImageProperties *self)
347
 
{
348
 
        gchar *path = NULL;
349
 
        BraseroImageFormat format;
350
 
        BraseroImagePropertiesPrivate *priv;
351
 
 
352
 
        priv = BRASERO_IMAGE_PROPERTIES_PRIVATE (self);
353
 
 
354
 
        format = brasero_burn_session_get_output_format (BRASERO_BURN_SESSION (priv->session));
355
 
        switch (format) {
356
 
        case BRASERO_IMAGE_FORMAT_BIN:
357
 
                brasero_burn_session_get_output (BRASERO_BURN_SESSION (priv->session),
358
 
                                                 &path,
359
 
                                                 NULL);
360
 
                break;
361
 
 
362
 
        case BRASERO_IMAGE_FORMAT_CLONE:
363
 
        case BRASERO_IMAGE_FORMAT_CDRDAO:
364
 
        case BRASERO_IMAGE_FORMAT_CUE:
365
 
                brasero_burn_session_get_output (BRASERO_BURN_SESSION (priv->session),
366
 
                                                 NULL,
367
 
                                                 &path);
368
 
                break;
369
 
 
370
 
        default:
371
 
                break;
372
 
        }
373
 
 
374
 
        return path;
375
 
}
376
 
 
377
367
static void
378
368
brasero_image_properties_update (BraseroImageProperties *self)
379
369
{
430
420
                                       const GValue *value,
431
421
                                       GParamSpec *pspec)
432
422
{
433
 
        BraseroImagePropertiesPrivate *priv;
434
 
 
435
 
        priv = BRASERO_IMAGE_PROPERTIES_PRIVATE (object);
436
 
 
437
423
        switch (property_id) {
438
424
        case PROP_SESSION: /* Readable and only writable at creation time */
439
425
                brasero_image_properties_set_session (BRASERO_IMAGE_PROPERTIES (object),
468
454
static void
469
455
brasero_image_properties_init (BraseroImageProperties *object)
470
456
{
471
 
        BraseroImagePropertiesPrivate *priv;
472
457
        GtkWidget *box;
473
458
 
474
 
        priv = BRASERO_IMAGE_PROPERTIES_PRIVATE (object);
475
 
 
476
459
        gtk_window_set_title (GTK_WINDOW (object), _("Location for Image File"));
477
460
        box = gtk_dialog_get_content_area (GTK_DIALOG (object));
478
461
        gtk_container_set_border_width (GTK_CONTAINER (box), 10);