Adding OK button, bugfixes
This commit is contained in:
@@ -60,7 +60,7 @@ CinnamonDynamicWallpaperExtension.prototype = {
|
||||
this.settings = new Settings.ExtensionSettings(this, uuid);
|
||||
|
||||
// Check for the first startup
|
||||
if (!this.settings.getValue("first_start")) {
|
||||
if (this.settings.getValue("first_start")) {
|
||||
|
||||
// Welcome notification
|
||||
this.showNotification("Welcome to Cinnamon Dynamic Wallpaper",
|
||||
|
||||
@@ -29,7 +29,7 @@ class Loop():
|
||||
self.start_times = suntimes.day_periods
|
||||
|
||||
# Position is given by user
|
||||
elif self.prefs.prefs[PrefenceEnums.PERIOD_SOURCE] == PeriodSourceEnum.CUSTOMLOCATION:
|
||||
elif self.prefs.period_source == PeriodSourceEnum.CUSTOMLOCATION:
|
||||
suntimes.calc_suntimes(float(self.prefs.latitude_custom), float(self.prefs.longitude_custom))
|
||||
self.start_times = suntimes.day_periods
|
||||
|
||||
|
||||
@@ -2806,6 +2806,20 @@
|
||||
<property name="can-focus">False</property>
|
||||
<property name="stack">stack_main</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
<property name="always-show-image">True</property>
|
||||
<signal name="clicked" handler="on_ok" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
@@ -2818,6 +2832,9 @@
|
||||
<property name="always-show-image">True</property>
|
||||
<signal name="clicked" handler="on_apply" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
@@ -622,6 +622,15 @@ class Preferences:
|
||||
subprocess.Popen(["xdg-open", "https://github.com/TobiZog/cinnamon-dynamic-wallpaper/issues/new"])
|
||||
|
||||
|
||||
def on_ok(self, *args):
|
||||
""" Callback for the OK button in the top bar
|
||||
"""
|
||||
self.on_apply()
|
||||
|
||||
# Close the window
|
||||
self.on_destroy()
|
||||
|
||||
|
||||
def on_apply(self, *args):
|
||||
""" Callback for the Apply button in the top bar
|
||||
"""
|
||||
@@ -632,9 +641,6 @@ class Preferences:
|
||||
loop = Loop()
|
||||
loop.exchange_image()
|
||||
|
||||
# Close the window
|
||||
self.on_destroy()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
Preferences().show()
|
||||
Reference in New Issue
Block a user