]> www.fi.muni.cz Git - evince.git/commitdiff
Add app-specific icons to our icon theme. Fixes bug #425508.
authorNickolay V. Shmyrev <nshmyrev@yandex.ru>
Wed, 9 May 2007 16:26:44 +0000 (16:26 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Wed, 9 May 2007 16:26:44 +0000 (16:26 +0000)
2007-05-09  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>

* shell/ev-application.c: (ev_application_open_window),
(ev_application_add_icon_path_for_screen),
(ev_application_open_uri_at_dest):
* shell/ev-navigation-action-widget.c: (popup_menu_under_arrow):
* shell/ev-navigation-action.c: (build_menu):

Add app-specific icons to our icon theme. Fixes bug
#425508.

svn path=/trunk/; revision=2444

ChangeLog
shell/ev-application.c
shell/ev-navigation-action-widget.c
shell/ev-navigation-action.c

index de2813110024994308c902b578893c51ff084fee..611368135a30c1ba2dbe860eb20523024924541e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2007-05-09  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * shell/ev-application.c: (ev_application_open_window),
+       (ev_application_add_icon_path_for_screen),
+       (ev_application_open_uri_at_dest):
+       * shell/ev-navigation-action-widget.c: (popup_menu_under_arrow):
+       * shell/ev-navigation-action.c: (build_menu):
+       
+       Add app-specific icons to our icon theme. Fixes bug
+       #425508.
+
+2007-05-09  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * shell/ev-application.c: (ev_application_open_window),
+       (ev_application_add_icon_path_for_screen),
+       (ev_application_open_uri_at_dest):
+       * shell/ev-navigation-action-widget.c: (popup_menu_under_arrow):
+       * shell/ev-navigation-action.c: (build_menu):
+
 2007-05-09  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * shell/ev-history.c: (ev_history_class_init),
index 1d21c2c1dfc6b5d2e4cccb1e2633c8f2f0d43df9..ce67ebbf02c6f6930ff5eec2d3adb8c1abb8ac21 100644 (file)
@@ -45,6 +45,8 @@
 
 #include <string.h>
 
+static void ev_application_add_icon_path_for_screen (GdkScreen *screen);
+
 struct _EvApplication {
        GObject base_instance;
 
@@ -379,6 +381,7 @@ ev_application_open_window (EvApplication  *application,
        if (screen) {
                gtk_window_set_screen (GTK_WINDOW (new_window), screen);
        }
+       ev_application_add_icon_path_for_screen (screen);
        
        gtk_widget_show (new_window);
        
@@ -458,30 +461,11 @@ ev_application_get_uri_window (EvApplication *application, const char *uri)
        return uri_window;
 }
 
-/**
- * ev_application_open_uri_at_dest:
- * @application: The instance of the application.
- * @uri: The uri to be opened.
- * @screen: Thee screen where the link will be shown.
- * @dest: The #EvLinkDest of the document.
- * @mode: The run mode of the window.
- * @unlink_temp_file: The unlink_temp_file option value.
- * @timestamp: Current time value.
- */
-void
-ev_application_open_uri_at_dest (EvApplication  *application,
-                                const char     *uri,
-                                GdkScreen      *screen,
-                                EvLinkDest     *dest,
-                                EvWindowRunMode mode,
-                                gboolean        unlink_temp_file,
-                                guint           timestamp)
+static void
+ev_application_add_icon_path_for_screen (GdkScreen *screen)
 {
-       EvWindow     *new_window;
        GtkIconTheme *icon_theme;
 
-       g_return_if_fail (uri != NULL);
-
        icon_theme = gtk_icon_theme_get_for_screen (screen);
        if (icon_theme) {
                gchar **path = NULL;
@@ -506,6 +490,32 @@ ev_application_open_uri_at_dest (EvApplication  *application,
                g_free (ev_icons_path);
                g_strfreev (path);
        }       
+}
+
+/**
+ * ev_application_open_uri_at_dest:
+ * @application: The instance of the application.
+ * @uri: The uri to be opened.
+ * @screen: Thee screen where the link will be shown.
+ * @dest: The #EvLinkDest of the document.
+ * @mode: The run mode of the window.
+ * @unlink_temp_file: The unlink_temp_file option value.
+ * @timestamp: Current time value.
+ */
+void
+ev_application_open_uri_at_dest (EvApplication  *application,
+                                const char     *uri,
+                                GdkScreen      *screen,
+                                EvLinkDest     *dest,
+                                EvWindowRunMode mode,
+                                gboolean        unlink_temp_file,
+                                guint           timestamp)
+{
+       EvWindow     *new_window;
+
+       g_return_if_fail (uri != NULL);
+       
+       ev_application_add_icon_path_for_screen (screen);
 
        new_window = ev_application_get_uri_window (application, uri);
        
index 1de4cf1a060627ed954f08686221adda5957afb9..fafa5017cdeee0797c2b7d88996c6a481b877aca 100644 (file)
@@ -157,11 +157,11 @@ static void
 popup_menu_under_arrow (EvNavigationActionWidget *button,
                         GdkEventButton    *event)
 {
+       g_signal_emit (button, signals[SHOW_MENU], 0);
+
        if (!button->menu)
                return;
 
-       g_signal_emit (button, signals[SHOW_MENU], 0);
-
        gtk_menu_popup (button->menu, NULL, NULL, 
                        (GtkMenuPositionFunc) menu_position_func,
                         button,
index 9da89f993c10149f9248799ecdecc8cbb51ef35a..3aa1bea921840a63377b805c09e3ea07f5d2c1d4 100644 (file)
@@ -134,12 +134,12 @@ build_menu (EvNavigationAction *action)
        EvHistory *history = action->priv->history;
        int start, end, i;
 
-       menu = GTK_MENU_SHELL (gtk_menu_new ());
-
-       if (history == NULL) {
-               return GTK_WIDGET (menu);
+       if (history == NULL || ev_history_get_n_links (history) <= 0) {
+               return NULL;
        }
 
+       menu = GTK_MENU_SHELL (gtk_menu_new ());
+
        start = 0;
        end = ev_history_get_n_links (history);