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
=== modified file 'src/configuration-model.vala'
--- src/configuration-model.vala 2011-01-19 20:38:18 +0000
+++ src/configuration-model.vala 2011-04-23 19:38:22 +0000
@@ -91,12 +91,22 @@
91 /**91 /**
92 * key for clipboard history accelerator92 * key for clipboard history accelerator
93 */93 */
94 public string history_accelerator_key { get { return "/keybindings/history"; } }94 public string history_accelerator_key { get { return "/keybindings/history"; } }
95 95
96 /**96 /**
97 * clipboard history accelerator97 * clipboard history accelerator
98 */98 */
99 public string history_accelerator { get; set; default = "<Ctrl><Alt>V"; }99 public string history_accelerator { get; set; default = "<Ctrl><Alt>V"; }
100
101 /**
102 * key for show indicator flag
103 */
104 public string show_indicator_key { get { return "/show-indicator"; } }
105
106 /**
107 * flag whether the indicator should be shown
108 */
109 public bool show_indicator { get; set; default = true; }
100 }110 }
101}111}
102112
103113
=== modified file 'src/controller.vala'
--- src/controller.vala 2011-03-30 14:15:44 +0000
+++ src/controller.vala 2011-04-23 19:38:22 +0000
@@ -244,6 +244,19 @@
244 // history_accelerator244 // history_accelerator
245 configuration_manager.add_string_notify(configuration_model.history_accelerator_key,245 configuration_manager.add_string_notify(configuration_model.history_accelerator_key,
246 change_history_accelerator, configuration_model.history_accelerator);246 change_history_accelerator, configuration_model.history_accelerator);
247
248 // show app indicator
249 configuration_manager.add_bool_notify(configuration_model.show_indicator_key,
250 () => {
251 indicator_view.set_visible(true);
252 configuration_model.show_indicator = true;
253 },
254 () => {
255 indicator_view.set_visible(false);
256 configuration_model.show_indicator = false;
257 },
258 configuration_model.show_indicator // default value
259 );
247 }260 }
248 261
249 /**262 /**
250263
=== modified file 'src/indicator-view.vala'
--- src/indicator-view.vala 2011-04-23 14:09:37 +0000
+++ src/indicator-view.vala 2011-04-23 19:38:22 +0000
@@ -67,7 +67,7 @@
67 // Setup indicator67 // Setup indicator
68 indicator = new AppIndicator.Indicator("diodon", "gtk-paste",68 indicator = new AppIndicator.Indicator("diodon", "gtk-paste",
69 AppIndicator.IndicatorCategory.APPLICATION_STATUS);69 AppIndicator.IndicatorCategory.APPLICATION_STATUS);
70 indicator.set_status(AppIndicator.IndicatorStatus.ACTIVE);70 set_visible(true);
71 71
72 // Setup application menu72 // Setup application menu
73 menu = new Gtk.Menu();73 menu = new Gtk.Menu();
@@ -104,6 +104,14 @@
104 menu.destroy();104 menu.destroy();
105 }105 }
106 106
107 public void set_visible(bool visible)
108 {
109 if (visible)
110 indicator.set_status(AppIndicator.IndicatorStatus.ACTIVE);
111 else
112 indicator.set_status(AppIndicator.IndicatorStatus.PASSIVE);
113 }
114
107 /**115 /**
108 * Select item by highlighting it.116 * Select item by highlighting it.
109 * 117 *

Subscribers

People subscribed via source and target branches