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