From 328d757caffe78250892dc0f61d0ad89ba299167 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Wed, 21 Apr 2021 10:55:48 +0300 Subject: [PATCH] UI: ProgramsWindow: Add "Remove" button to toolbar. --- src/ui/form/prog/programswindow.cpp | 8 +++++++- src/ui/form/prog/programswindow.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ui/form/prog/programswindow.cpp b/src/ui/form/prog/programswindow.cpp index ca72fa22..f7ad87e5 100644 --- a/src/ui/form/prog/programswindow.cpp +++ b/src/ui/form/prog/programswindow.cpp @@ -127,6 +127,7 @@ void ProgramsWindow::onRetranslateUi() m_btAllowApp->setText(tr("Allow")); m_btBlockApp->setText(tr("Block")); + m_btRemoveApp->setText(tr("Remove")); m_formAppEdit->unsetLocale(); m_formAppEdit->setWindowTitle(tr("Edit Program")); @@ -451,12 +452,14 @@ QLayout *ProgramsWindow::setupHeader() m_btEdit = ControlUtil::createButton(":/icons/pencil.png"); m_btEdit->setMenu(editMenu); - // Allow/Block + // Toolbar buttons m_btAllowApp = ControlUtil::createLinkButton(":/icons/sign-check.png"); m_btBlockApp = ControlUtil::createLinkButton(":/icons/sign-ban.png"); + m_btRemoveApp = ControlUtil::createLinkButton(":/icons/sign-delete.png"); connect(m_btAllowApp, &QAbstractButton::clicked, m_actAllowApp, &QAction::trigger); connect(m_btBlockApp, &QAbstractButton::clicked, m_actBlockApp, &QAction::trigger); + connect(m_btRemoveApp, &QAbstractButton::clicked, m_actRemoveApp, &QAction::trigger); // Log Options setupLogOptions(); @@ -465,6 +468,8 @@ QLayout *ProgramsWindow::setupHeader() layout->addWidget(ControlUtil::createSeparator(Qt::Vertical)); layout->addWidget(m_btAllowApp); layout->addWidget(m_btBlockApp); + layout->addWidget(ControlUtil::createSeparator(Qt::Vertical)); + layout->addWidget(m_btRemoveApp); layout->addStretch(); layout->addWidget(m_btLogOptions); @@ -559,6 +564,7 @@ void ProgramsWindow::setupTableAppsChanged() m_actRemoveApp->setEnabled(appSelected); m_btAllowApp->setEnabled(appSelected); m_btBlockApp->setEnabled(appSelected); + m_btRemoveApp->setEnabled(appSelected); m_appInfoRow->setVisible(appSelected); }; diff --git a/src/ui/form/prog/programswindow.h b/src/ui/form/prog/programswindow.h index 53094dc6..f9c33488 100644 --- a/src/ui/form/prog/programswindow.h +++ b/src/ui/form/prog/programswindow.h @@ -106,6 +106,7 @@ private: QAction *m_actPurgeApps = nullptr; QPushButton *m_btAllowApp = nullptr; QPushButton *m_btBlockApp = nullptr; + QPushButton *m_btRemoveApp = nullptr; QLabel *m_labelEditPath = nullptr; QLineEdit *m_editPath = nullptr; QPushButton *m_btSelectFile = nullptr;