fort/src/ui/qml/main.qml

84 lines
1.9 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"
ApplicationWindow {
id: mainWindow
visible: true
title: QT_TRANSLATE_NOOP("qml", "Fort Firewall")
width: 640
height: 480
minimumWidth: 400
minimumHeight: 300
font.pixelSize: 16
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")
}
}
SwipeView {
id: swipeView
anchors.fill: parent
currentIndex: tabBar.currentIndex
OptionsPage {
}
AddressesPage {
}
ApplicationsPage {
}
}
footer: Pane {
RowLayout {
anchors.right: parent.right
Button {
text: QT_TRANSLATE_NOOP("qml", "OK")
onClicked: {
if (fortWindow.save())
closeWindow();
}
}
Button {
text: QT_TRANSLATE_NOOP("qml", "Cancel")
onClicked: closeWindow()
}
Button {
text: QT_TRANSLATE_NOOP("qml", "Quit")
onClicked: Qt.quit()
}
}
}
}
}