UI: ProgramsWindow: Add "Remove" button to toolbar.

This commit is contained in:
Nodir Temirkhodjaev 2021-04-21 10:55:48 +03:00
parent 4ba73e2c52
commit 328d757caf
2 changed files with 8 additions and 1 deletions

View File

@ -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);
};

View File

@ -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;