After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 356008 - a 'reload all scripts' button on the deskbar applet
a 'reload all scripts' button on the deskbar applet
Status: RESOLVED FIXED
Product: deskbar-applet
Classification: Deprecated
Component: general
2.14.x
Other All
: Low enhancement
: 2.22
Assigned To: Deskbar Applet Maintainer(s)
Deskbar Applet Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2006-09-14 19:48 UTC by Jos van den Oever
Modified: 2008-01-09 21:04 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Patch to add reload all button (7.29 KB, patch)
2008-01-07 09:53 UTC, Nick Irvine
needs-work Details | Review
patch for reloading deskbar modules (88.53 KB, patch)
2008-01-09 19:50 UTC, JcRazo
none Details | Review
sorry it this one the patch i wanted to send, this works for me (6.09 KB, patch)
2008-01-09 20:15 UTC, JcRazo
committed Details | Review

Description Jos van den Oever 2006-09-14 19:48:49 UTC
It would make development of deskbar handlers much quicker if one could refresh all handler code with one mouseclick. A developer mode of the desklet a button providing this functionality would be great.

Other information:
Comment 1 Raphael Slinckx 2006-10-18 11:04:06 UTC
Ideally it should notice change and reload a module..
Comment 2 Sebastian Pölsterl 2007-11-18 18:03:34 UTC
Marking as gnome-love
Comment 3 Nick Irvine 2008-01-05 07:43:48 UTC
I'm willing to give it a shot.  I'll post a patch when I've got it.
Comment 4 Nick Irvine 2008-01-07 09:53:10 UTC
Created attachment 102306 [details] [review]
Patch to add reload all button

Applies to svn r1820
Comment 5 Nick Irvine 2008-01-07 09:56:57 UTC
I've posted a patch to add the reload all button.  Apply it in the desktop-applet directory.  Applicable to latest revision at time of writing, 1820.

The actual button is in the preferences window.  

Feedback is greatly appreciated.  This is my first ever patch to anything, so let me know if I've posted it correctly, etc.
Comment 6 Sebastian Pölsterl 2008-01-07 10:18:23 UTC
Very good work for your first patch. But there are still some issues:

1) The button should display 'Reload' rather than 'Restart'
2) You have to clear DisabledModuleList as well. In CoreImpl.reload_all_modules you have access both to ModuleList and DisabledModuleList. That way ModuleList.modules_reloading_cb is obsolete.
Comment 7 JcRazo 2008-01-09 19:50:11 UTC
Created attachment 102483 [details] [review]
patch for reloading deskbar modules

I'd like you to check out this patch, mm im sorry if its not a good one, its my first patch i hope it will be useful..
Comment 8 JcRazo 2008-01-09 20:11:28 UTC
Comment on attachment 102483 [details] [review]
patch for reloading deskbar modules

Index: data/prefs-dialog.glade
===================================================================
--- data/prefs-dialog.glade	(revision 1823)
+++ data/prefs-dialog.glade	(working copy)
@@ -224,6 +224,84 @@
 			      <property name="spacing">6</property>
 
 			      <child>
