Display period times in Image Configurator, Changelog

This commit is contained in:
2023-08-25 19:55:39 +02:00
parent 78a925ff8a
commit d433ab579d
5 changed files with 232 additions and 22 deletions

View File

@@ -1,3 +1,9 @@
# Version 1.4
- Log System
- Bugfixes
- Display times in Image Configurator
- Display time of last location update in Preferences
# Version 1.3 # Version 1.3
- Adding option to stretch the image over multiple displays - Adding option to stretch the image over multiple displays

View File

@@ -93,6 +93,16 @@ CinnamonDynamicWallpaperExtension.prototype = {
this.bindSettings("etr_img_night_twilight", "img_night_twilight", this.settingsUpdated) this.bindSettings("etr_img_night_twilight", "img_night_twilight", this.settingsUpdated)
this.bindSettings("etr_img_night", "img_night", this.settingsUpdated) this.bindSettings("etr_img_night", "img_night", this.settingsUpdated)
this.bindSettings("etr_morning_twilight_times", "img_morning_twilight_times")
this.bindSettings("etr_sunrise_times", "img_sunrise_times")
this.bindSettings("etr_morning_times", "img_morning_times")
this.bindSettings("etr_noon_times", "img_noon_times")
this.bindSettings("etr_afternoon_times", "img_afternoon_times")
this.bindSettings("etr_evening_times", "img_evening_times")
this.bindSettings("etr_sunset_times", "img_sunset_times")
this.bindSettings("etr_night_twilight_times", "img_night_twilight_times")
this.bindSettings("etr_night_times", "img_night_times")
// Check for the first startup // Check for the first startup
if (this.settings.getValue("first_start")) { if (this.settings.getValue("first_start")) {
@@ -273,6 +283,17 @@ CinnamonDynamicWallpaperExtension.prototype = {
return time.getHours().toString().padStart(2, "0") + ":" + time.getMinutes().toString().padStart(2, "0") return time.getHours().toString().padStart(2, "0") + ":" + time.getMinutes().toString().padStart(2, "0")
} }
this.img_morning_twilight_times = convertToTimeString(timesArray[0][0]) + " - " + convertToTimeString(timesArray[0][1])
this.img_sunrise_times = convertToTimeString(timesArray[1][0]) + " - " + convertToTimeString(timesArray[1][1])
this.img_morning_times = convertToTimeString(timesArray[2][0]) + " - " + convertToTimeString(timesArray[2][1])
this.img_noon_times = convertToTimeString(timesArray[3][0]) + " - " + convertToTimeString(timesArray[3][1])
this.img_afternoon_times = convertToTimeString(timesArray[4][0]) + " - " + convertToTimeString(timesArray[4][1])
this.img_evening_times = convertToTimeString(timesArray[5][0]) + " - " + convertToTimeString(timesArray[5][1])
this.img_sunset_times = convertToTimeString(timesArray[6][0]) + " - " + convertToTimeString(timesArray[6][1])
this.img_night_twilight_times = convertToTimeString(timesArray[7][0]) + " - " + convertToTimeString(timesArray[7][1])
this.img_night_times = convertToTimeString(timesArray[8][0]) + " - " + convertToTimeString(timesArray[8][1])
this.tvTimes = this.tvTimes =
"Morning Twilight:\t\t" + convertToTimeString(timesArray[0][0]) + " - " + convertToTimeString(timesArray[0][1]) + "Morning Twilight:\t\t" + convertToTimeString(timesArray[0][0]) + " - " + convertToTimeString(timesArray[0][1]) +
"\nSunrise:\t\t\t\t" + convertToTimeString(timesArray[1][0]) + " - " + convertToTimeString(timesArray[1][1]) + "\nSunrise:\t\t\t\t" + convertToTimeString(timesArray[1][0]) + " - " + convertToTimeString(timesArray[1][1]) +

View File

@@ -250,6 +250,18 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<child>
<object class="GtkLabel" id="lb_times_1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkImage" id="img_preview_1"> <object class="GtkImage" id="img_preview_1">
<property name="width-request">300</property> <property name="width-request">300</property>
@@ -263,7 +275,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -275,7 +287,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </object>
@@ -317,6 +329,18 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<child>
<object class="GtkLabel" id="lb_times_2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkImage" id="img_preview_2"> <object class="GtkImage" id="img_preview_2">
<property name="width-request">300</property> <property name="width-request">300</property>
@@ -329,7 +353,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -340,7 +364,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </object>
@@ -382,6 +406,18 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<child>
<object class="GtkLabel" id="lb_times_3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkImage" id="img_preview_3"> <object class="GtkImage" id="img_preview_3">
<property name="width-request">300</property> <property name="width-request">300</property>
@@ -394,7 +430,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -406,7 +442,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </object>
@@ -448,6 +484,18 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<child>
<object class="GtkLabel" id="lb_times_4">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkImage" id="img_preview_4"> <object class="GtkImage" id="img_preview_4">
<property name="width-request">300</property> <property name="width-request">300</property>
@@ -460,7 +508,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -471,7 +519,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </object>
@@ -513,6 +561,18 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<child>
<object class="GtkLabel" id="lb_times_5">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkImage" id="img_preview_5"> <object class="GtkImage" id="img_preview_5">
<property name="width-request">300</property> <property name="width-request">300</property>
@@ -525,7 +585,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -537,7 +597,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </object>
@@ -579,6 +639,18 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<child>
<object class="GtkLabel" id="lb_times_6">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkImage" id="img_preview_6"> <object class="GtkImage" id="img_preview_6">
<property name="width-request">300</property> <property name="width-request">300</property>
@@ -591,7 +663,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -603,7 +675,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </object>
@@ -645,6 +717,18 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<child>
<object class="GtkLabel" id="lb_times_7">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkImage" id="img_preview_7"> <object class="GtkImage" id="img_preview_7">
<property name="width-request">300</property> <property name="width-request">300</property>
@@ -657,7 +741,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -669,7 +753,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </object>
@@ -711,6 +795,18 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<child>
<object class="GtkLabel" id="lb_times_8">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkImage" id="img_preview_8"> <object class="GtkImage" id="img_preview_8">
<property name="width-request">300</property> <property name="width-request">300</property>
@@ -723,7 +819,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -735,7 +831,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </object>
@@ -777,6 +873,18 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<child>
<object class="GtkLabel" id="lb_times_9">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkImage" id="img_preview_9"> <object class="GtkImage" id="img_preview_9">
<property name="width-request">300</property> <property name="width-request">300</property>
@@ -789,7 +897,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -801,7 +909,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </object>

View File

@@ -21,7 +21,19 @@ class WindowHandler:
########### Class variables ########### ########### Class variables ###########
self.pref_path = pref_path self.pref_path = pref_path
self.pref_vars = [ self.time_values = [
"etr_morning_twilight_times",
"etr_sunrise_times",
"etr_morning_times",
"etr_noon_times",
"etr_afternoon_times",
"etr_evening_times",
"etr_sunset_times",
"etr_night_twilight_times",
"etr_night_times"
]
self.img_values = [
"etr_img_morning_twilight", "etr_img_morning_twilight",
"etr_img_sunrise", "etr_img_sunrise",
"etr_img_morning", "etr_img_morning",
@@ -70,6 +82,18 @@ class WindowHandler:
self.lb_heic_file = self.builder.get_object("lb_heic_file") self.lb_heic_file = self.builder.get_object("lb_heic_file")
self.fc_heic_file = self.builder.get_object("fc_heic_file") self.fc_heic_file = self.builder.get_object("fc_heic_file")
self.lb_times = [
self.builder.get_object("lb_times_1"),
self.builder.get_object("lb_times_2"),
self.builder.get_object("lb_times_3"),
self.builder.get_object("lb_times_4"),
self.builder.get_object("lb_times_5"),
self.builder.get_object("lb_times_6"),
self.builder.get_object("lb_times_7"),
self.builder.get_object("lb_times_8"),
self.builder.get_object("lb_times_9")
]
self.img_previews = [ self.img_previews = [
self.builder.get_object("img_preview_1"), self.builder.get_object("img_preview_1"),
self.builder.get_object("img_preview_2"), self.builder.get_object("img_preview_2"),
@@ -148,7 +172,8 @@ class WindowHandler:
self.cb_image_set.set_active(i) self.cb_image_set.set_active(i)
for i, val in enumerate(self.pref_vars): for i, val in enumerate(self.img_values):
# Bugfix: Load the images only, if there is choosen one
if pref_data[val]['value'] != None: if pref_data[val]['value'] != None:
# Set the preview image # Set the preview image
self.changePreviewImage(i, IMAGE_SELECTED_DIR + pref_data[val]['value']) self.changePreviewImage(i, IMAGE_SELECTED_DIR + pref_data[val]['value'])
@@ -163,6 +188,10 @@ class WindowHandler:
else: else:
self.image_source = Source.SET self.image_source = Source.SET
# Print the times of the day
for i, val in enumerate(self.time_values):
self.lb_times[i].set_text(pref_data[val]['value'])
def writeToSettings(self): def writeToSettings(self):
""" Save preferences to the Cinnamon preference file """ Save preferences to the Cinnamon preference file
@@ -176,12 +205,12 @@ class WindowHandler:
if self.image_source == Source.SET: if self.image_source == Source.SET:
pref_data["etr_choosen_image_set"]["value"] = self.cb_image_set.get_active_text() pref_data["etr_choosen_image_set"]["value"] = self.cb_image_set.get_active_text()
for i, val in enumerate(self.pref_vars): for i, val in enumerate(self.img_values):
pref_data[val]['value'] = str(i + 1) + ".jpg" pref_data[val]['value'] = str(i + 1) + ".jpg"
else: else:
pref_data["etr_choosen_image_set"]["value"] = "custom" pref_data["etr_choosen_image_set"]["value"] = "custom"
for i, val in enumerate(self.pref_vars): for i, val in enumerate(self.img_values):
image_name = self.cb_previews[i].get_active_text() image_name = self.cb_previews[i].get_active_text()
pref_data[val]['value'] = image_name pref_data[val]['value'] = image_name

View File

@@ -267,5 +267,51 @@
"first_start": { "first_start": {
"type": "generic", "type": "generic",
"default": true "default": true
},
"etr_morning_twilight_times": {
"type": "entry",
"default": "",
"description": ""
},
"etr_sunrise_times": {
"type": "entry",
"default": "",
"description": ""
},
"etr_morning_times": {
"type": "entry",
"default": "",
"description": ""
},
"etr_noon_times": {
"type": "entry",
"default": "",
"description": ""
},
"etr_afternoon_times": {
"type": "entry",
"default": "",
"description": ""
},
"etr_evening_times": {
"type": "entry",
"default": "",
"description": ""
},
"etr_sunset_times": {
"type": "entry",
"default": "",
"description": ""
},
"etr_night_twilight_times": {
"type": "entry",
"default": "",
"description": ""
},
"etr_night_times": {
"type": "entry",
"default": "",
"description": ""
} }
} }