pyatcron-devel-list
[Top][All Lists]
Advanced

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

[Pyatcron-devel-list] Some fixes in the task editor UI


From: Julien Olivier
Subject: [Pyatcron-devel-list] Some fixes in the task editor UI
Date: Fri, 23 Apr 2004 11:23:10 +0100

Hi.

The attached patch fixes 2 things:
 - When you close the task editor (SchedulerEditor) using the close
button, it destroys the window, instead of just hiding it. If you just
hide it, it will crash next time you edit a task.
 - The task editor window is now correctly centered on its parent, when
you open it, but it needs you to pass the parent widget to the
SchedulerEditor::show method.

-- 
Julien Olivier <address@hidden>
Index: pyatcron/src/lib/gui.py
===================================================================
RCS file: /cvsroot/pyatcron/pyatcron/src/lib/gui.py,v
retrieving revision 1.3
diff -u -r1.3 gui.py
--- pyatcron/src/lib/gui.py     20 Apr 2004 22:21:47 -0000      1.3
+++ pyatcron/src/lib/gui.py     23 Apr 2004 10:18:51 -0000
@@ -35,8 +35,14 @@
         # Display window
         # self.wtree.get_widget('taskProperties').show_all()
 
-    def show(self):
-        self.wtree.get_widget("taskProperties").show_all()
+    def show(self, parent):
+        win = self.wtree.get_widget("taskProperties")
+
+        # Center the window on the parent.
+        win.set_transient_for (parent)
+        win.set_position (gtk.WIN_POS_CENTER_ON_PARENT)
+
+        win.show_all()
 
     def on_task_changed(self,obj):
         print "Signal 'changed' from Task object received"
@@ -49,4 +55,4 @@
 
     def on_closeButton_clicked(self,*args):
         print "OK", args
-        self.wtree.get_widget('taskProperties').hide()
+        self.wtree.get_widget('taskProperties').destroy()
Index: pyatcron/src/lib/mainwin.py
===================================================================
RCS file: /cvsroot/pyatcron/pyatcron/src/lib/mainwin.py,v
retrieving revision 1.6
diff -u -r1.6 mainwin.py
--- pyatcron/src/lib/mainwin.py 20 Apr 2004 22:21:47 -0000      1.6
+++ pyatcron/src/lib/mainwin.py 23 Apr 2004 10:18:51 -0000
@@ -260,7 +260,7 @@
     def editTask (self):
         print "edit task #" + str (self.taskIndex)
         self.editor = SchedulerEditor(self.list[self.taskIndex])
-        self.editor.show()
+        self.editor.show(self.win)
         self.list[self.taskIndex].task.connect('changed', 
self.on_editor_changed)
         #self.updateTaskList ()
     

reply via email to

[Prev in Thread] Current Thread [Next in Thread]