diff --git a/src/ui/qml/pages/ActivityPage.qml b/src/ui/qml/pages/ActivityPage.qml index 26f8d018..6d22bb94 100644 --- a/src/ui/qml/pages/ActivityPage.qml +++ b/src/ui/qml/pages/ActivityPage.qml @@ -155,7 +155,7 @@ BasePage { Switch { id: cbShowBlockedApps - text: QT_TRANSLATE_NOOP("qml", "Show Blocked Applications and Addresses") + text: QT_TRANSLATE_NOOP("qml", "Log Blocked Applications") onToggled: switchLogReading(checked) } } diff --git a/src/ui/qml/pages/ApplicationsPage.qml b/src/ui/qml/pages/ApplicationsPage.qml index 38f42799..dba02bae 100644 --- a/src/ui/qml/pages/ApplicationsPage.qml +++ b/src/ui/qml/pages/ApplicationsPage.qml @@ -14,6 +14,26 @@ BasePage { editGroupName.forceActiveFocus(); } + function addAppGroup() { + const lastIndex = appGroups.length; + firewallConf.addAppGroupByName(editGroupName.text); + barGroups.currentIndex = lastIndex; + resetGroupName(); + } + + function removeAppGroup(index) { + firewallConf.removeAppGroup(index, index); + var lastIndex = appGroupsCount - 1; + barGroups.currentIndex = (index < appGroupsCount) + ? index : appGroupsCount - 1; + } + + function renameAppGroup() { + const appGroup = appsColumn.appGroup; + appGroup.name = editGroupName.text; + resetGroupName(); + } + function moveAppGroup(index, step) { var toIndex = index + step; if (toIndex < 0) @@ -37,21 +57,12 @@ BasePage { Button { enabled: editGroupName.text text: QT_TRANSLATE_NOOP("qml", "Add Group") - onClicked: { - const lastIndex = appGroups.length; - firewallConf.addAppGroupByName(editGroupName.text); - barGroups.currentIndex = lastIndex; - resetGroupName(); - } + onClicked: addAppGroup() } Button { enabled: editGroupName.text && appsColumn.enabled text: QT_TRANSLATE_NOOP("qml", "Rename Group") - onClicked: { - const appGroup = appsColumn.appGroup; - appGroup.name = editGroupName.text; - resetGroupName(); - } + onClicked: removeAppGroup() } Item { diff --git a/src/ui/qml/pages/apps/AppsColumn.qml b/src/ui/qml/pages/apps/AppsColumn.qml index 5229eb94..eadad506 100644 --- a/src/ui/qml/pages/apps/AppsColumn.qml +++ b/src/ui/qml/pages/apps/AppsColumn.qml @@ -11,9 +11,7 @@ ColumnLayout { RowLayout { Button { text: QT_TRANSLATE_NOOP("qml", "Remove Group") - onClicked: { - firewallConf.removeAppGroup(index, index); - } + onClicked: removeAppGroup(index) } Button { text: QT_TRANSLATE_NOOP("qml", "Move left")