diff --git a/safeeyes/safeeyes.py b/safeeyes/safeeyes.py index 7075ed91..26303e79 100644 --- a/safeeyes/safeeyes.py +++ b/safeeyes/safeeyes.py @@ -100,7 +100,8 @@ def do_startup(self): self.context['session'] = {'plugin': {}} self.break_screen = BreakScreen( - self.context, self.on_skipped, self.on_postponed, utility.STYLE_SHEET_PATH) + self, self.context, self.on_skipped, self.on_postponed, utility.STYLE_SHEET_PATH + ) self.break_screen.initialize(self.config) self.plugins_manager = PluginManager() self.safe_eyes_core = SafeEyesCore(self.context) diff --git a/safeeyes/ui/break_screen.py b/safeeyes/ui/break_screen.py index 7546fd83..76dca77a 100644 --- a/safeeyes/ui/break_screen.py +++ b/safeeyes/ui/break_screen.py @@ -41,7 +41,7 @@ class BreakScreen: This class reads the break_screen.glade and build the user interface. """ - def __init__(self, context, on_skipped, on_postponed, style_sheet_path): + def __init__(self, application, context, on_skipped, on_postponed, style_sheet_path): self.context = context self.count_labels = [] self.display = Display() @@ -55,6 +55,7 @@ def __init__(self, context, on_skipped, on_postponed, style_sheet_path): self.shortcut_disable_time = 2 self.strict_break = False self.windows = [] + self.application = application # Initialize the theme css_provider = Gtk.CssProvider() @@ -165,6 +166,7 @@ def __show_break_screen(self, message, image_path, widget, tray_actions): x = monitor_gemoetry.x y = monitor_gemoetry.y + window = BreakScreenWindow(application=self.application) builder = Gtk.Builder() builder.add_from_file(BREAK_SCREEN_GLADE) builder.connect_signals(self) @@ -286,3 +288,11 @@ def __destroy_all_screens(self): win.destroy() del self.windows[:] del self.count_labels[:] + +@Gtk.Template(filename=BREAK_SCREEN_GLADE) +class BreakScreenWindow(Gtk.Window): + __gtype_name__ = "BreakScreenWindow" + + def __init__(self, application): + super().__init__(application=application) +