55 lines
1.5 KiB
Vala
55 lines
1.5 KiB
Vala
namespace Reclaim {
|
|
public class Application : Adw.Application {
|
|
public static int main (string[] args) {
|
|
var app = new Reclaim.Application ();
|
|
|
|
return app.run (args);
|
|
}
|
|
|
|
public Application () {
|
|
Object (
|
|
application_id: Config.APP_ID,
|
|
flags: ApplicationFlags.HANDLES_COMMAND_LINE
|
|
);
|
|
|
|
|
|
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);
|
|
}
|
|
|
|
protected override void activate () {
|
|
active_window?.present ();
|
|
}
|
|
|
|
protected override void startup () {
|
|
resource_base_path = "/boneboneboner/reclaim";
|
|
|
|
base.startup ();
|
|
|
|
typeof (MainAccountListView).ensure ();
|
|
|
|
var account_repository = new SqliteAccountRepository ();
|
|
var accounts_view_model = new AccountsViewModel (account_repository);
|
|
|
|
typeof (EditAccountListRowContent).ensure ();
|
|
typeof (EditAccountListView).ensure ();
|
|
typeof (ContentView).ensure ();
|
|
|
|
new MainWindow (this, accounts_view_model);
|
|
}
|
|
|
|
protected override void shutdown () {
|
|
base.shutdown ();
|
|
|
|
}
|
|
|
|
public override int command_line (ApplicationCommandLine command_line) {
|
|
activate ();
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
}
|