deskbar-applet r2241 - in trunk: . data deskbar/ui/preferences



Author: sebp
Date: Tue Jul  8 19:41:10 2008
New Revision: 2241
URL: http://svn.gnome.org/viewvc/deskbar-applet?rev=2241&view=rev

Log:
Set top/up/down/bottom buttons insensitive by default (patch by Goran Rakic <grakic at devbase dot net>)
Added check if iter != None when one of the above buttons is pressed (fixes bug #490981)

Modified:
   trunk/ChangeLog
   trunk/data/prefs-dialog.glade
   trunk/deskbar/ui/preferences/DeskbarPreferences.py

Modified: trunk/data/prefs-dialog.glade
==============================================================================
--- trunk/data/prefs-dialog.glade	(original)
+++ trunk/data/prefs-dialog.glade	Tue Jul  8 19:41:10 2008
@@ -157,6 +157,7 @@
 				  <child>
 				    <widget class="GtkButton" id="button_top">
 				      <property name="visible">True</property>
+				      <property name="sensitive">False</property>
 				      <property name="can_default">True</property>
 				      <property name="can_focus">True</property>
 				      <property name="label">gtk-goto-top</property>
@@ -169,6 +170,7 @@
 				  <child>
 				    <widget class="GtkButton" id="button_up">
 				      <property name="visible">True</property>
+				      <property name="sensitive">False</property>
 				      <property name="can_default">True</property>
 				      <property name="can_focus">True</property>
 				      <property name="label">gtk-go-up</property>
@@ -181,6 +183,7 @@
 				  <child>
 				    <widget class="GtkButton" id="button_down">
 				      <property name="visible">True</property>
+				      <property name="sensitive">False</property>
 				      <property name="can_default">True</property>
 				      <property name="can_focus">True</property>
 				      <property name="label">gtk-go-down</property>
@@ -193,6 +196,7 @@
 				  <child>
 				    <widget class="GtkButton" id="button_bottom">
 				      <property name="visible">True</property>
+				      <property name="sensitive">False</property>
 				      <property name="can_default">True</property>
 				      <property name="can_focus">True</property>
 				      <property name="label">gtk-goto-bottom</property>

Modified: trunk/deskbar/ui/preferences/DeskbarPreferences.py
==============================================================================
--- trunk/deskbar/ui/preferences/DeskbarPreferences.py	(original)
+++ trunk/deskbar/ui/preferences/DeskbarPreferences.py	Tue Jul  8 19:41:10 2008
@@ -578,31 +578,35 @@
     
     def on_button_top_clicked(self, button):
         model, iter = self.moduleview.get_selection().get_selected()
-        self.module_list.move_module_to_top(iter)
-        self.moduleview.scroll_to_iter(iter)
-        self.set_buttons(self.moduleview.get_selection())
-        self.moduleview.grab_focus()
+        if iter != None:
+            self.module_list.move_module_to_top(iter)
+            self.moduleview.scroll_to_iter(iter)
+            self.set_buttons(self.moduleview.get_selection())
+            self.moduleview.grab_focus()
     
     def on_button_up_clicked(self, button):
         model, iter = self.moduleview.get_selection().get_selected()
-        self.module_list.move_module_up(iter)
-        self.moduleview.scroll_to_iter(iter)
-        self.set_buttons(self.moduleview.get_selection())
-        self.moduleview.grab_focus()
+        if iter != None:
+            self.module_list.move_module_up(iter)
+            self.moduleview.scroll_to_iter(iter)
+            self.set_buttons(self.moduleview.get_selection())
+            self.moduleview.grab_focus()
     
     def on_button_down_clicked(self, button):
         model, iter = self.moduleview.get_selection().get_selected()
-        self.module_list.move_module_down(iter)
-        self.moduleview.scroll_to_iter(iter)
-        self.set_buttons(self.moduleview.get_selection())
-        self.moduleview.grab_focus()
+        if iter != None:
+            self.module_list.move_module_down(iter)
+            self.moduleview.scroll_to_iter(iter)
+            self.set_buttons(self.moduleview.get_selection())
+            self.moduleview.grab_focus()
     
     def on_button_bottom_clicked(self, button):
         model, iter = self.moduleview.get_selection().get_selected()
-        self.module_list.move_module_to_bottom(iter)
-        self.moduleview.scroll_to_iter(iter)
-        self.set_buttons(self.moduleview.get_selection())
-        self.moduleview.grab_focus()
+        if iter != None:
+            self.module_list.move_module_to_bottom(iter)
+            self.moduleview.scroll_to_iter(iter)
+            self.set_buttons(self.moduleview.get_selection())
+            self.moduleview.grab_focus()
         
     def on_ui_changed(self, check):
         if self.sticktopanel_checkbox.get_active():



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]