|
|
|
|
@ -259,8 +259,10 @@ void MainWindow::select_System(){
|
|
|
|
|
}
|
|
|
|
|
void MainWindow::tempate_icon_select(Gtk::IconView *icon, Glib::RefPtr<Gtk::ListStore> >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;
|
|
|
|
|
@ -272,7 +274,6 @@ void MainWindow::tempate_icon_select(Gtk::IconView *icon, Glib::RefPtr<Gtk::List
|
|
|
|
|
int len_name_app = name_app.length();
|
|
|
|
|
string array_del[] = {"%f","%F","%d","%D","%n","%N"};
|
|
|
|
|
for (auto &del_sim: array_del){
|
|
|
|
|
cout << del_sim << endl;
|
|
|
|
|
str_remove(name_app, del_sim);
|
|
|
|
|
if (name_app.length()!=len_name_app){
|
|
|
|
|
txtCmd->set_text(name_app);
|
|
|
|
|
@ -285,7 +286,18 @@ void MainWindow::tempate_icon_select(Gtk::IconView *icon, Glib::RefPtr<Gtk::List
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::unselect_icon(Gtk::IconView *icon_entry){
|
|
|
|
|
for (Gtk::IconView* &icon : array_icon) {
|
|
|
|
|
|
|
|
|
|
if (icon_entry!=icon){
|
|
|
|
|
cout << "22222" << endl;
|
|
|
|
|
//icon->unselect_all();
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
cout << "11111" << endl;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::settings(){
|
|
|
|
|
this->pars_apps();
|
|
|
|
|
@ -310,6 +322,7 @@ void MainWindow::settings(){
|
|
|
|
|
rbSu->set_sensitive(false);
|
|
|
|
|
rbSudo->set_sensitive(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
void MainWindow::close_entry_app(){
|
|
|
|
|
this->icon_clear();
|
|
|
|
|
@ -420,7 +433,9 @@ void MainWindow::start_cmd(){
|
|
|
|
|
string str_variants_root = "";
|
|
|
|
|
string str_nice_cmd = "";
|
|
|
|
|
string user_cmd = "";
|
|
|
|
|
if (name_app.length()==0 && path_file.length()==0){
|
|
|
|
|
user_cmd = txtCmd->get_text();
|
|
|
|
|
}
|
|
|
|
|
//=========================================
|
|
|
|
|
if (chbAnotherUser->get_active()){
|
|
|
|
|
if (geteuid()!=0){
|
|
|
|
|
@ -473,8 +488,9 @@ void MainWindow::start_cmd(){
|
|
|
|
|
//=========================================
|
|
|
|
|
|
|
|
|
|
//=========================================
|
|
|
|
|
if (user_cmd.length()==0){
|
|
|
|
|
if (user_cmd.length()==0 && name_app.length()==0 && path_file.length()==0){
|
|
|
|
|
messageError->show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (chbTerminal->get_active()){
|
|
|
|
|
@ -485,19 +501,32 @@ void MainWindow::start_cmd(){
|
|
|
|
|
}
|
|
|
|
|
string cmd = "";
|
|
|
|
|
if (path_file!=""){
|
|
|
|
|
|
|
|
|
|
cmd = "" + str_cmd_terminal + str_variants_root + str_nice_cmd + " xdg-open '" + user_cmd + "' &";
|
|
|
|
|
cmd = "" + str_cmd_terminal + str_variants_root + str_nice_cmd + " xdg-open '" + path_file + "' ";
|
|
|
|
|
//cmd = format_cmd(str_cmd_terminal,str_variants_root,str_nice_cmd,path_file, cmd);
|
|
|
|
|
}
|
|
|
|
|
else if (name_app!=""){
|
|
|
|
|
cmd = "" + str_cmd_terminal + str_variants_root + str_nice_cmd + name_app;
|
|
|
|
|
//cmd = format_cmd(str_cmd_terminal,str_variants_root,str_nice_cmd,path_file, cmd);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
|
|
cmd = "" + str_cmd_terminal + str_variants_root + str_nice_cmd + user_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+ " &";
|
|
|
|
|
system(cmd.c_str());
|
|
|
|
|
|
|
|
|
|
path_file_name="";
|
|
|
|
|
path_file="";
|
|
|
|
|
name_app="";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::changed_user(){
|
|
|
|
|
Glib::ustring entry_user = cmbUser->get_active_text();
|
|
|
|
|
if (geteuid()==0 || entry_user == "root"){
|
|
|
|
|
|