Commit 7e99a1b4 authored by Bruce Cowan's avatar Bruce Cowan

A bit of modernisation

parent 6b11b81a
......@@ -2,9 +2,9 @@ from datetime import datetime
from gi.repository import Gtk
class AboutDialog(Gtk.AboutDialog):
"""An about dialog"""
__gtype_name__ = 'AboutDialog'
def __init__(self):
Gtk.AboutDialog.__init__(self)
......
......@@ -3,9 +3,9 @@ import math
from gi.repository import GLib, Gtk, Pango
class Countdown(Gtk.Label):
"""A label that displays a countdown to a specific time"""
__gtype_name__ = 'Countdown'
def __init__(self):
Gtk.Label.__init__(self)
......
......@@ -3,15 +3,16 @@
from datetime import datetime
import sys
from gi import require_version
require_version('Gtk', '3.0')
from gi.repository import Gio, Gtk, Pango
from aboutdialog import AboutDialog
from countdownapplicationwindow import CountdownApplicationWindow
from preferencedialog import PreferenceDialog
class CountdownApplication(Gtk.Application):
__gtype_name__ = 'CountdownApplication'
class CountdownApplication(Gtk.Application):
def __init__(self):
Gtk.Application.__init__(self, application_id="uk.me.bcowan.countdown")
......
......@@ -3,11 +3,9 @@ from gi.repository import Gtk
from digdate import DigitalClock
from countdown import Countdown
from preferencedialog import PreferenceDialog
from aboutdialog import AboutDialog
class CountdownApplicationWindow(Gtk.ApplicationWindow):
__gtype_name__ = 'CountdownApplicationWindow'
class CountdownApplicationWindow(Gtk.ApplicationWindow):
def __init__(self, app):
Gtk.ApplicationWindow.__init__(self, application=app)
......
......@@ -2,9 +2,9 @@ from datetime import datetime
from gi.repository import GLib, Gtk, Pango
class DigitalClock(Gtk.Label):
"""A label which shows the current time"""
__gtype_name__ = 'DigitalClock'
def __init__(self):
Gtk.Label.__init__(self)
......
......@@ -2,9 +2,9 @@ from datetime import datetime
from gi.repository import Gtk, Pango
class PreferenceDialog(Gtk.Dialog):
"""A dialogue for choosing preferences"""
__gtype_name__ = 'PreferenceDialog'
def __init__(self, target, fd):
Gtk.Dialog.__init__(self, title="Preferences", flags=Gtk.DialogFlags.MODAL, resizable=False, use_header_bar=True)
......
......@@ -2,9 +2,9 @@ from datetime import datetime
from gi.repository import Gtk
class TimeChooserDialog(Gtk.Dialog):
"""A dialogue for choosing a time"""
__gtype_name__ = 'TimeChooserDialog'
def __init__(self, target):
Gtk.Dialog.__init__(self, title="Choose a time", flags=Gtk.DialogFlags.MODAL, resizable=False)
......@@ -55,4 +55,4 @@ class TimeChooserDialog(Gtk.Dialog):
minute = self.minute.get_value_as_int()
second = self.second.get_value_as_int()
return datetime(year, month, day, hour, minute, second)
\ No newline at end of file
return datetime(year, month, day, hour, minute, second)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment