bug fixes
This commit is contained in:
@@ -32,7 +32,6 @@ public class KordophoneApp : Adw.Application
|
|||||||
add_action(quit_action);
|
add_action(quit_action);
|
||||||
|
|
||||||
// Warm up dbus connections
|
// Warm up dbus connections
|
||||||
Settings.get_instance();
|
|
||||||
Repository.get_instance();
|
Repository.get_instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,9 +37,14 @@ public class PreferencesWindow : Adw.PreferencesDialog {
|
|||||||
password_row.title = "Password";
|
password_row.title = "Password";
|
||||||
connection_group.add (password_row);
|
connection_group.add (password_row);
|
||||||
|
|
||||||
settings = Settings.get_instance();
|
settings = new Settings();
|
||||||
settings.settings_ready.connect(load_settings);
|
settings.settings_ready.connect(load_settings);
|
||||||
load_settings();
|
load_settings();
|
||||||
|
|
||||||
|
unowned var self = this;
|
||||||
|
closed.connect(() => {
|
||||||
|
self.save_settings();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void load_settings() {
|
private void load_settings() {
|
||||||
@@ -50,21 +55,15 @@ public class PreferencesWindow : Adw.PreferencesDialog {
|
|||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
warning("Failed to load settings: %s", e.message);
|
warning("Failed to load settings: %s", e.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_change_callbacks();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setup_change_callbacks() {
|
private void save_settings() {
|
||||||
server_url_row.changed.connect(() => {
|
try {
|
||||||
settings.set_server_url(server_url_row.text);
|
settings.set_server_url(server_url_row.text);
|
||||||
});
|
|
||||||
|
|
||||||
username_row.changed.connect(() => {
|
|
||||||
settings.set_username(username_row.text);
|
settings.set_username(username_row.text);
|
||||||
});
|
|
||||||
|
|
||||||
password_row.changed.connect(() => {
|
|
||||||
settings.set_password(password_row.text);
|
settings.set_password(password_row.text);
|
||||||
});
|
} catch (Error e) {
|
||||||
|
warning("Failed to save settings: %s", e.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,18 +5,10 @@ public class Settings : DBusServiceProxy
|
|||||||
public signal void config_changed();
|
public signal void config_changed();
|
||||||
public signal void settings_ready();
|
public signal void settings_ready();
|
||||||
|
|
||||||
public static Settings get_instance() {
|
|
||||||
if (instance == null) {
|
|
||||||
instance = new Settings();
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Settings instance = null;
|
|
||||||
private DBusService.Settings? dbus_settings;
|
private DBusService.Settings? dbus_settings;
|
||||||
private Secret.Service secret_service;
|
private Secret.Service secret_service;
|
||||||
|
|
||||||
private Settings() {
|
public Settings() {
|
||||||
base();
|
base();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -203,6 +203,8 @@ class TranscriptContainerView : Adw.Bin
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
pending_uploads.remove(upload_guid);
|
||||||
|
|
||||||
update_attachment_row_visibility();
|
update_attachment_row_visibility();
|
||||||
update_send_button_sensitivity();
|
update_send_button_sensitivity();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user