From 67513ff7e715dbc7ac76b80c79db90a7dbc5f002 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Wed, 3 Apr 2024 11:14:01 +0300 Subject: [PATCH] UI: *Edit: Refactor of initializeFocus() --- src/ui/form/prog/programeditdialog.cpp | 1 - src/ui/form/rule/ruleeditdialog.cpp | 7 +++++-- src/ui/form/zone/zoneeditdialog.cpp | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ui/form/prog/programeditdialog.cpp b/src/ui/form/prog/programeditdialog.cpp index dd3b3b17..8f35e0ce 100644 --- a/src/ui/form/prog/programeditdialog.cpp +++ b/src/ui/form/prog/programeditdialog.cpp @@ -191,7 +191,6 @@ void ProgramEditDialog::initializeFocus() } else if (isWildcard()) { m_editWildcard->setFocus(); } else { - m_editPath->selectAll(); m_editPath->setFocus(); } } diff --git a/src/ui/form/rule/ruleeditdialog.cpp b/src/ui/form/rule/ruleeditdialog.cpp index 7060115b..5f0e59d4 100644 --- a/src/ui/form/rule/ruleeditdialog.cpp +++ b/src/ui/form/rule/ruleeditdialog.cpp @@ -82,8 +82,11 @@ void RuleEditDialog::initializeRuleSet() void RuleEditDialog::initializeFocus() { - m_editName->selectAll(); - m_editName->setFocus(); + if (isEmpty()) { + m_editName->setFocus(); + } else { + m_editRuleText->setFocus(); + } } void RuleEditDialog::setupController() diff --git a/src/ui/form/zone/zoneeditdialog.cpp b/src/ui/form/zone/zoneeditdialog.cpp index dbfb3314..b4920490 100644 --- a/src/ui/form/zone/zoneeditdialog.cpp +++ b/src/ui/form/zone/zoneeditdialog.cpp @@ -66,7 +66,6 @@ void ZoneEditDialog::initializeBySource(const ZoneSourceWrapper &zoneSource) void ZoneEditDialog::initializeFocus() { - m_editName->selectAll(); m_editName->setFocus(); }