Skip to content

Commit

Permalink
remove main menu option. getting-things-gnome#114
Browse files Browse the repository at this point in the history
  • Loading branch information
flavin committed Sep 23, 2020
1 parent 8b18b2f commit 11962ca
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions GTG/plugins/unmaintained/hamster/hamster.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,8 @@ def activate(self, plugin_api):
self.hamster = dbus.SessionBus().get_object('org.gnome.Hamster',
'/org/gnome/Hamster')

# add menu item
# add button
if plugin_api.is_browser():
self.menu_item = Gtk.MenuItem(self.START_ACTIVITY_LABEL)
self.menu_item.show_all()
self.menu_item.connect('activate', self.browser_cb, plugin_api)
self.menu_item.set_sensitive(False)
plugin_api.add_menu_item(self.menu_item)
# and button
self.button.set_label(self.START_ACTIVITY_BUTTON_LABEL)
self.button.set_tooltip_text(self.TOOLTIP_TEXT_START_ACTIVITY)
self.button.set_sensitive(False)
Expand Down Expand Up @@ -341,7 +335,6 @@ def add(row, col_1, col_2, top_offset, active=False):

def deactivate(self, plugin_api):
if plugin_api.is_browser():
plugin_api.remove_menu_item(self.menu_item)
plugin_api.remove_toolbar_item(self.button)
else:
plugin_api.remove_toolbar_item(self.taskbutton)
Expand Down Expand Up @@ -372,14 +365,12 @@ def decide_start_or_stop_activity(self, task, widget):
def selection_changed(self, selection):
if selection.count_selected_rows() == 1:
self.button.set_sensitive(True)
self.menu_item.set_sensitive(True)
task_id = self.plugin_api.get_browser().get_selected_task()
task = self.plugin_api.get_requester().get_task(task_id)
self.decide_button_mode(self.button, task)
else:
self.change_button_to_start_activity(self.button)
self.button.set_sensitive(False)
self.menu_item.set_sensitive(False)

def decide_button_mode(self, button, task):
if self.is_task_active(task.get_id()):
Expand All @@ -388,12 +379,10 @@ def decide_button_mode(self, button, task):
self.change_button_to_start_activity(button)

def change_button_to_start_activity(self, button):
self.menu_item.set_label(self.START_ACTIVITY_LABEL)
button.set_label(self.START_ACTIVITY_BUTTON_LABEL)
button.set_tooltip_text(self.TOOLTIP_TEXT_START_ACTIVITY)

def change_button_to_stop_activity(self, button):
self.menu_item.set_label(self.STOP_ACTIVITY_LABEL)
button.set_label(self.STOP_ACTIVITY_BUTTON_LABEL)
button.set_tooltip_text(self.TOOLTIP_TEXT_STOP_ACTIVITY)

Expand Down

0 comments on commit 11962ca

Please sign in to comment.