mirror of
https://github.com/tnodir/fort
synced 2024-11-15 09:59:38 +00:00
UI: ProgramEditDialog: Simplify fillApp()
This commit is contained in:
parent
91c4974fe8
commit
5abc3981bb
@ -642,14 +642,23 @@ void ProgramEditDialog::fillApp(App &app) const
|
|||||||
app.acceptZones = m_btZones->zones();
|
app.acceptZones = m_btZones->zones();
|
||||||
app.rejectZones = m_btZones->uncheckedZones();
|
app.rejectZones = m_btZones->uncheckedZones();
|
||||||
|
|
||||||
// App Path
|
fillAppPath(app);
|
||||||
{
|
fillAppEndTime(app);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProgramEditDialog::fillAppPath(App &app) const
|
||||||
|
{
|
||||||
const QString appPath = m_editPath->text();
|
const QString appPath = m_editPath->text();
|
||||||
|
|
||||||
app.appOriginPath = isWildcard() ? m_editWildcard->toPlainText() : appPath;
|
app.appOriginPath = isWildcard() ? m_editWildcard->toPlainText() : appPath;
|
||||||
app.appPath = FileUtil::normalizePath(appPath);
|
app.appPath = FileUtil::normalizePath(appPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProgramEditDialog::fillAppEndTime(App &app) const
|
||||||
|
{
|
||||||
|
if (app.blocked)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!app.blocked) {
|
|
||||||
if (m_cscBlockAppIn->checkBox()->isChecked()) {
|
if (m_cscBlockAppIn->checkBox()->isChecked()) {
|
||||||
const int minutes = m_cscBlockAppIn->spinBox()->value();
|
const int minutes = m_cscBlockAppIn->spinBox()->value();
|
||||||
|
|
||||||
@ -657,7 +666,6 @@ void ProgramEditDialog::fillApp(App &app) const
|
|||||||
} else if (m_cbBlockAppAt->isChecked()) {
|
} else if (m_cbBlockAppAt->isChecked()) {
|
||||||
app.endTime = m_dteBlockAppAt->dateTime();
|
app.endTime = m_dteBlockAppAt->dateTime();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProgramEditDialog::isWildcard() const
|
bool ProgramEditDialog::isWildcard() const
|
||||||
|
@ -73,6 +73,8 @@ private:
|
|||||||
|
|
||||||
bool validateFields() const;
|
bool validateFields() const;
|
||||||
void fillApp(App &app) const;
|
void fillApp(App &app) const;
|
||||||
|
void fillAppPath(App &app) const;
|
||||||
|
void fillAppEndTime(App &app) const;
|
||||||
|
|
||||||
bool isWildcard() const;
|
bool isWildcard() const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user