Skip to content

Commit

Permalink
wip: breakscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
deltragon committed Aug 7, 2024
1 parent 8643580 commit 8fe7a43
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion safeeyes/safeeyes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 11 additions & 1 deletion safeeyes/ui/break_screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

0 comments on commit 8fe7a43

Please sign in to comment.