deskbar-applet r2063 - in trunk: . deskbar/ui
- From: sebp svn gnome org
- To: svn-commits-list gnome org
- Subject: deskbar-applet r2063 - in trunk: . deskbar/ui
- Date: Thu, 3 Apr 2008 20:07:40 +0100 (BST)
Author: sebp
Date: Thu Apr 3 20:07:40 2008
New Revision: 2063
URL: http://svn.gnome.org/viewvc/deskbar-applet?rev=2063&view=rev
Log:
Force window UI in tray mode
Modified:
trunk/ChangeLog
trunk/deskbar/ui/AbstractCuemiacDeskbarIcon.py
trunk/deskbar/ui/DeskbarStatusIcon.py
Modified: trunk/deskbar/ui/AbstractCuemiacDeskbarIcon.py
==============================================================================
--- trunk/deskbar/ui/AbstractCuemiacDeskbarIcon.py (original)
+++ trunk/deskbar/ui/AbstractCuemiacDeskbarIcon.py Thu Apr 3 20:07:40 2008
@@ -30,17 +30,19 @@
self._view = CuemiacWindowView(self._controller, self._core)
self._active_view = deskbar.WINDOW_UI_NAME
- def _setup_mvc(self):
+ def _setup_core (self):
self._core = CoreImpl(deskbar.MODULES_DIRS)
self._core.connect("loaded", self.on_loaded)
- self._controller = CuemiacWindowController(self._core)
-
+ def _setup_controller (self, core):
+ self._controller = CuemiacWindowController(core)
+
+ def _setup_view (self, core, window_type):
# Select the view based on user choice. CuemiacWindowView is
# the new style UI,
# CuemiacAlignedView is the older UI as seen in the
# Deskbar gnome-2-18 branch.
- if self._core.get_ui_name() == deskbar.WINDOW_UI_NAME:
+ if window_type == deskbar.WINDOW_UI_NAME:
self.create_window_ui()
else:
# We need to use an AlignedWindow, which needs a Widget (self.image
@@ -50,9 +52,14 @@
self._view.set_sensitive(False)
GconfStore.get_instance().connect("ui-name-changed", self._on_ui_name_changed)
+
+ def _setup_mvc(self):
+ self._setup_core()
+ self._setup_controller(self._core)
+ self._setup_view(self._core, self._core.get_ui_name())
self._core.run()
-
+
def _show_toggle(self, widget, time):
self._controller.on_keybinding_activated(widget, time, False)
Modified: trunk/deskbar/ui/DeskbarStatusIcon.py
==============================================================================
--- trunk/deskbar/ui/DeskbarStatusIcon.py (original)
+++ trunk/deskbar/ui/DeskbarStatusIcon.py Thu Apr 3 20:07:40 2008
@@ -1,8 +1,11 @@
-import deskbar
-import gtk
from deskbar.ui.AbstractCuemiacDeskbarIcon import AbstractCuemiacDeskbarIcon
from gettext import gettext as _
from os.path import join
+import deskbar
+import gtk
+import logging
+
+LOGGER = logging.getLogger(__name__)
class DeskbarPopupMenu (gtk.Menu):
@@ -105,7 +108,19 @@
def _on_popup_menu (self, status_icon, button, activate_time):
self._menu.show_all()
self._menu.popup(None, None, self._get_menu_position, button, activate_time)
+
+ def _on_ui_name_changed(self, gconfstore, name):
+ if name != deskbar.WINDOW_UI_NAME:
+ LOGGER.info ("Only window UI is supported in tray mode")
+
+ def _setup_mvc(self):
+ self._setup_core()
+ self._setup_controller(self._core)
+ # Force window UI, because button UI requires applet
+ self._setup_view(self._core, deskbar.WINDOW_UI_NAME)
+ self._core.run()
+
def _get_menu_position (self, menu):
(screen, rectangle, orient) = self.get_geometry ()
x = rectangle.x
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]