diff options
Diffstat (limited to 'src/eom-window.c')
-rw-r--r-- | src/eom-window.c | 94 |
1 files changed, 49 insertions, 45 deletions
diff --git a/src/eom-window.c b/src/eom-window.c index a431674..c039d67 100644 --- a/src/eom-window.c +++ b/src/eom-window.c @@ -496,38 +496,40 @@ update_status_bar (EomWindow *window) priv = window->priv; - if (priv->image != NULL && - eom_image_has_data (priv->image, EOM_IMAGE_DATA_DIMENSION)) { - int zoom, width, height; - goffset bytes = 0; + if (priv->image != NULL) + { + if ( eom_image_has_data (priv->image, EOM_IMAGE_DATA_DIMENSION)) + { + int zoom, width, height; + goffset bytes = 0; - zoom = floor (100 * eom_scroll_view_get_zoom (EOM_SCROLL_VIEW (priv->view)) + 0.5); + zoom = floor (100 * eom_scroll_view_get_zoom (EOM_SCROLL_VIEW (priv->view)) + 0.5); - eom_image_get_size (priv->image, &width, &height); + eom_image_get_size (priv->image, &width, &height); - bytes = eom_image_get_bytes (priv->image); + bytes = eom_image_get_bytes (priv->image); - if ((width > 0) && (height > 0)) { - char *size_string; + if ((width > 0) && (height > 0)) { + char *size_string; - size_string = g_format_size (bytes); + size_string = g_format_size (bytes); - /* Translators: This is the string displayed in the statusbar - * The tokens are from left to right: - * - image width - * - image height - * - image size in bytes - * - zoom in percent */ - str = g_strdup_printf (ngettext("%i × %i pixel %s %i%%", - "%i × %i pixels %s %i%%", height), - width, - height, - size_string, - zoom); + /* Translators: This is the string displayed in the statusbar + * The tokens are from left to right: + * - image width + * - image height + * - image size in bytes + * - zoom in percent */ + str = g_strdup_printf (ngettext("%i × %i pixel %s %i%%", + "%i × %i pixels %s %i%%", height), + width, + height, + size_string, + zoom); - g_free (size_string); + g_free (size_string); + } } - update_image_pos (window); } @@ -574,7 +576,6 @@ update_action_groups_state (EomWindow *window) GtkAction *action_sshow; GtkAction *action_print; gboolean print_disabled = FALSE; - gboolean show_image_collection = FALSE; gint n_images = 0; g_return_if_fail (EOM_IS_WINDOW (window)); @@ -633,6 +634,8 @@ update_action_groups_state (EomWindow *window) priv->status = EOM_WINDOW_STATUS_NORMAL; } } else { + gboolean show_image_collection; + if (priv->flags & EOM_STARTUP_DISABLE_COLLECTION) { g_settings_set_boolean (priv->ui_settings, EOM_CONF_UI_IMAGE_COLLECTION, FALSE); @@ -2814,7 +2817,6 @@ eom_window_set_wallpaper (EomWindow *window, const gchar *filename, const gchar gtk_widget_show_all (hbox); gtk_widget_show (info_bar); - eom_window_set_message_area (window, info_bar); gtk_info_bar_set_default_response (GTK_INFO_BAR (info_bar), GTK_RESPONSE_YES); @@ -3756,12 +3758,12 @@ eom_window_cmd_go_random (GtkAction *action, gpointer user_data) } static const GtkActionEntry action_entries_window[] = { - { "Image", NULL, N_("_Image") }, - { "Edit", NULL, N_("_Edit") }, - { "View", NULL, N_("_View") }, - { "Go", NULL, N_("_Go") }, - { "Tools", NULL, N_("_Tools") }, - { "Help", NULL, N_("_Help") }, + { "Image", NULL, N_("_Image"), NULL, NULL, NULL }, + { "Edit", NULL, N_("_Edit"), NULL, NULL, NULL }, + { "View", NULL, N_("_View"), NULL, NULL, NULL }, + { "Go", NULL, N_("_Go"), NULL, NULL, NULL }, + { "Tools", NULL, N_("_Tools"), NULL, NULL, NULL }, + { "Help", NULL, N_("_Help"), NULL, NULL, NULL }, { "ImageOpen", "document-open", N_("_Open…"), "<control>O", N_("Open a file"), @@ -4323,7 +4325,8 @@ eom_window_open_editor (GtkAction *action, { GdkAppLaunchContext *context; GAppInfo *app_info; - GList files; + GList *files = NULL; + GFile *file; app_info = get_appinfo_for_editor (window); @@ -4339,15 +4342,14 @@ eom_window_open_editor (GtkAction *action, gdk_app_launch_context_set_timestamp (context, gtk_get_current_event_time ()); - { - GList f = { eom_image_get_file (window->priv->image) }; - files = f; - } + file = eom_image_get_file (window->priv->image); + files = g_list_append (files, file); - g_app_info_launch (app_info, &files, + g_app_info_launch (app_info, files, G_APP_LAUNCH_CONTEXT (context), NULL); - g_object_unref (files.data); + g_list_free (files); + g_object_unref (file); g_object_unref (context); } @@ -4686,7 +4688,9 @@ static void eom_window_init (EomWindow *window) { GdkGeometry hints; +#if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11) GdkScreen *screen; +#endif EomWindowPrivate *priv; eom_debug (DEBUG_WINDOW); @@ -4699,8 +4703,6 @@ eom_window_init (EomWindow *window) hints.min_width = EOM_WINDOW_MIN_WIDTH; hints.min_height = EOM_WINDOW_MIN_HEIGHT; - screen = gtk_widget_get_screen (GTK_WIDGET (window)); - priv = window->priv = eom_window_get_instance_private (window); priv->view_settings = g_settings_new (EOM_CONF_VIEW); @@ -4738,6 +4740,7 @@ eom_window_init (EomWindow *window) window->priv->status = EOM_WINDOW_STATUS_UNKNOWN; #if defined(HAVE_LCMS) && defined(GDK_WINDOWING_X11) + screen = gtk_widget_get_screen (GTK_WIDGET (window)); window->priv->display_profile = eom_window_get_display_profile (screen); #endif @@ -5326,9 +5329,10 @@ eom_window_class_init (EomWindowClass *class) * @flags: the initialization parameters for the new window. * * - * Creates a new and empty #EomWindow. Use @flags to indicate - * if the window should be initialized fullscreen, in slideshow mode, - * and/or without the thumbnails collection visible. See #EomStartupFlags. + * Creates a new and empty #EomWindow. Use @flags to indicate if the window + * should be initialized fullscreen, in slideshow mode, and/or without the + * thumbnails collection visible. Use preserve-order to maintain + * the order of input parameters instead of sorting. See #EomStartupFlags. * * Returns: a newly created #EomWindow. **/ @@ -5468,7 +5472,7 @@ eom_window_open_file_list (EomWindow *window, GSList *file_list) g_slist_foreach (file_list, (GFunc) g_object_ref, NULL); window->priv->file_list = file_list; - job = eom_job_model_new (file_list); + job = eom_job_model_new (file_list, !!(window->priv->flags & EOM_STARTUP_PRESERVE_ORDER)); g_signal_connect (job, "finished", G_CALLBACK (eom_job_model_cb), |