Follow Night Light "Disable until tomorrow"
This commit is contained in:
@@ -22,12 +22,14 @@ const Signals = imports.signals;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const e = Me.imports.extension;
|
||||
const { logDebug } = Me.imports.utils;
|
||||
|
||||
|
||||
const COLOR_INTERFACE = `
|
||||
<node>
|
||||
<interface name="org.gnome.SettingsDaemon.Color">
|
||||
<property name="DisabledUntilTomorrow" type="b" access="readwrite"/>
|
||||
<property name="NightLightActive" type="b" access="read"/>
|
||||
</interface>
|
||||
</node>`;
|
||||
@@ -43,12 +45,15 @@ var TimerNightlight = class {
|
||||
|
||||
constructor() {
|
||||
this._colorDbusProxy = null;
|
||||
this._nightlightFollowDisableConnect = null;
|
||||
this._nightlightStateConnect = null;
|
||||
this._previousNightlightActive = null;
|
||||
}
|
||||
|
||||
enable() {
|
||||
logDebug('Enabling Night Light Timer...');
|
||||
this._connectToColorDbusProxy();
|
||||
this._connectSettings();
|
||||
this._listenToNightlightState();
|
||||
this.emit('time-changed', this.time);
|
||||
logDebug('Night Light Timer enabled.');
|
||||
@@ -57,6 +62,7 @@ var TimerNightlight = class {
|
||||
disable() {
|
||||
logDebug('Disabling Night Light Timer...');
|
||||
this._stopListeningToNightlightState();
|
||||
this._disconnectSettings();
|
||||
this._disconnectFromColorDbusProxy();
|
||||
logDebug('Night Light Timer disabled.');
|
||||
}
|
||||
@@ -84,6 +90,19 @@ var TimerNightlight = class {
|
||||
logDebug('Disconnected from Color DBus proxy.');
|
||||
}
|
||||
|
||||
_connectSettings() {
|
||||
logDebug('Connecting Night Light Timer to settings...');
|
||||
this._nightlightFollowDisableConnect = e.settings.time.connect('nightlight-follow-disable-changed', this._onNightlightFollowDisableChanged.bind(this));
|
||||
}
|
||||
|
||||
_disconnectSettings() {
|
||||
logDebug('Disconnecting Night Light Timer from settings...');
|
||||
if (this._nightlightFollowDisableConnect) {
|
||||
e.settings.time.disconnect(this._nightlightFollowDisableConnect);
|
||||
this._nightlightFollowDisableConnect = null;
|
||||
}
|
||||
}
|
||||
|
||||
_listenToNightlightState() {
|
||||
logDebug('Listening to Night Light state...');
|
||||
this._nightlightStateConnect = this._colorDbusProxy.connect(
|
||||
@@ -97,16 +116,24 @@ var TimerNightlight = class {
|
||||
logDebug('Stopped listening to Night Light state.');
|
||||
}
|
||||
|
||||
_onNightlightStateChanged(_sender, dbusProperties) {
|
||||
const properties = dbusProperties.deep_unpack();
|
||||
if (properties.NightLightActive) {
|
||||
logDebug(`Night Light has become ${properties.NightLightActive.unpack() ? '' : 'in'}active.`);
|
||||
|
||||
_onNightlightFollowDisableChanged(_settings, _value) {
|
||||
this._onNightlightStateChanged();
|
||||
}
|
||||
|
||||
_onNightlightStateChanged(_sender, _dbusProperties) {
|
||||
if (this._isNightlightActive() !== this._previousNightlightActive) {
|
||||
logDebug(`Night Light has become ${this._isNightlightActive() ? '' : 'in'}active.`);
|
||||
this._previousNightlightActive = this._isNightlightActive();
|
||||
this.emit('time-changed', this.time);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_isNightlightActive() {
|
||||
return this._colorDbusProxy.NightLightActive;
|
||||
return e.settings.time.nightlightFollowDisable
|
||||
? !this._colorDbusProxy.DisabledUntilTomorrow && this._colorDbusProxy.NightLightActive
|
||||
: this._colorDbusProxy.NightLightActive;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
+62
-39
@@ -7,16 +7,16 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Night Theme Switcher 7\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-09-24 13:12+0200\n"
|
||||
"PO-Revision-Date: 2020-09-23 20:13+0200\n"
|
||||
"POT-Creation-Date: 2020-11-04 11:00+0100\n"
|
||||
"PO-Revision-Date: 2020-11-04 11:02+0100\n"
|
||||
"Last-Translator: Romain Vigier <romain@romainvigier.fr>\n"
|
||||
"Language-Team: French - France <romain@romainvigier.fr>\n"
|
||||
"Language: fr_FR\n"
|
||||
"Language-Team: French <romain@romainvigier.fr>\n"
|
||||
"Language: fr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||
"X-Generator: Gtranslator 3.36.0\n"
|
||||
"X-Generator: Gtranslator 3.38.0\n"
|
||||
|
||||
#: src/modules/GtkThemer.js:179
|
||||
#, javascript-format
|
||||
@@ -39,11 +39,11 @@ msgstr ""
|
||||
"pour le thème GNOME Shell \"%s\". Veuillez les sélectionner manuellement "
|
||||
"dans les préférences de l’extension."
|
||||
|
||||
#: src/modules/TimerOndemand.js:167
|
||||
#: src/modules/TimerOndemand.js:185
|
||||
msgid "Switch to night theme"
|
||||
msgstr "Passer au thème nocturne"
|
||||
|
||||
#: src/modules/TimerOndemand.js:167
|
||||
#: src/modules/TimerOndemand.js:185
|
||||
msgid "Switch to day theme"
|
||||
msgstr "Passer au thème diurne"
|
||||
|
||||
@@ -73,7 +73,7 @@ msgstr "Thème d’icônes"
|
||||
msgid "Schedule"
|
||||
msgstr "Horaires"
|
||||
|
||||
#: src/preferences/Schedule.js:193 src/preferences/ui/schedule.ui:595
|
||||
#: src/preferences/Schedule.js:204 src/preferences/ui/schedule.ui:741
|
||||
msgid "Choose"
|
||||
msgstr "Choisir"
|
||||
|
||||
@@ -310,62 +310,72 @@ msgstr "Source d’horaires"
|
||||
msgid "The source used to check current time"
|
||||
msgstr "Source utilisée pour vérifier les horaires"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:140
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:136
|
||||
msgid "Follow Night Light \"Disable until tomorrow\""
|
||||
msgstr "Suivre \"Désactivé jusqu’à demain\" du mode nuit"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:137
|
||||
msgid "Switch back to day time when Night Light is temporarily disabled"
|
||||
msgstr ""
|
||||
"Permuter vers les variantes diurnes lorsque le mode nuit est désactivé "
|
||||
"temporairement"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:145
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:91
|
||||
msgid "On-demand time"
|
||||
msgstr "Temps à la demande"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:141
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:146
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:92
|
||||
msgid "The current time used in on-demand mode"
|
||||
msgstr "Le temps actuel utilisé dans le mode à la demande"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:145
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:150
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:96
|
||||
msgid "Key combination to toggle time"
|
||||
msgstr "Combinaison de touches pour permuter le temps"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:146
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:151
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:97
|
||||
msgid "The key combination that will toggle time in on-demand mode"
|
||||
msgstr "La combinaison de touches qui permutera le temps en mode à la demande"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:155
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:160
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:106
|
||||
msgid "On-demand button placement"
|
||||
msgstr "Emplacement du bouton à la demande"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:156
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:161
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:107
|
||||
msgid "Where the on-demand button will be placed"
|
||||
msgstr "Où le bouton du changement à la demande sera placé"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:160
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:165
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:111
|
||||
msgid "Use manual time source"
|
||||
msgstr "Utiliser une source d’horaires manuelle"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:161
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:166
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:112
|
||||
msgid "Disable automatic time source detection"
|
||||
msgstr "Désactive la détection automatique de la source d’horaires"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:165
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:170
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:116
|
||||
msgid "Sunrise time"
|
||||
msgstr "Heure du lever"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:166
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:171
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:117
|
||||
msgid "When the day starts"
|
||||
msgstr "Quand le jour se lève"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:170
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:175
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:121
|
||||
msgid "Sunset time"
|
||||
msgstr "Heure du coucher"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:171
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:176
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:122
|
||||
msgid "When the day ends"
|
||||
msgstr "Quand le jour se couche"
|
||||
@@ -380,7 +390,7 @@ msgstr "Sélectionnez votre image d’arrière-plan"
|
||||
|
||||
#: src/preferences/ui/backgrounds.ui:220 src/preferences/ui/backgrounds.ui:312
|
||||
#: src/preferences/ui/commands.ui:206 src/preferences/ui/commands.ui:300
|
||||
#: src/preferences/ui/schedule.ui:610
|
||||
#: src/preferences/ui/schedule.ui:756
|
||||
msgid "Clear"
|
||||
msgstr "Effacer"
|
||||
|
||||
@@ -441,7 +451,7 @@ msgid "Press your keyboard shortcut..."
|
||||
msgstr "Pressez votre raccourci clavier…"
|
||||
|
||||
#: src/preferences/ui/ondemand_keyboard_shortcut_dialog.ui:76
|
||||
#: src/preferences/ui/schedule.ui:581
|
||||
#: src/preferences/ui/schedule.ui:727
|
||||
msgid "Keyboard shortcut"
|
||||
msgstr "Raccourci clavier"
|
||||
|
||||
@@ -449,11 +459,11 @@ msgstr "Raccourci clavier"
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:82
|
||||
#: src/preferences/ui/schedule.ui:98
|
||||
msgid "Automatic time source"
|
||||
msgstr "Source d’horaires automatique"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:95
|
||||
#: src/preferences/ui/schedule.ui:111
|
||||
msgid ""
|
||||
"<small>The extension will try to use Night Light or Location Services to "
|
||||
"automatically set your current sunrise and sunset times if they are enabled. "
|
||||
@@ -464,60 +474,73 @@ msgstr ""
|
||||
"lever et de coucher du soleil. Si vous préférez, vous pouvez choisir "
|
||||
"manuellement une source d’horaires.</small>"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:158
|
||||
#: src/preferences/ui/schedule.ui:174
|
||||
msgid "Manual time source"
|
||||
msgstr "Source d’horaires manuelle"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:178
|
||||
#: src/preferences/ui/schedule.ui:194 src/preferences/ui/schedule.ui:300
|
||||
#: src/preferences/ui/schedule.ui:416
|
||||
msgid "Night Light"
|
||||
msgstr "Mode nuit"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:193
|
||||
#: src/preferences/ui/schedule.ui:209
|
||||
msgid "Location Services"
|
||||
msgstr "Services de localisation"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:208
|
||||
#: src/preferences/ui/schedule.ui:224
|
||||
msgid "Manual schedule"
|
||||
msgstr "Horaire manuel"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:223 src/preferences/ui/schedule.ui:539
|
||||
#: src/preferences/ui/schedule.ui:719
|
||||
#: src/preferences/ui/schedule.ui:239 src/preferences/ui/schedule.ui:685
|
||||
#: src/preferences/ui/schedule.ui:865
|
||||
msgid "On-demand"
|
||||
msgstr "À la demande"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:271
|
||||
#: src/preferences/ui/schedule.ui:287
|
||||
msgid "No preferences"
|
||||
msgstr "Pas de préférences"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:286 src/preferences/ui/schedule.ui:523
|
||||
#: src/preferences/ui/schedule.ui:348
|
||||
msgid "Follow <i>Disable until tomorrow</i>"
|
||||
msgstr "Suivre <i>Désactiver jusqu’à demain</i>"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:362
|
||||
msgid ""
|
||||
"<small>When Night Light is temporarily disabled, the extension will switch "
|
||||
"to day variants.</small>"
|
||||
msgstr ""
|
||||
"<small>Quand le mode nuit est temporairement désactivé, l’extension va "
|
||||
"permuter vers les variantes diurnes.</small>"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:432 src/preferences/ui/schedule.ui:669
|
||||
msgid "Manual schedule times"
|
||||
msgstr "Horaires manuels"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:328
|
||||
#: src/preferences/ui/schedule.ui:474
|
||||
msgid "Sunrise"
|
||||
msgstr "Lever du soleil"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:364 src/preferences/ui/schedule.ui:471
|
||||
#: src/preferences/ui/schedule.ui:510 src/preferences/ui/schedule.ui:617
|
||||
msgid ":"
|
||||
msgstr ":"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:435
|
||||
#: src/preferences/ui/schedule.ui:581
|
||||
msgid "Sunset"
|
||||
msgstr "Coucher du soleil"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:673
|
||||
#: src/preferences/ui/schedule.ui:819
|
||||
msgid "Button location"
|
||||
msgstr "Emplacement du bouton"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:689
|
||||
#: src/preferences/ui/schedule.ui:835
|
||||
msgid "None"
|
||||
msgstr "Aucun"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:690
|
||||
#: src/preferences/ui/schedule.ui:836
|
||||
msgid "Top bar"
|
||||
msgstr "Barre supérieure"
|
||||
|
||||
#: src/preferences/ui/schedule.ui:691
|
||||
#: src/preferences/ui/schedule.ui:837
|
||||
msgid "System menu"
|
||||
msgstr "Menu système"
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Night Theme Switcher 37\n"
|
||||
"Project-Id-Version: Night Theme Switcher 39\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-09-24 13:12+0200\n"
|
||||
"POT-Creation-Date: 2020-11-04 11:00+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -32,11 +32,11 @@ msgid ""
|
||||
"preferences."
|
||||
msgstr ""
|
||||
|
||||
#: src/modules/TimerOndemand.js:167
|
||||
#: src/modules/TimerOndemand.js:185
|
||||
msgid "Switch to night theme"
|
||||
msgstr ""
|
||||
|
||||
#: src/modules/TimerOndemand.js:167
|
||||
#: src/modules/TimerOndemand.js:185
|
||||
msgid "Switch to day theme"
|
||||
msgstr ""
|
||||
|
||||
@@ -66,7 +66,7 @@ msgstr ""
|
||||
msgid "Schedule"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/Schedule.js:193 src/preferences/ui/schedule.ui:595
|
||||
#: src/preferences/Schedule.js:204 src/preferences/ui/schedule.ui:741
|
||||
msgid "Choose"
|
||||
msgstr ""
|
||||
|
||||
@@ -303,62 +303,70 @@ msgstr ""
|
||||
msgid "The source used to check current time"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:140
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:136
|
||||
msgid "Follow Night Light \"Disable until tomorrow\""
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:137
|
||||
msgid "Switch back to day time when Night Light is temporarily disabled"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:145
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:91
|
||||
msgid "On-demand time"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:141
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:146
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:92
|
||||
msgid "The current time used in on-demand mode"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:145
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:150
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:96
|
||||
msgid "Key combination to toggle time"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:146
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:151
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:97
|
||||
msgid "The key combination that will toggle time in on-demand mode"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:155
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:160
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:106
|
||||
msgid "On-demand button placement"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:156
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:161
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:107
|
||||
msgid "Where the on-demand button will be placed"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:160
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:165
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:111
|
||||
msgid "Use manual time source"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:161
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:166
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:112
|
||||
msgid "Disable automatic time source detection"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:165
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:170
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:116
|
||||
msgid "Sunrise time"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:166
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:171
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:117
|
||||
msgid "When the day starts"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:170
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:175
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:121
|
||||
msgid "Sunset time"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:171
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:176
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.v0.gschema.xml:122
|
||||
msgid "When the day ends"
|
||||
msgstr ""
|
||||
@@ -373,7 +381,7 @@ msgstr ""
|
||||
|
||||
#: src/preferences/ui/backgrounds.ui:220 src/preferences/ui/backgrounds.ui:312
|
||||
#: src/preferences/ui/commands.ui:206 src/preferences/ui/commands.ui:300
|
||||
#: src/preferences/ui/schedule.ui:610
|
||||
#: src/preferences/ui/schedule.ui:756
|
||||
msgid "Clear"
|
||||
msgstr ""
|
||||
|
||||
@@ -427,7 +435,7 @@ msgid "Press your keyboard shortcut..."
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/ondemand_keyboard_shortcut_dialog.ui:76
|
||||
#: src/preferences/ui/schedule.ui:581
|
||||
#: src/preferences/ui/schedule.ui:727
|
||||
msgid "Keyboard shortcut"
|
||||
msgstr ""
|
||||
|
||||
@@ -435,71 +443,82 @@ msgstr ""
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:82
|
||||
#: src/preferences/ui/schedule.ui:98
|
||||
msgid "Automatic time source"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:95
|
||||
#: src/preferences/ui/schedule.ui:111
|
||||
msgid ""
|
||||
"<small>The extension will try to use Night Light or Location Services to "
|
||||
"automatically set your current sunrise and sunset times if they are enabled. "
|
||||
"If you prefer, you can manually choose a time source.</small>"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:158
|
||||
#: src/preferences/ui/schedule.ui:174
|
||||
msgid "Manual time source"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:178
|
||||
#: src/preferences/ui/schedule.ui:194 src/preferences/ui/schedule.ui:300
|
||||
#: src/preferences/ui/schedule.ui:416
|
||||
msgid "Night Light"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:193
|
||||
#: src/preferences/ui/schedule.ui:209
|
||||
msgid "Location Services"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:208
|
||||
#: src/preferences/ui/schedule.ui:224
|
||||
msgid "Manual schedule"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:223 src/preferences/ui/schedule.ui:539
|
||||
#: src/preferences/ui/schedule.ui:719
|
||||
#: src/preferences/ui/schedule.ui:239 src/preferences/ui/schedule.ui:685
|
||||
#: src/preferences/ui/schedule.ui:865
|
||||
msgid "On-demand"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:271
|
||||
#: src/preferences/ui/schedule.ui:287
|
||||
msgid "No preferences"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:286 src/preferences/ui/schedule.ui:523
|
||||
#: src/preferences/ui/schedule.ui:348
|
||||
msgid "Follow <i>Disable until tomorrow</i>"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:362
|
||||
msgid ""
|
||||
"<small>When Night Light is temporarily disabled, the extension will switch "
|
||||
"to day variants.</small>"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:432 src/preferences/ui/schedule.ui:669
|
||||
msgid "Manual schedule times"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:328
|
||||
#: src/preferences/ui/schedule.ui:474
|
||||
msgid "Sunrise"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:364 src/preferences/ui/schedule.ui:471
|
||||
#: src/preferences/ui/schedule.ui:510 src/preferences/ui/schedule.ui:617
|
||||
msgid ":"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:435
|
||||
#: src/preferences/ui/schedule.ui:581
|
||||
msgid "Sunset"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:673
|
||||
#: src/preferences/ui/schedule.ui:819
|
||||
msgid "Button location"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:689
|
||||
#: src/preferences/ui/schedule.ui:835
|
||||
msgid "None"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:690
|
||||
#: src/preferences/ui/schedule.ui:836
|
||||
msgid "Top bar"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/ui/schedule.ui:691
|
||||
#: src/preferences/ui/schedule.ui:837
|
||||
msgid "System menu"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -116,6 +116,9 @@ var SchedulePreferences = class {
|
||||
const manualPrefsStack = this._builder.get_object('manual_prefs_stack');
|
||||
const updateManualPrefsStackVisible = () => {
|
||||
switch (settings.time.timeSource) {
|
||||
case 'nightlight':
|
||||
manualPrefsStack.set_visible_child_name('nightlight');
|
||||
break;
|
||||
case 'schedule':
|
||||
manualPrefsStack.set_visible_child_name('schedule_times');
|
||||
break;
|
||||
@@ -129,6 +132,14 @@ var SchedulePreferences = class {
|
||||
settings.time.connect('time-source-changed', () => updateManualPrefsStackVisible());
|
||||
updateManualPrefsStackVisible();
|
||||
|
||||
const nightlightFollowDisableSwitch = this._builder.get_object('nightlight_follow_disable_switch');
|
||||
settings.time.settings.bind(
|
||||
'nightlight-follow-disable',
|
||||
nightlightFollowDisableSwitch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const scheduleTimesSunriseHoursSpin = this._builder.get_object('schedule_times_sunrise_hours_spin');
|
||||
scheduleTimesSunriseHoursSpin.value = Math.trunc(settings.time.scheduleSunrise);
|
||||
scheduleTimesSunriseHoursSpin.connect('output', () => {
|
||||
|
||||
+278
-148
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.36.0
|
||||
<!-- Generated with glade 3.38.1
|
||||
|
||||
Copyright (C) 2020
|
||||
|
||||
@@ -27,57 +27,73 @@ Author: Romain Vigier
|
||||
<!-- interface-name Night Theme Switcher -->
|
||||
<!-- interface-copyright 2020 -->
|
||||
<!-- interface-authors Romain Vigier -->
|
||||
<object class="GtkAdjustment" id="sunrise_hours_adjustment">
|
||||
<property name="upper">23</property>
|
||||
<property name="step-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="sunrise_minutes_adjustment">
|
||||
<property name="upper">59</property>
|
||||
<property name="step-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="sunset_hours_adjustment">
|
||||
<property name="upper">23</property>
|
||||
<property name="step-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="sunset_minutes_adjustment">
|
||||
<property name="upper">59</property>
|
||||
<property name="step-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkBox" id="schedule">
|
||||
<property name="width_request">600</property>
|
||||
<property name="width-request">600</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="margin_left">36</property>
|
||||
<property name="margin_right">36</property>
|
||||
<property name="margin_start">36</property>
|
||||
<property name="margin_end">36</property>
|
||||
<property name="margin_top">36</property>
|
||||
<property name="margin_bottom">36</property>
|
||||
<property name="margin-left">36</property>
|
||||
<property name="margin-right">36</property>
|
||||
<property name="margin-start">36</property>
|
||||
<property name="margin-end">36</property>
|
||||
<property name="margin-top">36</property>
|
||||
<property name="margin-bottom">36</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">30</property>
|
||||
<property name="baseline_position">top</property>
|
||||
<property name="baseline-position">top</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="auto">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label-xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="width-request">600</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="selection-mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="activatable">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">16</property>
|
||||
<property name="margin_right">16</property>
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-left">16</property>
|
||||
<property name="margin-right">16</property>
|
||||
<property name="margin-start">16</property>
|
||||
<property name="margin-end">16</property>
|
||||
<property name="margin-top">16</property>
|
||||
<property name="margin-bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Automatic time source</property>
|
||||
</object>
|
||||
@@ -90,12 +106,12 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes"><small>The extension will try to use Night Light or Location Services to automatically set your current sunrise and sunset times if they are enabled. If you prefer, you can manually choose a time source.</small></property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="use-markup">True</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="max_width_chars">50</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
@@ -117,7 +133,7 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkSwitch" id="auto_switch">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="active">True</property>
|
||||
@@ -147,13 +163,13 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkBox" id="manual">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Manual time source</property>
|
||||
<attributes>
|
||||
@@ -168,19 +184,19 @@ Author: Romain Vigier
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="width-request">600</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="manual_nightlight_radio">
|
||||
<property name="label" translatable="yes">Night Light</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">False</property>
|
||||
<property name="draw-indicator">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@@ -192,9 +208,9 @@ Author: Romain Vigier
|
||||
<object class="GtkRadioButton" id="manual_location_radio">
|
||||
<property name="label" translatable="yes">Location Services</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="draw_indicator">False</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="draw-indicator">False</property>
|
||||
<property name="group">manual_nightlight_radio</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -207,9 +223,9 @@ Author: Romain Vigier
|
||||
<object class="GtkRadioButton" id="manual_schedule_radio">
|
||||
<property name="label" translatable="yes">Manual schedule</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="draw_indicator">False</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="draw-indicator">False</property>
|
||||
<property name="group">manual_nightlight_radio</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -222,9 +238,9 @@ Author: Romain Vigier
|
||||
<object class="GtkRadioButton" id="manual_ondemand_radio">
|
||||
<property name="label" translatable="yes">On-demand</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="draw_indicator">False</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="draw-indicator">False</property>
|
||||
<property name="group">manual_nightlight_radio</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -253,14 +269,14 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkStack" id="manual_prefs_stack">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="vhomogeneous">False</property>
|
||||
<property name="transition_type">crossfade</property>
|
||||
<property name="interpolate_size">True</property>
|
||||
<property name="transition-type">crossfade</property>
|
||||
<property name="interpolate-size">True</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="none">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
@@ -272,16 +288,146 @@ Author: Romain Vigier
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="schedule_times">
|
||||
<property name="width_request">600</property>
|
||||
<object class="GtkBox" id="nightlight">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Night Light</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label-xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkListBox">
|
||||
<property name="width-request">600</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="selection-mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="activatable">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-left">16</property>
|
||||
<property name="margin-right">16</property>
|
||||
<property name="margin-start">16</property>
|
||||
<property name="margin-end">16</property>
|
||||
<property name="margin-top">16</property>
|
||||
<property name="margin-bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Follow <i>Disable until tomorrow</i></property>
|
||||
<property name="use-markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes"><small>When Night Light is temporarily disabled, the extension will switch to day variants.</small></property>
|
||||
<property name="use-markup">True</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="nightlight_follow_disable_switch">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label_item">
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">nightlight</property>
|
||||
<property name="title" translatable="yes">Night Light</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="schedule_times">
|
||||
<property name="width-request">600</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Manual schedule times</property>
|
||||
<attributes>
|
||||
@@ -297,34 +443,34 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label-xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="width-request">600</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="selection-mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="activatable">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">16</property>
|
||||
<property name="margin_right">16</property>
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-left">16</property>
|
||||
<property name="margin-right">16</property>
|
||||
<property name="margin-start">16</property>
|
||||
<property name="margin-end">16</property>
|
||||
<property name="margin-top">16</property>
|
||||
<property name="margin-bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Sunrise</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -336,15 +482,15 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="schedule_times_sunrise_hours_spin">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="max_length">2</property>
|
||||
<property name="width_chars">2</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="max-length">2</property>
|
||||
<property name="width-chars">2</property>
|
||||
<property name="text">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">sunrise_hours_adjustment</property>
|
||||
@@ -360,7 +506,7 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">:</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -372,9 +518,9 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="schedule_times_sunrise_minutes_spin">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="max_length">2</property>
|
||||
<property name="width_chars">2</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="max-length">2</property>
|
||||
<property name="width-chars">2</property>
|
||||
<property name="text">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">sunrise_minutes_adjustment</property>
|
||||
@@ -401,13 +547,13 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="activatable">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -415,23 +561,23 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="activatable">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">16</property>
|
||||
<property name="margin_right">16</property>
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-left">16</property>
|
||||
<property name="margin-right">16</property>
|
||||
<property name="margin-start">16</property>
|
||||
<property name="margin-end">16</property>
|
||||
<property name="margin-top">16</property>
|
||||
<property name="margin-bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Sunset</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -443,15 +589,15 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="schedule_times_sunset_hours_spin">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="max_length">2</property>
|
||||
<property name="width_chars">2</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="max-length">2</property>
|
||||
<property name="width-chars">2</property>
|
||||
<property name="text">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">sunset_hours_adjustment</property>
|
||||
@@ -467,7 +613,7 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">:</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -479,9 +625,9 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="schedule_times_sunset_minutes_spin">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="max_length">2</property>
|
||||
<property name="width_chars">2</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="max-length">2</property>
|
||||
<property name="width-chars">2</property>
|
||||
<property name="text">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">sunset_minutes_adjustment</property>
|
||||
@@ -521,20 +667,20 @@ Author: Romain Vigier
|
||||
<packing>
|
||||
<property name="name">schedule_times</property>
|
||||
<property name="title" translatable="yes">Manual schedule times</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="ondemand">
|
||||
<property name="width_request">600</property>
|
||||
<property name="width-request">600</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">On-demand</property>
|
||||
<attributes>
|
||||
@@ -550,34 +696,34 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label-xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="width-request">600</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="selection-mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="activatable">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">16</property>
|
||||
<property name="margin_right">16</property>
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-left">16</property>
|
||||
<property name="margin-right">16</property>
|
||||
<property name="margin-start">16</property>
|
||||
<property name="margin-end">16</property>
|
||||
<property name="margin-top">16</property>
|
||||
<property name="margin-bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Keyboard shortcut</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -589,13 +735,13 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="ondemand_shortcut_button">
|
||||
<property name="label" translatable="yes">Choose</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
@@ -609,8 +755,8 @@ Author: Romain Vigier
|
||||
<object class="GtkButton" id="ondemand_shortcut_clear_button">
|
||||
<property name="label" translatable="yes">Clear</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
</style>
|
||||
@@ -628,7 +774,7 @@ Author: Romain Vigier
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -639,13 +785,13 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="activatable">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -653,23 +799,23 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="activatable">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">16</property>
|
||||
<property name="margin_right">16</property>
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-left">16</property>
|
||||
<property name="margin-right">16</property>
|
||||
<property name="margin-start">16</property>
|
||||
<property name="margin-end">16</property>
|
||||
<property name="margin-top">16</property>
|
||||
<property name="margin-bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Button location</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -681,10 +827,10 @@ Author: Romain Vigier
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="ondemand_button_placement_combo">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="active">1</property>
|
||||
<property name="active_id">panel</property>
|
||||
<property name="active-id">panel</property>
|
||||
<items>
|
||||
<item id="none" translatable="yes">None</item>
|
||||
<item id="panel" translatable="yes">Top bar</item>
|
||||
@@ -717,7 +863,7 @@ Author: Romain Vigier
|
||||
<packing>
|
||||
<property name="name">ondemand</property>
|
||||
<property name="title" translatable="yes">On-demand</property>
|
||||
<property name="position">2</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
@@ -728,20 +874,4 @@ Author: Romain Vigier
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="sunrise_hours_adjustment">
|
||||
<property name="upper">23</property>
|
||||
<property name="step_increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="sunrise_minutes_adjustment">
|
||||
<property name="upper">59</property>
|
||||
<property name="step_increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="sunset_hours_adjustment">
|
||||
<property name="upper">23</property>
|
||||
<property name="step_increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="sunset_minutes_adjustment">
|
||||
<property name="upper">59</property>
|
||||
<property name="step_increment">1</property>
|
||||
</object>
|
||||
</interface>
|
||||
|
||||
@@ -131,6 +131,11 @@
|
||||
<summary>Time source</summary>
|
||||
<description>The source used to check current time</description>
|
||||
</key>
|
||||
<key name="nightlight-follow-disable" type="b">
|
||||
<default>false</default>
|
||||
<summary>Follow Night Light "Disable until tomorrow"</summary>
|
||||
<description>Switch back to day time when Night Light is temporarily disabled</description>
|
||||
</key>
|
||||
<key name="ondemand-time" type="s">
|
||||
<choices>
|
||||
<choice value="day"/>
|
||||
|
||||
@@ -37,6 +37,7 @@ var TimeSettings = class {
|
||||
logDebug('Connecting time settings signals...');
|
||||
this._timeSourceChangedConnect = this.settings.connect('changed::time-source', this._onTimeSourceChanged.bind(this));
|
||||
this._manualTimeSourceChangedConnect = this.settings.connect('changed::manual-time-source', this._onManualTimeSourceChanged.bind(this));
|
||||
this._nightlightFollowDisableConnect = this.settings.connect('changed::nightlight-follow-disable', this._onNightlightFollowDisableChanged.bind(this));
|
||||
this._ondemandKeybindingChangedConnect = this.settings.connect('changed::nightthemeswitcher-ondemand-keybinding', this._onOndemandKeybindingChanged.bind(this));
|
||||
this._ondemandButtonPlacementChangedConnect = this.settings.connect('changed::ondemand-button-placement', this._onOndemandButtonPlacementChanged.bind(this));
|
||||
logDebug('System time signals connected.');
|
||||
@@ -46,6 +47,7 @@ var TimeSettings = class {
|
||||
logDebug('Disconnecting time settings signals...');
|
||||
this.settings.disconnect(this._timeSourceChangedConnect);
|
||||
this.settings.disconnect(this._manualTimeSourceChangedConnect);
|
||||
this.settings.disconnect(this._nightlightFollowDisableConnect);
|
||||
this.settings.disconnect(this._ondemandKeybindingChangedConnect);
|
||||
this.settings.disconnect(this._ondemandButtonPlacementChangedConnect);
|
||||
logDebug('Time settings signals disconnected.');
|
||||
@@ -72,6 +74,15 @@ var TimeSettings = class {
|
||||
this.settings.set_boolean('manual-time-source', value);
|
||||
}
|
||||
|
||||
get nightlightFollowDisable() {
|
||||
return this.settings.get_boolean('nightlight-follow-disable');
|
||||
}
|
||||
|
||||
set nightlightFollowDisable(value) {
|
||||
if (value !== this.nightlightFollowDisable)
|
||||
this.settings.set_boolean('nightlight-follow-disable', value);
|
||||
}
|
||||
|
||||
get ondemandTime() {
|
||||
return this.settings.get_string('ondemand-time');
|
||||
}
|
||||
@@ -129,6 +140,11 @@ var TimeSettings = class {
|
||||
this.emit('manual-time-source-changed', this.manualTimeSource);
|
||||
}
|
||||
|
||||
_onNightlightFollowDisableChanged(_settings, _changedKey) {
|
||||
logDebug(`Follow Night Light "Disable unti tomorrow" has been ${this.nightlightFollowDisable ? 'ena' : 'disa'}bled.`);
|
||||
this.emit('nightlight-follow-disable-changed', this.nightlightFollowDisable);
|
||||
}
|
||||
|
||||
_onOndemandKeybindingChanged(_settings, _changedKey) {
|
||||
if (this.ondemandKeybinding)
|
||||
logDebug(`On-demand keybinding has changed to ${this.ondemandKeybinding}.`);
|
||||
|
||||
Reference in New Issue
Block a user