[clocks] Refactored some widget names



commit 312774b0649de1b4f4e0ddd18cc8d686844a0d1f
Author: Seif Lotfy <seif lotfy com>
Date:   Wed Jun 13 20:17:25 2012 +0200

    Refactored some widget names

 clocks.py  |    9 ++++-----
 widgets.py |   13 ++++++++-----
 2 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/clocks.py b/clocks.py
index fa80d39..ab7ba46 100644
--- a/clocks.py
+++ b/clocks.py
@@ -21,13 +21,12 @@
 from gi.repository import Gtk, GObject, Gio, Gdk
 from gi.repository.GdkPixbuf import Pixbuf
 
-from widgets import NewWorldClockWidget, DigitalClock, NewAlarm
+from widgets import NewWorldClockDialog, DigitalClock, NewAlarmDialog
 from storage import worldclockstorage
 
 from datetime import datetime, timedelta
 from pytz import timezone
 from timer import TimerWelcomeScreen, TimerScreen, Spinner
-from alarm import AlarmItem
 import pytz, time, os
 
 
@@ -137,7 +136,7 @@ class World (Clock):
 
     def open_new_dialog(self):
         parent = self.get_parent().get_parent().get_parent()
-        window = NewWorldClockWidget(parent)
+        window = NewWorldClockDialog(parent)
 
         #window.get_children()[0].pack_start(widget, False, False, 0)
         window.connect("add-clock", lambda w, l: self.add_clock(l))
@@ -152,10 +151,10 @@ class World (Clock):
 class Alarm (Clock):
     def __init__ (self):
         Clock.__init__ (self, "Alarm", True)
-        self.button.set_sensitive (True)
 
     def open_new_dialog(self):
-        window = NewAlarm()
+        parent = self.get_parent ().get_parent ().get_parent ()
+        window = NewAlarmDialog (parent)
         window.show_all ()
 
 class Stopwatch (Clock):
diff --git a/widgets.py b/widgets.py
index 157442b..cda48d3 100644
--- a/widgets.py
+++ b/widgets.py
@@ -24,7 +24,7 @@ from storage import Location
 import cairo, time
 
 
-class NewWorldClockWidget (Gtk.Dialog):
+class NewWorldClockDialog (Gtk.Dialog):
 
     __gsignals__ = {'add-clock': (GObject.SignalFlags.RUN_LAST,
                     None, (GObject.TYPE_PYOBJECT,))}
@@ -249,12 +249,15 @@ class DigitalClockDrawing (Gtk.DrawingArea):
         self.pixbuf = pixbuf
         return self.pixbuf
 
-class NewAlarm(Gtk.Dialog):
+class NewAlarmDialog (Gtk.Dialog):
 
-    def __init__(self):
-        Gtk.Dialog.__init__(self, title="New Alarm")
+    def __init__(self, parent):
+        Gtk.Dialog.__init__(self, "New Alarm", parent)
         self.set_border_width (12)
-    
+        self.parent = parent
+        self.set_transient_for(parent)
+        self.set_modal(True)
+
         table1 = Gtk.Table(4, 5, False) 
         table1.set_row_spacings(9)
         table1.set_col_spacings(9)



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