diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-27 15:14:24 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-27 15:29:45 +0100 |
commit | 29d6678fd546377459ef75cf54abeef5b969b5cf (patch) | |
tree | 8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch | |
parent | da49de6885ee1bc424e70bc02f21f6ab920efb55 (diff) | |
download | poky-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz |
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things
and is generally overwhelming. This commit splits it into several
logical sections roughly based on function, recipes.txt gives more
information about the classifications used.
The opportunity is also used to switch from "packages" to "recipes"
as used in OpenEmbedded as the term "packages" can be confusing to
people and has many different meanings.
Not all recipes have been classified yet, this is just a first pass
at separating things out. Some packages are moved to meta-extras as
they're no longer actively used or maintained.
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch')
-rw-r--r-- | meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch | 198 |
1 files changed, 198 insertions, 0 deletions
diff --git a/meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch b/meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch new file mode 100644 index 0000000000..61da9191a8 --- /dev/null +++ b/meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch | |||
@@ -0,0 +1,198 @@ | |||
1 | Index: 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 <libowl/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/TopMenu"))); | ||
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 | |||
137 | Index: 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 name="TopMenu" 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> | ||
186 | Index: 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 \ | ||