mirror of
https://github.com/tnodir/fort
synced 2024-11-15 05:25:56 +00:00
UI: Improve app groups handling.
This commit is contained in:
parent
b8c58cce82
commit
9e32f39fb1
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user