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
1=== modified file 'src/LibraryWindow.vala'
2--- src/LibraryWindow.vala 2013-06-27 07:04:46 +0000
3+++ src/LibraryWindow.vala 2013-07-26 18:14:25 +0000
4@@ -148,6 +148,12 @@
5 }*/
6 }
7
8+ private void change_view (Widgets.ViewSelector.Mode mode) {
9+ if (viewSelector.get_sensitive ()) {
10+ viewSelector.selected = mode;
11+ }
12+ }
13+
14 public override bool key_press_event (Gdk.EventKey event) {
15 var modifiers = Gtk.accelerator_get_default_mod_mask ();
16 bool modifiers_active = (event.state & modifiers) != 0;
17@@ -174,6 +180,18 @@
18 }
19 } else if ((event.state & Gdk.ModifierType.CONTROL_MASK) != 0) {
20 switch (event.keyval) {
21+ case Gdk.Key.@1:
22+ change_view (Widgets.ViewSelector.Mode.GRID);
23+ break;
24+ case Gdk.Key.@2:
25+ change_view (Widgets.ViewSelector.Mode.LIST);
26+ break;
27+ case Gdk.Key.@3:
28+ if (viewSelector.get_column_browser_toggle_visible ()) {
29+ change_view (Widgets.ViewSelector.Mode.COLUMN);
30+ }
31+
32+ break;
33 case Gdk.Key.f:
34 return false;
35 case Gdk.Key.q:
36
37=== modified file 'src/Widgets/ViewSelector.vala'
38--- src/Widgets/ViewSelector.vala 2013-05-22 20:42:53 +0000
39+++ src/Widgets/ViewSelector.vala 2013-07-26 18:14:25 +0000
40@@ -106,6 +106,10 @@
41 mode_button.set_active (sensitive ? (int)mode : 3);
42 }
43
44+ public new bool get_sensitive () {
45+ return mode_button.get_sensitive ();
46+ }
47+
48 // CRAPPY API
49 // XXX ugly workaround to avoid dealing with API breaks, since there's no time
50 // to come up with a fancy solution. Needs rewrite

Subscribers

People subscribed via source and target branches