From 327c506f07a7858c995b341935df05170191b867 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 2 Feb 2023 12:33:13 +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=B0=D0=B4=D0=B0=D0=BF=D1=82=D0=B8=D0=B2=D0=BD=D1=8B?= =?UTF-8?q?=D0=B9=20=D0=B4=D0=B8=D0=B7=D0=B0=D0=B9=D0=BD=20=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D1=8E=20=D0=B2=D1=8B=D0=B1=D0=BE=D1=80=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/CMakeLists.txt | 4 +- source/ublexec.cc | 51 ++-- source/ublexec.h | 7 +- ublexec.glade | 695 ++++++++++++++++++++++-------------------- 4 files changed, 386 insertions(+), 371 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index d9ace9b..d7bb690 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -8,8 +8,8 @@ include_directories(${GTK_INCLUDE_DIRS}) link_directories(${GTK_LIBRARY_DIRS}) add_definitions(${GTK_CFLAGS_OTHER}) -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wmissing-declarations -fdiagnostics-color=always") +#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a -g") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wmissing-declarations -fdiagnostics-color=always -g") set(SOURCE_FILES main.cc diff --git a/source/ublexec.cc b/source/ublexec.cc index b841dcf..d60a60a 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -88,7 +88,6 @@ void MainWindow::get_builder(){ builder->get_widget("dialogStartMenu", dialogStartMenu); builder->get_widget("btnStartMenuOK", btnStartMenuOK); builder->get_widget("btnStartMenuExit", btnStartMenuExit); - builder->get_widget("boxlistProgramm", boxlistProgramm); builder->get_widget("lblInfoHead", lblInfoHead); builder->get_widget("lblinfoCmd", lblinfoCmd); builder->get_widget("lblInfoTime", lblInfoTime); @@ -133,14 +132,6 @@ void MainWindow::get_builder(){ this->template_apps_obj(iconDevelopment, list_Development); this->template_apps_obj(iconSystem, list_System); - /* - list_Graphics = Gtk::ListStore::create( m_Columns ); - list_Graphics->set_sort_column( m_Columns.m_col_description, Gtk::SORT_ASCENDING ); - iconGraphics->set_model(list_Graphics); - iconGraphics->set_markup_column(m_Columns.m_col_description); - iconGraphics->set_pixbuf_column(m_Columns.m_col_pixbuf); - - */ } void MainWindow::template_apps_obj(Gtk::IconView *icon, Glib::RefPtr >k_list_app){ @@ -149,6 +140,7 @@ void MainWindow::template_apps_obj(Gtk::IconView *icon, Glib::RefPtrset_model(gtk_list_app); icon->set_markup_column(m_Columns.m_col_description); icon->set_pixbuf_column(m_Columns.m_col_pixbuf); + //icon->set_tooltip_column(m_Columns.app_name_exec); } @@ -209,6 +201,7 @@ void MainWindow::event(){ btnStartMenuOK->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::start_menu_entry_app)); btnStartMenuExit->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::close_start_menu)); btnStartMenuOK->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::ok_close_entry_app)); + iconGraphics->signal_selection_changed().connect(sigc::mem_fun(*this,&MainWindow::select_Graphics)); iconTools->signal_selection_changed().connect(sigc::mem_fun(*this,&MainWindow::select_Tools)); iconInternet->signal_selection_changed().connect(sigc::mem_fun(*this,&MainWindow::select_Internet)); iconMultimedia->signal_selection_changed().connect(sigc::mem_fun(*this,&MainWindow::select_Multimedia)); @@ -264,10 +257,10 @@ void MainWindow::tempate_icon_select(Gtk::IconView *icon, Glib::RefPtrget_iter(path); Gtk::TreeModel::Row row = *iter; - //const std::string filename = row[m_Columns.m_col_filename]; + auto app_name_exec = row[m_Columns.app_name_exec]; const Glib::ustring description = row[m_Columns.m_col_description]; - name_app = description; - txtCmd->set_text(name_app); + txtCmd->set_text(app_name_exec); + name_app = txtCmd->get_text(); } } @@ -332,54 +325,54 @@ void MainWindow::get_path_filemaneg(){ } } -void MainWindow::tempalte_row(string name, string path, Glib::RefPtr &dtk_list){ +void MainWindow::tempalte_row(string Name, string Exec, string path , Glib::RefPtr &dtk_list){ Gtk::TreeModel::Row row = *(dtk_list->append()); row[m_Columns.m_col_filename] = path; - row[m_Columns.m_col_description] = name; + row[m_Columns.m_col_description] = Name; + row[m_Columns.app_name_exec] = Exec; if (std::ifstream(path)){ row[m_Columns.m_col_pixbuf] = Gdk::Pixbuf::create_from_file(path); } else{ - path = "/usr/share/icons/Faenza/emblems/32/emblem-danger.png"; + path = "/usr/share/icons/Faenza/emblems/16/emblem-danger.png"; row[m_Columns.m_col_pixbuf] = Gdk::Pixbuf::create_from_file(path); } } void MainWindow::open_list_app(){ string path = ""; - for ( const auto &str_app : list_app){ - for ( const auto &str_categor : str_app.Categories){ - path = "/usr/share/icons/hicolor/32x32/apps/" + str_app.Icon + ".png"; - cout << str_categor << endl; + for ( const auto &st_app : list_app){ + for ( const auto &str_categor : st_app.Categories){ + path = "/usr/share/icons/hicolor/16x16/apps/" + st_app.Icon + ".png"; if (str_categor=="Graphics"){ - this->tempalte_row(str_app.Name, path, list_Graphics); + this->tempalte_row(st_app.Name,st_app.Exec, path, list_Graphics); } else if (str_categor=="Utility"){ - this->tempalte_row(str_app.Name, path, list_Tools); + this->tempalte_row(st_app.Name,st_app.Exec, path, list_Tools); } else if (str_categor=="Network"){ - this->tempalte_row(str_app.Name, path, list_Internet); + this->tempalte_row(st_app.Name,st_app.Exec, path,list_Internet); } else if (str_categor=="Multimedia" || str_categor== "Video" || str_categor== "Player" || str_categor== "AudioVideo"){ - this->tempalte_row(str_app.Name, path, list_Multimedia); + this->tempalte_row(st_app.Name,st_app.Exec, path, list_Multimedia); } else if (str_categor=="Settings"){ - this->tempalte_row(str_app.Name, path, list_Settings); + this->tempalte_row(st_app.Name,st_app.Exec, path, list_Settings); } else if (str_categor=="Education"){ - this->tempalte_row(str_app.Name, path, list_Education); + this->tempalte_row(st_app.Name,st_app.Exec, path, list_Education); } else if (str_categor=="Office"){ - this->tempalte_row(str_app.Name, path, list_Office); + this->tempalte_row(st_app.Name,st_app.Exec, path, list_Office); } else if (str_categor=="Other"){ - this->tempalte_row(str_app.Name, path, list_Other); + this->tempalte_row(st_app.Name,st_app.Exec, path, list_Other); } else if (str_categor=="Development"){ - this->tempalte_row(str_app.Name, path, list_Development); + this->tempalte_row(st_app.Name,st_app.Exec, path, list_Development); } else if (str_categor=="System"){ - this->tempalte_row(str_app.Name, path, list_System); + this->tempalte_row(st_app.Name,st_app.Exec, path, list_System); } } diff --git a/source/ublexec.h b/source/ublexec.h index 362a867..4b89d16 100644 --- a/source/ublexec.h +++ b/source/ublexec.h @@ -89,7 +89,7 @@ public: void select_Graphics(); void tmp_desktop(string cmd_name); void on_item_activated(const Gtk::TreeModel::Path& path); - void tempalte_row(string name, string path, Glib::RefPtr &dtk_list); + void tempalte_row(string Name, string Exec, string path , Glib::RefPtr &dtk_list); void tempate_icon_select(Gtk::IconView *icon, Glib::RefPtr >k_list); void ok_close_entry_app(); void select_Tools(); @@ -113,11 +113,15 @@ public: add(m_col_filename); add(m_col_description); add(m_col_pixbuf); + add(app_name_exec); + } Gtk::TreeModelColumn m_col_filename; Gtk::TreeModelColumn m_col_description; + Gtk::TreeModelColumn app_name_exec; Gtk::TreeModelColumn > m_col_pixbuf; + }; ModelColumns m_Columns; @@ -148,7 +152,6 @@ public: Gtk::Label *lblMessageError; Gtk::Button *btnStartMenuOK; Gtk::Button *btnStartMenuExit; - Gtk::Box *boxlistProgramm; Gtk::Window *dialogStartMenu; Gtk::Box *boxColor; Gtk::Label *lblInfoHead; diff --git a/ublexec.glade b/ublexec.glade index 458368a..a04c7f9 100644 --- a/ublexec.glade +++ b/ublexec.glade @@ -9,7 +9,7 @@ 10 - 200 + 500 400 False @@ -35,360 +35,379 @@ True in - - True + False + 5 + 5 + 5 + 5 + 5 + natural - + True False - vertical - - - True - False - start - center - 5 - 5 - 5 - 5 - 6 - 6 - Графика - - - False - True - 0 - - - - - True - True - 6 - 75 - 1 - 1 - True - - - False - True - 1 - - - - - True - False - start - center - 5 - 5 - 5 - 5 - 6 - 6 - Инструменты - - - False - True - 2 - - - - - True - True - 1 - 1 - 1 - - - False - True - 3 - - - - - True - False - start - center - 5 - 5 - 5 - 5 - 6 - 6 - Интернет - - - False - True - 4 - - - - - True - True - 1 - 1 - 1 - - - False - True - 5 - - - - - True - False - start - center - 5 - 5 - 5 - 5 - 6 - 6 - Мультимедиа - - - False - True - 6 - - - - - True - True - 1 - 1 - 1 - - - False - True - 7 - - - - - True - False - start - center - 5 - 5 - 5 - 5 - 6 - 6 - Настройки - - - False - True - 8 - - - - - True - True - 1 - 1 - 1 - - - False - True - 9 - - - - - True - False - start - center - 5 - 5 - 5 - 5 - 6 - 6 - Образование - - - False - True - 10 - - - - - True - True - 1 - 1 - 1 - - - False - True - 11 - - - - - True - False - start - center - 5 - 5 - 5 - 5 - 6 - 6 - Офис - - - False - True - 12 - - - - - True - True - 1 - 1 - 1 - - - False - True - 13 - - - - - True - False - start - center - 5 - 5 - 5 - 5 - 6 - 6 - Прочие - - - False - True - 14 - - - - - True - True - 1 - 1 - 1 - - - False - True - 15 - - + 1 + 1 + 5 + 0 + etched-out - + True False - start - center - 5 - 5 - 5 - 5 - 6 - 6 - Разработка - - - False - True - 16 - - - - - True - True - 1 - 1 - 1 + 12 + + + True + False + vertical + + + True + False + start + Графика + + + False + True + 0 + + + + + True + True + 1 + queue + 1 + 1 + 1 + + + + True + True + 1 + + + + + True + False + start + Инструменты + + + False + True + 2 + + + + + True + True + 1 + queue + 1 + 1 + 1 + + + + True + True + 3 + + + + + True + False + start + Интернет + + + False + True + 4 + + + + + True + True + 1 + queue + 1 + 1 + 1 + + + + True + True + 5 + + + + + True + False + start + Мультимедия + + + False + True + 6 + + + + + True + True + 1 + queue + 1 + 1 + 1 + + + + True + True + 7 + + + + + True + False + start + Настройки + + + False + True + 8 + + + + + True + True + 1 + queue + 1 + 1 + 1 + + + + True + True + 9 + + + + + True + False + start + Образование + + + False + True + 10 + + + + + True + True + 1 + queue + 1 + 1 + 1 + + + + True + True + 11 + + + + + True + False + start + Офис + + + False + True + 12 + + + + + True + True + 1 + queue + 1 + 1 + 1 + + + + True + True + 13 + + + + + True + False + start + Прочее + + + False + True + 14 + + + + + True + True + 1 + queue + 1 + 1 + 1 + + + + True + True + 15 + + + + + True + False + start + Разработка + + + False + True + 16 + + + + + True + True + 1 + queue + 1 + 1 + 1 + + + + True + True + 17 + + + + + True + False + start + Система + + + False + True + 18 + + + + + True + True + 1 + queue + 1 + 1 + 1 + + + + True + True + 19 + + + + + - - False - True - 17 - - - + + True False - start - center - 5 - 5 - 5 - 5 - 6 - 6 - Система - - False - True - 18 - - - - - True - True - 1 - 1 - 1 - - - False - True - 19 - + + + True