Merge lp:~bratsche/oif/disable-gestures into lp:~oif-team/oif/evince-gestures-trunk

Proposed by Cody Russell
Status: Merged
Merged at revision: 4206
Proposed branch: lp:~bratsche/oif/disable-gestures
Merge into: lp:~oif-team/oif/evince-gestures-trunk
Diff against target: 137 lines (+47/-26)
4 files modified
shell/ev-application.c (+14/-0)
shell/ev-application.h (+2/-0)
shell/ev-window.c (+28/-25)
shell/main.c (+3/-1)
To merge this branch: bzr merge lp:~bratsche/oif/disable-gestures
Reviewer Review Type Date Requested Status
Mohamed IKBEL Boulabiar (community) Approve
Review via email: mp+41180@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Mohamed IKBEL Boulabiar (boulabiar) wrote :

Tested and works fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shell/ev-application.c'
2--- shell/ev-application.c 2010-07-26 13:34:18 +0000
3+++ shell/ev-application.c 2010-11-18 14:51:58 +0000
4@@ -72,6 +72,8 @@
5
6 gchar *filechooser_open_uri;
7 gchar *filechooser_save_uri;
8+
9+ gboolean gestures_enabled;
10 };
11
12 struct _EvApplicationClass {
13@@ -126,6 +128,18 @@
14 return instance;
15 }
16
17+gboolean
18+ev_application_get_gestures_enabled (EvApplication *application)
19+{
20+ return application->gestures_enabled;
21+}
22+
23+void
24+ev_application_set_gestures_enabled (EvApplication *application, gboolean enabled)
25+{
26+ application->gestures_enabled = enabled;
27+}
28+
29 /* Session */
30 gboolean
31 ev_application_load_session (EvApplication *application)
32
33=== modified file 'shell/ev-application.h'
34--- shell/ev-application.h 2010-07-12 18:13:15 +0000
35+++ shell/ev-application.h 2010-11-18 14:51:58 +0000
36@@ -81,6 +81,8 @@
37 const gchar *ev_application_get_dot_dir (EvApplication *application,
38 gboolean create);
39 const gchar *ev_application_get_data_dir (EvApplication *application);
40+gboolean ev_application_get_gestures_enabled (EvApplication *application);
41+void ev_application_set_gestures_enabled (EvApplication *application, gboolean enabled);
42
43 G_END_DECLS
44
45
46=== modified file 'shell/ev-window.c'
47--- shell/ev-window.c 2010-10-12 18:00:39 +0000
48+++ shell/ev-window.c 2010-11-18 14:51:58 +0000
49@@ -5537,31 +5537,34 @@
50 IdoGestureManager *manager;
51
52 window = GTK_WINDOW (widget);
53- manager = ido_gesture_manager_get ();
54-
55- ido_gesture_manager_register_window (manager,
56- window,
57- IDO_GESTURE_PINCH,
58- 2,
59- ev_pinch_gesture_start,
60- ev_pinch_gesture_update,
61- ev_pinch_gesture_end);
62-
63- ido_gesture_manager_register_window (manager,
64- window,
65- IDO_GESTURE_DRAG,
66- 2,
67- ev_drag_gesture_start,
68- ev_drag_gesture_update,
69- ev_drag_gesture_end);
70-
71- ido_gesture_manager_register_window (manager,
72- window,
73- IDO_GESTURE_ROTATE,
74- 2,
75- ev_rotate_gesture_start,
76- ev_rotate_gesture_update,
77- ev_rotate_gesture_end);
78+
79+ if (ev_application_get_gestures_enabled (EV_APP)) {
80+ manager = ido_gesture_manager_get ();
81+
82+ ido_gesture_manager_register_window (manager,
83+ window,
84+ IDO_GESTURE_PINCH,
85+ 2,
86+ ev_pinch_gesture_start,
87+ ev_pinch_gesture_update,
88+ ev_pinch_gesture_end);
89+
90+ ido_gesture_manager_register_window (manager,
91+ window,
92+ IDO_GESTURE_DRAG,
93+ 2,
94+ ev_drag_gesture_start,
95+ ev_drag_gesture_update,
96+ ev_drag_gesture_end);
97+
98+ ido_gesture_manager_register_window (manager,
99+ window,
100+ IDO_GESTURE_ROTATE,
101+ 2,
102+ ev_rotate_gesture_start,
103+ ev_rotate_gesture_update,
104+ ev_rotate_gesture_end);
105+ }
106 }
107
108 static void
109
110=== modified file 'shell/main.c'
111--- shell/main.c 2010-07-26 13:34:18 +0000
112+++ shell/main.c 2010-11-18 14:51:58 +0000
113@@ -58,7 +58,7 @@
114 static gboolean unlink_temp_file = FALSE;
115 static gchar *print_settings;
116 static const char **file_arguments = NULL;
117-
118+static gboolean disable_gestures = FALSE;
119
120 static gboolean
121 option_version_cb (const gchar *option_name,
122@@ -82,6 +82,7 @@
123 { "find", 'l', 0, G_OPTION_ARG_STRING, &ev_find_string, N_("The word or phrase to find in the document"), N_("STRING")},
124 { "unlink-tempfile", 'u', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &unlink_temp_file, NULL, NULL },
125 { "print-settings", 't', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME, &print_settings, NULL, NULL },
126+ { "disable-gestures", 'g', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &disable_gestures, NULL, NULL },
127 { "version", 0, G_OPTION_FLAG_NO_ARG | G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, option_version_cb, NULL, NULL },
128 { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &file_arguments, NULL, N_("[FILEā€¦]") },
129 { NULL }
130@@ -312,6 +313,7 @@
131 #endif /* WITH_SMCLIENT && GDK_WINDOWING_X11 */
132
133 ev_application_load_session (EV_APP);
134+ ev_application_set_gestures_enabled (EV_APP, !disable_gestures);
135 load_files (file_arguments);
136
137 /* Change directory so we don't prevent unmounting in case the initial cwd

Subscribers

People subscribed via source and target branches