Skip to content

Commit d557abd

Browse files
committed
don't warn if optional stylesheet is missing
1 parent 68835b7 commit d557abd

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

safeeyes/safeeyes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ def _initialize_styles(self):
170170
utility.SYSTEM_STYLE_SHEET_PATH, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
171171
)
172172
utility.load_css_file(
173-
utility.CUSTOM_STYLE_SHEET_PATH, Gtk.STYLE_PROVIDER_PRIORITY_USER
173+
utility.CUSTOM_STYLE_SHEET_PATH,
174+
Gtk.STYLE_PROVIDER_PRIORITY_USER,
175+
required=False,
174176
)
175177

176178
def _retry_errored_plugins(self):

safeeyes/utility.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,12 @@ def sha256sum(filename):
388388
return h.hexdigest()
389389

390390

391-
def load_css_file(style_sheet_path, priority):
391+
def load_css_file(style_sheet_path, priority, required=True):
392+
if not os.path.isfile(style_sheet_path):
393+
if required:
394+
logging.warning("Failed loading required stylesheet")
395+
return
396+
392397
css_provider = Gtk.CssProvider()
393398
css_provider.load_from_path(style_sheet_path)
394399

0 commit comments

Comments
 (0)