mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:25:20 +00:00
UI: ProgramEditDialog: Focus on checked action
This commit is contained in:
parent
30d816a42a
commit
58981d1062
@ -115,6 +115,8 @@ void ProgramEditDialog::initialize(const AppRow &appRow, const QVector<qint64> &
|
||||
m_scScheduleIn->spinBox()->setValue(30);
|
||||
m_dteScheduleAt->setDateTime(appRow.scheduleTime);
|
||||
m_dteScheduleAt->setMinimumDateTime(DateUtil::now());
|
||||
|
||||
initializeFocus();
|
||||
}
|
||||
|
||||
void ProgramEditDialog::initializePathNameFields()
|
||||
@ -124,8 +126,6 @@ void ProgramEditDialog::initializePathNameFields()
|
||||
|
||||
initializePathField(isSingleSelection, isPathEditable);
|
||||
initializeNameField(isSingleSelection, isPathEditable);
|
||||
|
||||
initializeFocus();
|
||||
}
|
||||
|
||||
void ProgramEditDialog::initializePathField(bool isSingleSelection, bool isPathEditable)
|
||||
@ -167,7 +167,7 @@ void ProgramEditDialog::initializeNameField(bool isSingleSelection, bool isPathE
|
||||
void ProgramEditDialog::initializeFocus()
|
||||
{
|
||||
if (!isEmpty()) {
|
||||
m_rbAllowApp->setFocus();
|
||||
m_btgActions->checkedButton()->setFocus();
|
||||
} else if (isWildcard()) {
|
||||
m_editWildcard->setFocus();
|
||||
} else {
|
||||
@ -294,6 +294,8 @@ void ProgramEditDialog::setupUi()
|
||||
// Allow/Block/etc Actions Layout
|
||||
auto actionsLayout = setupActionsLayout();
|
||||
|
||||
setupActionsGroup();
|
||||
|
||||
// Advanced Options
|
||||
setupAdvancedOptions();
|
||||
|
||||
@ -435,13 +437,16 @@ void ProgramEditDialog::setupComboAppGroups()
|
||||
|
||||
QLayout *ProgramEditDialog::setupActionsLayout()
|
||||
{
|
||||
// Allow
|
||||
m_rbAllowApp = new QRadioButton();
|
||||
m_rbAllowApp->setIcon(IconCache::icon(":/icons/accept.png"));
|
||||
m_rbAllowApp->setChecked(true);
|
||||
|
||||
// Block
|
||||
m_rbBlockApp = new QRadioButton();
|
||||
m_rbBlockApp->setIcon(IconCache::icon(":/icons/deny.png"));
|
||||
|
||||
// Kill Process
|
||||
m_rbKillProcess = new QRadioButton();
|
||||
m_rbKillProcess->setIcon(IconCache::icon(":/icons/scull.png"));
|
||||
|
||||
@ -454,6 +459,16 @@ QLayout *ProgramEditDialog::setupActionsLayout()
|
||||
return layout;
|
||||
}
|
||||
|
||||
void ProgramEditDialog::setupActionsGroup()
|
||||
{
|
||||
m_btgActions = new QButtonGroup(this);
|
||||
m_btgActions->setExclusive(true);
|
||||
|
||||
m_btgActions->addButton(m_rbAllowApp);
|
||||
m_btgActions->addButton(m_rbBlockApp);
|
||||
m_btgActions->addButton(m_rbKillProcess);
|
||||
}
|
||||
|
||||
void ProgramEditDialog::setupAdvancedOptions()
|
||||
{
|
||||
// Use Group Perm.
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <model/applistmodel.h>
|
||||
#include <util/window/widgetwindow.h>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QButtonGroup)
|
||||
QT_FORWARD_DECLARE_CLASS(QCheckBox)
|
||||
QT_FORWARD_DECLARE_CLASS(QComboBox)
|
||||
QT_FORWARD_DECLARE_CLASS(QDateTimeEdit)
|
||||
@ -72,6 +73,7 @@ private:
|
||||
QLayout *setupNotesLayout();
|
||||
void setupComboAppGroups();
|
||||
QLayout *setupActionsLayout();
|
||||
void setupActionsGroup();
|
||||
void setupAdvancedOptions();
|
||||
QLayout *setupChildLayout();
|
||||
QLayout *setupLogLayout();
|
||||
@ -113,6 +115,7 @@ private:
|
||||
QRadioButton *m_rbAllowApp = nullptr;
|
||||
QRadioButton *m_rbBlockApp = nullptr;
|
||||
QRadioButton *m_rbKillProcess = nullptr;
|
||||
QButtonGroup *m_btgActions = nullptr;
|
||||
QCheckBox *m_cbUseGroupPerm = nullptr;
|
||||
QCheckBox *m_cbApplyChild = nullptr;
|
||||
QCheckBox *m_cbKillChild = nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user