[geary/gnumdk/fix_quit: 8/10] client: startup notifications is a freedesktop.org concept
- From: Cédric Bellegarde <cbellegarde src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/gnumdk/fix_quit: 8/10] client: startup notifications is a freedesktop.org concept
- Date: Thu, 25 Aug 2022 21:50:29 +0000 (UTC)
commit 786a9df5364a11a184e25be05f4c81273fa6604a
Author: Cédric Bellegarde <cedric.bellegarde@ædishatz.org>
Date: Tue Aug 23 07:12:55 2022 +0200
client: startup notifications is a freedesktop.org concept
Do not use the same wording for our background mode
desktop/org.gnome.Geary.gschema.xml | 6 +++---
src/client/application/application-client.vala | 4 ++--
src/client/application/application-configuration.vala | 8 ++++----
src/client/application/application-startup-manager.vala | 12 ++++++------
src/client/components/components-preferences-window.vala | 2 +-
5 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/desktop/org.gnome.Geary.gschema.xml b/desktop/org.gnome.Geary.gschema.xml
index 136b431e4..6d4711ccb 100644
--- a/desktop/org.gnome.Geary.gschema.xml
+++ b/desktop/org.gnome.Geary.gschema.xml
@@ -61,10 +61,10 @@
<description>List of languages that are always displayed in the popover of the spell
checker.</description>
</key>
- <key name="startup-notifications" type="b">
+ <key name="run-in-background" type="b">
<default>false</default>
- <summary>Notify of new mail at startup</summary>
- <description>True to notify of new mail at startup.</description>
+ <summary>Run application in background on logon and when closed</summary>
+ <description>True to run application in background.</description>
</key>
<key name="ask-open-attachment" type="b">
diff --git a/src/client/application/application-client.vala b/src/client/application/application-client.vala
index 3da32b2d1..da9377a21 100644
--- a/src/client/application/application-client.vala
+++ b/src/client/application/application-client.vala
@@ -210,7 +210,7 @@ public class Application.Client : Gtk.Application {
*/
public bool is_background_service {
get {
- return this.config.startup_notifications;
+ return this.config.run_in_background;
}
}
@@ -1151,7 +1151,7 @@ public class Application.Client : Gtk.Application {
private async void update_autostart_file() {
try {
this.autostart.delete_startup_file();
- if (this.config.startup_notifications) {
+ if (this.config.run_in_background) {
this.autostart.install_startup_file();
}
} catch (GLib.Error err) {
diff --git a/src/client/application/application-configuration.vala
b/src/client/application/application-configuration.vala
index 3bbf0a61e..79b534962 100644
--- a/src/client/application/application-configuration.vala
+++ b/src/client/application/application-configuration.vala
@@ -25,7 +25,7 @@ public class Application.Configuration : Geary.BaseObject {
public const string SINGLE_KEY_SHORTCUTS = "single-key-shortcuts";
public const string SPELL_CHECK_LANGUAGES = "spell-check-languages";
public const string SPELL_CHECK_VISIBLE_LANGUAGES = "spell-check-visible-languages";
- public const string STARTUP_NOTIFICATIONS_KEY = "startup-notifications";
+ public const string RUN_IN_BACKGROUND_KEY = "run-in-background";
public const string UNDO_SEND_DELAY = "undo-send-delay";
public const string WINDOW_HEIGHT_KEY = "window-height";
public const string WINDOW_MAXIMIZE_KEY = "window-maximize";
@@ -101,9 +101,9 @@ public class Application.Configuration : Geary.BaseObject {
public bool single_key_shortcuts { get; set; default = false; }
- public bool startup_notifications {
- get { return settings.get_boolean(STARTUP_NOTIFICATIONS_KEY); }
- set { set_boolean(STARTUP_NOTIFICATIONS_KEY, value); }
+ public bool run_in_background {
+ get { return settings.get_boolean(RUN_IN_BACKGROUND_KEY); }
+ set { set_boolean(RUN_IN_BACKGROUND_KEY, value); }
}
private const string CLOCK_FORMAT_KEY = "clock-format";
diff --git a/src/client/application/application-startup-manager.vala
b/src/client/application/application-startup-manager.vala
index 1eb3bcd01..1d7a3b9c2 100644
--- a/src/client/application/application-startup-manager.vala
+++ b/src/client/application/application-startup-manager.vala
@@ -25,9 +25,9 @@ public class Application.StartupManager : GLib.Object {
).get_child(AUTOSTART_FOLDER)
.get_child(AUTOSTART_DESKTOP_FILE);
- // Connect startup-notifications option callback
- config.settings.changed[Configuration.STARTUP_NOTIFICATIONS_KEY].connect(
- on_startup_notification_change
+ // Connect run-in-background option callback
+ config.settings.changed[Configuration.RUN_IN_BACKGROUND_KEY].connect(
+ on_run_in_background_change
);
}
@@ -74,12 +74,12 @@ public class Application.StartupManager : GLib.Object {
* the file doesn't exist).
*/
public void sync_with_config() {
- this.config.startup_notifications = this.startup_file.query_exists();
+ this.config.run_in_background = this.startup_file.query_exists();
}
- private void on_startup_notification_change() {
+ private void on_run_in_background_change() {
try {
- if (this.config.startup_notifications) {
+ if (this.config.run_in_background) {
install_startup_file();
} else {
delete_startup_file();
diff --git a/src/client/components/components-preferences-window.vala
b/src/client/components/components-preferences-window.vala
index b43d3b829..69d6d6d3b 100644
--- a/src/client/components/components-preferences-window.vala
+++ b/src/client/components/components-preferences-window.vala
@@ -216,7 +216,7 @@ public class Components.PreferencesWindow : Hdy.PreferencesWindow {
"state"
);
config.bind(
- Application.Configuration.STARTUP_NOTIFICATIONS_KEY,
+ Application.Configuration.RUN_IN_BACKGROUND_KEY,
startup_notifications,
"state"
);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]