Yoda/src/main.cpp

57 lines
1.1 KiB
C++
Raw Normal View History

#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",
2024-08-16 19:45:42 +03:00
[app]
{
app->quit();
}
2024-08-11 08:07:00 +03:00
);
2024-08-12 14:18:09 +03:00
// Init accels @TODO db settings
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-09-05 16:40:41 +03:00
app->set_accel_for_action(
"win.main_tab_append",
"<Primary>t"
);
app->set_accel_for_action(
"win.main_tab_page_navigation_update",
"<Primary>r"
);
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
);
}