mirror of
https://github.com/tnodir/fort
synced 2024-11-15 12:56:16 +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 {
|
BasePage {
|
||||||
|
|
||||||
readonly property var appGroups: firewallConf.appGroups
|
readonly property var appGroups: firewallConf.appGroups
|
||||||
|
readonly property int appGroupsCount: appGroups.length
|
||||||
|
|
||||||
function resetGroupName() {
|
function resetGroupName() {
|
||||||
editGroupName.text = "";
|
editGroupName.text = "";
|
||||||
editGroupName.forceActiveFocus();
|
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 {
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
TextField {
|
TextField {
|
||||||
enabled: rptAppGroups.count < 16
|
enabled: appGroupsCount < 16
|
||||||
id: editGroupName
|
id: editGroupName
|
||||||
placeholderText: QT_TRANSLATE_NOOP("qml", "Group Name")
|
placeholderText: QT_TRANSLATE_NOOP("qml", "Group Name")
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,14 @@ ColumnLayout {
|
|||||||
firewallConf.removeAppGroup(index, index);
|
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 {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -41,7 +49,6 @@ ColumnLayout {
|
|||||||
|
|
||||||
textArea {
|
textArea {
|
||||||
placeholderText: "
|
placeholderText: "
|
||||||
System
|
|
||||||
C:\\Program Files\\Internet Explorer\\iexplore.exe
|
C:\\Program Files\\Internet Explorer\\iexplore.exe
|
||||||
"
|
"
|
||||||
text: appGroup.blockText
|
text: appGroup.blockText
|
||||||
@ -59,6 +66,7 @@ C:\\Program Files\\Internet Explorer\\iexplore.exe
|
|||||||
|
|
||||||
textArea {
|
textArea {
|
||||||
placeholderText: "
|
placeholderText: "
|
||||||
|
System
|
||||||
C:\\Program Files\\Skype\\Phone\\Skype.exe
|
C:\\Program Files\\Skype\\Phone\\Skype.exe
|
||||||
"
|
"
|
||||||
text: appGroup.allowText
|
text: appGroup.allowText
|
||||||
|
Loading…
Reference in New Issue
Block a user