mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:56:22 +00:00
UI: Add buttons to move app groups.
This commit is contained in:
parent
e72ce0546e
commit
b8c58cce82
@ -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")
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user