From 9c9ce0daf5dcc3468b1e38e056a878ccbad477c5 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Fri, 3 Mar 2023 16:40:28 +0600 Subject: [PATCH] =?UTF-8?q?=D0=95=D1=81=D0=BB=D0=B8=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C=20=D1=81?= =?UTF-8?q?=D1=82=D1=91=D1=80=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=83?= =?UTF-8?q?,=20=D0=B3=D0=B0=D0=BB=D0=BA=D0=B8=20=D0=BE=D1=82=D0=BA=D0=BB?= =?UTF-8?q?=D1=8E=D1=87=D0=B5=D0=BD=D1=8B.=20=D0=98=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ublexec.cc | 14 +++++++++----- source/ublexec.h | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) 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);