fort/src/ui/qml/main.qml

87 lines
2.1 KiB
QML
Raw Normal View History

2017-09-01 13:13:12 +00:00
import QtQuick 2.9
import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2
import QtQuick.Controls 2.2
import "pages"
2017-09-02 10:17:51 +00:00
import com.fortfirewall 1.0
2017-09-01 13:13:12 +00:00
ApplicationWindow {
id: mainWindow
2017-09-01 15:13:17 +00:00
width: 800
height: 600
2017-09-02 12:52:39 +00:00
minimumWidth: 540
minimumHeight: 500
2017-09-02 13:07:40 +00:00
visible: true
2017-09-01 13:13:12 +00:00
font.pixelSize: 16
2017-09-02 10:17:51 +00:00
readonly property FortSettings fortSettings: fortManager.fortSettings
readonly property FirewallConf firewallConf: fortManager.firewallConfToEdit
2017-09-01 13:13:12 +00:00
Component.onCompleted: {
tabBar.currentItem.forceActiveFocus();
}
function closeWindow() {
mainWindow.close();
}
Page {
anchors.fill: parent
Keys.onEscapePressed: closeWindow()
header: TabBar {
id: tabBar
currentIndex: swipeView.currentIndex
TabButton {
text: QT_TRANSLATE_NOOP("qml", "Options")
}
TabButton {
text: QT_TRANSLATE_NOOP("qml", "IPv4 Addresses")
}
TabButton {
text: QT_TRANSLATE_NOOP("qml", "Applications")
}
2017-09-02 08:18:26 +00:00
TabButton {
text: QT_TRANSLATE_NOOP("qml", "Activity")
}
2017-09-01 13:13:12 +00:00
}
SwipeView {
id: swipeView
anchors.fill: parent
currentIndex: tabBar.currentIndex
2017-09-01 15:13:17 +00:00
OptionsPage {}
AddressesPage {}
ApplicationsPage {}
2017-09-02 08:07:07 +00:00
ActivityPage {}
2017-09-01 13:13:12 +00:00
}
footer: Pane {
RowLayout {
anchors.right: parent.right
Button {
text: QT_TRANSLATE_NOOP("qml", "OK")
onClicked: {
2017-09-01 15:13:17 +00:00
if (fortManager.saveConf())
2017-09-01 13:13:12 +00:00
closeWindow();
}
}
Button {
text: QT_TRANSLATE_NOOP("qml", "Cancel")
onClicked: closeWindow()
}
Button {
text: QT_TRANSLATE_NOOP("qml", "Quit")
onClicked: Qt.quit()
}
}
}
}
}