Merge lp:~andrea.corbellini/diodon/disable-indicator into lp:~diodon-team/diodon/trunk

Proposed by Andrea Corbellini
Status: Merged
Merge reported by: Oliver Sauder
Merged at revision: not available
Proposed branch: lp:~andrea.corbellini/diodon/disable-indicator
Merge into: lp:~diodon-team/diodon/trunk
Diff against target: 84 lines (+38/-7)
3 files modified
src/configuration-model.vala (+16/-6)
src/controller.vala (+13/-0)
src/indicator-view.vala (+9/-1)
To merge this branch: bzr merge lp:~andrea.corbellini/diodon/disable-indicator
Reviewer Review Type Date Requested Status
Oliver Sauder Approve
Review via email: mp+58879@code.launchpad.net

Description of the change

This branch adds a new GConf key (/diodon/show-indicator) to let you disable the application indicator. The reason for this change is that for people like me, who use just the keyboard shortcut to access the clipboard, the application indicator is useless and often annoying too.

Note that I've not added this option to the preferences window. That's because if you set this option by mistake and if you don't know what the keyboard shortcut is, Diodon is unreachable. Instead, having just the GConf key allow only power users to use this option (i.e.: users that can easily roll-back mistakes).

To post a comment you must log in.
Revision history for this message
Oliver Sauder (sao) wrote :

I can see your point. As this is a power user option it is better not to add it to the preferences dialog.

Currently I'm working on a Diodon unity lens. As soon as this is up and running I'm thinking of a plugin system where the indicator and the lens (and other features...) can be enabled/disabled. This would make this option deprecated. However this option do for now.

Thanks for your work.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/configuration-model.vala'
2--- src/configuration-model.vala 2011-01-19 20:38:18 +0000
3+++ src/configuration-model.vala 2011-04-23 19:38:22 +0000
4@@ -91,12 +91,22 @@
5 /**
6 * key for clipboard history accelerator
7 */
8- public string history_accelerator_key { get { return "/keybindings/history"; } }
9-
10- /**
11- * clipboard history accelerator
12- */
13- public string history_accelerator { get; set; default = "<Ctrl><Alt>V"; }
14+ public string history_accelerator_key { get { return "/keybindings/history"; } }
15+
16+ /**
17+ * clipboard history accelerator
18+ */
19+ public string history_accelerator { get; set; default = "<Ctrl><Alt>V"; }
20+
21+ /**
22+ * key for show indicator flag
23+ */
24+ public string show_indicator_key { get { return "/show-indicator"; } }
25+
26+ /**
27+ * flag whether the indicator should be shown
28+ */
29+ public bool show_indicator { get; set; default = true; }
30 }
31 }
32
33
34=== modified file 'src/controller.vala'
35--- src/controller.vala 2011-03-30 14:15:44 +0000
36+++ src/controller.vala 2011-04-23 19:38:22 +0000
37@@ -244,6 +244,19 @@
38 // history_accelerator
39 configuration_manager.add_string_notify(configuration_model.history_accelerator_key,
40 change_history_accelerator, configuration_model.history_accelerator);
41+
42+ // show app indicator
43+ configuration_manager.add_bool_notify(configuration_model.show_indicator_key,
44+ () => {
45+ indicator_view.set_visible(true);
46+ configuration_model.show_indicator = true;
47+ },
48+ () => {
49+ indicator_view.set_visible(false);
50+ configuration_model.show_indicator = false;
51+ },
52+ configuration_model.show_indicator // default value
53+ );
54 }
55
56 /**
57
58=== modified file 'src/indicator-view.vala'
59--- src/indicator-view.vala 2011-04-23 14:09:37 +0000
60+++ src/indicator-view.vala 2011-04-23 19:38:22 +0000
61@@ -67,7 +67,7 @@
62 // Setup indicator
63 indicator = new AppIndicator.Indicator("diodon", "gtk-paste",
64 AppIndicator.IndicatorCategory.APPLICATION_STATUS);
65- indicator.set_status(AppIndicator.IndicatorStatus.ACTIVE);
66+ set_visible(true);
67
68 // Setup application menu
69 menu = new Gtk.Menu();
70@@ -104,6 +104,14 @@
71 menu.destroy();
72 }
73
74+ public void set_visible(bool visible)
75+ {
76+ if (visible)
77+ indicator.set_status(AppIndicator.IndicatorStatus.ACTIVE);
78+ else
79+ indicator.set_status(AppIndicator.IndicatorStatus.PASSIVE);
80+ }
81+
82 /**
83 * Select item by highlighting it.
84 *

Subscribers

People subscribed via source and target branches