From d206beb82b020033f5edf25a1c901f9e3ceb293b Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 12 Aug 2024 14:18:09 +0300 Subject: [PATCH] draft global accels preset --- src/app/browser.cpp | 15 ++------------- src/app/browser.hpp | 4 ++-- src/main.cpp | 33 +++++++++++++++++++++------------ 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/app/browser.cpp b/src/app/browser.cpp index d86ef398..a9a2d31f 100644 --- a/src/app/browser.cpp +++ b/src/app/browser.cpp @@ -5,8 +5,8 @@ using namespace app; Browser::Browser( - const Glib::RefPtr & app, - const lib::Database & db + //const Glib::RefPtr & app, + //const std::shared_ptr & db ) { // Init window set_title( @@ -48,17 +48,6 @@ Browser::Browser( & Browser::debug ) ); - - // Init - app->set_accel_for_action( - "win.tab", - "t" - ); - - app->set_accel_for_action( - "win.debug", - "i" - ); } Browser::~Browser() diff --git a/src/app/browser.hpp b/src/app/browser.hpp index 3932f665..575f4200 100644 --- a/src/app/browser.hpp +++ b/src/app/browser.hpp @@ -31,8 +31,8 @@ namespace app const int HEIGHT = 480; Browser( - const Glib::RefPtr & app, - const lib::Database & db + //const Glib::RefPtr & app, + //const std::shared_ptr & db ); ~Browser(); diff --git a/src/main.cpp b/src/main.cpp index 02c9d2e7..db6cc20b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,12 +6,18 @@ int main( int argc, char * argv[] ) { + // Init profile database + const std::shared_ptr db( + new lib::Database( + "database.sqlite3" + ) + ); + // Init app const Glib::RefPtr app = Gtk::Application::create( "io.github.yggverse.Yoda" ); - // Init actions app->add_action( "quit", sigc::mem_fun( @@ -20,24 +26,27 @@ int main( ) ); - // Init accels + // Init accels @TODO db settings app->set_accel_for_action( - "app.quit", - "q" + "win.tab", + "t" ); - // Init profile - const std::shared_ptr db( - new lib::Database( - "database.sqlite3" - ) + app->set_accel_for_action( + "win.debug", + "i" + ); + + app->set_accel_for_action( + "app.quit", + "q" ); // Launch browser component return app->make_window_and_run( argc, - argv, - app, - db + argv + //app, + //db ); } \ No newline at end of file