gedit r6327 - in trunk: . plugins/snippets/snippets



Author: jessevdk
Date: Sun Jun 22 11:26:19 2008
New Revision: 6327
URL: http://svn.gnome.org/viewvc/gedit?rev=6327&view=rev

Log:
	* plugins/snippets/snippets/Manager.py:
	* plguins/snippets/snippets/snippets.glade:
	
	Make sure to cleanup in destroy instead of 'response' because the 
	'response' signal is not called if the gedit window is destroyed
	(fixes bug #537987)


Modified:
   trunk/ChangeLog
   trunk/plugins/snippets/snippets/Manager.py
   trunk/plugins/snippets/snippets/snippets.glade

Modified: trunk/plugins/snippets/snippets/Manager.py
==============================================================================
--- trunk/plugins/snippets/snippets/Manager.py	(original)
+++ trunk/plugins/snippets/snippets/Manager.py	Sun Jun 22 11:26:19 2008
@@ -317,7 +317,9 @@
                 glade.set_custom_handler(self.custom_handler)
                 self.xml = glade.XML(os.path.dirname(__file__) + '/snippets.glade')
                 
-                handlers_dic = {'on_dialog_snippets_response': self.on_dialog_snippets_response,
+                handlers_dic = {
+                        'on_dialog_snippets_response': self.on_dialog_snippets_response,
+                        'on_dialog_snippets_destroy': self.on_dialog_snippets_destroy,
                         'on_button_new_snippet_clicked': self.on_button_new_snippet_clicked,
                         'on_button_import_snippets_clicked': self.on_button_import_snippets_clicked,
                         'on_button_export_snippets_clicked': self.on_button_export_snippets_clicked,
@@ -612,11 +614,7 @@
                         piter = self.model.iter_next(piter)
 
         # Callbacks
-        def on_dialog_snippets_response(self, dlg, resp):
-                if resp == gtk.RESPONSE_HELP:
-                        gedit.help_display(self.dlg, 'gedit.xml', 'gedit-snippets-plugin')
-                        return
-
+        def on_dialog_snippets_destroy(self, dlg):
                 # Remove temporary drag export
                 if self._temp_export:
                       shutil.rmtree(os.path.dirname(self._temp_export))
@@ -630,8 +628,14 @@
                 self.unref_languages()        
                 self.snippet = None        
                 self.model = None
+                self.dlg = None                
+        
+        def on_dialog_snippets_response(self, dlg, resp):                                
+                if resp == gtk.RESPONSE_HELP:
+                        gedit.help_display(self.dlg, 'gedit.xml', 'gedit-snippets-plugin')
+                        return
+
                 self.dlg.destroy()
-                self.dlg = None
         
         def on_cell_editing_started(self, renderer, editable, path):
                 piter = self.model.get_iter(path)

Modified: trunk/plugins/snippets/snippets/snippets.glade
==============================================================================
--- trunk/plugins/snippets/snippets/snippets.glade	(original)
+++ trunk/plugins/snippets/snippets/snippets.glade	Sun Jun 22 11:26:19 2008
@@ -21,6 +21,7 @@
   <property name="urgency_hint">False</property>
   <property name="has_separator">False</property>
   <signal name="response" handler="on_dialog_snippets_response" last_modification_time="Mon, 19 Dec 2005 11:20:00 GMT"/>
+  <signal name="destroy" handler="on_dialog_snippets_destroy" last_modification_time="Sun, 22 Jun 2008 13:22:00 GMT"/>
 
   <child internal-child="vbox">
     <widget class="GtkVBox" id="dialog-vbox1">



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