~ubuntu-branches/ubuntu/precise/eog/precise-proposed

« back to all changes in this revision

Viewing changes to src/eog-application.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2012-01-17 17:06:58 UTC
  • mfrom: (1.14.27)
  • Revision ID: package-import@ubuntu.com-20120117170658-7iwmqpl3sbqrme9o
Tags: 3.3.4-0ubuntu1
* New upstream version
* Drop the patches included in the new version
* debian/control.in:
  - updated glib requirement

Show diffs side-by-side

added added

removed removed

Lines of Context:
295
295
        return file_window;
296
296
}
297
297
 
 
298
static EogWindow *
 
299
eog_application_get_first_window (EogApplication *application)
 
300
{
 
301
        g_return_val_if_fail (EOG_IS_APPLICATION (application), NULL);
 
302
 
 
303
        GList *windows;
 
304
        GList *l;
 
305
        EogWindow *window = NULL;
 
306
        windows = gtk_window_list_toplevels ();
 
307
        for (l = windows; l != NULL; l = l->next) {
 
308
                if (EOG_IS_WINDOW (l->data)) {
 
309
                        window = EOG_WINDOW (l->data);
 
310
                        break;
 
311
                }
 
312
        }
 
313
        g_list_free (windows);
 
314
 
 
315
        return window;
 
316
}
 
317
 
 
318
 
298
319
static void
299
320
eog_application_show_window (EogWindow *window, gpointer user_data)
300
321
{
314
335
 * Opens a list of files in a #EogWindow. If an #EogWindow displaying the first
315
336
 * image in the list is already open, this will be used. Otherwise, an empty
316
337
 * #EogWindow is used, either already existing or newly created.
 
338
 * If the EOG_STARTUP_SINGLE_WINDOW flag is set, the files are opened in the
 
339
 * first #EogWindow and no new one is opened.
317
340
 *
318
341
 * Returns: Currently always %TRUE.
319
342
 **/
326
349
{
327
350
        EogWindow *new_window = NULL;
328
351
 
329
 
        if (file_list != NULL)
330
 
                new_window = eog_application_get_file_window (application,
331
 
                                                              (GFile *) file_list->data);
 
352
        if (file_list != NULL) {
 
353
                if(flags & EOG_STARTUP_SINGLE_WINDOW)
 
354
                        new_window = eog_application_get_first_window (application);
 
355
                else
 
356
                        new_window = eog_application_get_file_window (application,
 
357
                                                                      (GFile *) file_list->data);
 
358
        }
332
359
 
333
360
        if (new_window != NULL) {
334
 
                gtk_window_present_with_time (GTK_WINDOW (new_window),
335
 
                                              timestamp);
 
361
                if(flags & EOG_STARTUP_SINGLE_WINDOW)
 
362
                        eog_window_open_file_list (new_window, file_list);
 
363
                else
 
364
                        gtk_window_present_with_time (GTK_WINDOW (new_window),
 
365
                                                      timestamp);
336
366
                return TRUE;
337
367
        }
338
368