diff --git a/src/ui/fort_images.qrc b/src/ui/fort_images.qrc index 559ccea1..13bec836 100644 --- a/src/ui/fort_images.qrc +++ b/src/ui/fort_images.qrc @@ -27,5 +27,7 @@ images/shield.png images/textfield_rename.png images/tick.png + images/world.png + images/world_link.png diff --git a/src/ui/fort_qml.qrc b/src/ui/fort_qml.qrc index a4421dea..490f9e1c 100644 --- a/src/ui/fort_qml.qrc +++ b/src/ui/fort_qml.qrc @@ -23,6 +23,7 @@ qml/pages/SchedulePage.qml qml/pages/StatisticsPage.qml qml/pages/addresses/AddressesColumn.qml + qml/pages/addresses/AddressGroupRow.qml qml/pages/apps/AppsColumn.qml qml/pages/apps/AppsTextColumn.qml qml/pages/apps/SpeedLimitButton.qml diff --git a/src/ui/images/world.png b/src/ui/images/world.png new file mode 100644 index 00000000..68f21d30 Binary files /dev/null and b/src/ui/images/world.png differ diff --git a/src/ui/images/world_link.png b/src/ui/images/world_link.png new file mode 100644 index 00000000..b8edc126 Binary files /dev/null and b/src/ui/images/world_link.png differ diff --git a/src/ui/qml/pages/AddressesPage.qml b/src/ui/qml/pages/AddressesPage.qml index 4506fee9..993457e6 100644 --- a/src/ui/qml/pages/AddressesPage.qml +++ b/src/ui/qml/pages/AddressesPage.qml @@ -1,65 +1,38 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 +import "../controls" import "addresses" import com.fortfirewall 1.0 BasePage { - property AddressGroup addressGroup: firewallConf.inetAddressGroup - - RowLayout { + ColumnLayout { anchors.fill: parent - spacing: 10 - AddressesColumn { - id: includeAddresses + TabBar { + id: barGroups + Layout.fillWidth: true - title { + TabButton { + icon.source: "qrc:/images/world.png" text: translationManager.dummyBool - && qsTranslate("qml", "Include") + && qsTranslate("qml", "Internet") } - checkBoxAll { - enabled: !excludeAddresses.checkBoxAll.checked - || checkBoxAll.checked + TabButton { + icon.source: "qrc:/images/world_link.png" text: translationManager.dummyBool - && qsTranslate("qml", "Include All") - } - - useAll: addressGroup.includeAll - ipText: addressGroup.includeText - - onUseAllToggled: { - addressGroup.includeAll = checked; - } - onIpTextEdited: { - addressGroup.includeText = ipText; + && qsTranslate("qml", "Filter Internet") } } - AddressesColumn { - id: excludeAddresses + HSeparator {} - title { - text: translationManager.dummyBool - && qsTranslate("qml", "Exclude") - } - checkBoxAll { - enabled: !includeAddresses.checkBoxAll.checked - || checkBoxAll.checked - text: translationManager.dummyBool - && qsTranslate("qml", "Exclude All") - } + AddressGroupRow { + Layout.fillWidth: true + Layout.fillHeight: true - useAll: addressGroup.excludeAll - ipText: addressGroup.excludeText - - onUseAllToggled: { - addressGroup.excludeAll = checked; - } - onIpTextEdited: { - addressGroup.excludeText = ipText; - } + addressGroup: firewallConf.addressGroups[barGroups.currentIndex] } } } diff --git a/src/ui/qml/pages/addresses/AddressGroupRow.qml b/src/ui/qml/pages/addresses/AddressGroupRow.qml new file mode 100644 index 00000000..cecda8bd --- /dev/null +++ b/src/ui/qml/pages/addresses/AddressGroupRow.qml @@ -0,0 +1,61 @@ +import QtQuick 2.9 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.3 +import com.fortfirewall 1.0 + +RowLayout { + + spacing: 10 + + property AddressGroup addressGroup + + AddressesColumn { + id: includeAddresses + + title { + text: translationManager.dummyBool + && qsTranslate("qml", "Include") + } + checkBoxAll { + enabled: !excludeAddresses.checkBoxAll.checked + || checkBoxAll.checked + text: translationManager.dummyBool + && qsTranslate("qml", "Include All") + } + + useAll: addressGroup.includeAll + ipText: addressGroup.includeText + + onUseAllToggled: { + addressGroup.includeAll = checked; + } + onIpTextEdited: { + addressGroup.includeText = ipText; + } + } + + AddressesColumn { + id: excludeAddresses + + title { + text: translationManager.dummyBool + && qsTranslate("qml", "Exclude") + } + checkBoxAll { + enabled: !includeAddresses.checkBoxAll.checked + || checkBoxAll.checked + text: translationManager.dummyBool + && qsTranslate("qml", "Exclude All") + } + + useAll: addressGroup.excludeAll + ipText: addressGroup.excludeText + + onUseAllToggled: { + addressGroup.excludeAll = checked; + } + onIpTextEdited: { + addressGroup.excludeText = ipText; + } + } +}