diff --git a/source/ublexec.cc b/source/ublexec.cc index d8dcfcf..4c70ac2 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -214,6 +214,15 @@ void MainWindow::event(){ rbSudo->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::denamic_cmd)); txtCmd->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_cmd)); txtCmd->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_cmd)); + txtCmd->signal_delete_text().connect(sigc::mem_fun(*this, &MainWindow::delete_cmd)); +} +void MainWindow::delete_cmd(const int &x,const int &y){ + if (y>1){ + chbTerminal->set_active(false); + chbAnotherUser->set_active(false); + cbxExecuteEpriority->set_active(false); + txtCmd->set_text(""); + } } bool MainWindow::focus_in_txt_cmd(GdkEventFocus* event){ @@ -229,9 +238,6 @@ bool MainWindow::focus_in_txt_cmd(GdkEventFocus* event){ else{ user_cmd = txtCmd->get_text(); } - chbTerminal->set_active(false); - chbAnotherUser->set_active(false); - cbxExecuteEpriority->set_active(false); cmd_old = txtCmd->get_text(); return true; } @@ -592,11 +598,9 @@ void MainWindow::denamic_cmd(){ } bool MainWindow::focus_out_txt_cmd(GdkEventFocus* event){ - //this->focus_in_txt_cmd(event); if (cmd_old!=txtCmd->get_text()){ user_cmd = txtCmd->get_text(); } - this->denamic_cmd(); return true; } diff --git a/source/ublexec.h b/source/ublexec.h index 829e7c7..75eef48 100644 --- a/source/ublexec.h +++ b/source/ublexec.h @@ -84,6 +84,7 @@ public: void select_System(); void icon_clear(); void set_icon_array(); + void delete_cmd(const int &x,const int &y); void synopsis_show(); void denamic_cmd(); bool focus_out_txt_cmd(GdkEventFocus* event);