Yoda/src/main.cpp

40 lines
695 B
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-11 12:35:57 +03:00
// Init profile
auto database = lib::Database(
"database.sqlite3"
);
2024-08-10 08:37:52 +03:00
// Init app
2024-08-08 12:44:27 +03:00
auto 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
// Init actions
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-11 09:55:10 +03:00
// Init accels
2024-08-11 08:07:00 +03:00
app->set_accel_for_action(
"app.quit",
"<Primary>q"
);
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-11 09:55:10 +03:00
argv,
app
2024-08-04 19:45:28 +03:00
);
}