summaryrefslogtreecommitdiffstats
path: root/meta/packages/puzzles
diff options
context:
space:
mode:
authorIan Holmes <iain@openedhand.com>2007-08-09 14:19:42 +0000
committerIan Holmes <iain@openedhand.com>2007-08-09 14:19:42 +0000
commit6ec68c28337b0f31ee221a1c63fee6c1085404b4 (patch)
tree52802a4bda38169cc3b8ba708133e62a8c66149c /meta/packages/puzzles
parentd1798db3ca4cb25ffc4bc46d3f87f932a2940486 (diff)
downloadpoky-6ec68c28337b0f31ee221a1c63fee6c1085404b4.tar.gz
Use R22 of oh-puzzles and apply the owl menu patch to it
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2476 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/puzzles')
-rw-r--r--meta/packages/puzzles/files/oh-puzzles-owl-menu.patch198
-rw-r--r--meta/packages/puzzles/oh-puzzles_svn.bb3
2 files changed, 200 insertions, 1 deletions
diff --git a/meta/packages/puzzles/files/oh-puzzles-owl-menu.patch b/meta/packages/puzzles/files/oh-puzzles-owl-menu.patch
new file mode 100644
index 0000000000..e280ea81bd
--- /dev/null
+++ b/meta/packages/puzzles/files/oh-puzzles-owl-menu.patch
@@ -0,0 +1,198 @@
1Index: src/gtk.c
2===================================================================
3--- src/gtk.c (revision 22)
4+++ src/gtk.c (working copy)
5@@ -28,6 +28,8 @@
6 #include <gdk/gdkx.h>
7 #include <gdk-pixbuf/gdk-pixbuf.h>
8
9+#include <owlwindowmenu.h>
10+
11 #include <librsvg/rsvg.h>
12
13 #include <X11/Xlib.h>
14@@ -1237,6 +1239,7 @@
15 }
16 }
17
18+#if 0
19 static void
20 add_widget (GtkUIManager *merge,
21 GtkWidget *widget,
22@@ -1247,10 +1250,11 @@
23 gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
24
25 toplevel = gtk_widget_get_toplevel (GTK_WIDGET (box));
26- gtk_widget_show_all (toplevel);
27 }
28+#endif
29
30 static GtkActionEntry toplevel_actions[] = {
31+ { "Top", NULL, "" },
32 { "Game", NULL, N_("Game") },
33 { "Settings", NULL, N_("Settings") },
34 { "Help", NULL, N_("Help") },
35@@ -1303,11 +1307,13 @@
36 frontend *fe)
37 {
38 GString *xml;
39+ GError *error = NULL;
40 gboolean presets = FALSE;
41 GSList *radio_group = NULL;
42 int i;
43
44- xml = g_string_new ("<ui><menubar><placeholder name=\"TypePlaceholder\">"
45+ xml = g_string_new ("<ui><menubar><menu name=\"TopMenu\" action=\"Top\">"
46+ "<placeholder name=\"TypePlaceholder\">"
47 "<menu name=\"SettingsMenu\" action=\"Settings\">");
48
49 for (i = 0; i < midend_num_presets(fe->me); i++) {
50@@ -1359,8 +1365,14 @@
51 "<menuitem name=\"CustomMenu\" action=\"Custom\"/>");
52 }
53
54- g_string_append (xml, "</menu></placeholder></menubar></ui>");
55- gtk_ui_manager_add_ui_from_string (merge, xml->str, -1, NULL);
56+ g_string_append (xml, "</menu></placeholder></menu></menubar></ui>");
57+
58+ gtk_ui_manager_add_ui_from_string (merge, xml->str, -1, &error);
59+ if (error != NULL) {
60+ g_warning ("Error adding custom: %s", error->message);
61+ g_error_free (error);
62+ }
63+
64 g_string_free (xml, TRUE);
65 }
66
67@@ -1434,6 +1446,7 @@
68 new_window(char *arg, char **error)
69 {
70 frontend *fe;
71+ GError *err = NULL;
72 GtkBox *vbox;
73 GtkUIManager *merge;
74 GtkActionGroup *actions;
75@@ -1496,8 +1509,6 @@
76 gtk_window_add_accel_group(GTK_WINDOW(fe->window), fe->accelgroup);
77
78 merge = gtk_ui_manager_new ();
79- g_signal_connect (G_OBJECT (merge), "add_widget",
80- G_CALLBACK (add_widget), vbox);
81
82 actions = gtk_action_group_new ("PuzzleActions");
83 gtk_action_group_add_actions (actions, toplevel_actions,
84@@ -1509,22 +1520,39 @@
85
86 gtk_ui_manager_insert_action_group (merge, actions, 0);
87
88- gtk_ui_manager_add_ui_from_file (merge, DATADIR "/oh-puzzles/ui/menu.xml", NULL);
89+ gtk_ui_manager_add_ui_from_file (merge, DATADIR "/oh-puzzles/ui/menu.xml",
90+ &err);
91+ if (err != NULL) {
92+ g_warning ("Error making UI: %s", err->message);
93+ g_error_free (err);
94+ err = NULL;
95+ }
96
97 if (thegame.can_solve) {
98- char *str = "<ui><menubar><menu name=\"GameMenu\" action=\"Game\">"
99+ char *str = "<ui><menubar><menu name=\"TopMenu\" action=\"Top\">"
100+ "<menu name=\"GameMenu\" action=\"Game\">"
101 "<placeholder name=\"SolvePlaceholder\">"
102 "<separator name=\"SolveSep\"/>"
103 "<menuitem name=\"SolveMenu\" action=\"Solve\"/>"
104- "</placeholder></menu></menubar></ui>";
105+ "</placeholder></menu></menu></menubar></ui>";
106
107- gtk_ui_manager_add_ui_from_string (merge, str, -1, NULL);
108+ gtk_ui_manager_add_ui_from_string (merge, str, -1, &err);
109+ if (err != NULL) {
110+ g_warning ("Error adding solve. %s", err->message);
111+ g_error_free (err);
112+ }
113 }
114
115 if ((n = midend_num_presets(fe->me)) > 0 || thegame.can_configure) {
116 generate_settings_menu (merge, actions, fe);
117 }
118
119+ /* Do this so that the menu is packed now instead of in the idle loop */
120+ gtk_ui_manager_ensure_update (merge);
121+
122+ owl_set_window_menu_item (GTK_WINDOW (fe->window),
123+ GTK_MENU_ITEM (gtk_ui_manager_get_widget (merge, "/menubar/Top")));
124+
125 setup_colours (fe);
126 setup_pixbufs (fe);
127
128@@ -1572,7 +1600,7 @@
129 GDK_BUTTON_RELEASE_MASK |
130 GDK_BUTTON_MOTION_MASK);
131
132- /* The window is shown once the menubar has been added */
133+ gtk_widget_show_all (fe->window);
134 return fe;
135 }
136
137Index: src/menu.xml
138===================================================================
139--- src/menu.xml (revision 22)
140+++ src/menu.xml (working copy)
141@@ -1,26 +1,25 @@
142 <ui>
143 <menubar>
144-<menu name="GameMenu" action="Game">
145- <menuitem name="NewMenu" action="New"/>
146- <menuitem name="RestartMenu" action="Restart"/>
147-<!-- <menuitem name="SpecificMenu" action="Specific"/> -->
148- <menuitem name="RandomMenu" action="Random"/>
149- <separator name="GameSep1"/>
150- <menuitem name="LoadMenu" action="Load"/>
151- <menuitem name="SaveMenu" action="Save"/>
152- <separator name="GameSep2"/>
153- <menuitem name="UndoMenu" action="Undo"/>
154- <menuitem name="RedoMenu" action="Redo"/>
155- <placeholder name="CopyPlaceholder"/>
156- <placeholder name="SolvePlaceholder"/>
157- <separator name="GameSep3"/>
158- <menuitem name="QuitMenu" action="Quit"/>
159-</menu>
160+<menu action="Top">
161+ <menu name="GameMenu" action="Game">
162+ <menuitem name="NewMenu" action="New"/>
163+ <menuitem name="RestartMenu" action="Restart"/>
164+ <!-- <menuitem name="SpecificMenu" action="Specific"/> -->
165+ <menuitem name="RandomMenu" action="Random"/>
166+ <separator name="GameSep1"/>
167+ <menuitem name="LoadMenu" action="Load"/>
168+ <menuitem name="SaveMenu" action="Save"/>
169+ <separator name="GameSep2"/>
170+ <menuitem name="UndoMenu" action="Undo"/>
171+ <menuitem name="RedoMenu" action="Redo"/>
172+ <placeholder name="CopyPlaceholder"/>
173+ <placeholder name="SolvePlaceholder"/>
174+ </menu>
175
176-<placeholder name="TypePlaceholder"/>
177-
178-<menu name="HelpMenu" action="Help">
179+ <placeholder name="TypePlaceholder"/>
180 <menuitem name="AboutMenu" action="About"/>
181+ <menuitem name="QuitMenu" action="Quit"/>
182+
183 </menu>
184 </menubar>
185 </ui>
186Index: src/Makefile.am
187===================================================================
188--- src/Makefile.am (revision 22)
189+++ src/Makefile.am (working copy)
190@@ -10,7 +10,7 @@
191 lightup loopy map mines net netslide pattern pegs rect samegame \
192 sixteen slant solo tents twiddle untangle
193
194-libpuzzles_la_LIBADD = $(PUZZLES_LIBS)
195+libpuzzles_la_LIBADD = $(PUZZLES_LIBS) -lowl
196 libpuzzles_la_SOURCES = combi.c \
197 configuration.c \
198 drawing.c \
diff --git a/meta/packages/puzzles/oh-puzzles_svn.bb b/meta/packages/puzzles/oh-puzzles_svn.bb
index cf6a9d990e..8f02bf221a 100644
--- a/meta/packages/puzzles/oh-puzzles_svn.bb
+++ b/meta/packages/puzzles/oh-puzzles_svn.bb
@@ -7,7 +7,8 @@ PR = "r0"
7 7
8inherit autotools pkgconfig 8inherit autotools pkgconfig
9 9
10SRC_URI = "svn://svn.o-hand.com/repos/;module=oh-puzzles;proto=http" 10SRC_URI = "svn://svn.o-hand.com/repos/;module=oh-puzzles;proto=http \
11 file://oh-puzzles-owl-menu.patch;patch=1;pnum=0"
11S = "${WORKDIR}/${PN}" 12S = "${WORKDIR}/${PN}"
12 13
13do_install_append () { 14do_install_append () {