summaryrefslogtreecommitdiff
path: root/portato/gui
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/gui/templates/MainWindow.ui1
-rw-r--r--portato/gui/windows/main.py60
2 files changed, 9 insertions, 52 deletions
diff --git a/portato/gui/templates/MainWindow.ui b/portato/gui/templates/MainWindow.ui
index 39d7d4e..3a30907 100644
--- a/portato/gui/templates/MainWindow.ui
+++ b/portato/gui/templates/MainWindow.ui
@@ -103,6 +103,7 @@
<object class="GtkToggleAction" id="pauseAction">
<property name="name">pauseActionMenu</property>
<property name="label" translatable="yes">Emerge _Paused</property>
+ <signal handler="cb_pause_emerge" name="activate"/>
</object>
<accelerator key="Z" modifiers="GDK_CONTROL_MASK"/>
</child>
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index b043532..33a5ee4 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -558,13 +558,6 @@ class MainWindow (Window):
# pause menu items
self.emergePaused = False
- self.pauseItems = {}
- # self.pauseItems["tray"] = self.trayPopup.tree.get_widget("pauseItemTray")
- # self.pauseItems["popup"] = self.consolePopup.tree.get_widget("pauseItemPopup")
- # self.pauseItems["menu"] = self.tree.get_widget("pauseItemMenu")
-
- for k,v in self.pauseItems.iteritems():
- self.pauseItems[k] = (v, v.connect_after("activate", self.cb_pause_emerge(k)))
# systray
if self.cfg.get_boolean("showSystray", "GUI"):
@@ -1771,50 +1764,13 @@ class MainWindow (Window):
self.queue.append(package, update = True, oneshot = set, forceUpdate = True)
- def cb_pause_emerge (self, curr):
- """
- This method returns a callback for a "pause emerge" toggle button.
- It is needed as there are different toggle buttons of this type and if one is clicked,
- the others should be marked too.
-
- @param curr: The button to return the callback for.
- @type curr: gtk.ToggleButton
- """
- def pause (cb):
- """
- The actual callback.
-
- Mark all other buttons too.
-
- @param cb: The button which got toggled.
- @type cb: gtk.ToggleButton
- """
-
- # pause or continue
- self.emergePaused = cb.get_active()
- if not self.emergePaused:
- self.queue.continue_emerge()
- #self.tray.set_from_file(APP_ICON)
- else:
- self.queue.stop_emerge()
- #self.tray.set_from_file(os.path.join(ICON_DIR, "pausing.png"))
-
- # block the handlers of the other buttons
- # so that calling "set_active" does not call this callback recursivly
- for v in self.pauseItems.itervalues():
- v[0].handler_block(v[1])
-
- # mark the others
- for k, v in self.pauseItems.iteritems():
- if k != curr:
- v[0].set_active(self.emergePaused)
-
- # unblock
- for v in self.pauseItems.itervalues():
- v[0].handler_unblock(v[1])
-
- return False
- return pause
+ def cb_pause_emerge (self, action):
+ # pause or continue
+ self.emergePaused = action.get_active()
+ if not self.emergePaused:
+ self.queue.continue_emerge()
+ else:
+ self.queue.stop_emerge()
def cb_kill_clicked (self, *args):
"""
@@ -1822,7 +1778,7 @@ class MainWindow (Window):
"""
self.queue.kill_emerge()
if self.emergePaused: # unmark the "pause emerge" buttons
- self.pauseItems["menu"][0].set_active(False) # calling one button is enough (see: cb_pause_emerge)
+ self.tree.get_widget("generalActionGroup").get_action("pauseAction").set_active(False)
def cb_copy_clicked (self, *args):
"""
t/commit/.zsh/zshrc?id=4595adbc3de01228bb122575264d9385f6cbd9b4&follow=1'>Set terminal title not only on path change, but for each new prompt.René 'Necoro' Neumann1-2/+2 2013-10-22cwd-spawn: Use M-Return instead of M-o for consistency.René 'Necoro' Neumann1-2/+2 2013-10-22Add cwd-spawn to urxvt to allow spawning a new terminal from the currentRené 'Necoro' Neumann3-2/+199 2013-10-22Use chpwd_functions and precmd_functions instead of putting everything inRené 'Necoro' Neumann1-19/+23 2013-09-30urxvt: execute the wgetpaste check each timeRené 'Necoro' Neumann1-2/+5 2013-09-30urxvt: wgetpaste fixRené 'Necoro' Neumann1-4/+4 2013-09-30Allow HOME variable in .Xresources.René 'Necoro' Neumann2-3/+3 2013-09-30wgetpaste support for urxvt.René 'Necoro' Neumann2-1/+28 2013-09-30Urxvt autotransform for <filename>:<line>.René 'Necoro' Neumann1-1/+4 2013-09-30Remove tabbed(x) from urxvt. We use i3 -- no need for it.René 'Necoro' Neumann1-9/+0 2013-09-30Do not display icon in urxvt. It's not supported by i3 anyway.René 'Necoro' Neumann1-1/+1 2013-09-29Remove wrong monitors lineRené 'Necoro' Neumann1-1/+0 2013-09-29Delete vimperator paste plugin -- seems not to work anymore with new FFRené 'Necoro' Neumann1-266/+0 2013-09-29Use $HOST instead of Cauchiy in titleRené 'Necoro' Neumann1-1/+1 2013-09-24Remove herbstluftwmRené 'Necoro' Neumann1-1/+0 2013-09-24Conky changesRené 'Necoro' Neumann2-5/+13 2013-09-15Remove trailing slash from \~ulpRené 'Necoro' Neumann1-1/+1 2013-09-15Make cci explicitly use python2René 'Necoro' Neumann1-1/+1 2013-09-10Node/NPM preparationRené 'Necoro' Neumann3-1/+13