2008-06-30 klockan 11:05 skrev Daniel M German: > Well, I took the job. I am not sure this is in line with the way Evince > would like to implement it, but it works: I'm not sure what the way forward is (I'm not a maintainer), but thanks for the patch anyway. > [snip] > The only bug I could not fix is that by default the menu shows "drag > mode" as ON, even though its value is false. You need to toggle it twice > to make it work. The patch contains some simple printfs to help debug > it/trace it. > > Comments? I've added a few comments on your patch below. Note that I've not tested your code at all. > Index: shell/ev-view-private.h > =================================================================== > --- shell/ev-view-private.h (revision 3061) > +++ shell/ev-view-private.h (working copy) > @@ -148,6 +148,7 @@ > int pressed_button; > > /* Information for middle clicking and dragging around. */ > + gboolean drag_mode; If Evince decides to go modal, a EV_DRAG_MODE_* enumeration would fit better. Perhaps an "image selection" mode or other stuff will be thought of later, so not having it as a boolean value might be better. > Index: shell/ev-window.c > =================================================================== > --- shell/ev-window.c (revision 3061) > +++ shell/ev-window.c (working copy) > @@ -370,6 +370,7 @@ > ev_window_set_action_sensitive (ev_window, "EditRotateRight", has_pages); > > /* View menu */ > + ev_window_set_action_sensitive (ev_window, "ViewDragMode", has_pages); This might be the line causing "need to click twice" bug you mentioned before. > @@ -997,6 +998,7 @@ > GValue fullscreen = { 0, }; > GValue rotation = { 0, }; > GValue maximized = { 0, }; > + GValue dragMode = { 0, }; Coding style: use drag_mode, not dragMode. > @@ -1027,6 +1029,12 @@ > g_value_unset (&zoom); > } > > + /* Drag mode */ > + if (ev_metadata_manager_get (uri, "drag_mode", &dragMode, FALSE)) { > + ev_view_set_drag_mode (view, g_value_get_boolean (&dragMode)); > + g_value_unset (&dragMode); > + } > + Same here, of course. > @@ -4475,6 +4529,9 @@ > { "ViewContinuous", EV_STOCK_VIEW_CONTINUOUS, N_("_Continuous"), NULL, > N_("Show the entire document"), > G_CALLBACK (ev_window_cmd_continuous), TRUE }, > + { "ViewDragMode", NULL, N_("Dra_g Mode"), NULL, > + N_("Toggle drag mode") , > + G_CALLBACK (ev_window_cmd_drag_mode), TRUE }, > { "ViewDual", EV_STOCK_VIEW_DUAL, N_("_Dual"), NULL, > N_("Show two pages at once"), > G_CALLBACK (ev_window_cmd_dual), FALSE }, Are you sure this is correct? That's it for now. mvrgr, Wouter -- :wq mail uws xs4all nl web http://uwstopia.nl she called out a warning :: don't ever let life pass you by -- incubus
Attachment:
signature.asc
Description: Digital signature