Yoda/src/main.cpp

43 lines
790 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-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
// 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-11 14:52:09 +03:00
// Init profile
2024-08-12 12:39:55 +03:00
const std::shared_ptr<lib::Database> db(
new lib::Database(
"database.sqlite3"
)
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-11 09:55:10 +03:00
argv,
2024-08-11 14:52:09 +03:00
app,
db
2024-08-04 19:45:28 +03:00
);
}