reclaim/src/Application.vala

55 lines
1.5 KiB
Vala
Raw Normal View History

2022-01-05 15:58:29 -05:00
namespace Reclaim {
public class Application : Adw.Application {
public static int main (string[] args) {
var app = new Reclaim.Application ();
2022-01-05 15:58:29 -05:00
return app.run (args);
}
2021-12-30 13:48:27 -05:00
2022-01-05 15:58:29 -05:00
public Application () {
Object (
application_id: Config.APP_ID,
flags: ApplicationFlags.HANDLES_COMMAND_LINE
);
2021-12-30 13:48:27 -05:00
2022-01-05 15:58:29 -05:00
Intl.setlocale (LocaleCategory.ALL, "");
Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.LOCALEDIR);
Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
Intl.textdomain (Config.GETTEXT_PACKAGE);
}
2021-12-30 13:48:27 -05:00
2022-01-05 15:58:29 -05:00
protected override void activate () {
active_window?.present ();
}
2021-12-30 13:48:27 -05:00
2022-01-05 15:58:29 -05:00
protected override void startup () {
resource_base_path = "/boneboneboner/reclaim";
2022-01-05 15:58:29 -05:00
base.startup ();
2021-12-30 13:48:27 -05:00
2022-01-18 17:37:52 -05:00
typeof (MainAccountListView).ensure ();
2021-12-30 13:48:27 -05:00
2022-01-05 15:58:29 -05:00
var account_repository = new SqliteAccountRepository ();
var accounts_view_model = new AccountsViewModel (account_repository);
2022-01-18 17:37:52 -05:00
typeof (EditAccountListRowContent).ensure ();
typeof (EditAccountListView).ensure ();
2022-01-05 15:58:29 -05:00
typeof (ContentView).ensure ();
2021-12-30 13:48:27 -05:00
2022-01-05 15:58:29 -05:00
new MainWindow (this, accounts_view_model);
}
2021-12-30 13:48:27 -05:00
2022-01-05 15:58:29 -05:00
protected override void shutdown () {
base.shutdown ();
}
2021-12-30 13:48:27 -05:00
2022-01-05 15:58:29 -05:00
public override int command_line (ApplicationCommandLine command_line) {
activate ();
2021-12-30 13:48:27 -05:00
2022-01-05 15:58:29 -05:00
return 0;
}
2021-12-30 13:48:27 -05:00
}
}