Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-07-13 09:10:27 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-07-13 09:10:27 (GMT)
commite079d763801670453ef7e5aa1c5d414587e34e0f (patch)
treef703823015e14d85e600c6778d29abc9e53ee158 /shell
parentcc66d7d4df08a8654bfe2050eeea6575ffe2ddac (diff)
Update the task list on add/remove rather than
rebuilding every time. Note that this is _not_ the real UI. It's just some stuff I put there because we need the functionality while we finalize the real design and we figure out how to implement it.
Diffstat (limited to 'shell')
-rw-r--r--shell/HomeWindow.py52
1 files changed, 34 insertions, 18 deletions
diff --git a/shell/HomeWindow.py b/shell/HomeWindow.py
index 65328ab..ed8262b 100644
--- a/shell/HomeWindow.py
+++ b/shell/HomeWindow.py
@@ -42,27 +42,34 @@ class ActivityGrid(gtk.VBox):
gtk.VBox.__init__(self)
self._home = home
- self.update()
+ self._buttons = {}
- def _add_all(self):
screen = wnck.screen_get_default()
for window in screen.get_windows():
if not window.is_skip_tasklist():
- self.add(window)
+ self._add(window)
+ screen.connect('window_opened', self.__window_opened_cb)
+ screen.connect('window_closed', self.__window_closed_cb)
+
+ def __window_opened_cb(self, screen, window):
+ if not window.is_skip_tasklist():
+ self._add(window)
+
+ def __window_closed_cb(self, screen, window):
+ if not window.is_skip_tasklist():
+ self._remove(window)
- def _remove_all(self):
- for child in self.get_children():
- self.remove(child)
+ def _remove(self, window):
+ button = self._buttons[window.get_xid()]
+ self.remove(button)
- def add(self, window):
+ def _add(self, window):
button = gtk.Button(window.get_name())
button.connect('clicked', self.__button_clicked_cb, window)
self.pack_start(button, False)
button.show()
-
- def update(self):
- self._remove_all()
- self._add_all()
+
+ self._buttons[window.get_xid()] = button
def __button_clicked_cb(self, button, window):
self._home.activate(window)
@@ -72,17 +79,30 @@ class HomeWindow(gtk.Window):
gtk.Window.__init__(self)
self._shell = shell
-
- vbox = gtk.VBox()
+
+ self.set_skip_taskbar_hint(True)
+
+ vbox = gtk.VBox(False, 6)
+ vbox.set_border_width(24)
toolbar = Toolbar(self)
vbox.pack_start(toolbar, False)
toolbar.show()
+
+ label = gtk.Label('Open activities:')
+ label.set_alignment(0.0, 0.5)
+ vbox.pack_start(label, False)
+ label.show()
self._grid = ActivityGrid(self)
vbox.pack_start(self._grid)
self._grid.show()
-
+
+ label = gtk.Label('Shared activities:')
+ label.set_alignment(0.0, 0.5)
+ vbox.pack_start(label, False)
+ label.show()
+
self.add(vbox)
vbox.show()
@@ -96,7 +116,3 @@ class HomeWindow(gtk.Window):
def activate(self, activity_window):
activity_window.activate(gtk.get_current_event_time())
self.hide()
-
- def show(self):
- self._grid.update()
- gtk.Window.show(self)