From 8917c58931cc5a0ef7d21b7781a2d97706c4ac49 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Wed, 22 Mar 2023 15:47:28 +0600 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D0=BE=D0=B9=20=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=BE=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/main.cc | 20 ++++++++++++++------ source/ublexec.cc | 2 ++ source/ublexec.h | 1 + 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/source/main.cc b/source/main.cc index 50150ff..0908fe5 100644 --- a/source/main.cc +++ b/source/main.cc @@ -2,17 +2,19 @@ int main(int argc, char** argv) { + string str_argv= ""; string str_cmd_argv = ""; - for (int i=1; i 1){ + str_argv = argv[1]; + } + if (str_argv.find("--socket-id") != std::string::npos) { + auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.plug"); + auto builder = Gtk::Builder::create_from_file(path_glade); Glib::init(); setlocale(LC_ALL, ""); Glib::OptionContext context; @@ -31,6 +33,12 @@ int main(int argc, char** argv) { return 0; } else { + if (argc == 2) { + name_app_cmd = argv[1]; + } + int local_argc = 1; + auto app = Gtk::Application::create(local_argc, argv, "org.gtkmm.example.plug"); + auto builder = Gtk::Builder::create_from_file(path_glade); MainWindow* wnd = nullptr; builder->get_widget_derived("window", wnd); auto r = app->run(*wnd); diff --git a/source/ublexec.cc b/source/ublexec.cc index 3682eb3..6460465 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -5,6 +5,7 @@ const string path_app = "/usr/bin/"; const string path_glade = "/usr/share/ublexec/ui/ublexec.glade"; const string path_css = "/usr/share/ublexec/css/ublexec.css"; const string app_name = "ublexec"; +string name_app_cmd = ""; const string path_img_head_background = "/usr/share/ublexec/images/logo-background.png"; int socket_ext_id_I = 0; int socket_trd_id_I = 0; @@ -413,6 +414,7 @@ void MainWindow::unselect_icon(Gtk::IconView *icon_entry) { } void MainWindow::settings() { + user_cmd = name_app_cmd; this->pars_apps(); this->get_builder(); this->event(); diff --git a/source/ublexec.h b/source/ublexec.h index 065a420..49c1db5 100644 --- a/source/ublexec.h +++ b/source/ublexec.h @@ -24,6 +24,7 @@ extern const string path_app; extern const string app_name; extern const string path_glade; extern const string path_css; +extern string name_app_cmd; extern const string path_img_head_background; extern int socket_ext_id_I; extern int socket_trd_id_I;