client: startup notifications is a freedesktop.org concept

Do not use the same wording for our background mode
This commit is contained in:
Cédric Bellegarde 2022-08-23 07:12:55 +02:00 committed by Cédric Bellegarde
parent f910b82a63
commit 786a9df536
5 changed files with 16 additions and 16 deletions

View file

@ -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) {

View file

@ -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";

View file

@ -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();

View file

@ -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"
);