2024-08-10 17:57:15 +03:00
|
|
|
#include "main.hpp"
|
|
|
|
#include "app/browser.hpp"
|
2024-08-11 12:35:57 +03:00
|
|
|
#include "lib/database.hpp"
|
2024-08-04 19:45:28 +03:00
|
|
|
|
|
|
|
int main(
|
|
|
|
int argc,
|
2024-08-11 09:55:10 +03:00
|
|
|
char * argv[]
|
2024-08-04 19:45:28 +03:00
|
|
|
) {
|
2024-08-12 14:18:09 +03:00
|
|
|
// Init profile database
|
|
|
|
const std::shared_ptr<lib::Database> db(
|
|
|
|
new lib::Database(
|
|
|
|
"database.sqlite3"
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2024-08-10 08:37:52 +03:00
|
|
|
// Init app
|
2024-08-12 12:39:55 +03:00
|
|
|
const Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(
|
2024-08-11 09:55:10 +03:00
|
|
|
"io.github.yggverse.Yoda"
|
2024-08-04 19:45:28 +03:00
|
|
|
);
|
|
|
|
|
2024-08-11 08:07:00 +03:00
|
|
|
app->add_action(
|
|
|
|
"quit",
|
|
|
|
sigc::mem_fun(
|
2024-08-11 09:55:10 +03:00
|
|
|
* app,
|
|
|
|
& Gtk::Application::quit
|
2024-08-11 08:07:00 +03:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2024-08-12 14:18:09 +03:00
|
|
|
// Init accels @TODO db settings
|
2024-08-11 08:07:00 +03:00
|
|
|
app->set_accel_for_action(
|
2024-08-12 18:12:01 +03:00
|
|
|
"win.tab_append",
|
2024-08-12 14:18:09 +03:00
|
|
|
"<Primary>t"
|
2024-08-11 08:07:00 +03:00
|
|
|
);
|
|
|
|
|
2024-08-13 20:05:21 +03:00
|
|
|
app->set_accel_for_action(
|
2024-08-14 07:11:24 +03:00
|
|
|
"win.tab_update",
|
2024-08-13 20:05:21 +03:00
|
|
|
"<Primary>r"
|
|
|
|
);
|
|
|
|
|
2024-08-12 14:18:09 +03:00
|
|
|
app->set_accel_for_action(
|
|
|
|
"win.debug",
|
|
|
|
"<Primary>i"
|
|
|
|
);
|
|
|
|
|
|
|
|
app->set_accel_for_action(
|
|
|
|
"app.quit",
|
|
|
|
"<Primary>q"
|
2024-08-11 14:52:09 +03:00
|
|
|
);
|
|
|
|
|
2024-08-10 08:37:52 +03:00
|
|
|
// Launch browser component
|
2024-08-08 12:44:27 +03:00
|
|
|
return app->make_window_and_run<app::Browser>(
|
2024-08-04 19:45:28 +03:00
|
|
|
argc,
|
2024-08-12 14:18:09 +03:00
|
|
|
argv
|
|
|
|
//app,
|
|
|
|
//db
|
2024-08-04 19:45:28 +03:00
|
|
|
);
|
|
|
|
}
|