Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNickolay V. Shmyrev <nshmyrev@yandex.ru>2007-05-09 16:26:44 (GMT)
committer Nickolay V. Shmyrev <nshmyrev@src.gnome.org>2007-05-09 16:26:44 (GMT)
commit122c227b07387a942e4379eef8132fe6b6e92e80 (patch)
treee563df6100a1aa8eea5de74593c6aea1db507ba8
parent33bf66b8f4e2d719c847af1c177c71b5173b49aa (diff)
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): Add app-specific icons to our icon theme. Fixes bug #425508. svn path=/trunk/; revision=2444
-rw-r--r--ChangeLog19
-rw-r--r--shell/ev-application.c52
-rw-r--r--shell/ev-navigation-action-widget.c4
-rw-r--r--shell/ev-navigation-action.c8
4 files changed, 56 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index de28131..6113681 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,24 @@
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),
(ev_history_add_link):
* shell/ev-history.h:
diff --git a/shell/ev-application.c b/shell/ev-application.c
index 1d21c2c..ce67ebb 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -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);
diff --git a/shell/ev-navigation-action-widget.c b/shell/ev-navigation-action-widget.c
index 1de4cf1..fafa501 100644
--- a/shell/ev-navigation-action-widget.c
+++ b/shell/ev-navigation-action-widget.c
@@ -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,
diff --git a/shell/ev-navigation-action.c b/shell/ev-navigation-action.c
index 9da89f9..3aa1bea 100644
--- a/shell/ev-navigation-action.c
+++ b/shell/ev-navigation-action.c
@@ -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);