[eog] EogWindow: Allow plugin entries in gear menu
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog] EogWindow: Allow plugin entries in gear menu
- Date: Fri, 30 Jan 2015 22:32:41 +0000 (UTC)
commit 8b74808890afdff86f01e4b2748f3e4733068937
Author: Felix Riemann <friemann gnome org>
Date: Fri Jan 30 22:58:18 2015 +0100
EogWindow: Allow plugin entries in gear menu
Based on the corresponding feature in Totem.
https://bugzilla.gnome.org/show_bug.cgi?id=741050
data/eog-gear-menu.ui | 1 +
src/eog-window.c | 18 +++++++++++++++++-
src/eog-window.h | 3 +++
3 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/data/eog-gear-menu.ui b/data/eog-gear-menu.ui
index 5e0b3ca..6445622 100644
--- a/data/eog-gear-menu.ui
+++ b/data/eog-gear-menu.ui
@@ -45,5 +45,6 @@
<attribute name="action">win.properties</attribute>
</item>
</section>
+ <section id="plugins-section"/>
</menu>
</interface>
diff --git a/src/eog-window.c b/src/eog-window.c
index bc718c9..9622517 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -136,6 +136,8 @@ struct _EogWindowPrivate {
GtkWidget *zoom_scale;
GtkWidget *properties_dlg;
+ GtkBuilder *gear_menu_builder;
+
GtkWidget *fullscreen_popup;
GSource *fullscreen_timeout_source;
@@ -4351,7 +4353,8 @@ eog_window_construct_ui (EogWindow *window)
builder_object = gtk_builder_get_object (builder, "gear-menu");
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button),
G_MENU_MODEL (builder_object));
- g_clear_object (&builder);
+ priv->gear_menu_builder = builder;
+ builder = NULL;
gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), menu_button);
gtk_widget_show (menu_button);
@@ -5278,6 +5281,19 @@ eog_window_open_file_list (EogWindow *window, GSList *file_list)
g_object_unref (job);
}
+GMenu *
+eog_window_get_gear_menu_section (EogWindow *window, const gchar *id)
+{
+ GObject *object;
+ g_return_val_if_fail (EOG_IS_WINDOW (window), NULL);
+
+ object = gtk_builder_get_object (window->priv->gear_menu_builder, id);
+ if (object == NULL || !G_IS_MENU (object))
+ return NULL;
+
+ return G_MENU (object);
+}
+
/**
* eog_window_get_ui_manager:
* @window: An #EogWindow.
diff --git a/src/eog-window.h b/src/eog-window.h
index 3316c6f..e2b67f6 100644
--- a/src/eog-window.h
+++ b/src/eog-window.h
@@ -33,6 +33,7 @@
#include <glib.h>
#include <glib-object.h>
+#include <gio/gmenu.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
@@ -104,6 +105,8 @@ void eog_window_set_mode (EogWindow *window,
EogWindowMode mode);
GtkUIManager *eog_window_get_ui_manager (EogWindow *window);
+GMenu *eog_window_get_gear_menu_section (EogWindow *window,
+ const gchar *id);
EogListStore *eog_window_get_store (EogWindow *window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]