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