+				<widget class="GtkButton" id="reload">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="relief">GTK_RELIEF_NORMAL</property>
+				  <property name="focus_on_click">True</property>
+
+				  <child>
+				    <widget class="GtkAlignment" id="alignment30">
+				      <property name="visible">True</property>
+				      <property name="xalign">0.5</property>
+				      <property name="yalign">0.5</property>
+				      <property name="xscale">0</property>
+				      <property name="yscale">0</property>
+				      <property name="top_padding">0</property>
+				      <property name="bottom_padding">0</property>
+				      <property name="left_padding">0</property>
+				      <property name="right_padding">0</property>
+
+				      <child>
+					<widget class="GtkHBox" id="hbox199">
+					  <property name="visible">True</property>
+					  <property name="homogeneous">False</property>
+					  <property name="spacing">2</property>
+
+					  <child>
+					    <widget class="GtkImage" id="image8">
+					      <property name="visible">True</property>
+					      <property name="stock">gtk-clear</property>
+					      <property name="icon_size">4</property>
+					      <property name="xalign">0.5</property>
+					      <property name="yalign">0.5</property>
+					      <property name="xpad">0</property>
+					      <property name="ypad">0</property>
+					    </widget>
+					    <packing>
+					      <property name="padding">0</property>
+					      <property name="expand">False</property>
+					      <property name="fill">False</property>
+					    </packing>
+					  </child>
+
+					  <child>
+					    <widget class="GtkLabel" id="label1332">
+					      <property name="visible">True</property>
+					      <property name="label" translatable="yes">_Reload</property>
+					      <property name="use_underline">True</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.5</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>
+				  </child>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+
+			      <child>
 				<widget class="GtkButton" id="more">
 				  <property name="visible">True</property>
 				  <property name="can_focus">True</property>
Index: deskbar/core/CoreImpl.py
===================================================================
--- deskbar/core/CoreImpl.py	(revision 1823)
+++ deskbar/core/CoreImpl.py	(working copy)
@@ -237,6 +237,13 @@
         else:
             self._module_loader.initialize_module(module)
         self._module_list.increase_bottom_enabled_path()
+
+    def reload_all_modules(self):
+        self._module_list.clear()
+	self._disabled_module_list.clear()
+	logging.info("Reloading all modules")
+	self._module_loader.emit("modules-reloading")
+	self._module_loader.load_all()
     
     def stop_queries(self):
         self._stop_queries = True
@@ -337,4 +344,4 @@
     def forward_query_ready(self, handler, query, matches):
         if query == self._last_query and matches != None and len(matches) > 0 and not self._stop_queries:
             self._emit_query_ready(matches)
-        
\ No newline at end of file
+        
Index: deskbar/core/ModuleLoader.py
===================================================================
--- deskbar/core/ModuleLoader.py	(revision 1823)
+++ deskbar/core/ModuleLoader.py	(working copy)
@@ -34,6 +34,8 @@
         "module-not-initialized" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_PYOBJECT]),
         # Fired when the passed module module has run the stop() method successfully. The module is not usable anymore
         "module-stopped" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_PYOBJECT]),
+	#Fired when reload_all gets called, but before any reloading actually gets done
+         "modules-reloading" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, []),
     }
     
     def __init__ (self, dirs, extension=".py"):
Index: deskbar/ui/preferences/DeskbarPreferences.py
===================================================================
--- deskbar/ui/preferences/DeskbarPreferences.py	(revision 1823)
+++ deskbar/ui/preferences/DeskbarPreferences.py	(working copy)
@@ -74,6 +74,8 @@
         self.more_button.set_sensitive(False)
         self.more_button.connect("clicked", self.on_more_button_clicked)
         self.more_button_callback = None
+	self.reload_button = self.glade.get_widget("reload")
+	self.reload_button.connect("clicked", self.on_reload_button_clicked)
 
         # Info are at the bottom
         self.info_area = self.glade.get_widget("info_area")
@@ -220,6 +222,9 @@
     def on_more_button_clicked(self, button):
         if self.more_button_callback != None:
             self.more_button_callback(self.dialog)
+
+    def on_reload_button_clicked(self, button):
+	self._model.reload_all_modules()
     
     def on_module_selected(self, selection):
         module_context = self.moduleview.get_selected_module()
Comment 9 JcRazo 2008-01-09 20:15:10 UTC
Created attachment 102484 [details] [review]
sorry it this one the patch i wanted to send, this works for me

This is the patch i wanted to send, does the same as the other i sent but the glade modification is less and works
Comment 10 Sebastian Pölsterl 2008-01-09 21:04:26 UTC
Thanks a lot for this patch. It's perfectly. I just changed the icon of the button and added a tooltip and committed it to svn trunk. It will be part of 2.21.5.