diff --git a/source/ublexec.cc b/source/ublexec.cc index 121f5f3..867aa94 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -99,7 +99,7 @@ void MainWindow::get_builder(){ builder->get_widget("lblInfoNooPriority", lblInfoNooPriority); builder->get_widget("lblInfoExec", lblInfoExec); builder->get_widget("lblInfoPriority", lblInfoPriority); - builder->get_widget("lblInfoPriority", lblInfoEnterProg); + builder->get_widget("lblInfoEnterProg", lblInfoEnterProg); builder->get_widget("boxColor", boxColor); builder->get_widget("lblGraphics", lblGraphics); builder->get_widget("lblTools", lblTools); @@ -121,6 +121,17 @@ void MainWindow::get_builder(){ builder->get_widget("iconDevelopment", iconDevelopment); builder->get_widget("iconSystem", iconSystem); builder->get_widget("lblSystem", lblSystem); + Gtk::IconView *array_icon[10]; + array_icon[0]=this->iconGraphics; + array_icon[1]=this->iconTools; + array_icon[2]=this->iconInternet; + array_icon[3]=this->iconMultimedia; + array_icon[4]=this->iconSettings; + array_icon[5]=this->iconEducation; + array_icon[6]=this->iconOffice; + array_icon[7]=this->iconOther; + array_icon[8]=this->iconDevelopment; + array_icon[9]=this->iconSystem; } @@ -133,7 +144,6 @@ 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); } @@ -153,17 +163,17 @@ void MainWindow::localization(){ this->set_title(gettext("ublexec")); btnStart->set_label(gettext("Run")); wndChooseFileWallpaper->set_title(gettext("Please select File")); - dialogStartMenu->set_title(gettext("Warning!")); - lblInfoHead->set_text(gettext("Running applications as a user with a\n specified priority")); + dialogStartMenu->set_title(gettext("Selecting Programs")); + lblInfoHead->set_text(gettext("Running applications as a user with a\nspecified priority")); lblinfoCmd->set_text(gettext("Command Line")); - lblInfoTime->set_text(gettext("Team:")); + lblInfoTime->set_text(gettext("Team")); labInfoExecutTerm->set_text(gettext("Run in the terminal emulator")); lblInfoUser->set_text(gettext("User")); lblInfoUserOther->set_text(gettext("Run as another user")); - lblInfoUserName->set_text(gettext("User Name:")); - lblInfoNooPriority->set_text(gettext("Priority:")); + lblInfoUserName->set_text(gettext("User Name")); + lblInfoNooPriority->set_text(gettext("Priority")); lblInfoExec->set_text(gettext("Change startup priority")); - lblInfoPriority->set_text(gettext("Priority:")); + lblInfoPriority->set_text(gettext("Priority")); lblMessageError->set_text(gettext("Select an executable file or program")); lblInfoEnterProg->set_text(gettext("Selecting Programs")); lblGraphics->set_text(gettext("Graphics")); @@ -204,7 +214,7 @@ void MainWindow::event(){ iconOther->signal_selection_changed().connect(sigc::mem_fun(*this,&MainWindow::select_Other)); iconDevelopment->signal_selection_changed().connect(sigc::mem_fun(*this,&MainWindow::select_Development)); iconSystem->signal_selection_changed().connect(sigc::mem_fun(*this,&MainWindow::select_System)); - + } @@ -228,73 +238,69 @@ void MainWindow::ok_close_entry_app(){ } void MainWindow::select_Graphics(){ - this->tempate_icon_select(iconGraphics,list_Graphics); + this->tempate_icon_select(this->iconGraphics,list_Graphics); } void MainWindow::select_Tools(){ - this->tempate_icon_select(iconTools,list_Tools); + this->tempate_icon_select(this->iconTools,list_Tools); } void MainWindow::select_Internet(){ - this->tempate_icon_select(iconInternet,list_Internet); + this->tempate_icon_select(this->iconInternet,list_Internet); } void MainWindow::select_Multimedia(){ - this->tempate_icon_select(iconMultimedia,list_Multimedia); + this->tempate_icon_select(this->iconMultimedia,list_Multimedia); } void MainWindow::select_Settings(){ - this->tempate_icon_select(iconSettings,list_Settings); + this->tempate_icon_select(this->iconSettings,list_Settings); } void MainWindow::select_Education(){ - this->tempate_icon_select(iconEducation,list_Education); + this->tempate_icon_select(this->iconEducation,list_Education); } void MainWindow::select_Office(){ - this->tempate_icon_select(iconOffice,list_Office); + this->tempate_icon_select(this->iconOffice,list_Office); } void MainWindow::select_Other(){ - this->tempate_icon_select(iconOther,list_Other); + this->tempate_icon_select(this->iconOther,list_Other); } void MainWindow::select_Development(){ - this->tempate_icon_select(iconDevelopment,list_Development); + this->tempate_icon_select(this->iconDevelopment,list_Development); } void MainWindow::select_System(){ - this->tempate_icon_select(iconSystem,list_System); + this->tempate_icon_select(this->iconSystem,list_System); } void MainWindow::tempate_icon_select(Gtk::IconView *icon, Glib::RefPtr >k_list){ auto selected = (*icon).get_selected_items(); - if(!selected.empty()) { this->unselect_icon(icon); const Gtk::TreeModel::Path& path = *selected.begin(); Gtk::TreeModel::iterator iter = gtk_list->get_iter(path); Gtk::TreeModel::Row row = *iter; - auto app_name_exec = row[m_Columns.app_name_exec]; const Glib::ustring description = row[m_Columns.m_col_description]; txtCmd->set_text(app_name_exec); name_app = txtCmd->get_text(); int len_name_app = name_app.length(); - string array_del[] = {"%f","%F","%d","%D","%n","%N"}; + string array_del[] = {"%f","%F","%d","%D","%n","%N","%U"}; for (auto &del_sim: array_del){ str_remove(name_app, del_sim); if (name_app.length()!=len_name_app){ txtCmd->set_text(name_app); break; } - } - - } } void MainWindow::unselect_icon(Gtk::IconView *icon_entry){ - for (Gtk::IconView* &icon : array_icon) { - - if (icon_entry!=icon){ - cout << "22222" << endl; + for (int index=0; index<10; ++index){ + Gtk::IconView *icon = this->array_icon[index]; + printf("%p %p", icon, icon_entry); + if (&icon_entry!=&icon){ + cout << "11111" << endl; //icon->unselect_all(); } else{ - cout << "11111" << endl; + cout << "22222" << endl; } } } @@ -509,21 +515,20 @@ void MainWindow::start_cmd(){ //cmd = format_cmd(str_cmd_terminal,str_variants_root,str_nice_cmd,path_file, cmd); } else{ - user_cmd = this->str_remove(user_cmd,str_cmd_terminal); - user_cmd = this->str_remove(user_cmd,str_variants_root); - user_cmd = this->str_remove(user_cmd,str_nice_cmd); + user_cmd = this->str_remove(user_cmd, str_cmd_terminal); + user_cmd = this->str_remove(user_cmd, str_variants_root); + user_cmd = this->str_remove(user_cmd, str_nice_cmd); string amp = " &"; user_cmd = this->str_remove(user_cmd, amp); cmd = "" + str_cmd_terminal + str_variants_root + str_nice_cmd + user_cmd; - //cmd = format_cmd(str_cmd_terminal,str_variants_root,str_nice_cmd,path_file, cmd); } txtCmd->set_text(cmd); - cmd=cmd+ " &"; + cmd = cmd + " &"; system(cmd.c_str()); - path_file_name=""; - path_file=""; - name_app=""; + path_file_name = ""; + path_file = ""; + name_app = ""; } diff --git a/source/ublexec.h b/source/ublexec.h index 59261e6..3144e5e 100644 --- a/source/ublexec.h +++ b/source/ublexec.h @@ -190,6 +190,7 @@ public: Gtk::IconView *iconOther; Gtk::IconView *iconDevelopment; Gtk::IconView *iconSystem; + Gtk::IconView *iconEntry; Glib::RefPtr list_Graphics; Glib::RefPtr list_Tools; @@ -225,18 +226,7 @@ public: list list_app; set set_categories; int index_exec_gui_apps = 0; - Gtk::IconView* array_icon[10] = { - iconGraphics, - iconTools, - iconInternet, - iconMultimedia, - iconSettings, - iconEducation, - iconOffice, - iconOther, - iconDevelopment, - iconSystem - }; + Gtk::IconView* array_icon[10]; }; diff --git a/ublexec.glade b/ublexec.glade index e666d14..05c68d8 100644 --- a/ublexec.glade +++ b/ublexec.glade @@ -21,7 +21,7 @@ True False - Выбор программ + Selecting Programs False @@ -67,7 +67,7 @@ True False start - Графика + Graphics False @@ -99,7 +99,7 @@ True False start - Инструменты + Tools False @@ -131,7 +131,7 @@ True False start - Интернет + Internet False @@ -163,7 +163,7 @@ True False start - Мультимедия + Multimedia False @@ -195,7 +195,7 @@ True False start - Настройки + Settings False @@ -227,7 +227,7 @@ True False start - Образование + Education False @@ -259,7 +259,7 @@ True False start - Офис + Office False @@ -291,7 +291,7 @@ True False start - Прочее + Other False @@ -323,7 +323,7 @@ True False start - Разработка + Development False @@ -355,7 +355,7 @@ True False start - Система + System False @@ -522,8 +522,8 @@ 5 6 6 - Запуск приложений от имени пользователя с -указанным приоритетом + Running applications as a user with a +specified priority @@ -582,7 +582,7 @@ 5 6 6 - Команда: + Team True 0 @@ -722,7 +722,7 @@ True False - Выполнить в эмуляторе терминале + Run in the terminal emulator @@ -745,7 +745,7 @@ True False - Командная строка + Command Line @@ -807,7 +807,7 @@ True False - Выполнить от имени другого пользователя + Run as another user @@ -901,7 +901,7 @@ 5 6 6 - Имя поьзователя: + User Name True 0 @@ -942,7 +942,7 @@ True False - Пользователь + User @@ -1000,7 +1000,7 @@ True False - Изменить приоритет запуска + Change startup priority @@ -1025,7 +1025,7 @@ 5 6 6 - Приоритет: + Priority: True 0 @@ -1113,7 +1113,7 @@ 5 6 6 - 19 (Низкий) + 19 (Low) True 0 @@ -1135,7 +1135,7 @@ 5 6 6 - -20 (Высокий) + -20 (High) True 0 @@ -1175,7 +1175,7 @@ True False - Приоритет + Priority @@ -1194,7 +1194,7 @@ - Запустить + Run True True True @@ -1274,7 +1274,7 @@ 10 10 15 - Выберите исполняемый файл или программу + Select an executable file or program True diff --git a/ublexec_ru.po b/ublexec_ru.po index b718cd2..9259859 100644 --- a/ublexec_ru.po +++ b/ublexec_ru.po @@ -45,11 +45,11 @@ msgstr "Выход" msgid "Selecting Programs" msgstr "Выбор программ" -msgid "Running applications as a user with a\n specified priority" -msgstr "Запуск приложений от имени пользователя с\n указанным приоритетом" +msgid "Running applications as a user with a\nspecified priority" +msgstr "Запуск приложений от имени пользователя с\nуказанным приоритетом" -msgid "Team:" -msgstr "Команда:" +msgid "Team" +msgstr "Команда" msgid "Run in the terminal emulator" msgstr "Выполнить в эмуляторе терминале" @@ -69,8 +69,8 @@ msgstr "su" msgid "sudo" msgstr "sudo" -msgid "User Name:" -msgstr "Имя поьзователя:" +msgid "User Name" +msgstr "Имя поьзователя" msgid "User" msgstr "Пользователь" @@ -78,8 +78,8 @@ msgstr "Пользователь" msgid "Change startup priority" msgstr "Изменить приоритет запуска" -msgid "Priority:" -msgstr "Приоритет:" +msgid "Priority" +msgstr "Приоритет" msgid "19 (Low)" msgstr "19 (Низкий)" @@ -87,9 +87,6 @@ msgstr "19 (Низкий)" msgid "-20 (High)" msgstr "-20 (Высокий)" -msgid "Priority" -msgstr "Приоритет" - msgid "Run" msgstr "Запустить"