deskbar-applet r2279 - in trunk: . data deskbar/core deskbar/ui deskbar/ui/preferences
- From: sebp svn gnome org
- To: svn-commits-list gnome org
- Subject: deskbar-applet r2279 - in trunk: . data deskbar/core deskbar/ui deskbar/ui/preferences
- Date: Sun, 3 Aug 2008 10:53:12 +0000 (UTC)
Author: sebp
Date: Sun Aug 3 10:53:12 2008
New Revision: 2279
URL: http://svn.gnome.org/viewvc/deskbar-applet?rev=2279&view=rev
Log:
Added option to change entry width when Button UI is used
Modified:
trunk/ChangeLog
trunk/data/deskbar-applet.schemas.in
trunk/data/prefs-dialog.glade
trunk/deskbar/core/CoreImpl.py
trunk/deskbar/core/GconfStore.py
trunk/deskbar/ui/CuemiacAlignedView.py
trunk/deskbar/ui/CuemiacWindowView.py
trunk/deskbar/ui/preferences/DeskbarPreferences.py
Modified: trunk/data/deskbar-applet.schemas.in
==============================================================================
--- trunk/data/deskbar-applet.schemas.in (original)
+++ trunk/data/deskbar-applet.schemas.in Sun Aug 3 10:53:12 2008
@@ -171,5 +171,17 @@
<short>Selects the user interface to use, one of "Window" or "Button"</short>
</locale>
</schema>
+
+ <schema>
+ <key>/schemas/apps/deskbar/entry_width</key>
+ <applyto>/apps/deskbar/entry_width</applyto>
+ <owner>deskbar</owner>
+ <type>int</type>
+ <default>20</default>
+ <locale name="C">
+ <short>The applet's entry width in number of characters</short>
+ <long>This value only takes affect when "ui_name" is set to "Button"</long>
+ </locale>
+ </schema>
</schemalist>
</gconfschemafile>
Modified: trunk/data/prefs-dialog.glade
==============================================================================
--- trunk/data/prefs-dialog.glade (original)
+++ trunk/data/prefs-dialog.glade Sun Aug 3 10:53:12 2008
@@ -1087,14 +1087,38 @@
<property name="spacing">18</property>
<child>
- <widget class="GtkFrame" id="frame4">
+ <widget class="GtkVBox" id="vbox166">
<property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label1335">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Window Behavior</b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
<child>
- <widget class="GtkAlignment" id="alignment31">
+ <widget class="GtkAlignment" id="alignment33">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
@@ -1119,18 +1143,36 @@
</widget>
</child>
</widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
</child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="frame_width">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label1333">
+ <widget class="GtkLabel" id="label1318">
<property name="visible">True</property>
- <property name="label" translatable="yes"><b>Window Behavior</b></property>
+ <property name="label" translatable="yes"><b>Width</b></property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
- <property name="xalign">0.5</property>
+ <property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
@@ -1140,7 +1182,80 @@
<property name="angle">0</property>
</widget>
<packing>
- <property name="type">label_item</property>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment19">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox187">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkSpinButton" id="width">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">20 10 1000 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="width_units">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">characters</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
</packing>
</child>
</widget>
Modified: trunk/deskbar/core/CoreImpl.py
==============================================================================
--- trunk/deskbar/core/CoreImpl.py (original)
+++ trunk/deskbar/core/CoreImpl.py Sun Aug 3 10:53:12 2008
@@ -166,6 +166,9 @@
def get_ui_name(self):
return self._gconf.get_ui_name()
+
+ def get_entry_width(self):
+ return self._gconf.get_entry_width()
def set_keybinding(self, binding):
"""
@@ -243,6 +246,9 @@
if not self._gconf.set_ui_name(name):
LOGGER.error("Unable to save ui name setting to GConf")
+ def set_entry_width(self, width):
+ return self._gconf.set_entry_width(width)
+
def get_history(self):
"""
@return: L{deskbar.core.DeskbarHistory.DeskbarHistory}
Modified: trunk/deskbar/core/GconfStore.py
==============================================================================
--- trunk/deskbar/core/GconfStore.py (original)
+++ trunk/deskbar/core/GconfStore.py Sun Aug 3 10:53:12 2008
@@ -42,6 +42,8 @@
GCONF_MAX_HISTORY_ITEMS = GCONF_DIR + "/max_history_items"
GCONF_UI_NAME = GCONF_DIR + "/ui_name"
+
+ GCONF_ENTRY_WIDTH = GCONF_DIR + "/entry_width"
GCONF_DEFAULT_BROWSER = "/desktop/gnome/url-handlers/http/command"
@@ -60,6 +62,7 @@
"max-history-items-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_INT]),
"default-browser-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_STRING]),
"ui-name-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_STRING]),
+ "entry-width-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_INT]),
}
__instance = None
@@ -94,6 +97,7 @@
self._client.notify_add(self.GCONF_TYPINGDELAY, self.__emit_signal_int, "max-history-items-changed")
self._client.notify_add(self.GCONF_DEFAULT_BROWSER, self.__emit_signal_string, "default-browser-changed")
self._client.notify_add(self.GCONF_UI_NAME, self.__emit_signal_string, "ui-name-changed")
+ self._client.notify_add(self.GCONF_ENTRY_WIDTH, self.__emit_signal_int, "entry-width-changed")
def __emit_signal_string(self, client, cnxn_id, entry, data):
if entry.value != None:
@@ -186,6 +190,9 @@
def get_ui_name(self):
return self._client.get_string(self.GCONF_UI_NAME)
+
+ def get_entry_width(self):
+ return self._client.get_int(self.GCONF_ENTRY_WIDTH)
def set_keybinding(self, binding):
return self.__set_string_if_writeable(self.GCONF_KEYBINDING, binding)
@@ -238,6 +245,9 @@
def set_ui_name(self, name):
return self.__set_string_if_writeable(self.GCONF_UI_NAME, name)
+ def set_entry_width(self, width):
+ return self.__set_int_if_writeable(self.GCONF_ENTRY_WIDTH, int(width))
+
def __set_string_if_writeable(self, key, val):
if self._client.key_is_writable(key):
return self._client.set_string(key, val)
Modified: trunk/deskbar/ui/CuemiacAlignedView.py
==============================================================================
--- trunk/deskbar/ui/CuemiacAlignedView.py (original)
+++ trunk/deskbar/ui/CuemiacAlignedView.py Sun Aug 3 10:53:12 2008
@@ -2,6 +2,7 @@
import gtk.gdk
import gobject
import gnomeapplet
+from deskbar.core.GconfStore import GconfStore
from deskbar.ui.AbstractCuemiacView import AbstractCuemiacView
from deskbar.ui.cuemiac.CuemiacAlignedWindow import CuemiacAlignedWindow
@@ -21,6 +22,8 @@
self._controller.register_view(self)
self.applet = applet
+ GconfStore.get_instance().connect("entry-width-changed", self._on_entry_width_changed)
+
self.set_type_hint (gtk.gdk.WINDOW_TYPE_HINT_MENU)
self.applet.set_applet_flags(gnomeapplet.EXPAND_MINOR)
self.applet.set_flags(gtk.CAN_FOCUS)
@@ -40,6 +43,8 @@
self.set_role("deskbar-search-window")
+ self.get_entry().set_width_chars(self._model.get_entry_width())
+
# VBox
self.add(self.vbox_main)
@@ -133,4 +138,7 @@
else:
self.vbox_main.reorder_child(self.results_box, 0)
self.vbox_main.reorder_child(self.header, 2)
+
+ def _on_entry_width_changed(self, store, width):
+ self.get_entry().set_width_chars(width)
\ No newline at end of file
Modified: trunk/deskbar/ui/CuemiacWindowView.py
==============================================================================
--- trunk/deskbar/ui/CuemiacWindowView.py (original)
+++ trunk/deskbar/ui/CuemiacWindowView.py Sun Aug 3 10:53:12 2008
@@ -25,6 +25,9 @@
self.set_role("deskbar-search-window")
self.set_property("skip-taskbar-hint", True)
+ # Reset width to default
+ self.get_entry().set_width_chars(-1)
+
self.add(self.vbox_main)
# Search entry
Modified: trunk/deskbar/ui/preferences/DeskbarPreferences.py
==============================================================================
--- trunk/deskbar/ui/preferences/DeskbarPreferences.py (original)
+++ trunk/deskbar/ui/preferences/DeskbarPreferences.py Sun Aug 3 10:53:12 2008
@@ -23,12 +23,14 @@
gtk.HBox.__init__(self, spacing=6)
self.info_image = gtk.image_new_from_stock(stock_icon, gtk.ICON_SIZE_BUTTON)
self.info_image.set_padding(3, 0)
+ self.info_image.show()
self.pack_start(self.info_image, expand=False, fill=False)
self.label = gtk.Label()
self.label.set_line_wrap(True)
self.label.set_alignment(0.0, 0.5)
self.label.set_justify(gtk.JUSTIFY_LEFT)
self.label.set_markup(text)
+ self.label.show()
self.pack_start(self.label, expand=True, fill=True)
class DeskbarPreferences:
@@ -75,6 +77,7 @@
self.moduleview.get_selection().connect("changed", self.on_module_selected)
self.moduleview.get_selection().connect("changed", self.set_buttons)
self.module_list.connect('row-changed', lambda list, path, iter: self.on_module_selected(self.moduleview.get_selection()))
+ self.moduleview.show()
container.add(self.moduleview)
# Buttons beneath list
@@ -91,6 +94,7 @@
self.old_info_message = None
info_text = _("<i><small>Drag and drop an extension to change its order.</small></i>")
self.default_info = InfoBox(info_text, gtk.STOCK_DIALOG_INFO)
+ self.default_info.show()
self.info_area.add(self.default_info)
# Buttons on the right
@@ -106,8 +110,17 @@
def __setup_general_tab(self):
self.keyboard_shortcut_entry = AccelEntry()
self.keyboard_shortcut_entry.connect('accel-edited', self.on_keyboard_shortcut_entry_changed)
+ self.keyboard_shortcut_entry.get_widget().show()
self.glade.get_widget("keybinding_entry_container").pack_start(self.keyboard_shortcut_entry.get_widget(), False)
+ if self._model.get_ui_name() == deskbar.BUTTON_UI_NAME:
+ spinbutton = self.glade.get_widget("width")
+ spinbutton.set_value(self._model.get_entry_width())
+ spinbutton.connect('value-changed', self.on_entry_width_changed)
+ else:
+ frame = self.glade.get_widget("frame_width")
+ frame.hide()
+
self.use_selection = self._model.get_use_selection()
self.use_selection_box = self.glade.get_widget("use_selection")
self.use_selection_box.connect('toggled', self.on_use_selection_toggled)
@@ -131,6 +144,7 @@
def __setup_disabled_modules_tab(self):
self.disabledmoduleview = DisabledModuleListView( self._model.get_disabled_module_list() )
self.disabledmoduleview.get_selection().connect("changed", self.on_disabled_module_changed)
+ self.disabledmoduleview.show()
disabledhandlers = self.glade.get_widget("disabledhandlers")
disabledhandlers.add(self.disabledmoduleview)
@@ -173,6 +187,7 @@
self.webmoduleview = WebModuleListView(self.web_module_list)
self.webmoduleview.get_selection().connect("changed", self.on_webmodule_selected)
self.web_module_list.connect('row-changed', lambda list, path, iter: self.on_webmodule_selected (self.webmoduleview.get_selection()))
+ self.webmoduleview.show()
container.add(self.webmoduleview)
self.install = self.glade.get_widget("install")
@@ -245,7 +260,7 @@
def show_run_hide(self, parent):
self.dialog.set_screen(parent.get_screen())
- self.dialog.show_all()
+ self.dialog.show()
self.moduleview.grab_focus()
self.dialog.connect("response", self.on_dialog_response)
@@ -606,10 +621,16 @@
self.moduleview.grab_focus()
def on_ui_changed(self, check):
+ frame = self.glade.get_widget("frame_width")
if self.sticktopanel_checkbox.get_active():
self._model.set_ui_name(deskbar.BUTTON_UI_NAME)
+ frame.show()
else:
self._model.set_ui_name(deskbar.WINDOW_UI_NAME)
+ frame.hide()
def on_modules_initialized(self, model):
self.reload_button.set_sensitive(True)
+
+ def on_entry_width_changed(self, spinbutton):
+ self._model.set_entry_width(spinbutton.get_value())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]