~ubuntu-branches/ubuntu/oneiric/gimp/oneiric-security

« back to all changes in this revision

Viewing changes to app/widgets/gimpfiledialog.c

  • Committer: Bazaar Package Importer
  • Author(s): Pedro Fragoso
  • Date: 2008-11-24 14:16:39 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20081124141639-12b1g29vvadd5pzp
Tags: 2.6.3-1ubuntu1
* Sync with Debian experimental (LP: #301724)
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch:
  - updated some strings for ubuntu
* debian/rules:
  - updated translation templates
* debian/control:
  - Drop webkit build dependency. gimp is the only thing pulling
    in webkit for the desktop CDs, and makes them explode
    Without the webkit help browser
    plugin, help will just be displayed in the default browser.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
 
63
63
 
64
64
static void     gimp_file_dialog_progress_iface_init (GimpProgressInterface *iface);
 
65
 
 
66
static void     gimp_file_dialog_destroy             (GtkObject        *object);
65
67
static gboolean gimp_file_dialog_delete_event        (GtkWidget        *widget,
66
68
                                                      GdkEventAny      *event);
67
69
static void     gimp_file_dialog_response            (GtkDialog        *dialog,
121
123
static void
122
124
gimp_file_dialog_class_init (GimpFileDialogClass *klass)
123
125
{
 
126
  GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
124
127
  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
125
128
  GtkDialogClass *dialog_class = GTK_DIALOG_CLASS (klass);
126
129
 
 
130
  object_class->destroy      = gimp_file_dialog_destroy;
 
131
 
127
132
  widget_class->delete_event = gimp_file_dialog_delete_event;
128
133
 
129
134
  dialog_class->response     = gimp_file_dialog_response;
147
152
  iface->get_window = gimp_file_dialog_progress_get_window;
148
153
}
149
154
 
 
155
static void
 
156
gimp_file_dialog_destroy (GtkObject *object)
 
157
{
 
158
  GimpFileDialog *dialog = GIMP_FILE_DIALOG (object);
 
159
 
 
160
  GTK_OBJECT_CLASS (parent_class)->destroy (object);
 
161
 
 
162
  dialog->progress = NULL;
 
163
}
 
164
 
150
165
static gboolean
151
166
gimp_file_dialog_delete_event (GtkWidget   *widget,
152
167
                               GdkEventAny *event)
164
179
    {
165
180
      file_dialog->canceled = TRUE;
166
181
 
167
 
      if (GIMP_PROGRESS_BOX (file_dialog->progress)->active &&
 
182
      if (file_dialog->progress                             &&
 
183
          GIMP_PROGRESS_BOX (file_dialog->progress)->active &&
168
184
          GIMP_PROGRESS_BOX (file_dialog->progress)->cancelable)
169
185
        {
170
186
          gimp_progress_cancel (GIMP_PROGRESS (dialog));
178
194
                                 gboolean      cancelable)
179
195
{
180
196
  GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
181
 
  GimpProgress   *retval;
182
 
 
183
 
  retval = gimp_progress_start (GIMP_PROGRESS (dialog->progress),
184
 
                                message, cancelable);
185
 
  gtk_widget_show (dialog->progress);
186
 
 
187
 
  gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
188
 
                                     GTK_RESPONSE_CANCEL, cancelable);
 
197
  GimpProgress   *retval = NULL;
 
198
 
 
199
  if (dialog->progress)
 
200
    {
 
201
      retval = gimp_progress_start (GIMP_PROGRESS (dialog->progress),
 
202
                                    message, cancelable);
 
203
      gtk_widget_show (dialog->progress);
 
204
 
 
205
      gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
 
206
                                         GTK_RESPONSE_CANCEL, cancelable);
 
207
    }
189
208
 
190
209
  return retval;
191
210
}
195
214
{
196
215
  GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
197
216
 
198
 
  gimp_progress_end (GIMP_PROGRESS (dialog->progress));
199
 
  gtk_widget_hide (dialog->progress);
 
217
  if (dialog->progress)
 
218
    {
 
219
      gimp_progress_end (GIMP_PROGRESS (dialog->progress));
 
220
      gtk_widget_hide (dialog->progress);
 
221
    }
200
222
}
201
223
 
202
224
static gboolean
204
226
{
205
227
  GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
206
228
 
207
 
  return gimp_progress_is_active (GIMP_PROGRESS (dialog->progress));
 
229
  if (dialog->progress)
 
230
    return gimp_progress_is_active (GIMP_PROGRESS (dialog->progress));
 
231
 
 
232
  return FALSE;
208
233
}
209
234
 
210
235
static void
213
238
{
214
239
  GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
215
240
 
216
 
  gimp_progress_set_text (GIMP_PROGRESS (dialog->progress), message);
 
241
  if (dialog->progress)
 
242
    gimp_progress_set_text (GIMP_PROGRESS (dialog->progress), message);
217
243
}
218
244
 
219
245
static void
222
248
{
223
249
  GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
224
250
 
225
 
  gimp_progress_set_value (GIMP_PROGRESS (dialog->progress), percentage);
 
251
  if (dialog->progress)
 
252
    gimp_progress_set_value (GIMP_PROGRESS (dialog->progress), percentage);
226
253
}
227
254
 
228
255
static gdouble
230
257
{
231
258
  GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
232
259
 
233
 
  return gimp_progress_get_value (GIMP_PROGRESS (dialog->progress));
 
260
  if (dialog->progress)
 
261
    return gimp_progress_get_value (GIMP_PROGRESS (dialog->progress));
 
262
 
 
263
  return 0.0;
234
264
}
235
265
 
236
266
static void
238
268
{
239
269
  GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
240
270
 
241
 
  gimp_progress_pulse (GIMP_PROGRESS (dialog->progress));
 
271
  if (dialog->progress)
 
272
    gimp_progress_pulse (GIMP_PROGRESS (dialog->progress));
242
273
}
243
274
 
244
275
static guint32
368
399
 
369
400
  g_return_if_fail (GIMP_IS_FILE_DIALOG (dialog));
370
401
 
 
402
  /*  bail out if we are already destroyed  */
 
403
  if (! dialog->progress)
 
404
    return;
 
405
 
371
406
  children =
372
407
    gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox));
373
408