summaryrefslogtreecommitdiffstats
path: root/meta/recipes-sato/pcmanfm/files/owl-window-menu.patch
blob: 0826a16bc2aafc41b0a292c7dfc6ef7e0e31840a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
0.9.7 use a new menu bar from gtk_ui_manager, so need a translation here to
enable owl menu

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>

Upstream-Status: Inappropriate [enable feature]

Index: pcmanfm-0.9.7/configure.ac
===================================================================
--- pcmanfm-0.9.7.orig/configure.ac	2010-07-27 10:28:12.000000000 +0800
+++ pcmanfm-0.9.7/configure.ac	2010-07-27 18:03:42.000000000 +0800
@@ -70,6 +70,8 @@
 
 gtk_modules="gtk+-2.0 >= 2.16.0"
 PKG_CHECK_MODULES(GTK, [$gtk_modules])
+OWL_LIBS="-lowl"
+GTK_LIBS="$GTK_LIBS $OWL_LIBS"
 AC_SUBST(GTK_CFLAGS)
 AC_SUBST(GTK_LIBS)
 
Index: pcmanfm-0.9.7/src/main-win.c
===================================================================
--- pcmanfm-0.9.7.orig/src/main-win.c	2010-07-27 10:56:08.000000000 +0800
+++ pcmanfm-0.9.7/src/main-win.c	2010-07-27 17:28:59.000000000 +0800
@@ -36,6 +36,8 @@
 #include "main-win.h"
 #include "pref.h"
 
+#include "libowl/owlwindowmenu.h"
+
 static void fm_main_win_finalize              (GObject *object);
 G_DEFINE_TYPE(FmMainWin, fm_main_win, GTK_TYPE_WINDOW);
 
@@ -466,9 +468,27 @@
         fm_main_win_chdir(win, path);
 }
 
+/* Transfer gtk_ui_manager menubar to gtk menubar */
+static GtkWidget * ui_menubar_to_menu(GtkWidget *menubar)
+{
+    GtkWidget *main_menu;
+    GList *iter;
+
+    main_menu = gtk_menu_new();
+
+    for ( iter = gtk_container_get_children(GTK_CONTAINER(menubar));
+          iter;
+          iter = g_list_next(iter) )
+    {
+        GtkWidget *menu = GTK_WIDGET(iter->data);
+        gtk_widget_reparent(menu, main_menu);
+    }
+    return main_menu;
+}
+
 static void fm_main_win_init(FmMainWin *self)
 {
-    GtkWidget *vbox, *menubar, *toolitem, *scroll;
+    GtkWidget *vbox, *menubar, *owl_menubar, *toolitem, *scroll;
     GtkUIManager* ui;
     GtkActionGroup* act_grp;
     GtkAction* act;
@@ -537,7 +557,6 @@
 
     self->popup = gtk_ui_manager_get_widget(ui, "/popup");
 
-    gtk_box_pack_start( (GtkBox*)vbox, menubar, FALSE, TRUE, 0 );
     gtk_box_pack_start( (GtkBox*)vbox, self->toolbar, FALSE, TRUE, 0 );
 
     /* load bookmarks menu */
@@ -586,6 +605,11 @@
     gtk_container_add( (GtkContainer*)self, vbox );
     gtk_widget_show_all(vbox);
 
+    owl_menubar = ui_menubar_to_menu(menubar);
+    gtk_widget_show_all (owl_menubar);
+    owl_set_window_menu (GTK_WINDOW(self),
+			 GTK_MENU(owl_menubar));
+
     /* create new tab */
     fm_main_win_add_tab(self, fm_path_get_home());
     gtk_widget_grab_focus(self->folder_view);