UI: Add buttons to move app groups.

This commit is contained in:
Nodir Temirkhodjaev 2017-09-05 19:12:31 +05:00
parent e72ce0546e
commit b8c58cce82
2 changed files with 22 additions and 2 deletions

View File

@ -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")
}

View File

@ -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