diff --git a/Makefile b/Makefile index 69aebbf..178739f 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,11 @@ all: init build init: @echo "Initialize ..."; \ + version="$$(cat VERSION.md)"; \ + version=$${version:8}; \ + search="s/string version_application.*$&"; \ + replace="string version_application = \"$${version}\";"; \ + sed -i -e "$$search/$$replace/gi" source/ublexec.h; \ echo "-- Build path: ${CMAKE_BUILD_DIR}" depend: diff --git a/VERSION.md b/VERSION.md new file mode 100644 index 0000000..12ebd01 --- /dev/null +++ b/VERSION.md @@ -0,0 +1 @@ +VERSION 1.0 diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 8883823..543d234 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -10,7 +10,7 @@ add_definitions(${GTK_CFLAGS_OTHER}) find_package(Threads REQUIRED) #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(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wmissing-declarations -fdiagnostics-color=always") set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/source/ublexec.cc b/source/ublexec.cc index 76ab60a..11fa404 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -141,10 +141,12 @@ void MainWindow::add_CSS(){ } void MainWindow::localization(){ - btnSynopsis->set_label(_("Synopsis")); + aboutWindows->set_website(_("https://wiki.ublinux.com")); + btnSynopsis->set_label(_("Help")); btnAbout->set_label(_("About the program")); aboutWindows->set_comments(_("ublexec")); aboutWindows->set_website_label(_("Project Home Page")); + aboutWindows->set_version(_(version_application.c_str())); lblHeaderName->set_text(_("ublexec")); this->set_title(_("ublexec")); btnStart->set_label(_("Run")); @@ -217,7 +219,7 @@ void MainWindow::delete_cmd(const int &x,const int &y){ bool MainWindow::focus_in_txt_cmd(GdkEventFocus* event){ if (user_cmd.length() != 0){ - //user_cmd_old = user_cmd; + //user_cmd_old = user_cmd;gi } else if (name_app.length() != 0){ //name_app_old = name_app; @@ -323,7 +325,6 @@ void MainWindow::unselect_icon(Gtk::IconView *icon_entry){ } void MainWindow::settings(){ - system("nohup xhost + local: > /dev/null 2>&1 &"); this->pars_apps(); this->get_builder(); this->event(); @@ -399,13 +400,7 @@ void MainWindow::tempalte_row(string Name, string Exec, string path , Glib::Ref Gtk::TreeModel::Row row = *(dtk_list->append()); row[m_Columns.m_col_filename] = path; row[m_Columns.m_col_description] = Name; - if (std::ifstream(path)){ - row[m_Columns.m_col_pixbuf] = Gdk::Pixbuf::create_from_file(path); - } - else{ - path = "/usr/share/icons/Faenza/emblems/16/emblem-danger.png"; - row[m_Columns.m_col_pixbuf] = Gdk::Pixbuf::create_from_file(path); - } + row[m_Columns.icon_name] = path; row[m_Columns.app_name_exec] = Exec; row[m_Columns.float_h_align] = 0.5; row[m_Columns.float_w_align] = 0.5; @@ -425,7 +420,7 @@ void MainWindow::open_list_app(){ string path = ""; 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"; + path = st_app.Icon; if (str_categor=="Graphics"){ this->tempalte_row(st_app.Name,st_app.Exec, path, list_Graphics); } @@ -505,6 +500,11 @@ string MainWindow::start_cmd(string user_cmd){ } } } + if (cmbUser->get_active_text().length()!=0){ + string user_cmd_X = "xhost +SI:localuser:"; + user_cmd_X += cmbUser->get_active_text(); + system(user_cmd_X.c_str()); + } if ((cbxExecuteEpriority->get_active()) && (chbAnotherUser->get_active()==false)){ str_nice_cmd = " nice -n " + to_string(spinPriority->get_value_as_int()) + " "; } diff --git a/source/ublexec.h b/source/ublexec.h index f15e8f3..5f34098 100644 --- a/source/ublexec.h +++ b/source/ublexec.h @@ -88,7 +88,6 @@ public: void denamic_cmd(); bool focus_out_txt_cmd(GdkEventFocus* event); bool focus_in_txt_cmd(GdkEventFocus* event); - //static void me_thread(string cmd); void unselect_icon(Gtk::IconView *icon_entry); void str_remove(std::string& source, std::string & to_remove); vector split(const std::string &s, char delim); @@ -104,9 +103,11 @@ public: add(app_name_exec); add(float_h_align); add(float_w_align); + add(icon_name); } Gtk::TreeModelColumn m_col_filename; + Gtk::TreeModelColumn icon_name; Gtk::TreeModelColumn m_col_description; Gtk::TreeModelColumn app_name_exec; Gtk::TreeModelColumn > m_col_pixbuf; @@ -194,6 +195,7 @@ public: Glib::RefPtr list_Development; Glib::RefPtr list_System; public: + string version_application = "1.0"; string cmd_old = ""; string user_cmd=""; string user_cmd_old=""; diff --git a/style.css b/style.css index 5b6b638..0ea8eb1 100644 --- a/style.css +++ b/style.css @@ -5,39 +5,46 @@ text-shadow: 1px 1px #ffffff; } .menuitemtop *{ - margin:2px 2px 0 2px; - padding: 5px 10px 3px 5px; + margin:2px 2px 0 2px; + padding: 5px 10px 3px 5px; } .menuitemmiddle *{ - margin:0 2px 0 2px; - padding: 3px 10px 3px 5px; + margin:0 2px 0 2px; + padding: 3px 10px 3px 5px; } .menuitembottom *{ - margin:0 2px 2px 2px; - padding: 3px 10px 5px 5px; + margin:0 2px 2px 2px; + padding: 3px 10px 5px 5px; } .menuitemtop:hover { - background:@theme_bg_color; + border-radius:3px; + background:@theme_bg_color; } .menuitemmiddle:hover { + border-radius:3px; background:@theme_bg_color; } .menuitembottom:hover { + border-radius:3px; background:@theme_bg_color; + } .menuitemtop:hover* { + border-radius:3px; margin:2px 2px 0 2px; padding: 5px 10px 3px 5px; background:@theme_selected_bg_color; border-color:transparent; } .menuitemmiddle:hover* { + border-radius:3px; margin:0 2px 0 2px; padding: 3px 10px 3px 5px; background:@theme_selected_bg_color; border-color:transparent; } .menuitembottom:hover* { + border-radius:3px; margin:0 2px 2px 2px; padding: 3px 10px 5px 5px; background:@theme_selected_bg_color; @@ -45,26 +52,21 @@ } .menuitembottom{ margin-top:0px; - border-color:alpha(@theme_text_color, 0.4); - border-style:solid; - border-left-width:1px; - border-bottom-width:1px; - border-right-width:1px; } .menuitemmiddle{ margin-top:0px; margin-bottom:0px; - border-color:alpha(@theme_text_color, 0.4); - border-style:solid; - border-left-width:1px; - border-right-width:1px; } .menuitemtop{ margin-bottom:0px; - border-color:alpha(@theme_text_color, 0.4); - border-style:solid; - border-left-width:1px; - border-top-width:1px; - border-right-width:1px; +} + +.bkim{ + background-image: -gtk-gradient(linear, + left top, left bottom, + from(@entry_background_a), + color-stop(0.20, @entry_background_b), + color-stop(0.85, @entry_background_c), + to(@entry_background_d)); } \ No newline at end of file diff --git a/ublexec.glade b/ublexec.glade index 69d12fa..09eb905 100644 --- a/ublexec.glade +++ b/ublexec.glade @@ -142,6 +142,7 @@ 5 5 + 6 2 @@ -215,6 +216,7 @@ 5 5 + 6 2 @@ -292,6 +294,7 @@ 5 5 + 6 2 @@ -368,6 +371,7 @@ 5 5 + 6 2 @@ -444,6 +448,7 @@ 5 5 + 6 2 @@ -520,6 +525,7 @@ 5 5 + 6 2 @@ -596,6 +602,7 @@ 5 5 + 6 2 @@ -672,6 +679,7 @@ 5 5 + 6 2 @@ -748,6 +756,7 @@ 5 5 + 6 2 @@ -824,6 +833,7 @@ 5 5 + 6 2 @@ -1158,8 +1168,8 @@ specified priority 5 5 5 - 6 - 6 + 3 + 3 gtk-directory @@ -1192,8 +1202,6 @@ specified priority 5 5 5 - 6 - 6 edit-select-all diff --git a/ublexec_ru.po b/ublexec_ru.po index 7eb916b..5f16e42 100644 --- a/ublexec_ru.po +++ b/ublexec_ru.po @@ -6,10 +6,13 @@ msgid "" msgstr "" +msgid "https://wiki.ublinux.com" +msgstr "https://wiki.ublinux.ru" + msgid "About the program" msgstr "О программе" -msgid "Synopsis" +msgid "Help" msgstr "Справка" msgid "Project Home Page"