diff --git a/deluge/ui/gtkui/glade/preferences_dialog.glade b/deluge/ui/gtkui/glade/preferences_dialog.glade
index d4cdc61..2e3016f 100644
a
|
b
|
Disabled</property>
|
2069 | 2069 | </packing> |
2070 | 2070 | </child> |
2071 | 2071 | <child> |
| 2072 | <widget class="GtkAlignment" id="alignment32"> |
| 2073 | <property name="visible">True</property> |
| 2074 | <property name="left_padding">10</property> |
| 2075 | <child> |
| 2076 | <widget class="GtkCheckButton" id="chk_disable_appindicator"> |
| 2077 | <property name="label" translatable="yes">Disable Application Indicator</property> |
| 2078 | <property name="visible">True</property> |
| 2079 | <property name="sensitive">False</property> |
| 2080 | <property name="can_focus">False</property> |
| 2081 | <property name="receives_default">False</property> |
| 2082 | <property name="use_underline">True</property> |
| 2083 | <property name="draw_indicator">True</property> |
| 2084 | </widget> |
| 2085 | </child> |
| 2086 | </widget> |
| 2087 | <packing> |
| 2088 | <property name="position">3</property> |
| 2089 | </packing> |
| 2090 | </child> |
| 2091 | <child> |
2072 | 2092 | <widget class="GtkAlignment" id="alignment17"> |
2073 | 2093 | <property name="visible">True</property> |
2074 | 2094 | <property name="bottom_padding">3</property> |
… |
… |
Disabled</property>
|
2088 | 2108 | </widget> |
2089 | 2109 | <packing> |
2090 | 2110 | <property name="expand">False</property> |
2091 | | <property name="position">3</property> |
| 2111 | <property name="position">4</property> |
2092 | 2112 | </packing> |
2093 | 2113 | </child> |
2094 | 2114 | <child> |
… |
… |
Disabled</property>
|
2131 | 2151 | </child> |
2132 | 2152 | </widget> |
2133 | 2153 | <packing> |
2134 | | <property name="position">4</property> |
| 2154 | <property name="position">5</property> |
2135 | 2155 | </packing> |
2136 | 2156 | </child> |
2137 | 2157 | </widget> |
diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py
index 1609a28..2c5f762 100644
a
|
b
|
def start():
|
116 | 116 | "enable_system_tray": True, |
117 | 117 | "close_to_tray": True, |
118 | 118 | "start_in_tray": False, |
| 119 | "disable_appindicator": False, |
119 | 120 | "lock_tray": False, |
120 | 121 | "tray_password": "", |
121 | 122 | "check_new_releases": True, |
diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py
index edc253e..05bee31 100644
a
|
b
|
def _show(self):
|
471 | 471 | self.gtkui_config["close_to_tray"]) |
472 | 472 | self.glade.get_widget("chk_start_in_tray").set_active( |
473 | 473 | self.gtkui_config["start_in_tray"]) |
| 474 | self.glade.get_widget("chk_disable_appindicator").set_active( |
| 475 | self.gtkui_config["disable_appindicator"]) |
474 | 476 | self.glade.get_widget("chk_lock_tray").set_active( |
475 | 477 | self.gtkui_config["lock_tray"]) |
476 | 478 | self.glade.get_widget("chk_classic_mode").set_active( |
… |
… |
def set_config(self, hide=False):
|
637 | 639 | self.glade.get_widget("chk_min_on_close").get_active() |
638 | 640 | new_gtkui_config["start_in_tray"] = \ |
639 | 641 | self.glade.get_widget("chk_start_in_tray").get_active() |
| 642 | new_gtkui_config["disable_appindicator"] = \ |
| 643 | self.glade.get_widget("chk_disable_appindicator").get_active() |
640 | 644 | new_gtkui_config["lock_tray"] = \ |
641 | 645 | self.glade.get_widget("chk_lock_tray").get_active() |
642 | 646 | passhex = sha_hash(\ |
… |
… |
def on_toggle(self, widget):
|
782 | 786 | "spin_outgoing_port_max": False}, |
783 | 787 | "chk_use_tray": {"chk_min_on_close": True, |
784 | 788 | "chk_start_in_tray": True, |
| 789 | "chk_disable_appindicator": True, |
785 | 790 | "chk_lock_tray": True}, |
786 | 791 | "chk_lock_tray": {"txt_tray_password": True, |
787 | 792 | "password_label": True}, |
diff --git a/deluge/ui/gtkui/systemtray.py b/deluge/ui/gtkui/systemtray.py
index c4bce49..41cdebd 100644
a
|
b
|
def __init__(self):
|
55 | 55 | component.Component.__init__(self, "SystemTray", interval=4) |
56 | 56 | self.window = component.get("MainWindow") |
57 | 57 | self.config = ConfigManager("gtkui.conf") |
| 58 | |
58 | 59 | # List of widgets that need to be hidden when not connected to a host |
59 | 60 | self.hide_widget_list = [ |
60 | 61 | "menuitem_add_torrent", |
… |
… |
def __init__(self):
|
70 | 71 | ] |
71 | 72 | self.config.register_set_function("enable_system_tray", |
72 | 73 | self.on_enable_system_tray_set) |
| 74 | # bit of a hack to prevent function from doing something on startup |
| 75 | self.__disabled_set_once = False |
| 76 | self.config.register_set_function("disable_appindicator", |
| 77 | self.on_disable_appindicator_set) |
73 | 78 | |
74 | 79 | self.max_download_speed = -1.0 |
75 | 80 | self.download_rate = 0.0 |
… |
… |
def enable(self):
|
103 | 108 | |
104 | 109 | self.tray_menu = self.tray_glade.get_widget("tray_menu") |
105 | 110 | |
106 | | if appindicator: |
| 111 | if appindicator and not self.config["disable_appindicator"]: |
107 | 112 | log.debug("Enabling the Application Indicator..") |
108 | 113 | self.indicator = appindicator.Indicator ( |
109 | 114 | "deluge", "deluge", appindicator.CATEGORY_APPLICATION_STATUS) |
… |
… |
def __start(self):
|
162 | 167 | |
163 | 168 | # These do not work with appindicator currently and can crash Deluge. |
164 | 169 | # Related to Launchpad bug #608219 |
165 | | if appindicator: |
| 170 | if appindicator and not self.config["disable_appindicator"]: |
166 | 171 | self.hide_widget_list.remove("menuitem_download_limit") |
167 | 172 | self.hide_widget_list.remove("menuitem_upload_limit") |
168 | 173 | self.hide_widget_list.remove("separatormenuitem3") |
… |
… |
def stop(self):
|
200 | 205 | |
201 | 206 | def shutdown(self): |
202 | 207 | if self.config["enable_system_tray"]: |
203 | | if appindicator: |
| 208 | if appindicator and not self.config["disable_appindicator"]: |
204 | 209 | self.indicator.set_status(appindicator.STATUS_PASSIVE) |
205 | 210 | else: |
206 | 211 | self.tray.set_visible(False) |
… |
… |
def update(self):
|
236 | 241 | return |
237 | 242 | |
238 | 243 | # Tool tip text not available for appindicator |
239 | | if appindicator: |
| 244 | if appindicator and not self.config["disable_appindicator"]: |
240 | 245 | return |
241 | 246 | |
242 | 247 | # Set the tool tip text |
… |
… |
def build_tray_bwsetsubmenu(self):
|
285 | 290 | submenu_bwupset.show_all() |
286 | 291 | |
287 | 292 | # Re-set the menu to partly work around Launchpad bug #608219 |
288 | | if appindicator: |
| 293 | if appindicator and not self.config["disable_appindicator"]: |
289 | 294 | self.indicator.set_menu(self.tray_menu) |
290 | 295 | |
291 | | def disable(self): |
| 296 | def disable(self,invert_app_ind_conf=False): |
292 | 297 | """Disables the system tray icon or appindicator.""" |
293 | 298 | try: |
294 | | if appindicator: |
| 299 | if invert_app_ind_conf: |
| 300 | app_ind_conf = not self.config["disable_appindicator"] |
| 301 | else: |
| 302 | app_ind_conf = self.config["disable_appindicator"] |
| 303 | if appindicator and not app_ind_conf: |
295 | 304 | if hasattr(self, "_sig_win_hide"): |
296 | 305 | self.window.window.disconnect(self._sig_win_hide) |
297 | 306 | self.window.window.disconnect(self._sig_win_show) |
… |
… |
def on_enable_system_tray_set(self, key, value):
|
323 | 332 | else: |
324 | 333 | self.disable() |
325 | 334 | |
| 335 | def on_disable_appindicator_set(self, key, value): |
| 336 | """Called whenever the 'disable_appindicator' config key is modified""" |
| 337 | if self.__disabled_set_once: |
| 338 | self.disable(True) |
| 339 | self.enable() |
| 340 | self.__disabled_set_once = True |
| 341 | |
326 | 342 | def on_tray_clicked(self, icon): |
327 | 343 | """Called when the tray icon is left clicked.""" |
328 | 344 | self.blink(False) |