Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent the use of non-image files as a background image #2206

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion guake/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +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):
# 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() else ""
"background-image-file", filename
)

def on_background_image_file_remove_clicked(self, btn):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
release_summary: >
Prevent the use of non-image files as the background image. The following file extensions are allowed: .jpg, .jpeg, .png, .gif


fixes:
- |

- Prevent users from setting non-image files as a background image, closes #2205
Loading