diff --git a/src/ui/qml/pages/ApplicationsPage.qml b/src/ui/qml/pages/ApplicationsPage.qml index 421661d3..38f42799 100644 --- a/src/ui/qml/pages/ApplicationsPage.qml +++ b/src/ui/qml/pages/ApplicationsPage.qml @@ -7,18 +7,30 @@ import com.fortfirewall 1.0 BasePage { readonly property var appGroups: firewallConf.appGroups + readonly property int appGroupsCount: appGroups.length function resetGroupName() { editGroupName.text = ""; editGroupName.forceActiveFocus(); } + function moveAppGroup(index, step) { + var toIndex = index + step; + if (toIndex < 0) + toIndex = appGroupsCount - 1; + else if (toIndex >= appGroupsCount) + toIndex = 0; + + firewallConf.moveAppGroup(index, toIndex); + barGroups.currentIndex = toIndex; + } + ColumnLayout { anchors.fill: parent RowLayout { TextField { - enabled: rptAppGroups.count < 16 + enabled: appGroupsCount < 16 id: editGroupName placeholderText: QT_TRANSLATE_NOOP("qml", "Group Name") } diff --git a/src/ui/qml/pages/apps/AppsColumn.qml b/src/ui/qml/pages/apps/AppsColumn.qml index 3eacec83..5229eb94 100644 --- a/src/ui/qml/pages/apps/AppsColumn.qml +++ b/src/ui/qml/pages/apps/AppsColumn.qml @@ -15,6 +15,14 @@ ColumnLayout { firewallConf.removeAppGroup(index, index); } } + Button { + text: QT_TRANSLATE_NOOP("qml", "Move left") + onClicked: moveAppGroup(index, -1) + } + Button { + text: QT_TRANSLATE_NOOP("qml", "Move right") + onClicked: moveAppGroup(index, 1) + } Item { Layout.fillWidth: true @@ -41,7 +49,6 @@ ColumnLayout { textArea { placeholderText: " -System C:\\Program Files\\Internet Explorer\\iexplore.exe " text: appGroup.blockText @@ -59,6 +66,7 @@ C:\\Program Files\\Internet Explorer\\iexplore.exe textArea { placeholderText: " +System C:\\Program Files\\Skype\\Phone\\Skype.exe " text: appGroup.allowText