Merge lp:~marcus-lundgren/noise/fix-1182740 into lp:~elementary-apps/noise/trunk

Proposed by Marcus Lundgren
Status: Merged
Approved by: David Gomes
Approved revision: 1502
Merged at revision: 1513
Proposed branch: lp:~marcus-lundgren/noise/fix-1182740
Merge into: lp:~elementary-apps/noise/trunk
Diff against target: 50 lines (+22/-0)
2 files modified
src/LibraryWindow.vala (+18/-0)
src/Widgets/ViewSelector.vala (+4/-0)
To merge this branch: bzr merge lp:~marcus-lundgren/noise/fix-1182740
Reviewer Review Type Date Requested Status
Julián Unrrein (community) Approve
David Gomes (community) Approve
Review via email: mp+176217@code.launchpad.net

Commit message

Ctrl + n now changes the view mode, fixing bug bug #1182740.

Description of the change

Ctrl + n now changes the view mode.

To post a comment you must log in.
Revision history for this message
David Gomes (davidgomes) wrote :

Newline after diff's line 30. All is good otherwise, I'll test it later.

review: Needs Fixing
1502. By Marcus Lundgren

Added a missing newline.

Revision history for this message
David Gomes (davidgomes) wrote :

Approving, not merging yet because I need this to be test-compiled on 12.04 and tested by someone that will verify that this branch works as expected.

review: Approve
Revision history for this message
Julián Unrrein (junrrein) wrote :

I tested this on elementary Luna, but I couldn't get it to work. I tested this both running without installing, and then installing and trying again.

Console output doesn't seem to tell anything relevant.

Revision history for this message
Julián Unrrein (junrrein) wrote :

I misunderstood how the function was supposed to work because I didn't even look at the bug report. I'm sorry.

I kept pressing "<Ctrl>+n", where n is the actual letter. Of course it didn't work.

Now I can verify that this works as expected.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/LibraryWindow.vala'
--- src/LibraryWindow.vala 2013-06-27 07:04:46 +0000
+++ src/LibraryWindow.vala 2013-07-26 18:14:25 +0000
@@ -148,6 +148,12 @@
148 }*/148 }*/
149 }149 }
150150
151 private void change_view (Widgets.ViewSelector.Mode mode) {
152 if (viewSelector.get_sensitive ()) {
153 viewSelector.selected = mode;
154 }
155 }
156
151 public override bool key_press_event (Gdk.EventKey event) {157 public override bool key_press_event (Gdk.EventKey event) {
152 var modifiers = Gtk.accelerator_get_default_mod_mask ();158 var modifiers = Gtk.accelerator_get_default_mod_mask ();
153 bool modifiers_active = (event.state & modifiers) != 0;159 bool modifiers_active = (event.state & modifiers) != 0;
@@ -174,6 +180,18 @@
174 }180 }
175 } else if ((event.state & Gdk.ModifierType.CONTROL_MASK) != 0) {181 } else if ((event.state & Gdk.ModifierType.CONTROL_MASK) != 0) {
176 switch (event.keyval) {182 switch (event.keyval) {
183 case Gdk.Key.@1:
184 change_view (Widgets.ViewSelector.Mode.GRID);
185 break;
186 case Gdk.Key.@2:
187 change_view (Widgets.ViewSelector.Mode.LIST);
188 break;
189 case Gdk.Key.@3:
190 if (viewSelector.get_column_browser_toggle_visible ()) {
191 change_view (Widgets.ViewSelector.Mode.COLUMN);
192 }
193
194 break;
177 case Gdk.Key.f:195 case Gdk.Key.f:
178 return false;196 return false;
179 case Gdk.Key.q:197 case Gdk.Key.q:
180198
=== modified file 'src/Widgets/ViewSelector.vala'
--- src/Widgets/ViewSelector.vala 2013-05-22 20:42:53 +0000
+++ src/Widgets/ViewSelector.vala 2013-07-26 18:14:25 +0000
@@ -106,6 +106,10 @@
106 mode_button.set_active (sensitive ? (int)mode : 3);106 mode_button.set_active (sensitive ? (int)mode : 3);
107 }107 }
108108
109 public new bool get_sensitive () {
110 return mode_button.get_sensitive ();
111 }
112
109 // CRAPPY API113 // CRAPPY API
110 // XXX ugly workaround to avoid dealing with API breaks, since there's no time114 // XXX ugly workaround to avoid dealing with API breaks, since there's no time
111 // to come up with a fancy solution. Needs rewrite115 // to come up with a fancy solution. Needs rewrite

Subscribers

People subscribed via source and target branches