From 6a997e494590616adc39cb0a92e55fcfdb76b95f Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 21 Dec 2023 10:31:53 +0100 Subject: [PATCH] Preferences UI --- .../5.4/preferences/preferences.glade | 1844 ++++++++++++++--- .../5.4/preferences/preferences.py | 114 +- 2 files changed, 1623 insertions(+), 335 deletions(-) diff --git a/cinnamon-dynamic-wallpaper@TobiZog/5.4/preferences/preferences.glade b/cinnamon-dynamic-wallpaper@TobiZog/5.4/preferences/preferences.glade index c3c1dae..f6185d5 100644 --- a/cinnamon-dynamic-wallpaper@TobiZog/5.4/preferences/preferences.glade +++ b/cinnamon-dynamic-wallpaper@TobiZog/5.4/preferences/preferences.glade @@ -9,6 +9,16 @@ 5 10 + + 23 + 1 + 10 + + + 59 + 1 + 10 + *.heic @@ -18,7 +28,7 @@ False center 1024 - 600 + 400 center @@ -42,7 +52,7 @@ False start 64 - Behaviour + Image Source @@ -54,32 +64,34 @@ - + True False - 64 - 64 - none - False + center + True + expand - - 36 + True True + True + True False - 12 - 12 - 12 - 12 + 8 + 8 + 8 + 8 + vertical + 4 - + True False - start - Expand image over all displays + applications-graphics + 6 False @@ -88,13 +100,13 @@ - + True - True - end + False + Image Set - True + False True 1 @@ -102,32 +114,119 @@ + + True + True + 0 + + + + + True + True + True + + + + True + False + 8 + 8 + 8 + 8 + vertical + 4 + + + True + False + preferences-desktop-wallpaper + 6 + + + False + True + 0 + + + + + True + False + HEIC file + + + False + True + 1 + + + + + + + True + True + 1 + + + + + True + True + True + + + + True + False + 8 + 8 + 8 + 8 + vertical + 4 + + + True + False + folder-open + 6 + + + False + True + 0 + + + + + True + False + Source Folder + + + False + True + 1 + + + + + + + True + True + 2 + False True - 3 1 - - - True - False - start - 64 - Image Source - - - - - - False - True - 2 - - True @@ -137,169 +236,7 @@ none False - - True - True - - - True - False - center - True - expand - - - True - True - True - - - - True - False - 8 - 8 - 8 - 8 - vertical - - - True - False - applications-graphics - 6 - - - False - True - 0 - - - - - True - False - Image Set - - - False - True - 1 - - - - - - - True - True - 0 - - - - - True - True - True - - - - True - False - 8 - 8 - 8 - 8 - vertical - - - True - False - preferences-desktop-wallpaper - 6 - - - False - True - 0 - - - - - True - False - HEIC file - - - False - True - 1 - - - - - - - True - True - 1 - - - - - True - True - True - - - - True - False - 8 - 8 - 8 - 8 - vertical - - - True - False - folder-open - 6 - - - False - True - 0 - - - - - True - False - Source Folder - - - False - True - 1 - - - - - - - True - True - 2 - - - - - - - - + 64 True True @@ -342,7 +279,7 @@ - + 64 True @@ -386,7 +323,7 @@ - + 64 True @@ -434,7 +371,7 @@ False True 3 - 3 + 2 @@ -451,7 +388,7 @@ False True - 4 + 3 @@ -468,6 +405,7 @@ False 8 8 + True True @@ -649,7 +587,7 @@ True False - accessories-dictionary + ../../../time_bar.svg False @@ -664,6 +602,7 @@ False 8 8 + True 200 @@ -842,12 +781,128 @@ + + False + True + 4 + + + + + True + False + start + 64 + Behaviour + + + + False True 5 + + + True + False + 64 + 64 + none + False + + + 36 + True + True + + + True + False + 12 + 12 + 12 + 12 + + + True + False + start + Expand image over all displays + + + False + True + 0 + + + + + True + True + end + + + True + True + 1 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + + + True + False + start + Show image on Lock Screen + + + False + True + 0 + + + + + True + True + end + + + True + True + 1 + + + + + + + + + False + True + 3 + 6 + + image_config @@ -882,33 +937,36 @@ - + True False - 64 - 64 - none - False + center + True + expand - + True True - False + True + True False - 12 - 12 - 12 - 12 - True + 8 + 8 + 8 + 8 + 8 + 8 + vertical + 4 - + True False - start - Determination mode of the day periods + network-wireless + 6 False @@ -917,20 +975,10 @@ - + True False - 0 - True - - Calculate time periods by location - Determe custom time periods - - - - False - - + Use Network Location False @@ -941,6 +989,113 @@ + + True + True + 0 + + + + + True + True + True + + + + True + False + 8 + 8 + 8 + 8 + vertical + 4 + + + True + False + preferences-desktop-keyboard + 6 + + + False + True + 0 + + + + + True + False + Custom Location + + + False + True + 1 + + + + + + + True + True + 1 + + + + + True + True + True + + + + True + False + 8 + 8 + 8 + 8 + 8 + 8 + vertical + 4 + + + True + False + document-open-recent + 6 + + + False + True + 0 + + + + + True + False + Custom Time Periods + + + False + True + 1 + + + + + + + True + True + 2 + @@ -975,31 +1130,17 @@ none False - - True - True - - - True - False - - - - - - - - - - - - + True True True False + 8 + 8 + 8 + 8 True @@ -1031,18 +1172,1062 @@ - + True True True False + 8 + 8 + 8 + 8 + True - + + True + False + start + Latitude + + + False + True + 0 + - + + True + True + + + False + True + 1 + + + + + + + + + True + True + + + True + False + 8 + 8 + 8 + 8 + True + + + True + False + start + Longitude + + + False + True + 0 + + + + + True + True + + + False + True + 1 + + + + + + + + + True + True + + + True + False + True + + + + True + False + + + True + False + Period 1 + + + + + + 0 + 0 + + + + + True + True + 0 + vertical + adjustment_minutes + + + 5 + 0 + + + + + True + False + 8 + 8 + : + + + + + + 4 + 0 + + + + + True + True + 8 + 8 + vertical + adjustment_hours + + + 3 + 0 + + + + + True + True + 0 + vertical + adjustment_minutes + + + 5 + 1 + + + + + True + True + 12 + vertical + adjustment_hours + 12 + + + 3 + 1 + + + + + True + True + 0 + vertical + adjustment_minutes + + + 5 + 2 + + + + + True + True + 0 + vertical + adjustment_minutes + + + 5 + 3 + + + + + True + True + 0 + vertical + adjustment_minutes + + + 5 + 4 + + + + + True + True + 12 + vertical + adjustment_hours + 12 + + + 3 + 2 + + + + + True + True + 12 + vertical + adjustment_hours + 12 + + + 3 + 3 + + + + + True + True + 12 + vertical + adjustment_hours + 12 + + + 3 + 4 + + + + + True + False + 8 + 8 + 8 + 8 + : + + + + + + 4 + 1 + + + + + True + False + 8 + 8 + 8 + 8 + : + + + + + + 4 + 2 + + + + + True + False + 8 + 8 + 8 + 8 + : + + + + + + 4 + 3 + + + + + True + False + 8 + 8 + 8 + 8 + : + + + + + + 4 + 4 + + + + + True + False + 8 + 8 + 8 + 8 + 00:00 + + + + + + 1 + 0 + + + + + True + False + 8 + 8 + 8 + 8 + 00:00 + + + + + + 1 + 1 + + + + + True + False + 8 + 8 + 8 + 8 + 00:00 + + + + + + 1 + 2 + + + + + True + False + 8 + 8 + 8 + 8 + 00:00 + + + + + + 1 + 3 + + + + + True + False + 8 + 8 + 8 + 8 + 00:00 + + + + + + 1 + 4 + + + + + True + False + 8 + 8 + 8 + 8 + - + + + + + + 2 + 0 + + + + + True + False + 8 + 8 + 8 + 8 + - + + + + + + 2 + 1 + + + + + True + False + 8 + 8 + 8 + 8 + - + + + + + + 2 + 2 + + + + + True + False + 8 + 8 + 8 + 8 + - + + + + + + 2 + 3 + + + + + True + False + 8 + 8 + 8 + 8 + - + + + + + + 2 + 4 + + + + + True + False + Period 2 + + + + + + 0 + 1 + + + + + True + False + Period 3 + + + + + + 0 + 2 + + + + + True + False + Period 4 + + + + + + 0 + 3 + + + + + True + False + Period 5 + + + + + + 0 + 4 + + + + + False + True + 0 + + + + + + True + False + + + True + True + 0 + vertical + adjustment_minutes + + + 5 + 0 + + + + + True + True + 0 + vertical + adjustment_hours + + + 3 + 0 + + + + + True + False + 8 + 8 + 00:00 + + + + + + 1 + 0 + + + + + True + False + 8 + 8 + - + + + + + + 2 + 0 + + + + + True + False + 8 + 8 + 8 + 8 + : + + + + + + 4 + 0 + + + + + True + False + 8 + 8 + 8 + 8 + : + + + + + + 4 + 1 + + + + + True + False + 8 + 8 + 8 + 8 + : + + + + + + 4 + 2 + + + + + True + False + 8 + 8 + 8 + 8 + : + + + + + + 4 + 3 + + + + + True + False + 8 + 8 + 8 + 8 + : + + + + + + 4 + 4 + + + + + True + False + 8 + 8 + 8 + 8 + - + + + + + + 2 + 1 + + + + + True + False + 8 + 8 + 8 + 8 + - + + + + + + 2 + 2 + + + + + True + False + 8 + 8 + 8 + 8 + - + + + + + + 2 + 3 + + + + + True + False + 8 + 8 + 8 + 8 + - + + + + + + 2 + 4 + + + + + True + True + 0 + vertical + adjustment_minutes + + + 5 + 1 + + + + + True + True + 12 + vertical + adjustment_hours + 12 + + + 3 + 1 + + + + + True + True + 0 + vertical + adjustment_minutes + + + 5 + 2 + + + + + True + True + 0 + vertical + adjustment_minutes + + + 5 + 3 + + + + + True + True + 0 + vertical + adjustment_minutes + + + 5 + 4 + + + + + True + True + 12 + vertical + adjustment_hours + 12 + + + 3 + 3 + + + + + True + True + 12 + vertical + adjustment_hours + 12 + + + 3 + 2 + + + + + True + True + 12 + vertical + adjustment_hours + 12 + + + 3 + 4 + + + + + True + False + 8 + 8 + 8 + 8 + 00:00 + + + + + + 1 + 1 + + + + + True + False + 8 + 8 + 8 + 8 + 00:00 + + + + + + 1 + 2 + + + + + True + False + 8 + 8 + 8 + 8 + 00:00 + + + + + + 1 + 3 + + + + + True + False + 8 + 8 + 8 + 8 + 00:00 + + + + + + 1 + 4 + + + + + True + False + Period 6 + + + + + + 0 + 0 + + + + + True + False + Period 7 + + + + + + 0 + 1 + + + + + True + False + Period 8 + + + + + + 0 + 2 + + + + + True + False + Period 9 + + + + + + 0 + 3 + + + + + True + False + Period 10 + + + + + + 0 + 4 + + + + + False + True + 1 + @@ -1055,9 +2240,6 @@ 3 - - - location_times @@ -1105,28 +2287,16 @@ True True - + True False 12 12 12 12 - vertical - - - True - False - Based on a location or by user choice, this extensions calculates the periods of a day and switches the background image of your Cinnamon desktop. The extension offers as image sources a set of preconfigured wallpapers, a heic image import by the user or a custom folder with single images. - True - 0 - - - False - True - 0 - - + Based on a location or by user choice, this extensions calculates the periods of a day and switches the background image of your Cinnamon desktop. The extension offers as image sources a set of preconfigured wallpapers, a heic image import by the user or a custom folder with single images. + True + 0 @@ -1136,26 +2306,14 @@ True True - + True False 12 12 12 12 - vertical - - - True - False - Developed by TobiZog - - - False - True - 0 - - + Developed by TobiZog @@ -1165,16 +2323,14 @@ True True - + True - True - - - True - False - If you need more information or want to rate the extension, you can visit the Cinnamon Spices Website. - - + False + 12 + 12 + 12 + 12 + If you need more information or want to rate the extension, you can visit the Cinnamon Spices Website. @@ -1189,19 +2345,15 @@ True True True + 12 + 12 + 12 + 12 + - - - True - True - - - - - False @@ -1242,6 +2394,10 @@ True False + 12 + 12 + 12 + 12 This project is Open Source. You can take a look inside the whole source code of this extension on GitHub. @@ -1257,6 +2413,11 @@ True True True + 12 + 12 + 12 + 12 + @@ -1268,6 +2429,76 @@ 3 + + + True + False + start + 64 + Issues and Enhancements + + + + + + False + True + 4 + + + + + True + False + 64 + 64 + none + False + + + True + True + + + True + False + 12 + 12 + 12 + 12 + Do you find an issue? Or want a new feature? Go to the GitHub repository and create a new issue. If you find an error message in the logs above, add it to the issue report. + + + + + + + True + True + + + Create a new issue on GitHub + True + True + True + 12 + 12 + 12 + 12 + 12 + 12 + + + + + + + + False + True + 5 + + about @@ -1296,6 +2527,7 @@ True True True + False True True diff --git a/cinnamon-dynamic-wallpaper@TobiZog/5.4/preferences/preferences.py b/cinnamon-dynamic-wallpaper@TobiZog/5.4/preferences/preferences.py index e21047e..dbaf6f3 100644 --- a/cinnamon-dynamic-wallpaper@TobiZog/5.4/preferences/preferences.py +++ b/cinnamon-dynamic-wallpaper@TobiZog/5.4/preferences/preferences.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 # Imports -import gi, os +import gi, os, subprocess from time_bar import create_bar_chart gi.require_version("Gtk", "3.0") @@ -24,15 +24,26 @@ class Preferences: self.builder.connect_signals(self) - # UI objects - self.buttonImageSet = self.builder.get_object("tb_image") - self.buttonHeicFile = self.builder.get_object("tb_heic") - self.buttonSourceFolder = self.builder.get_object("tb_folder") - self.listBoxRowImageSet = self.builder.get_object("lbr_image") - self.listBoxRowHeicFile = self.builder.get_object("lbr_heic") - self.listBoxRowSourceFolder = self.builder.get_object("lbr_folder") + ########## UI objects ########## + + ## Image Configuration + self.tbImageSet = self.builder.get_object("tb_image_set") + self.tbHeicFile = self.builder.get_object("tb_heic_file") + self.tbSourceFolder = self.builder.get_object("tb_source_folder") + self.lbrImageSet = self.builder.get_object("lbr_image_set") + self.lbrHeicFile = self.builder.get_object("lbr_heic_file") + self.lbrSourceFolder = self.builder.get_object("lbr_source_folder") self.imgBar = self.builder.get_object("img_bar") + ## Location & Times + self.tbNetworkLocation = self.builder.get_object("tb_network_location") + self.tbCustomLocation = self.builder.get_object("tb_custom_location") + self.tbTimePeriods = self.builder.get_object("tb_time_periods") + self.lbrNetworkLocation = self.builder.get_object("lbr_network_location") + self.lbrCustomLocationLongitude = self.builder.get_object("lbr_custom_location_longitude") + self.lbrCustomLocationLatitude = self.builder.get_object("lbr_custom_location_latitude") + self.lbrTimePeriods = self.builder.get_object("lbr_time_periods") + # Time bar # todo: Sample times @@ -47,7 +58,8 @@ class Preferences: window = self.builder.get_object("window_main") window.show_all() - self.buttonImageSet.set_active(True) + self.tbImageSet.set_active(True) + self.tbNetworkLocation.set_active(True) Gtk.main() @@ -59,33 +71,77 @@ class Preferences: #################### Callbacks #################### - - def onToggleButtonImageClicked(self, button): + + ## Image Configuration + + def onToggleButtonImageSetClicked(self, button): if button.get_active(): - self.buttonHeicFile.set_active(False) - self.buttonSourceFolder.set_active(False) + self.tbHeicFile.set_active(False) + self.tbSourceFolder.set_active(False) - self.listBoxRowImageSet.set_visible(True) - self.listBoxRowHeicFile.set_visible(False) - self.listBoxRowSourceFolder.set_visible(False) - - def onToggleButtonHeicClicked(self, button): + self.lbrImageSet.set_visible(True) + self.lbrHeicFile.set_visible(False) + self.lbrSourceFolder.set_visible(False) + + def onToggleButtonHeicFileClicked(self, button): if button.get_active(): - self.buttonImageSet.set_active(False) - self.buttonSourceFolder.set_active(False) + self.tbImageSet.set_active(False) + self.tbSourceFolder.set_active(False) - self.listBoxRowImageSet.set_visible(False) - self.listBoxRowHeicFile.set_visible(True) - self.listBoxRowSourceFolder.set_visible(False) + self.lbrImageSet.set_visible(False) + self.lbrHeicFile.set_visible(True) + self.lbrSourceFolder.set_visible(False) - def onToggleButtonFolderClicked(self, button): + def onToggleButtonSourceFolderClicked(self, button): if button.get_active(): - self.buttonImageSet.set_active(False) - self.buttonHeicFile.set_active(False) + self.tbImageSet.set_active(False) + self.tbHeicFile.set_active(False) - self.listBoxRowImageSet.set_visible(False) - self.listBoxRowHeicFile.set_visible(False) - self.listBoxRowSourceFolder.set_visible(True) + self.lbrImageSet.set_visible(False) + self.lbrHeicFile.set_visible(False) + self.lbrSourceFolder.set_visible(True) + + + ## Location & Times + + def onToggleButtonNetworkLocationClicked(self, button): + if button.get_active(): + self.tbCustomLocation.set_active(False) + self.tbTimePeriods.set_active(False) + + self.lbrNetworkLocation.set_visible(True) + self.lbrCustomLocationLongitude.set_visible(False) + self.lbrCustomLocationLatitude.set_visible(False) + self.lbrTimePeriods.set_visible(False) + + def onToggleButtonCustomLocationClicked(self, button): + if button.get_active(): + self.tbNetworkLocation.set_active(False) + self.tbTimePeriods.set_active(False) + + self.lbrNetworkLocation.set_visible(False) + self.lbrCustomLocationLongitude.set_visible(True) + self.lbrCustomLocationLatitude.set_visible(True) + self.lbrTimePeriods.set_visible(False) + + def onToggleButtonTimePeriodsClicked(self, button): + if button.get_active(): + self.tbNetworkLocation.set_active(False) + self.tbCustomLocation.set_active(False) + + self.lbrNetworkLocation.set_visible(False) + self.lbrCustomLocationLongitude.set_visible(False) + self.lbrCustomLocationLatitude.set_visible(False) + self.lbrTimePeriods.set_visible(True) + + def onCinnamonSpicesWebsiteButtonClicked(self, button): + subprocess.Popen(["xdg-open", "https://cinnamon-spices.linuxmint.com/extensions/view/97"]) + + def onGithubWebsiteButtonClicked(self, button): + subprocess.Popen(["xdg-open", "https://github.com/TobiZog/cinnamon-dynamic-wallpaper"]) + + def onCreateIssueButtonClicked(self, button): + subprocess.Popen(["xdg-open", "https://github.com/TobiZog/cinnamon-dynamic-wallpaper/issues/new"])