Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
0scvr committed Oct 9, 2023
1 parent 8820d8a commit c83db5b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions guake/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,14 @@ def on_font_style_font_set(self, fbtn):
self.settings.styleFont.set_string("style", fbtn.get_font_name())

def on_background_image_file_chooser_file_changed(self, fc):
allowed_extensions = (".jpg", ".jpeg", ".png", ".gif") # only allow files with these extensions
# only allow files with these extensions
allowed_extensions = (".jpg", ".jpeg", ".png", ".gif")
filename = ""
if fc.get_filename() and fc.get_filename().endswith(allowed_extensions):
filename = fc.get_filename()

self.settings.general.set_string(
"background-image-file", fc.get_filename() if fc.get_filename() and fc.get_filename().endswith(allowed_extensions) else ""
"background-image-file", filename
)

def on_background_image_file_remove_clicked(self, btn):
Expand Down

0 comments on commit c83db5b

Please sign in to comment.