mirror of
https://github.com/tnodir/fort
synced 2024-11-18 00:35:50 +00:00
84 lines
1.9 KiB
QML
84 lines
1.9 KiB
QML
|
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()
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|