UI: AddressesPage: Add "Internet" & "Filter Internet" tabs.

This commit is contained in:
Nodir Temirkhodjaev 2018-01-20 15:27:13 +05:00
parent 8c468aaa69
commit 4c918df002
6 changed files with 80 additions and 43 deletions

View File

@ -27,5 +27,7 @@
<file>images/shield.png</file>
<file>images/textfield_rename.png</file>
<file>images/tick.png</file>
<file>images/world.png</file>
<file>images/world_link.png</file>
</qresource>
</RCC>

View File

@ -23,6 +23,7 @@
<file>qml/pages/SchedulePage.qml</file>
<file>qml/pages/StatisticsPage.qml</file>
<file>qml/pages/addresses/AddressesColumn.qml</file>
<file>qml/pages/addresses/AddressGroupRow.qml</file>
<file>qml/pages/apps/AppsColumn.qml</file>
<file>qml/pages/apps/AppsTextColumn.qml</file>
<file>qml/pages/apps/SpeedLimitButton.qml</file>

BIN
src/ui/images/world.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 957 B

View File

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

View File

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