Merge lp:~larsu/evince/port-popup-menu-to-gmenumodel into lp:~ubuntu-desktop/evince/ubuntu
- port-popup-menu-to-gmenumodel
- Merge into ubuntu
Proposed by
Lars Karlitski
Status: | Merged |
---|---|
Merged at revision: | 237 |
Proposed branch: | lp:~larsu/evince/port-popup-menu-to-gmenumodel |
Merge into: | lp:~ubuntu-desktop/evince/ubuntu |
Diff against target: |
1739 lines (+811/-171) 1 file modified
debian/patches/0001-Port-to-GMenuModel-and-add-menu-bar.patch (+811/-171) |
To merge this branch: | bzr merge lp:~larsu/evince/port-popup-menu-to-gmenumodel |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sebastien Bacher | Approve | ||
Review via email: mp+209068@code.launchpad.net |
Commit message
menubar patch: port popup menus to GMenuModel
Description of the change
menubar patch: port popup menus to GMenuModel
To post a comment you must log in.
Revision history for this message
Lars Karlitski (larsu) wrote : | # |
> Thanks, that works fine, I noticed that some menu items are missing (compared
> to the old/upstream version)
>
> - copy
> - select all
> - open parent folder
>
> Did you mean to drop those? Having at least the "copy" one seems like useful
Ah thanks. I've overlooked them. Added them back in r238.
- 238. By Lars Karlitski
-
menubar patch: add missing items to popup menus
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/patches/0001-Port-to-GMenuModel-and-add-menu-bar.patch' |
2 | --- debian/patches/0001-Port-to-GMenuModel-and-add-menu-bar.patch 2014-03-03 11:19:48 +0000 |
3 | +++ debian/patches/0001-Port-to-GMenuModel-and-add-menu-bar.patch 2014-03-04 13:05:00 +0000 |
4 | @@ -30,8 +30,8 @@ |
5 | |
6 | Index: evince-3.10.3/shell/Makefile.am |
7 | =================================================================== |
8 | ---- evince-3.10.3.orig/shell/Makefile.am 2014-03-03 12:17:53.199442435 +0100 |
9 | -+++ evince-3.10.3/shell/Makefile.am 2014-03-03 12:17:53.183442435 +0100 |
10 | +--- evince-3.10.3.orig/shell/Makefile.am 2014-03-04 14:02:21.045143557 +0100 |
11 | ++++ evince-3.10.3/shell/Makefile.am 2014-03-04 14:02:21.029143557 +0100 |
12 | @@ -75,6 +75,8 @@ |
13 | ev-sidebar-page.h \ |
14 | ev-sidebar-thumbnails.c \ |
15 | @@ -41,13 +41,13 @@ |
16 | main.c |
17 | |
18 | nodist_evince_SOURCES = \ |
19 | -@@ -172,12 +174,13 @@ |
20 | +@@ -172,12 +174,12 @@ |
21 | |
22 | EXTRA_DIST = \ |
23 | evince.css \ |
24 | - evince-appmenu.ui \ |
25 | evince-icon.rc \ |
26 | - evince-ui.xml \ |
27 | +- evince-ui.xml \ |
28 | evince.gresource.xml \ |
29 | ev-gdbus.xml \ |
30 | - ev-daemon-gdbus.xml |
31 | @@ -59,8 +59,8 @@ |
32 | $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate-source --c-name ev $< |
33 | Index: evince-3.10.3/shell/ev-application.c |
34 | =================================================================== |
35 | ---- evince-3.10.3.orig/shell/ev-application.c 2014-03-03 12:17:53.199442435 +0100 |
36 | -+++ evince-3.10.3/shell/ev-application.c 2014-03-03 12:18:09.000000000 +0100 |
37 | +--- evince-3.10.3.orig/shell/ev-application.c 2014-03-04 14:02:21.045143557 +0100 |
38 | ++++ evince-3.10.3/shell/ev-application.c 2014-03-04 14:02:24.000000000 +0100 |
39 | @@ -42,6 +42,9 @@ |
40 | #include "ev-application.h" |
41 | #include "ev-file-helpers.h" |
42 | @@ -447,8 +447,8 @@ |
43 | +} |
44 | Index: evince-3.10.3/shell/ev-application.h |
45 | =================================================================== |
46 | ---- evince-3.10.3.orig/shell/ev-application.h 2014-03-03 12:17:53.199442435 +0100 |
47 | -+++ evince-3.10.3/shell/ev-application.h 2014-03-03 12:17:53.183442435 +0100 |
48 | +--- evince-3.10.3.orig/shell/ev-application.h 2014-03-04 14:02:21.045143557 +0100 |
49 | ++++ evince-3.10.3/shell/ev-application.h 2014-03-04 14:02:21.033143557 +0100 |
50 | @@ -81,6 +81,14 @@ |
51 | GdkScreen *screen, |
52 | const char *topic); |
53 | @@ -466,8 +466,8 @@ |
54 | #endif /* !EV_APPLICATION_H */ |
55 | Index: evince-3.10.3/shell/ev-bookmarks.c |
56 | =================================================================== |
57 | ---- evince-3.10.3.orig/shell/ev-bookmarks.c 2014-03-03 12:17:53.199442435 +0100 |
58 | -+++ evince-3.10.3/shell/ev-bookmarks.c 2014-03-03 12:17:53.183442435 +0100 |
59 | +--- evince-3.10.3.orig/shell/ev-bookmarks.c 2014-03-04 14:02:21.045143557 +0100 |
60 | ++++ evince-3.10.3/shell/ev-bookmarks.c 2014-03-04 14:02:21.033143557 +0100 |
61 | @@ -224,6 +224,14 @@ |
62 | return g_list_copy (bookmarks->items); |
63 | } |
64 | @@ -485,8 +485,8 @@ |
65 | EvBookmark *bookmark) |
66 | Index: evince-3.10.3/shell/ev-bookmarks.h |
67 | =================================================================== |
68 | ---- evince-3.10.3.orig/shell/ev-bookmarks.h 2014-03-03 12:17:53.199442435 +0100 |
69 | -+++ evince-3.10.3/shell/ev-bookmarks.h 2014-03-03 12:17:53.183442435 +0100 |
70 | +--- evince-3.10.3.orig/shell/ev-bookmarks.h 2014-03-04 14:02:21.045143557 +0100 |
71 | ++++ evince-3.10.3/shell/ev-bookmarks.h 2014-03-04 14:02:21.033143557 +0100 |
72 | @@ -43,6 +43,7 @@ |
73 | GType ev_bookmarks_get_type (void) G_GNUC_CONST; |
74 | EvBookmarks *ev_bookmarks_new (EvMetadata *metadata); |
75 | @@ -498,7 +498,7 @@ |
76 | Index: evince-3.10.3/shell/ev-recent-menu-model.c |
77 | =================================================================== |
78 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
79 | -+++ evince-3.10.3/shell/ev-recent-menu-model.c 2014-03-03 12:17:53.183442435 +0100 |
80 | ++++ evince-3.10.3/shell/ev-recent-menu-model.c 2014-03-04 14:02:21.033143557 +0100 |
81 | @@ -0,0 +1,108 @@ |
82 | +/* |
83 | + * Copyright 2014 Canonical Ltd |
84 | @@ -611,7 +611,7 @@ |
85 | Index: evince-3.10.3/shell/ev-recent-menu-model.h |
86 | =================================================================== |
87 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
88 | -+++ evince-3.10.3/shell/ev-recent-menu-model.h 2014-03-03 12:17:53.183442435 +0100 |
89 | ++++ evince-3.10.3/shell/ev-recent-menu-model.h 2014-03-04 14:02:21.033143557 +0100 |
90 | @@ -0,0 +1,30 @@ |
91 | +/* |
92 | + * Copyright 2014 Canonical Ltd |
93 | @@ -645,8 +645,8 @@ |
94 | +#endif |
95 | Index: evince-3.10.3/shell/ev-sidebar-bookmarks.c |
96 | =================================================================== |
97 | ---- evince-3.10.3.orig/shell/ev-sidebar-bookmarks.c 2014-03-03 12:17:53.199442435 +0100 |
98 | -+++ evince-3.10.3/shell/ev-sidebar-bookmarks.c 2014-03-03 12:17:53.187442435 +0100 |
99 | +--- evince-3.10.3.orig/shell/ev-sidebar-bookmarks.c 2014-03-04 14:02:21.045143557 +0100 |
100 | ++++ evince-3.10.3/shell/ev-sidebar-bookmarks.c 2014-03-04 14:02:21.037143557 +0100 |
101 | @@ -40,11 +40,6 @@ |
102 | N_COLUMNS |
103 | }; |
104 | @@ -716,8 +716,8 @@ |
105 | GtkWidget * |
106 | Index: evince-3.10.3/shell/ev-toolbar.c |
107 | =================================================================== |
108 | ---- evince-3.10.3.orig/shell/ev-toolbar.c 2014-03-03 12:17:53.199442435 +0100 |
109 | -+++ evince-3.10.3/shell/ev-toolbar.c 2014-03-03 12:17:53.187442435 +0100 |
110 | +--- evince-3.10.3.orig/shell/ev-toolbar.c 2014-03-04 14:02:21.045143557 +0100 |
111 | ++++ evince-3.10.3/shell/ev-toolbar.c 2014-03-04 14:02:21.037143557 +0100 |
112 | @@ -24,9 +24,12 @@ |
113 | |
114 | #include "ev-toolbar.h" |
115 | @@ -984,8 +984,8 @@ |
116 | static void |
117 | Index: evince-3.10.3/shell/ev-utils.c |
118 | =================================================================== |
119 | ---- evince-3.10.3.orig/shell/ev-utils.c 2014-03-03 12:17:53.199442435 +0100 |
120 | -+++ evince-3.10.3/shell/ev-utils.c 2014-03-03 12:17:53.187442435 +0100 |
121 | +--- evince-3.10.3.orig/shell/ev-utils.c 2014-03-04 14:02:21.045143557 +0100 |
122 | ++++ evince-3.10.3/shell/ev-utils.c 2014-03-04 14:02:21.037143557 +0100 |
123 | @@ -22,6 +22,7 @@ |
124 | |
125 | #include "ev-utils.h" |
126 | @@ -1087,8 +1087,8 @@ |
127 | +} |
128 | Index: evince-3.10.3/shell/ev-utils.h |
129 | =================================================================== |
130 | ---- evince-3.10.3.orig/shell/ev-utils.h 2014-03-03 12:17:53.199442435 +0100 |
131 | -+++ evince-3.10.3/shell/ev-utils.h 2014-03-03 12:17:53.187442435 +0100 |
132 | +--- evince-3.10.3.orig/shell/ev-utils.h 2014-03-04 14:02:21.045143557 +0100 |
133 | ++++ evince-3.10.3/shell/ev-utils.h 2014-03-04 14:02:21.037143557 +0100 |
134 | @@ -42,6 +42,13 @@ |
135 | void file_chooser_dialog_add_writable_pixbuf_formats (GtkFileChooser *chooser); |
136 | GdkPixbufFormat* get_gdk_pixbuf_format_by_extension (const gchar *uri); |
137 | @@ -1105,8 +1105,8 @@ |
138 | #endif /* __EV_VIEW_H__ */ |
139 | Index: evince-3.10.3/shell/ev-window.c |
140 | =================================================================== |
141 | ---- evince-3.10.3.orig/shell/ev-window.c 2014-03-03 12:17:53.199442435 +0100 |
142 | -+++ evince-3.10.3/shell/ev-window.c 2014-03-03 12:18:34.127444106 +0100 |
143 | +--- evince-3.10.3.orig/shell/ev-window.c 2014-03-04 14:02:21.045143557 +0100 |
144 | ++++ evince-3.10.3/shell/ev-window.c 2014-03-04 14:02:45.629144561 +0100 |
145 | @@ -87,10 +87,10 @@ |
146 | #include "ev-print-operation.h" |
147 | #include "ev-progress-message-area.h" |
148 | @@ -1119,8 +1119,12 @@ |
149 | |
150 | #ifdef ENABLE_DBUS |
151 | #include "ev-gdbus-generated.h" |
152 | -@@ -175,8 +175,6 @@ |
153 | - GtkActionGroup *attachment_popup_action_group; |
154 | +@@ -171,24 +171,26 @@ |
155 | + |
156 | + /* UI Builders */ |
157 | + GtkActionGroup *action_group; |
158 | +- GtkActionGroup *view_popup_action_group; |
159 | +- GtkActionGroup *attachment_popup_action_group; |
160 | GtkActionGroup *zoom_selector_popup_action_group; |
161 | GtkRecentManager *recent_manager; |
162 | - GtkActionGroup *recent_action_group; |
163 | @@ -1128,7 +1132,27 @@ |
164 | GtkActionGroup *bookmarks_action_group; |
165 | guint bookmarks_ui_id; |
166 | GtkUIManager *ui_manager; |
167 | -@@ -206,6 +204,7 @@ |
168 | + |
169 | + /* Popup view */ |
170 | +- GtkWidget *view_popup; |
171 | + EvLink *link; |
172 | + EvImage *image; |
173 | + EvAnnotation *annot; |
174 | + |
175 | ++ GMenuModel *document_view_menu; |
176 | ++ GMenuModel *external_link_section; |
177 | ++ GMenuModel *internal_link_section; |
178 | ++ GMenuModel *image_section; |
179 | ++ GMenuModel *attachment_section; |
180 | ++ GMenuModel *annotation_section; |
181 | ++ GtkWidget *popup_menu; |
182 | ++ |
183 | + /* Popup attachment */ |
184 | +- GtkWidget *attachment_popup; |
185 | + GList *attach_list; |
186 | + |
187 | + /* Document */ |
188 | +@@ -206,6 +208,7 @@ |
189 | EvWindowTitle *title; |
190 | EvMetadata *metadata; |
191 | EvBookmarks *bookmarks; |
192 | @@ -1136,7 +1160,7 @@ |
193 | |
194 | /* Load params */ |
195 | EvLinkDest *dest; |
196 | -@@ -262,8 +261,6 @@ |
197 | +@@ -262,8 +265,6 @@ |
198 | #define GS_OVERRIDE_RESTRICTIONS "override-restrictions" |
199 | #define GS_PAGE_CACHE_SIZE "page-cache-size" |
200 | #define GS_AUTO_RELOAD "auto-reload" |
201 | @@ -1145,7 +1169,7 @@ |
202 | |
203 | #define SIDEBAR_DEFAULT_SIZE 132 |
204 | #define LINKS_SIDEBAR_ID "links" |
205 | -@@ -328,13 +325,9 @@ |
206 | +@@ -328,29 +329,9 @@ |
207 | static void ev_window_run_fullscreen (EvWindow *window); |
208 | static void ev_window_stop_fullscreen (EvWindow *window, |
209 | gboolean unfullscreen_window); |
210 | @@ -1156,10 +1180,26 @@ |
211 | gboolean unfullscreen_window); |
212 | -static void ev_window_cmd_view_presentation (GtkAction *action, |
213 | - EvWindow *window); |
214 | - static void ev_view_popup_cmd_open_link (GtkAction *action, |
215 | - EvWindow *window); |
216 | - static void ev_view_popup_cmd_open_link_new_window (GtkAction *action, |
217 | -@@ -361,8 +354,6 @@ |
218 | +-static void ev_view_popup_cmd_open_link (GtkAction *action, |
219 | +- EvWindow *window); |
220 | +-static void ev_view_popup_cmd_open_link_new_window (GtkAction *action, |
221 | +- EvWindow *window); |
222 | +-static void ev_view_popup_cmd_copy_link_address (GtkAction *action, |
223 | +- EvWindow *window); |
224 | +-static void ev_view_popup_cmd_save_image_as (GtkAction *action, |
225 | +- EvWindow *window); |
226 | +-static void ev_view_popup_cmd_copy_image (GtkAction *action, |
227 | +- EvWindow *window); |
228 | +-static void ev_view_popup_cmd_annot_properties (GtkAction *action, |
229 | +- EvWindow *window); |
230 | +-static void ev_attachment_popup_cmd_open_attachment (GtkAction *action, |
231 | +- EvWindow *window); |
232 | +-static void ev_attachment_popup_cmd_save_attachment_as (GtkAction *action, |
233 | +- EvWindow *window); |
234 | + static void ev_window_cmd_view_fit_page (GtkAction *action, |
235 | + EvWindow *ev_window); |
236 | + static void ev_window_cmd_view_fit_width (GtkAction *action, |
237 | +@@ -361,8 +342,6 @@ |
238 | EvLink *link, |
239 | EvWindow *window); |
240 | static void ev_window_update_find_status_message (EvWindow *ev_window); |
241 | @@ -1168,7 +1208,7 @@ |
242 | static void find_bar_search_changed_cb (EggFindBar *find_bar, |
243 | GParamSpec *param, |
244 | EvWindow *ev_window); |
245 | -@@ -396,6 +387,17 @@ |
246 | +@@ -396,6 +375,17 @@ |
247 | } |
248 | |
249 | static void |
250 | @@ -1186,7 +1226,7 @@ |
251 | ev_window_set_action_sensitive (EvWindow *ev_window, |
252 | const char *name, |
253 | gboolean sensitive) |
254 | -@@ -419,6 +421,7 @@ |
255 | +@@ -419,6 +409,7 @@ |
256 | gboolean can_get_text = FALSE; |
257 | gboolean has_pages = FALSE; |
258 | gboolean can_find = FALSE; |
259 | @@ -1194,7 +1234,7 @@ |
260 | |
261 | if (document) { |
262 | has_document = TRUE; |
263 | -@@ -438,10 +441,8 @@ |
264 | +@@ -438,10 +429,8 @@ |
265 | can_find = TRUE; |
266 | } |
267 | |
268 | @@ -1207,7 +1247,7 @@ |
269 | } |
270 | |
271 | if (!override_restrictions && info && info->fields_mask & EV_DOCUMENT_INFO_PERMISSIONS) { |
272 | -@@ -463,33 +464,31 @@ |
273 | +@@ -463,33 +452,31 @@ |
274 | } |
275 | |
276 | /* File menu */ |
277 | @@ -1260,7 +1300,7 @@ |
278 | has_pages && ev_window->priv->bookmarks); |
279 | |
280 | /* Toolbar-specific actions: */ |
281 | -@@ -507,62 +506,58 @@ |
282 | +@@ -507,62 +494,58 @@ |
283 | gboolean has_pages = FALSE; |
284 | gboolean presentation_mode; |
285 | gboolean can_find_in_page = FALSE; |
286 | @@ -1351,7 +1391,7 @@ |
287 | } |
288 | |
289 | static void |
290 | -@@ -593,6 +588,8 @@ |
291 | +@@ -593,6 +576,8 @@ |
292 | set_widget_visibility (priv->toolbar, toolbar); |
293 | set_widget_visibility (priv->find_bar, findbar); |
294 | set_widget_visibility (priv->sidebar, sidebar); |
295 | @@ -1360,7 +1400,7 @@ |
296 | } |
297 | |
298 | static void |
299 | -@@ -892,7 +889,7 @@ |
300 | +@@ -892,7 +877,7 @@ |
301 | view_selection_changed_cb (EvView *view, |
302 | EvWindow *window) |
303 | { |
304 | @@ -1369,7 +1409,7 @@ |
305 | ev_view_get_has_selection (view)); |
306 | } |
307 | |
308 | -@@ -1436,27 +1433,6 @@ |
309 | +@@ -1436,27 +1421,6 @@ |
310 | } |
311 | #endif |
312 | |
313 | @@ -1397,7 +1437,7 @@ |
314 | static gboolean |
315 | ev_window_setup_document (EvWindow *ev_window) |
316 | { |
317 | -@@ -1471,8 +1447,6 @@ |
318 | +@@ -1471,8 +1435,6 @@ |
319 | ev_window_title_set_document (ev_window->priv->title, document); |
320 | ev_window_title_set_uri (ev_window->priv->title, ev_window->priv->uri); |
321 | |
322 | @@ -1406,7 +1446,7 @@ |
323 | #ifdef HAVE_DESKTOP_SCHEMAS |
324 | if (!ev_window->priv->lockdown_settings) { |
325 | ev_window->priv->lockdown_settings = g_settings_new (GS_LOCKDOWN_SCHEMA_NAME); |
326 | -@@ -1563,8 +1537,9 @@ |
327 | +@@ -1563,8 +1525,9 @@ |
328 | ev_window_document_changed (EvWindow *ev_window, |
329 | gpointer user_data) |
330 | { |
331 | @@ -1418,7 +1458,7 @@ |
332 | ev_window_reload_document (ev_window, NULL); |
333 | } |
334 | |
335 | -@@ -2410,124 +2385,10 @@ |
336 | +@@ -2410,124 +2373,10 @@ |
337 | } |
338 | } |
339 | |
340 | @@ -1544,7 +1584,7 @@ |
341 | } |
342 | |
343 | static void |
344 | -@@ -2545,26 +2406,13 @@ |
345 | +@@ -2545,26 +2394,13 @@ |
346 | } |
347 | |
348 | static void |
349 | @@ -1576,7 +1616,7 @@ |
350 | } |
351 | |
352 | static void |
353 | -@@ -2583,185 +2431,6 @@ |
354 | +@@ -2583,185 +2419,6 @@ |
355 | gtk_recent_manager_add_item (window->priv->recent_manager, filename); |
356 | } |
357 | |
358 | @@ -1762,7 +1802,7 @@ |
359 | static gboolean |
360 | show_saving_progress (GFile *dst) |
361 | { |
362 | -@@ -2952,8 +2621,8 @@ |
363 | +@@ -2952,8 +2609,8 @@ |
364 | return; |
365 | } |
366 | |
367 | @@ -1773,7 +1813,7 @@ |
368 | |
369 | uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (fc)); |
370 | |
371 | -@@ -2975,7 +2644,7 @@ |
372 | +@@ -2975,7 +2632,7 @@ |
373 | } |
374 | |
375 | static void |
376 | @@ -1782,7 +1822,7 @@ |
377 | { |
378 | GtkWidget *fc; |
379 | gchar *base_name; |
380 | -@@ -3003,9 +2672,9 @@ |
381 | +@@ -3003,9 +2660,9 @@ |
382 | g_object_unref (file); |
383 | g_free (base_name); |
384 | |
385 | @@ -1795,7 +1835,7 @@ |
386 | |
387 | g_signal_connect (fc, "response", |
388 | G_CALLBACK (file_save_dialog_response_cb), |
389 | -@@ -3015,9 +2684,21 @@ |
390 | +@@ -3015,9 +2672,21 @@ |
391 | } |
392 | |
393 | static void |
394 | @@ -1819,7 +1859,7 @@ |
395 | GAppInfo *app_info; |
396 | gchar *command; |
397 | const char *uri; |
398 | -@@ -3052,8 +2733,11 @@ |
399 | +@@ -3052,8 +2721,11 @@ |
400 | } |
401 | |
402 | static void |
403 | @@ -1832,7 +1872,7 @@ |
404 | GtkWidget *ev_window_widget; |
405 | GFile *file; |
406 | GFile *parent; |
407 | -@@ -3589,14 +3273,22 @@ |
408 | +@@ -3589,14 +3261,22 @@ |
409 | } |
410 | |
411 | static void |
412 | @@ -1857,7 +1897,7 @@ |
413 | if (ev_window->priv->properties == NULL) { |
414 | ev_window->priv->properties = ev_properties_dialog_new (); |
415 | ev_properties_dialog_set_document (EV_PROPERTIES_DIALOG (ev_window->priv->properties), |
416 | -@@ -3622,7 +3314,7 @@ |
417 | +@@ -3622,7 +3302,7 @@ |
418 | |
419 | switch (response) { |
420 | case GTK_RESPONSE_YES: |
421 | @@ -1866,7 +1906,7 @@ |
422 | break; |
423 | case GTK_RESPONSE_NO: |
424 | gtk_widget_destroy (GTK_WIDGET (ev_window)); |
425 | -@@ -3823,64 +3515,81 @@ |
426 | +@@ -3823,64 +3503,81 @@ |
427 | } |
428 | |
429 | static void |
430 | @@ -1972,7 +2012,7 @@ |
431 | } |
432 | |
433 | static void |
434 | -@@ -3897,9 +3606,27 @@ |
435 | +@@ -3897,9 +3594,27 @@ |
436 | } |
437 | |
438 | static void |
439 | @@ -2003,7 +2043,7 @@ |
440 | } |
441 | |
442 | static void |
443 | -@@ -3916,12 +3643,6 @@ |
444 | +@@ -3916,12 +3631,6 @@ |
445 | } |
446 | |
447 | static void |
448 | @@ -2016,7 +2056,7 @@ |
449 | ev_window_cmd_view_zoom_automatic (GtkAction *action, |
450 | EvWindow *ev_window) |
451 | { |
452 | -@@ -3957,29 +3678,28 @@ |
453 | +@@ -3957,29 +3666,28 @@ |
454 | } |
455 | |
456 | static void |
457 | @@ -2056,7 +2096,7 @@ |
458 | } |
459 | |
460 | static void |
461 | -@@ -4004,8 +3724,11 @@ |
462 | +@@ -4004,8 +3712,11 @@ |
463 | } |
464 | |
465 | static void |
466 | @@ -2069,7 +2109,7 @@ |
467 | gboolean find_bar_hidden; |
468 | |
469 | if (EV_WINDOW_IS_PRESENTATION (ev_window)) |
470 | -@@ -4029,8 +3752,11 @@ |
471 | +@@ -4029,8 +3740,11 @@ |
472 | } |
473 | |
474 | static void |
475 | @@ -2082,7 +2122,7 @@ |
476 | gboolean find_bar_hidden; |
477 | |
478 | if (EV_WINDOW_IS_PRESENTATION (ev_window)) |
479 | -@@ -4047,9 +3773,11 @@ |
480 | +@@ -4047,9 +3761,11 @@ |
481 | } |
482 | |
483 | static void |
484 | @@ -2096,7 +2136,7 @@ |
485 | |
486 | ev_view_copy (EV_VIEW (ev_window->priv->view)); |
487 | } |
488 | -@@ -4067,15 +3795,12 @@ |
489 | +@@ -4067,15 +3783,12 @@ |
490 | static void |
491 | ev_window_update_fullscreen_action (EvWindow *window) |
492 | { |
493 | @@ -2117,7 +2157,7 @@ |
494 | } |
495 | |
496 | static void |
497 | -@@ -4292,16 +4017,19 @@ |
498 | +@@ -4292,16 +4005,19 @@ |
499 | } |
500 | |
501 | static void |
502 | @@ -2141,7 +2181,7 @@ |
503 | } |
504 | |
505 | static void |
506 | -@@ -4336,15 +4064,11 @@ |
507 | +@@ -4336,15 +4052,11 @@ |
508 | static void |
509 | ev_window_update_presentation_action (EvWindow *window) |
510 | { |
511 | @@ -2161,7 +2201,7 @@ |
512 | } |
513 | |
514 | static void |
515 | -@@ -4459,14 +4183,17 @@ |
516 | +@@ -4459,14 +4171,17 @@ |
517 | } |
518 | |
519 | static void |
520 | @@ -2183,7 +2223,7 @@ |
521 | } |
522 | |
523 | static gboolean |
524 | -@@ -4530,10 +4257,12 @@ |
525 | +@@ -4530,10 +4245,12 @@ |
526 | ev_window_update_actions_sensitivity (window); |
527 | } |
528 | |
529 | @@ -2198,7 +2238,7 @@ |
530 | gint rotation; |
531 | |
532 | if (EV_WINDOW_IS_PRESENTATION (ev_window)) { |
533 | -@@ -4548,8 +4277,11 @@ |
534 | +@@ -4548,8 +4265,11 @@ |
535 | } |
536 | |
537 | static void |
538 | @@ -2211,7 +2251,7 @@ |
539 | gint rotation; |
540 | |
541 | if (EV_WINDOW_IS_PRESENTATION (ev_window)) { |
542 | -@@ -4564,16 +4296,23 @@ |
543 | +@@ -4564,16 +4284,23 @@ |
544 | } |
545 | |
546 | static void |
547 | @@ -2239,7 +2279,7 @@ |
548 | EvWindowPrivate *priv = ev_window->priv; |
549 | EvDocumentModel *model = priv->model; |
550 | GSettings *settings = priv->default_settings; |
551 | -@@ -4582,7 +4321,7 @@ |
552 | +@@ -4582,7 +4309,7 @@ |
553 | g_settings_set_boolean (settings, "continuous", |
554 | ev_document_model_get_continuous (model)); |
555 | g_settings_set_boolean (settings, "dual-page", |
556 | @@ -2248,7 +2288,7 @@ |
557 | g_settings_set_boolean (settings, "dual-page-odd-left", |
558 | ev_document_model_get_dual_page_odd_pages_left (model)); |
559 | g_settings_set_boolean (settings, "fullscreen", |
560 | -@@ -4607,59 +4346,78 @@ |
561 | +@@ -4607,59 +4334,78 @@ |
562 | } |
563 | |
564 | static void |
565 | @@ -2345,7 +2385,7 @@ |
566 | int n_pages, current_page; |
567 | |
568 | g_return_if_fail (EV_IS_WINDOW (ev_window)); |
569 | -@@ -4673,11 +4431,14 @@ |
570 | +@@ -4673,11 +4419,14 @@ |
571 | } |
572 | |
573 | static void |
574 | @@ -2363,7 +2403,7 @@ |
575 | |
576 | current_page = ev_document_model_get_page (ev_window->priv->model); |
577 | |
578 | -@@ -4686,15 +4447,6 @@ |
579 | +@@ -4686,15 +4435,6 @@ |
580 | } |
581 | } |
582 | |
583 | @@ -2379,7 +2419,7 @@ |
584 | static gint |
585 | compare_bookmarks (EvBookmark *a, |
586 | EvBookmark *b) |
587 | -@@ -4705,59 +4457,33 @@ |
588 | +@@ -4705,59 +4445,33 @@ |
589 | static void |
590 | ev_window_setup_bookmarks (EvWindow *window) |
591 | { |
592 | @@ -2407,27 +2447,27 @@ |
593 | - window->priv->bookmarks_action_group = gtk_action_group_new ("BookmarksActions"); |
594 | - gtk_ui_manager_insert_action_group (window->priv->ui_manager, |
595 | - window->priv->bookmarks_action_group, -1); |
596 | -- |
597 | ++ for (it = items; it; it = it->next) { |
598 | ++ EvBookmark *bookmark = it->data; |
599 | ++ GMenuItem *item; |
600 | + |
601 | - items = ev_bookmarks_get_bookmarks (window->priv->bookmarks); |
602 | - items = g_list_sort (items, (GCompareFunc)compare_bookmarks); |
603 | -- |
604 | ++ item = g_menu_item_new (bookmark->title, NULL); |
605 | ++ g_menu_item_set_action_and_target (item, "win.goto-bookmark", "u", bookmark->page); |
606 | ++ g_menu_append_item (window->priv->bookmarks_menu, item); |
607 | + |
608 | - for (l = items; l && l->data; l = g_list_next (l)) { |
609 | - EvBookmark *bm = (EvBookmark *)l->data; |
610 | - GtkAction *action; |
611 | -+ for (it = items; it; it = it->next) { |
612 | -+ EvBookmark *bookmark = it->data; |
613 | -+ GMenuItem *item; |
614 | - |
615 | +- |
616 | - action = ev_bookmark_action_new (bm); |
617 | - g_signal_connect (action, "activate", |
618 | - G_CALLBACK (ev_window_cmd_bookmark_activate), |
619 | - window); |
620 | - gtk_action_group_add_action (window->priv->bookmarks_action_group, |
621 | - action); |
622 | -+ item = g_menu_item_new (bookmark->title, NULL); |
623 | -+ g_menu_item_set_action_and_target (item, "win.goto-bookmark", "u", bookmark->page); |
624 | -+ g_menu_append_item (window->priv->bookmarks_menu, item); |
625 | - |
626 | +- |
627 | - gtk_ui_manager_add_ui (window->priv->ui_manager, |
628 | - window->priv->bookmarks_ui_id, |
629 | - "/ActionMenu/BookmarksMenu/BookmarksItems", |
630 | @@ -2454,7 +2494,7 @@ |
631 | EvBookmark bm; |
632 | gchar *page_label; |
633 | |
634 | -@@ -4771,32 +4497,41 @@ |
635 | +@@ -4771,32 +4485,41 @@ |
636 | } |
637 | |
638 | static void |
639 | @@ -2508,7 +2548,7 @@ |
640 | ev_view_autoscroll_stop (EV_VIEW (window->priv->view)); |
641 | |
642 | if (gtk_widget_get_visible (window->priv->find_bar)) |
643 | -@@ -4890,29 +4625,20 @@ |
644 | +@@ -4890,29 +4613,20 @@ |
645 | } |
646 | |
647 | static void |
648 | @@ -2546,7 +2586,7 @@ |
649 | } |
650 | |
651 | static void |
652 | -@@ -4930,27 +4656,16 @@ |
653 | +@@ -4930,27 +4644,16 @@ |
654 | } |
655 | |
656 | static void |
657 | @@ -2578,7 +2618,7 @@ |
658 | |
659 | if (window->priv->metadata && !ev_window_is_empty (window)) |
660 | ev_metadata_set_boolean (window->priv->metadata, "inverted-colors", |
661 | -@@ -4960,43 +4675,20 @@ |
662 | +@@ -4960,43 +4663,20 @@ |
663 | } |
664 | |
665 | static void |
666 | @@ -2629,7 +2669,7 @@ |
667 | } |
668 | |
669 | static void |
670 | -@@ -5004,119 +4696,36 @@ |
671 | +@@ -5004,119 +4684,36 @@ |
672 | GParamSpec *pspec, |
673 | EvWindow *ev_window) |
674 | { |
675 | @@ -2675,7 +2715,8 @@ |
676 | - "Christian Persch <chpe" "\100" "gnome.org>", |
677 | - NULL |
678 | - }; |
679 | -- |
680 | ++ EvWindow *ev_window = user_data; |
681 | + |
682 | - const char *documenters[] = { |
683 | - "Nickolay V. Shmyrev <nshmyrev@yandex.ru>", |
684 | - "Phil Bull <philbull@gmail.com>", |
685 | @@ -2705,8 +2746,7 @@ |
686 | - |
687 | - for (p = authors; *p; ++p) |
688 | - *p = _(*p); |
689 | -+ EvWindow *ev_window = user_data; |
690 | - |
691 | +- |
692 | - for (p = documenters; *p; ++p) |
693 | - *p = _(*p); |
694 | -#endif |
695 | @@ -2764,7 +2804,7 @@ |
696 | update_chrome_visibility (ev_window); |
697 | } |
698 | |
699 | -@@ -5137,14 +4746,11 @@ |
700 | +@@ -5137,14 +4734,11 @@ |
701 | GParamSpec *pspec, |
702 | EvWindow *ev_window) |
703 | { |
704 | @@ -2781,7 +2821,263 @@ |
705 | |
706 | if (ev_window->priv->metadata) |
707 | ev_metadata_set_boolean (ev_window->priv->metadata, "sidebar_visibility", |
708 | -@@ -5542,21 +5148,6 @@ |
709 | +@@ -5154,14 +4748,10 @@ |
710 | + } |
711 | + } |
712 | + |
713 | +-static void |
714 | ++static GMenuModel * |
715 | + view_menu_link_popup (EvWindow *ev_window, |
716 | + EvLink *link) |
717 | + { |
718 | +- gboolean show_external = FALSE; |
719 | +- gboolean show_internal = FALSE; |
720 | +- GtkAction *action; |
721 | +- |
722 | + if (ev_window->priv->link) |
723 | + g_object_unref (ev_window->priv->link); |
724 | + |
725 | +@@ -5178,42 +4768,23 @@ |
726 | + switch (ev_link_action_get_action_type (ev_action)) { |
727 | + case EV_LINK_ACTION_TYPE_GOTO_DEST: |
728 | + case EV_LINK_ACTION_TYPE_GOTO_REMOTE: |
729 | +- show_internal = TRUE; |
730 | +- break; |
731 | ++ return ev_window->priv->internal_link_section; |
732 | + case EV_LINK_ACTION_TYPE_EXTERNAL_URI: |
733 | + case EV_LINK_ACTION_TYPE_LAUNCH: |
734 | +- show_external = TRUE; |
735 | +- break; |
736 | +- default: |
737 | +- break; |
738 | ++ return ev_window->priv->external_link_section; |
739 | ++ default: |
740 | ++ return NULL; |
741 | + } |
742 | + } |
743 | + } |
744 | +- |
745 | +- action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group, |
746 | +- "OpenLink"); |
747 | +- gtk_action_set_visible (action, show_external); |
748 | +- |
749 | +- action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group, |
750 | +- "CopyLinkAddress"); |
751 | +- gtk_action_set_visible (action, show_external); |
752 | +- |
753 | +- action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group, |
754 | +- "GoLink"); |
755 | +- gtk_action_set_visible (action, show_internal); |
756 | +- |
757 | +- action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group, |
758 | +- "OpenLinkNewWindow"); |
759 | +- gtk_action_set_visible (action, show_internal); |
760 | ++ |
761 | ++ return NULL; |
762 | + } |
763 | + |
764 | +-static void |
765 | ++static GMenuModel * |
766 | + view_menu_image_popup (EvWindow *ev_window, |
767 | + EvImage *image) |
768 | + { |
769 | +- GtkAction *action; |
770 | +- gboolean show_image = FALSE; |
771 | +- |
772 | + if (ev_window->priv->image) |
773 | + g_object_unref (ev_window->priv->image); |
774 | + |
775 | +@@ -5222,38 +4793,22 @@ |
776 | + else |
777 | + ev_window->priv->image = NULL; |
778 | + |
779 | +- show_image = (ev_window->priv->image != NULL); |
780 | +- |
781 | +- action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group, |
782 | +- "SaveImageAs"); |
783 | +- gtk_action_set_visible (action, show_image); |
784 | +- |
785 | +- action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group, |
786 | +- "CopyImage"); |
787 | +- gtk_action_set_visible (action, show_image); |
788 | ++ return ev_window->priv->image != NULL ? ev_window->priv->image_section : NULL; |
789 | + } |
790 | + |
791 | +-static void |
792 | ++static GMenuModel * |
793 | + view_menu_annot_popup (EvWindow *ev_window, |
794 | + EvAnnotation *annot) |
795 | + { |
796 | +- GtkAction *action; |
797 | +- gboolean show_annot = FALSE; |
798 | +- |
799 | + if (ev_window->priv->annot) |
800 | + g_object_unref (ev_window->priv->annot); |
801 | + ev_window->priv->annot = (annot) ? g_object_ref (annot) : NULL; |
802 | + |
803 | +- action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group, |
804 | +- "AnnotProperties"); |
805 | +- gtk_action_set_visible (action, (annot != NULL && EV_IS_ANNOTATION_MARKUP (annot))); |
806 | +- |
807 | + if (annot && EV_IS_ANNOTATION_ATTACHMENT (annot)) { |
808 | + EvAttachment *attachment; |
809 | + |
810 | + attachment = ev_annotation_attachment_get_attachment (EV_ANNOTATION_ATTACHMENT (annot)); |
811 | + if (attachment) { |
812 | +- show_annot = TRUE; |
813 | + if (ev_window->priv->attach_list) { |
814 | + g_list_foreach (ev_window->priv->attach_list, |
815 | + (GFunc) g_object_unref, NULL); |
816 | +@@ -5263,16 +4818,43 @@ |
817 | + ev_window->priv->attach_list = |
818 | + g_list_prepend (ev_window->priv->attach_list, |
819 | + g_object_ref (attachment)); |
820 | ++ |
821 | ++ return ev_window->priv->annotation_section; |
822 | + } |
823 | + } |
824 | + |
825 | +- action = gtk_action_group_get_action (ev_window->priv->attachment_popup_action_group, |
826 | +- "OpenAttachment"); |
827 | +- gtk_action_set_visible (action, show_annot); |
828 | +- |
829 | +- action = gtk_action_group_get_action (ev_window->priv->attachment_popup_action_group, |
830 | +- "SaveAttachmentAs"); |
831 | +- gtk_action_set_visible (action, show_annot); |
832 | ++ return NULL; |
833 | ++} |
834 | ++ |
835 | ++static void |
836 | ++popup_menu_detach (GtkWidget *attach_widget, |
837 | ++ GtkMenu *menu) |
838 | ++{ |
839 | ++ EvWindow *window = EV_WINDOW (attach_widget); |
840 | ++ |
841 | ++ window->priv->popup_menu = NULL; |
842 | ++} |
843 | ++ |
844 | ++static GMenu * |
845 | ++menu_new_copy (GMenuModel *source) |
846 | ++{ |
847 | ++ GMenu *menu; |
848 | ++ gint n_items; |
849 | ++ gint i; |
850 | ++ |
851 | ++ menu = g_menu_new (); |
852 | ++ |
853 | ++ n_items = g_menu_model_get_n_items (source); |
854 | ++ for (i = 0; i < n_items; i++) { |
855 | ++ GMenuItem *item; |
856 | ++ |
857 | ++ item = g_menu_item_new_from_model (source, i); |
858 | ++ g_menu_append_item (menu, item); |
859 | ++ |
860 | ++ g_object_unref (item); |
861 | ++ } |
862 | ++ |
863 | ++ return menu; |
864 | + } |
865 | + |
866 | + static gboolean |
867 | +@@ -5280,34 +4862,44 @@ |
868 | + GList *items, |
869 | + EvWindow *ev_window) |
870 | + { |
871 | +- GList *l; |
872 | +- gboolean has_link = FALSE; |
873 | +- gboolean has_image = FALSE; |
874 | +- gboolean has_annot = FALSE; |
875 | ++ GList *l; |
876 | ++ GMenu *popup; |
877 | ++ |
878 | ++ if (ev_window->priv->popup_menu) { |
879 | ++ gtk_widget_destroy (ev_window->priv->popup_menu); |
880 | ++ ev_window->priv->popup_menu = NULL; |
881 | ++ } |
882 | ++ |
883 | ++ /* make a deep copy of the base menu to append the optionally |
884 | ++ * visible sections to */ |
885 | ++ popup = menu_new_copy (ev_window->priv->document_view_menu); |
886 | + |
887 | + for (l = items; l; l = g_list_next (l)) { |
888 | + if (EV_IS_LINK (l->data)) { |
889 | +- view_menu_link_popup (ev_window, EV_LINK (l->data)); |
890 | +- has_link = TRUE; |
891 | ++ GMenuModel *section = view_menu_link_popup (ev_window, EV_LINK (l->data)); |
892 | ++ if (section) |
893 | ++ g_menu_prepend_section (popup, NULL, section); |
894 | + } else if (EV_IS_IMAGE (l->data)) { |
895 | +- view_menu_image_popup (ev_window, EV_IMAGE (l->data)); |
896 | +- has_image = TRUE; |
897 | ++ GMenuModel *section = view_menu_image_popup (ev_window, EV_IMAGE (l->data)); |
898 | ++ if (section) |
899 | ++ g_menu_append_section (popup, NULL, section); |
900 | + } else if (EV_IS_ANNOTATION (l->data)) { |
901 | +- view_menu_annot_popup (ev_window, EV_ANNOTATION (l->data)); |
902 | +- has_annot = TRUE; |
903 | ++ GMenuModel *section = view_menu_annot_popup (ev_window, EV_ANNOTATION (l->data)); |
904 | ++ if (section) |
905 | ++ g_menu_append_section (popup, NULL, section); |
906 | + } |
907 | + } |
908 | + |
909 | +- if (!has_link) |
910 | +- view_menu_link_popup (ev_window, NULL); |
911 | +- if (!has_image) |
912 | +- view_menu_image_popup (ev_window, NULL); |
913 | +- if (!has_annot) |
914 | +- view_menu_annot_popup (ev_window, NULL); |
915 | ++ if (g_menu_model_get_n_items (G_MENU_MODEL (popup)) > 0) { |
916 | ++ ev_window->priv->popup_menu = gtk_menu_new_from_model (G_MENU_MODEL (popup)); |
917 | ++ gtk_menu_attach_to_widget (GTK_MENU (ev_window->priv->popup_menu), |
918 | ++ GTK_WIDGET (ev_window), popup_menu_detach); |
919 | + |
920 | +- gtk_menu_popup (GTK_MENU (ev_window->priv->view_popup), |
921 | +- NULL, NULL, NULL, NULL, |
922 | +- 3, gtk_get_current_event_time ()); |
923 | ++ gtk_menu_popup (GTK_MENU (ev_window->priv->popup_menu), NULL, NULL, NULL, NULL, |
924 | ++ 3, gtk_get_current_event_time ()); |
925 | ++ } |
926 | ++ |
927 | ++ g_object_unref (popup); |
928 | + return TRUE; |
929 | + } |
930 | + |
931 | +@@ -5316,8 +4908,6 @@ |
932 | + GList *attach_list, |
933 | + EvWindow *ev_window) |
934 | + { |
935 | +- GtkWidget *popup; |
936 | +- |
937 | + g_assert (attach_list != NULL); |
938 | + |
939 | + if (ev_window->priv->attach_list) { |
940 | +@@ -5325,13 +4915,19 @@ |
941 | + (GFunc) g_object_unref, NULL); |
942 | + g_list_free (ev_window->priv->attach_list); |
943 | + } |
944 | +- |
945 | ++ |
946 | + ev_window->priv->attach_list = attach_list; |
947 | +- |
948 | +- popup = ev_window->priv->attachment_popup; |
949 | + |
950 | +- gtk_menu_popup (GTK_MENU (popup), NULL, NULL, |
951 | +- NULL, NULL, |
952 | ++ if (ev_window->priv->popup_menu) { |
953 | ++ gtk_widget_destroy (ev_window->priv->popup_menu); |
954 | ++ ev_window->priv->popup_menu = NULL; |
955 | ++ } |
956 | ++ |
957 | ++ ev_window->priv->popup_menu = gtk_menu_new_from_model (ev_window->priv->attachment_section); |
958 | ++ gtk_menu_attach_to_widget (GTK_MENU (ev_window->priv->popup_menu), |
959 | ++ GTK_WIDGET (ev_window), popup_menu_detach); |
960 | ++ |
961 | ++ gtk_menu_popup (GTK_MENU (ev_window->priv->popup_menu), NULL, NULL, NULL, NULL, |
962 | + 3, gtk_get_current_event_time ()); |
963 | + |
964 | + return TRUE; |
965 | +@@ -5542,21 +5138,6 @@ |
966 | } |
967 | |
968 | static void |
969 | @@ -2803,7 +3099,7 @@ |
970 | ev_window_show_find_bar (EvWindow *ev_window) |
971 | { |
972 | if (gtk_widget_get_visible (ev_window->priv->find_bar)) { |
973 | -@@ -5583,7 +5174,7 @@ |
974 | +@@ -5583,7 +5164,7 @@ |
975 | update_chrome_flag (ev_window, EV_CHROME_FINDBAR, TRUE); |
976 | update_chrome_visibility (ev_window); |
977 | gtk_widget_grab_focus (ev_window->priv->find_bar); |
978 | @@ -2812,7 +3108,7 @@ |
979 | } |
980 | |
981 | static void |
982 | -@@ -5601,7 +5192,7 @@ |
983 | +@@ -5601,7 +5182,7 @@ |
984 | update_chrome_flag (ev_window, EV_CHROME_FINDBAR, FALSE); |
985 | update_chrome_visibility (ev_window); |
986 | gtk_widget_grab_focus (ev_window->priv->view); |
987 | @@ -2821,7 +3117,7 @@ |
988 | |
989 | ev_history_thaw (ev_window->priv->history); |
990 | } |
991 | -@@ -5651,10 +5242,15 @@ |
992 | +@@ -5651,10 +5232,15 @@ |
993 | ev_window_set_caret_navigation_enabled (EvWindow *window, |
994 | gboolean enabled) |
995 | { |
996 | @@ -2837,7 +3133,7 @@ |
997 | } |
998 | |
999 | static void |
1000 | -@@ -5668,7 +5264,7 @@ |
1001 | +@@ -5668,7 +5254,7 @@ |
1002 | |
1003 | /* Turn the confirmation dialog off if the user has requested not to show it again */ |
1004 | if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (window->priv->ask_caret_navigation_check))) { |
1005 | @@ -2846,7 +3142,7 @@ |
1006 | g_settings_apply (window->priv->settings); |
1007 | } |
1008 | |
1009 | -@@ -5678,9 +5274,11 @@ |
1010 | +@@ -5678,9 +5264,11 @@ |
1011 | } |
1012 | |
1013 | static void |
1014 | @@ -2860,7 +3156,7 @@ |
1015 | GtkWidget *message_area; |
1016 | GtkWidget *box; |
1017 | GtkWidget *hbox; |
1018 | -@@ -5689,7 +5287,7 @@ |
1019 | +@@ -5689,7 +5277,7 @@ |
1020 | /* Don't ask for user confirmation to turn the caret navigation off when it is active, |
1021 | * or to turn it on when the confirmation dialog is not to be shown per settings */ |
1022 | enabled = ev_view_is_caret_navigation_enabled (EV_VIEW (window->priv->view)); |
1023 | @@ -2869,7 +3165,25 @@ |
1024 | ev_window_set_caret_navigation_enabled (window, !enabled); |
1025 | return; |
1026 | } |
1027 | -@@ -5805,28 +5403,15 @@ |
1028 | +@@ -5793,40 +5381,24 @@ |
1029 | + priv->action_group = NULL; |
1030 | + } |
1031 | + |
1032 | +- if (priv->view_popup_action_group) { |
1033 | +- g_object_unref (priv->view_popup_action_group); |
1034 | +- priv->view_popup_action_group = NULL; |
1035 | +- } |
1036 | +- |
1037 | +- if (priv->attachment_popup_action_group) { |
1038 | +- g_object_unref (priv->attachment_popup_action_group); |
1039 | +- priv->attachment_popup_action_group = NULL; |
1040 | +- } |
1041 | ++ g_clear_object (&priv->document_view_menu); |
1042 | ++ g_clear_object (&priv->external_link_section); |
1043 | ++ g_clear_object (&priv->internal_link_section); |
1044 | ++ g_clear_object (&priv->image_section); |
1045 | ++ g_clear_object (&priv->attachment_section); |
1046 | ++ g_clear_object (&priv->annotation_section); |
1047 | |
1048 | g_clear_object (&priv->zoom_selector_popup_action_group); |
1049 | |
1050 | @@ -2898,7 +3212,7 @@ |
1051 | if (priv->default_settings) { |
1052 | g_settings_apply (priv->default_settings); |
1053 | g_object_unref (priv->default_settings); |
1054 | -@@ -5838,8 +5423,6 @@ |
1055 | +@@ -5838,8 +5410,6 @@ |
1056 | priv->lockdown_settings = NULL; |
1057 | } |
1058 | |
1059 | @@ -2907,7 +3221,7 @@ |
1060 | if (priv->model) { |
1061 | g_signal_handlers_disconnect_by_func (priv->model, |
1062 | ev_window_page_changed_cb, |
1063 | -@@ -5955,7 +5538,6 @@ |
1064 | +@@ -5955,7 +5525,6 @@ |
1065 | G_OBJECT_CLASS (ev_window_parent_class)->dispose (object); |
1066 | } |
1067 | |
1068 | @@ -2915,7 +3229,7 @@ |
1069 | /* |
1070 | * GtkWindow catches keybindings for the menu items _before_ passing them to |
1071 | * the focused widget. This is unfortunate and means that pressing Ctrl+a, |
1072 | -@@ -6012,184 +5594,10 @@ |
1073 | +@@ -6012,206 +5581,6 @@ |
1074 | g_type_class_add_private (g_object_class, sizeof (EvWindowPrivate)); |
1075 | } |
1076 | |
1077 | @@ -3093,24 +3407,36 @@ |
1078 | - G_CALLBACK (ev_window_cmd_toggle_find) }, |
1079 | -}; |
1080 | - |
1081 | - /* Popups specific items */ |
1082 | - static const GtkActionEntry view_popup_entries [] = { |
1083 | - /* Links */ |
1084 | +-/* Popups specific items */ |
1085 | +-static const GtkActionEntry view_popup_entries [] = { |
1086 | +- /* Links */ |
1087 | - { "OpenLink", GTK_STOCK_OPEN, N_("_Open Link"), NULL, |
1088 | -+ { "OpenLink", NULL, N_("_Open Link"), NULL, |
1089 | - NULL, G_CALLBACK (ev_view_popup_cmd_open_link) }, |
1090 | - { "GoLink", GTK_STOCK_GO_FORWARD, N_("_Go To"), NULL, |
1091 | - NULL, G_CALLBACK (ev_view_popup_cmd_open_link) }, |
1092 | -@@ -6206,7 +5614,7 @@ |
1093 | - }; |
1094 | - |
1095 | - static const GtkActionEntry attachment_popup_entries [] = { |
1096 | +- NULL, G_CALLBACK (ev_view_popup_cmd_open_link) }, |
1097 | +- { "GoLink", GTK_STOCK_GO_FORWARD, N_("_Go To"), NULL, |
1098 | +- NULL, G_CALLBACK (ev_view_popup_cmd_open_link) }, |
1099 | +- { "OpenLinkNewWindow", NULL, N_("Open in New _Window"), NULL, |
1100 | +- NULL, G_CALLBACK (ev_view_popup_cmd_open_link_new_window) }, |
1101 | +- { "CopyLinkAddress", NULL, N_("_Copy Link Address"), NULL, |
1102 | +- NULL, G_CALLBACK (ev_view_popup_cmd_copy_link_address) }, |
1103 | +- { "SaveImageAs", NULL, N_("_Save Image As…"), NULL, |
1104 | +- NULL, G_CALLBACK (ev_view_popup_cmd_save_image_as) }, |
1105 | +- { "CopyImage", NULL, N_("Copy _Image"), NULL, |
1106 | +- NULL, G_CALLBACK (ev_view_popup_cmd_copy_image) }, |
1107 | +- { "AnnotProperties", NULL, N_("Annotation Properties…"), NULL, |
1108 | +- NULL, G_CALLBACK (ev_view_popup_cmd_annot_properties) } |
1109 | +-}; |
1110 | +- |
1111 | +-static const GtkActionEntry attachment_popup_entries [] = { |
1112 | - { "OpenAttachment", GTK_STOCK_OPEN, N_("_Open Attachment"), NULL, |
1113 | -+ { "OpenAttachment", NULL, N_("_Open Attachment"), NULL, |
1114 | - NULL, G_CALLBACK (ev_attachment_popup_cmd_open_attachment) }, |
1115 | - { "SaveAttachmentAs", GTK_STOCK_SAVE_AS, N_("_Save Attachment As…"), NULL, |
1116 | - NULL, G_CALLBACK (ev_attachment_popup_cmd_save_attachment_as) }, |
1117 | -@@ -6276,13 +5684,6 @@ |
1118 | +- NULL, G_CALLBACK (ev_attachment_popup_cmd_open_attachment) }, |
1119 | +- { "SaveAttachmentAs", GTK_STOCK_SAVE_AS, N_("_Save Attachment As…"), NULL, |
1120 | +- NULL, G_CALLBACK (ev_attachment_popup_cmd_save_attachment_as) }, |
1121 | +-}; |
1122 | +- |
1123 | + static const GtkToggleActionEntry zoom_selector_popup_actions[] = { |
1124 | + { "ViewFitPage", EV_STOCK_ZOOM_PAGE, N_("Fit Pa_ge"), NULL, |
1125 | + N_("Make the current document fill the window"), |
1126 | +@@ -6276,13 +5645,6 @@ |
1127 | } |
1128 | |
1129 | static void |
1130 | @@ -3124,7 +3450,7 @@ |
1131 | zoom_action_activated_cb (EvZoomAction *action, |
1132 | EvWindow *window) |
1133 | { |
1134 | -@@ -6378,42 +5779,6 @@ |
1135 | +@@ -6378,42 +5740,6 @@ |
1136 | } |
1137 | |
1138 | static void |
1139 | @@ -3167,7 +3493,7 @@ |
1140 | sidebar_widget_model_set (EvSidebarLinks *ev_sidebar_links, |
1141 | GParamSpec *pspec, |
1142 | EvWindow *ev_window) |
1143 | -@@ -6647,21 +6012,21 @@ |
1144 | +@@ -6647,21 +5973,21 @@ |
1145 | const gchar *name = ev_link_action_get_name (action); |
1146 | |
1147 | if (g_ascii_strcasecmp (name, "FirstPage") == 0) { |
1148 | @@ -3197,7 +3523,44 @@ |
1149 | } else { |
1150 | g_warning ("Unimplemented named action: %s, please post a " |
1151 | "bug report in Evince bugzilla " |
1152 | -@@ -6782,8 +6147,8 @@ |
1153 | +@@ -6702,14 +6028,21 @@ |
1154 | + } |
1155 | + |
1156 | + static void |
1157 | +-ev_view_popup_cmd_open_link (GtkAction *action, EvWindow *window) |
1158 | ++ev_window_activate_open_link_action (GSimpleAction *action, |
1159 | ++ GVariant *parameter, |
1160 | ++ gpointer user_data) |
1161 | + { |
1162 | ++ EvWindow *window = user_data; |
1163 | ++ |
1164 | + ev_view_handle_link (EV_VIEW (window->priv->view), window->priv->link); |
1165 | + } |
1166 | + |
1167 | + static void |
1168 | +-ev_view_popup_cmd_open_link_new_window (GtkAction *action, EvWindow *window) |
1169 | ++ev_window_activate_open_link_in_new_window_action (GSimpleAction *action, |
1170 | ++ GVariant *parameter, |
1171 | ++ gpointer user_data) |
1172 | + { |
1173 | ++ EvWindow *window = user_data; |
1174 | + EvLinkAction *ev_action = NULL; |
1175 | + EvLinkDest *dest; |
1176 | + |
1177 | +@@ -6725,8 +6058,11 @@ |
1178 | + } |
1179 | + |
1180 | + static void |
1181 | +-ev_view_popup_cmd_copy_link_address (GtkAction *action, EvWindow *window) |
1182 | ++ev_window_activate_copy_link_address_action (GSimpleAction *action, |
1183 | ++ GVariant *parameter, |
1184 | ++ gpointer user_data) |
1185 | + { |
1186 | ++ EvWindow *window = user_data; |
1187 | + EvLinkAction *ev_action; |
1188 | + |
1189 | + ev_action = ev_link_get_action (window->priv->link); |
1190 | +@@ -6782,8 +6118,8 @@ |
1191 | return; |
1192 | } |
1193 | |
1194 | @@ -3208,7 +3571,20 @@ |
1195 | |
1196 | uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (fc)); |
1197 | filter = gtk_file_chooser_get_filter (GTK_FILE_CHOOSER (fc)); |
1198 | -@@ -6887,9 +6252,9 @@ |
1199 | +@@ -6862,8 +6198,11 @@ |
1200 | + } |
1201 | + |
1202 | + static void |
1203 | +-ev_view_popup_cmd_save_image_as (GtkAction *action, EvWindow *window) |
1204 | ++ev_window_activate_save_image_action (GSimpleAction *action, |
1205 | ++ GVariant *parameter, |
1206 | ++ gpointer user_data) |
1207 | + { |
1208 | ++ EvWindow *window = user_data; |
1209 | + GtkWidget *fc; |
1210 | + |
1211 | + if (!window->priv->image) |
1212 | +@@ -6887,9 +6226,9 @@ |
1213 | gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (fc), TRUE); |
1214 | |
1215 | file_chooser_dialog_add_writable_pixbuf_formats (GTK_FILE_CHOOSER (fc)); |
1216 | @@ -3221,7 +3597,47 @@ |
1217 | |
1218 | g_signal_connect (fc, "response", |
1219 | G_CALLBACK (image_save_dialog_response_cb), |
1220 | -@@ -7023,8 +6388,8 @@ |
1221 | +@@ -6899,8 +6238,11 @@ |
1222 | + } |
1223 | + |
1224 | + static void |
1225 | +-ev_view_popup_cmd_copy_image (GtkAction *action, EvWindow *window) |
1226 | ++ev_window_activate_copy_image_action (GSimpleAction *action, |
1227 | ++ GVariant *parameter, |
1228 | ++ gpointer user_data) |
1229 | + { |
1230 | ++ EvWindow *window = user_data; |
1231 | + GtkClipboard *clipboard; |
1232 | + GdkPixbuf *pixbuf; |
1233 | + |
1234 | +@@ -6919,9 +6261,11 @@ |
1235 | + } |
1236 | + |
1237 | + static void |
1238 | +-ev_view_popup_cmd_annot_properties (GtkAction *action, |
1239 | +- EvWindow *window) |
1240 | ++ev_window_activate_show_annotation_properties_action (GSimpleAction *action, |
1241 | ++ GVariant *parameter, |
1242 | ++ gpointer user_data) |
1243 | + { |
1244 | ++ EvWindow *window = user_data; |
1245 | + const gchar *author; |
1246 | + GdkRGBA rgba; |
1247 | + gdouble opacity; |
1248 | +@@ -6980,8 +6324,11 @@ |
1249 | + } |
1250 | + |
1251 | + static void |
1252 | +-ev_attachment_popup_cmd_open_attachment (GtkAction *action, EvWindow *window) |
1253 | ++ev_window_activate_open_attachment_action (GSimpleAction *action, |
1254 | ++ GVariant *parameter, |
1255 | ++ gpointer user_data) |
1256 | + { |
1257 | ++ EvWindow *window = user_data; |
1258 | + GList *l; |
1259 | + GdkScreen *screen; |
1260 | + |
1261 | +@@ -7023,8 +6370,8 @@ |
1262 | return; |
1263 | } |
1264 | |
1265 | @@ -3232,7 +3648,20 @@ |
1266 | |
1267 | uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (fc)); |
1268 | target_file = g_file_new_for_uri (uri); |
1269 | -@@ -7122,8 +6487,8 @@ |
1270 | +@@ -7089,8 +6436,11 @@ |
1271 | + } |
1272 | + |
1273 | + static void |
1274 | +-ev_attachment_popup_cmd_save_attachment_as (GtkAction *action, EvWindow *window) |
1275 | ++ev_window_activate_save_attachment_action (GSimpleAction *action, |
1276 | ++ GVariant *parameter, |
1277 | ++ gpointer user_data) |
1278 | + { |
1279 | ++ EvWindow *window = user_data; |
1280 | + GtkWidget *fc; |
1281 | + EvAttachment *attachment = NULL; |
1282 | + |
1283 | +@@ -7122,8 +6472,8 @@ |
1284 | gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (fc), |
1285 | ev_attachment_get_name (attachment)); |
1286 | |
1287 | @@ -3243,7 +3672,7 @@ |
1288 | |
1289 | g_signal_connect (fc, "response", |
1290 | G_CALLBACK (attachment_save_dialog_response_cb), |
1291 | -@@ -7154,16 +6519,16 @@ |
1292 | +@@ -7154,16 +6504,16 @@ |
1293 | if (EV_WINDOW_IS_PRESENTATION (window)) |
1294 | ev_view_presentation_previous_page (EV_VIEW_PRESENTATION (window->priv->presentation_view)); |
1295 | else |
1296 | @@ -3264,7 +3693,7 @@ |
1297 | } |
1298 | } |
1299 | |
1300 | -@@ -7278,8 +6643,72 @@ |
1301 | +@@ -7278,11 +6628,84 @@ |
1302 | } |
1303 | |
1304 | static void |
1305 | @@ -3332,12 +3761,24 @@ |
1306 | + { "escape", ev_window_activate_escape_action, NULL, NULL, NULL }, |
1307 | + { "open-menu", ev_window_activate_open_menu_command, NULL, NULL, NULL }, |
1308 | + { "caret-navigation", activate_toggle_action, NULL, "false", ev_window_change_caret_navigation_action_state }, |
1309 | ++ { "open-link", ev_window_activate_open_link_action, NULL, NULL, NULL }, |
1310 | ++ { "open-link-in-new-window", ev_window_activate_open_link_in_new_window_action, NULL, NULL, NULL }, |
1311 | ++ { "save-image", ev_window_activate_save_image_action, NULL, NULL, NULL }, |
1312 | ++ { "copy-image", ev_window_activate_copy_image_action, NULL, NULL, NULL }, |
1313 | ++ { "show-annotation-properties", ev_window_activate_show_annotation_properties_action, NULL, NULL, NULL }, |
1314 | ++ { "copy-link-address", ev_window_activate_copy_link_address_action, NULL, NULL, NULL }, |
1315 | ++ { "open-attachment", ev_window_activate_open_attachment_action, NULL, NULL, NULL }, |
1316 | ++ { "save-attachment", ev_window_activate_save_attachment_action, NULL, NULL, NULL }, |
1317 | + }; |
1318 | + |
1319 | GtkActionGroup *action_group; |
1320 | GtkAccelGroup *accel_group; |
1321 | GtkCssProvider *css_provider; |
1322 | -@@ -7343,6 +6772,8 @@ |
1323 | ++ GtkBuilder *builder; |
1324 | + GError *error = NULL; |
1325 | + GtkWidget *sidebar_widget; |
1326 | + GtkWidget *overlay; |
1327 | +@@ -7343,6 +6766,8 @@ |
1328 | G_CALLBACK (activate_link_cb), |
1329 | ev_window); |
1330 | |
1331 | @@ -3346,7 +3787,7 @@ |
1332 | app_info = g_app_info_get_default_for_uri_scheme ("mailto"); |
1333 | ev_window->priv->has_mailto_handler = app_info != NULL; |
1334 | g_clear_object (&app_info); |
1335 | -@@ -7351,15 +6782,13 @@ |
1336 | +@@ -7351,15 +6776,13 @@ |
1337 | gtk_container_add (GTK_CONTAINER (ev_window), ev_window->priv->main_box); |
1338 | gtk_widget_show (ev_window->priv->main_box); |
1339 | |
1340 | @@ -3366,7 +3807,44 @@ |
1341 | register_custom_actions (ev_window, action_group); |
1342 | |
1343 | ev_window->priv->ui_manager = gtk_ui_manager_new (); |
1344 | -@@ -7415,12 +6844,6 @@ |
1345 | +@@ -7370,24 +6793,6 @@ |
1346 | + gtk_ui_manager_get_accel_group (ev_window->priv->ui_manager); |
1347 | + gtk_window_add_accel_group (GTK_WINDOW (ev_window), accel_group); |
1348 | + |
1349 | +- action_group = gtk_action_group_new ("ViewPopupActions"); |
1350 | +- ev_window->priv->view_popup_action_group = action_group; |
1351 | +- gtk_action_group_set_translation_domain (action_group, NULL); |
1352 | +- gtk_action_group_add_actions (action_group, view_popup_entries, |
1353 | +- G_N_ELEMENTS (view_popup_entries), |
1354 | +- ev_window); |
1355 | +- gtk_ui_manager_insert_action_group (ev_window->priv->ui_manager, |
1356 | +- action_group, 0); |
1357 | +- |
1358 | +- action_group = gtk_action_group_new ("AttachmentPopupActions"); |
1359 | +- ev_window->priv->attachment_popup_action_group = action_group; |
1360 | +- gtk_action_group_set_translation_domain (action_group, NULL); |
1361 | +- gtk_action_group_add_actions (action_group, attachment_popup_entries, |
1362 | +- G_N_ELEMENTS (attachment_popup_entries), |
1363 | +- ev_window); |
1364 | +- gtk_ui_manager_insert_action_group (ev_window->priv->ui_manager, |
1365 | +- action_group, 0); |
1366 | +- |
1367 | + action_group = gtk_action_group_new ("ZoomSelectorPopupActions"); |
1368 | + ev_window->priv->zoom_selector_popup_action_group = action_group; |
1369 | + gtk_action_group_set_translation_domain (action_group, NULL); |
1370 | +@@ -7397,11 +6802,6 @@ |
1371 | + gtk_ui_manager_insert_action_group (ev_window->priv->ui_manager, |
1372 | + action_group, 0); |
1373 | + |
1374 | +- gtk_ui_manager_add_ui_from_resource (ev_window->priv->ui_manager, |
1375 | +- "/org/gnome/evince/shell/ui/evince.xml", |
1376 | +- &error); |
1377 | +- g_assert_no_error (error); |
1378 | +- |
1379 | + ev_window_register_zoom_selector_popup_actions (ev_window); |
1380 | + |
1381 | + css_provider = gtk_css_provider_new (); |
1382 | +@@ -7415,12 +6815,6 @@ |
1383 | g_object_unref (css_provider); |
1384 | |
1385 | ev_window->priv->recent_manager = gtk_recent_manager_get_default (); |
1386 | @@ -3379,7 +3857,7 @@ |
1387 | |
1388 | ev_window->priv->toolbar = ev_toolbar_new (ev_window); |
1389 | gtk_widget_set_no_show_all (ev_window->priv->toolbar, TRUE); |
1390 | -@@ -7526,10 +6949,6 @@ |
1391 | +@@ -7526,10 +6920,6 @@ |
1392 | |
1393 | sidebar_widget = ev_sidebar_bookmarks_new (); |
1394 | ev_window->priv->sidebar_bookmarks = sidebar_widget; |
1395 | @@ -3390,7 +3868,7 @@ |
1396 | gtk_widget_show (sidebar_widget); |
1397 | ev_sidebar_add_page (EV_SIDEBAR (ev_window->priv->sidebar), |
1398 | sidebar_widget); |
1399 | -@@ -7565,7 +6984,7 @@ |
1400 | +@@ -7565,7 +6955,7 @@ |
1401 | g_object_set(ev_window->priv->view, "enable-gestures", |
1402 | _oif_ev_application_get_gestures_enabled (EV_APP), NULL); |
1403 | #endif |
1404 | @@ -3399,7 +3877,30 @@ |
1405 | GS_PAGE_CACHE_SIZE); |
1406 | ev_view_set_page_cache_size (EV_VIEW (ev_window->priv->view), |
1407 | page_cache_mb * 1024 * 1024); |
1408 | -@@ -7731,9 +7150,6 @@ |
1409 | +@@ -7707,13 +7097,17 @@ |
1410 | + G_CALLBACK (find_bar_visibility_changed_cb), |
1411 | + ev_window); |
1412 | + |
1413 | ++ builder = gtk_builder_new_from_resource ("/org/gnome/evince/shell/ui/popup-menus.ui"); |
1414 | ++ |
1415 | + /* Popups */ |
1416 | +- ev_window->priv->view_popup = gtk_ui_manager_get_widget (ev_window->priv->ui_manager, |
1417 | +- "/DocumentPopup"); |
1418 | +- ev_window->priv->link = NULL; |
1419 | ++ ev_window->priv->document_view_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "document-view-menu")); |
1420 | ++ ev_window->priv->external_link_section = G_MENU_MODEL (gtk_builder_get_object (builder, "external-link-menu")); |
1421 | ++ ev_window->priv->internal_link_section = G_MENU_MODEL (gtk_builder_get_object (builder, "internal-link-menu")); |
1422 | ++ ev_window->priv->image_section = G_MENU_MODEL (gtk_builder_get_object (builder, "image-menu")); |
1423 | ++ ev_window->priv->attachment_section = G_MENU_MODEL (gtk_builder_get_object (builder, "attachment-menu")); |
1424 | ++ ev_window->priv->annotation_section = G_MENU_MODEL (gtk_builder_get_object (builder, "annotation-menu")); |
1425 | + |
1426 | +- ev_window->priv->attachment_popup = gtk_ui_manager_get_widget (ev_window->priv->ui_manager, |
1427 | +- "/AttachmentPopup"); |
1428 | ++ ev_window->priv->link = NULL; |
1429 | + ev_window->priv->attach_list = NULL; |
1430 | + |
1431 | + /* Media player keys */ |
1432 | +@@ -7731,9 +7125,6 @@ |
1433 | g_settings_delay (ev_window->priv->default_settings); |
1434 | ev_window_setup_default (ev_window); |
1435 | |
1436 | @@ -3409,7 +3910,16 @@ |
1437 | gtk_window_set_default_size (GTK_WINDOW (ev_window), 600, 600); |
1438 | |
1439 | ev_window_sizing_mode_changed_cb (ev_window->priv->model, NULL, ev_window); |
1440 | -@@ -7762,7 +7178,6 @@ |
1441 | +@@ -7745,6 +7136,8 @@ |
1442 | + NULL, 0, |
1443 | + GDK_ACTION_COPY); |
1444 | + gtk_drag_dest_add_uri_targets (GTK_WIDGET (ev_window)); |
1445 | ++ |
1446 | ++ g_object_unref (builder); |
1447 | + } |
1448 | + |
1449 | + /** |
1450 | +@@ -7762,7 +7155,6 @@ |
1451 | ev_window = GTK_WIDGET (g_object_new (EV_TYPE_WINDOW, |
1452 | "type", GTK_WINDOW_TOPLEVEL, |
1453 | "application", g_application_get_default (), |
1454 | @@ -3417,7 +3927,7 @@ |
1455 | NULL)); |
1456 | |
1457 | return ev_window; |
1458 | -@@ -7801,3 +7216,11 @@ |
1459 | +@@ -7801,3 +7193,11 @@ |
1460 | |
1461 | return ev_window->priv->zoom_selector_popup_action_group; |
1462 | } |
1463 | @@ -3431,8 +3941,8 @@ |
1464 | +} |
1465 | Index: evince-3.10.3/shell/ev-window.h |
1466 | =================================================================== |
1467 | ---- evince-3.10.3.orig/shell/ev-window.h 2014-03-03 12:17:53.199442435 +0100 |
1468 | -+++ evince-3.10.3/shell/ev-window.h 2014-03-03 12:17:53.191442435 +0100 |
1469 | +--- evince-3.10.3.orig/shell/ev-window.h 2014-03-04 14:02:21.045143557 +0100 |
1470 | ++++ evince-3.10.3/shell/ev-window.h 2014-03-04 14:02:21.041143557 +0100 |
1471 | @@ -89,7 +89,7 @@ |
1472 | GtkUIManager *ev_window_get_ui_manager (EvWindow *ev_window); |
1473 | GtkActionGroup *ev_window_get_main_action_group (EvWindow *ev_window); |
1474 | @@ -3444,8 +3954,8 @@ |
1475 | |
1476 | Index: evince-3.10.3/shell/evince-appmenu.ui |
1477 | =================================================================== |
1478 | ---- evince-3.10.3.orig/shell/evince-appmenu.ui 2014-03-03 12:17:53.199442435 +0100 |
1479 | -+++ evince-3.10.3/shell/evince-appmenu.ui 2014-03-03 12:17:53.191442435 +0100 |
1480 | +--- evince-3.10.3.orig/shell/evince-appmenu.ui 2014-03-04 14:02:21.045143557 +0100 |
1481 | ++++ evince-3.10.3/shell/evince-appmenu.ui 2014-03-04 14:02:21.041143557 +0100 |
1482 | @@ -20,6 +20,16 @@ |
1483 | <menu id="appmenu"> |
1484 | <section> |
1485 | @@ -3465,10 +3975,10 @@ |
1486 | <attribute name="accel">F1</attribute> |
1487 | Index: evince-3.10.3/shell/evince-ui.xml |
1488 | =================================================================== |
1489 | ---- evince-3.10.3.orig/shell/evince-ui.xml 2014-03-03 12:17:53.199442435 +0100 |
1490 | -+++ evince-3.10.3/shell/evince-ui.xml 2014-03-03 12:17:53.191442435 +0100 |
1491 | -@@ -1,70 +1,10 @@ |
1492 | - <ui> |
1493 | +--- evince-3.10.3.orig/shell/evince-ui.xml 2014-03-04 14:02:21.045143557 +0100 |
1494 | ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 |
1495 | +@@ -1,118 +0,0 @@ |
1496 | +-<ui> |
1497 | - <popup name="ActionMenu" accelerators="true"> |
1498 | - <menuitem name="FileOpenMenu" action="FileOpen"/> |
1499 | - <menuitem name="FileOpenCopyMenu" action="FileOpenCopy"/> |
1500 | @@ -3521,12 +4031,12 @@ |
1501 | - <menuitem name="ViewReload" action="ViewReload"/> |
1502 | - </popup> |
1503 | - |
1504 | - <popup name="DocumentPopup" action="DocumentPopupAction"> |
1505 | - <menuitem name="OpenLink" action="OpenLink"/> |
1506 | - <menuitem name="CopyLinkAddress" action="CopyLinkAddress"/> |
1507 | - <menuitem name="GoLink" action="GoLink"/> |
1508 | - <menuitem name="OpenLinkNewWindow" action="OpenLinkNewWindow"/> |
1509 | - <separator/> |
1510 | +- <popup name="DocumentPopup" action="DocumentPopupAction"> |
1511 | +- <menuitem name="OpenLink" action="OpenLink"/> |
1512 | +- <menuitem name="CopyLinkAddress" action="CopyLinkAddress"/> |
1513 | +- <menuitem name="GoLink" action="GoLink"/> |
1514 | +- <menuitem name="OpenLinkNewWindow" action="OpenLinkNewWindow"/> |
1515 | +- <separator/> |
1516 | - <menuitem name="GoPreviousPage" action="GoPreviousPage"/> |
1517 | - <menuitem name="GoNextPage" action="GoNextPage"/> |
1518 | - <menuitem name="ViewReload" action="ViewReload"/> |
1519 | @@ -3535,21 +4045,29 @@ |
1520 | - <menuitem name="EditCopy" action="EditCopy"/> |
1521 | - <menuitem name="EditSelectAllPopup" action="EditSelectAll"/> |
1522 | - <separator/> |
1523 | - <menuitem name="SaveImageAs" action="SaveImageAs"/> |
1524 | - <menuitem name="CopyImage" action="CopyImage"/> |
1525 | - <separator/> |
1526 | -@@ -72,7 +12,6 @@ |
1527 | - <menuitem name="SaveAttachmentAs" action="SaveAttachmentAs"/> |
1528 | - <separator/> |
1529 | - <menuitem name="AnnotProperties" action="AnnotProperties"/> |
1530 | +- <menuitem name="SaveImageAs" action="SaveImageAs"/> |
1531 | +- <menuitem name="CopyImage" action="CopyImage"/> |
1532 | +- <separator/> |
1533 | +- <menuitem name="OpenAttachment" action="OpenAttachment"/> |
1534 | +- <menuitem name="SaveAttachmentAs" action="SaveAttachmentAs"/> |
1535 | +- <separator/> |
1536 | +- <menuitem name="AnnotProperties" action="AnnotProperties"/> |
1537 | - <menuitem name="FileOpenContainingFolder" action="FileOpenContainingFolder"/> |
1538 | - </popup> |
1539 | - |
1540 | - <popup name="AttachmentPopup" action="AttachmentPopupAction"> |
1541 | -@@ -88,31 +27,4 @@ |
1542 | - <separator/> |
1543 | - <placeholder name="ViewZoomItems"/> |
1544 | - </popup> |
1545 | +- </popup> |
1546 | +- |
1547 | +- <popup name="AttachmentPopup" action="AttachmentPopupAction"> |
1548 | +- <menuitem name="OpenAttachment" action="OpenAttachment"/> |
1549 | +- <separator/> |
1550 | +- <menuitem name="SaveAttachmentAs" action="SaveAttachmentAs"/> |
1551 | +- </popup> |
1552 | +- |
1553 | +- <popup name="ZoomSelectorPopup"> |
1554 | +- <menuitem name="ViewFitPage" action="ViewFitPage"/> |
1555 | +- <menuitem name="ViewFitWidth" action="ViewFitWidth"/> |
1556 | +- <menuitem name="ViewZoomAutomatic" action="ViewZoomAutomatic"/> |
1557 | +- <separator/> |
1558 | +- <placeholder name="ViewZoomItems"/> |
1559 | +- </popup> |
1560 | - |
1561 | - <accelerator name="PageDownAccel" action="PageDown"/> |
1562 | - <accelerator name="PageUpAccel" action="PageUp"/> |
1563 | @@ -3577,24 +4095,27 @@ |
1564 | - <accelerator name="FitWidthAccel" action ="FitWidth" /> |
1565 | - <accelerator name="F10Accel" action="F10" /> |
1566 | - <accelerator name="F7Accel" action="F7" /> |
1567 | - </ui> |
1568 | +-</ui> |
1569 | Index: evince-3.10.3/shell/evince.gresource.xml |
1570 | =================================================================== |
1571 | ---- evince-3.10.3.orig/shell/evince.gresource.xml 2014-03-03 12:17:53.199442435 +0100 |
1572 | -+++ evince-3.10.3/shell/evince.gresource.xml 2014-03-03 12:17:53.195442435 +0100 |
1573 | -@@ -19,6 +19,7 @@ |
1574 | +--- evince-3.10.3.orig/shell/evince.gresource.xml 2014-03-04 14:02:21.045143557 +0100 |
1575 | ++++ evince-3.10.3/shell/evince.gresource.xml 2014-03-04 14:02:21.041143557 +0100 |
1576 | +@@ -17,8 +17,9 @@ |
1577 | + --> |
1578 | + <gresources> |
1579 | <gresource prefix="/org/gnome/evince/shell"> |
1580 | - <file alias="ui/evince.xml" compressed="true" preprocess="xml-stripblanks">evince-ui.xml</file> |
1581 | +- <file alias="ui/evince.xml" compressed="true" preprocess="xml-stripblanks">evince-ui.xml</file> |
1582 | <file alias="ui/evince.css" compressed="true">evince.css</file> |
1583 | - <file alias="ui/appmenu.ui" compressed="true" preprocess="xml-stripblanks">evince-appmenu.ui</file> |
1584 | + <file alias="ui/menus.ui" compressed="true" preprocess="xml-stripblanks">menus.ui</file> |
1585 | + <file alias="ui/traditional-menus.ui" compressed="true" preprocess="xml-stripblanks">traditional-menus.ui</file> |
1586 | ++ <file alias="ui/popup-menus.ui" compressed="true" preprocess="xml-stripblanks">popup-menus.ui</file> |
1587 | </gresource> |
1588 | </gresources> |
1589 | Index: evince-3.10.3/shell/menus.ui |
1590 | =================================================================== |
1591 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
1592 | -+++ evince-3.10.3/shell/menus.ui 2014-03-03 12:18:09.000000000 +0100 |
1593 | ++++ evince-3.10.3/shell/menus.ui 2014-03-04 14:02:24.000000000 +0100 |
1594 | @@ -0,0 +1,188 @@ |
1595 | +<?xml version="1.0" encoding="UTF-8"?> |
1596 | +<!-- |
1597 | @@ -3787,7 +4308,7 @@ |
1598 | Index: evince-3.10.3/shell/traditional-menus.ui |
1599 | =================================================================== |
1600 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
1601 | -+++ evince-3.10.3/shell/traditional-menus.ui 2014-03-03 12:17:53.195442435 +0100 |
1602 | ++++ evince-3.10.3/shell/traditional-menus.ui 2014-03-04 14:02:21.041143557 +0100 |
1603 | @@ -0,0 +1,230 @@ |
1604 | +<?xml version="1.0" encoding="UTF-8"?> |
1605 | +<!-- |
1606 | @@ -4021,8 +4542,8 @@ |
1607 | +</interface> |
1608 | Index: evince-3.10.3/po/POTFILES.in |
1609 | =================================================================== |
1610 | ---- evince-3.10.3.orig/po/POTFILES.in 2014-03-03 12:17:53.199442435 +0100 |
1611 | -+++ evince-3.10.3/po/POTFILES.in 2014-03-03 12:17:53.195442435 +0100 |
1612 | +--- evince-3.10.3.orig/po/POTFILES.in 2014-03-04 14:02:21.045143557 +0100 |
1613 | ++++ evince-3.10.3/po/POTFILES.in 2014-03-04 14:02:21.041143557 +0100 |
1614 | @@ -56,3 +56,6 @@ |
1615 | shell/ev-window-title.c |
1616 | shell/main.c |
1617 | @@ -4030,3 +4551,122 @@ |
1618 | +[type: gettext/glade]shell/menus.ui |
1619 | +[type: gettext/glade]shell/traditional-menus.ui |
1620 | +shell/ev-toolbar.c |
1621 | +Index: evince-3.10.3/shell/popup-menus.ui |
1622 | +=================================================================== |
1623 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
1624 | ++++ evince-3.10.3/shell/popup-menus.ui 2014-03-04 14:02:45.629144561 +0100 |
1625 | +@@ -0,0 +1,114 @@ |
1626 | ++<?xml version="1.0" encoding="UTF-8"?> |
1627 | ++<!-- |
1628 | ++ Copyright © 2013 Canonical Ltd. |
1629 | ++ |
1630 | ++ This program is free software; you can redistribute it and/or modify |
1631 | ++ it under the terms of the GNU General Public License as published by |
1632 | ++ the Free Software Foundation; either version 3, or (at your option) |
1633 | ++ any later version. |
1634 | ++ |
1635 | ++ This program is distributed in the hope conf it will be useful, |
1636 | ++ but WITHOUT ANY WARRANTY; without even the implied warranty of |
1637 | ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1638 | ++ GNU General Public License for more details. |
1639 | ++ |
1640 | ++ You should have received a copy of the GNU General Public License |
1641 | ++ along with this program; if not, write to the Free Software |
1642 | ++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1643 | ++ |
1644 | ++ Author: Lars Uebernickel <lars.uebernickel@canonical.com> |
1645 | ++--> |
1646 | ++<interface> |
1647 | ++ <menu id="document-view-menu"> |
1648 | ++ <section> |
1649 | ++ <item> |
1650 | ++ <attribute name="label" translatable="yes">_Previous Page</attribute> |
1651 | ++ <attribute name="action">win.go-previous-page</attribute> |
1652 | ++ </item> |
1653 | ++ <item> |
1654 | ++ <attribute name="label" translatable="yes">_Next Page</attribute> |
1655 | ++ <attribute name="action">win.go-next-page</attribute> |
1656 | ++ </item> |
1657 | ++ <item> |
1658 | ++ <attribute name="label" translatable="yes">_Reload</attribute> |
1659 | ++ <attribute name="action">win.reload</attribute> |
1660 | ++ </item> |
1661 | ++ <item> |
1662 | ++ <attribute name="label" translatable="yes">Auto_scroll</attribute> |
1663 | ++ <attribute name="action">win.auto-scroll</attribute> |
1664 | ++ </item> |
1665 | ++ </section> |
1666 | ++ <section> |
1667 | ++ <item> |
1668 | ++ <attribute name="label" translatable="yes">_Copy</attribute> |
1669 | ++ <attribute name="action">win.copy</attribute> |
1670 | ++ </item> |
1671 | ++ <item> |
1672 | ++ <attribute name="label" translatable="yes">Select _All</attribute> |
1673 | ++ <attribute name="action">win.select-all</attribute> |
1674 | ++ </item> |
1675 | ++ </section> |
1676 | ++ <section> |
1677 | ++ <item> |
1678 | ++ <attribute name="label" translatable="yes">Open Containing _Folder</attribute> |
1679 | ++ <attribute name="action">win.open-containing-folder</attribute> |
1680 | ++ </item> |
1681 | ++ </section> |
1682 | ++ </menu> |
1683 | ++ <menu id="external-link-menu"> |
1684 | ++ <section> |
1685 | ++ <item> |
1686 | ++ <attribute name="label" translatable="yes">_Open Link</attribute> |
1687 | ++ <attribute name="action">win.open-link</attribute> |
1688 | ++ </item> |
1689 | ++ <item> |
1690 | ++ <attribute name="label" translatable="yes">_Copy Link Address</attribute> |
1691 | ++ <attribute name="action">win.copy-link-address</attribute> |
1692 | ++ </item> |
1693 | ++ </section> |
1694 | ++ </menu> |
1695 | ++ <menu id="internal-link-menu"> |
1696 | ++ <section> |
1697 | ++ <item> |
1698 | ++ <attribute name="label" translatable="yes">_Go To</attribute> |
1699 | ++ <attribute name="action">win.open-link</attribute> |
1700 | ++ </item> |
1701 | ++ <item> |
1702 | ++ <attribute name="label" translatable="yes">Open in New _Window</attribute> |
1703 | ++ <attribute name="action">win.open-link-in-new-window</attribute> |
1704 | ++ </item> |
1705 | ++ </section> |
1706 | ++ </menu> |
1707 | ++ <menu id="image-menu"> |
1708 | ++ <section> |
1709 | ++ <item> |
1710 | ++ <attribute name="label" translatable="yes">_Save Image As…</attribute> |
1711 | ++ <attribute name="action">win.save-image</attribute> |
1712 | ++ </item> |
1713 | ++ <item> |
1714 | ++ <attribute name="label" translatable="yes">Copy _Image</attribute> |
1715 | ++ <attribute name="action">win.copy-image</attribute> |
1716 | ++ </item> |
1717 | ++ </section> |
1718 | ++ </menu> |
1719 | ++ <menu id="attachment-menu"> |
1720 | ++ <section> |
1721 | ++ <item> |
1722 | ++ <attribute name="label" translatable="yes">_Open Attachment</attribute> |
1723 | ++ <attribute name="action">win.open-attachment</attribute> |
1724 | ++ </item> |
1725 | ++ <item> |
1726 | ++ <attribute name="label" translatable="yes">_Save Attachment As…</attribute> |
1727 | ++ <attribute name="action">win.save-attachment</attribute> |
1728 | ++ </item> |
1729 | ++ </section> |
1730 | ++ </menu> |
1731 | ++ <menu id="annotation-menu"> |
1732 | ++ <section> |
1733 | ++ <item> |
1734 | ++ <attribute name="label" translatable="yes">Annotation Properties…</attribute> |
1735 | ++ <attribute name="action">win.show-annotation-properties</attribute> |
1736 | ++ </item> |
1737 | ++ </section> |
1738 | ++ </menu> |
1739 | ++</interface> |
Thanks, that works fine, I noticed that some menu items are missing (compared to the old/upstream version)
- copy
- select all
- open parent folder
Did you mean to drop those? Having at least the "copy" one seems like useful