aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/application.vala
diff options
context:
space:
mode:
authoreerielili <lionel@les-miquelots.net>2024-08-25 13:32:38 +0000
committerGitHub <noreply@github.com>2024-08-25 13:32:38 +0000
commit45755727db79a2935376d24e7bde7eadb0f2f7ca (patch)
tree73715da99c9d980079df6f2d561822364655e04d /main/src/ui/application.vala
parent62cdea3a5e701c04f3a7fd9d6b5f48e28fef1f72 (diff)
parent51252f74c94c17d56aa75534652bdc5d43a504cb (diff)
downloaddino-45755727db79a2935376d24e7bde7eadb0f2f7ca.tar.gz
dino-45755727db79a2935376d24e7bde7eadb0f2f7ca.zip
Merge branch 'master' into add-yourselfadd-yourself
Diffstat (limited to 'main/src/ui/application.vala')
-rw-r--r--main/src/ui/application.vala33
1 files changed, 18 insertions, 15 deletions
diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala
index 1c96e9ce..d213ef09 100644
--- a/main/src/ui/application.vala
+++ b/main/src/ui/application.vala
@@ -113,13 +113,17 @@ public class Dino.Ui.Application : Adw.Application, Dino.Application {
}
private void create_actions() {
- SimpleAction accounts_action = new SimpleAction("accounts", null);
- accounts_action.activate.connect(show_accounts_window);
- add_action(accounts_action);
-
- SimpleAction settings_action = new SimpleAction("settings", null);
- settings_action.activate.connect(show_settings_window);
- add_action(settings_action);
+ SimpleAction preferences_action = new SimpleAction("preferences", null);
+ preferences_action.activate.connect(show_preferences_window);
+ add_action(preferences_action);
+
+ SimpleAction preferences_account_action = new SimpleAction("preferences-account", VariantType.INT32);
+ preferences_account_action.activate.connect((variant) => {
+ Account? account = db.get_account_by_id(variant.get_int32());
+ if (account == null) return;
+ show_preferences_account_window(account);
+ });
+ add_action(preferences_account_action);
SimpleAction about_action = new SimpleAction("about", null);
about_action.activate.connect(show_about_window);
@@ -252,17 +256,16 @@ public class Dino.Ui.Application : Adw.Application, Dino.Application {
return Environment.get_variable("GTK_CSD") != "0";
}
- private void show_accounts_window() {
- ManageAccounts.Dialog dialog = new ManageAccounts.Dialog(stream_interactor, db);
- dialog.set_transient_for(get_active_window());
- dialog.account_enabled.connect(add_connection);
- dialog.account_disabled.connect(remove_connection);
+ private void show_preferences_window() {
+ Ui.PreferencesWindow dialog = new Ui.PreferencesWindow() { transient_for = window };
+ dialog.model.populate(db, stream_interactor);
dialog.present();
}
- private void show_settings_window() {
- SettingsDialog dialog = new SettingsDialog();
- dialog.set_transient_for(get_active_window());
+ private void show_preferences_account_window(Account account) {
+ Ui.PreferencesWindow dialog = new Ui.PreferencesWindow() { transient_for = window };
+ dialog.model.populate(db, stream_interactor);
+ dialog.accounts_page.account_chosen(account);
dialog.present();
}