fort/src/ui/qml/main.qml

59 lines
1.0 KiB
QML
Raw Normal View History

2017-09-01 13:13:12 +00:00
import QtQuick 2.9
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 {
2017-09-03 05:57:35 +00:00
id: appWindow
2017-09-01 13:13:12 +00:00
2017-09-01 15:13:17 +00:00
width: 800
height: 600
2017-09-02 14:25:47 +00:00
minimumWidth: 700
minimumHeight: 600
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-03 05:57:35 +00:00
onClosing: {
if (visible) {
close.accepted = false;
closeWindow();
}
}
onVisibleChanged: {
if (visible) {
2017-09-04 11:39:15 +00:00
mainPage.opened();
} else {
mainPage.closed();
2017-09-03 05:57:35 +00:00
}
2017-09-01 13:13:12 +00:00
}
function closeWindow() {
2017-09-03 05:57:35 +00:00
fortManager.closeWindow();
2017-09-01 13:13:12 +00:00
}
2017-09-05 11:06:21 +00:00
FileUtil {
id: fileUtil
}
NetUtil {
id: netUtil
}
OsUtil {
id: osUtil
}
2017-09-03 05:57:35 +00:00
MainPage {
id: mainPage
2017-09-01 13:13:12 +00:00
anchors.fill: parent
2017-09-06 12:06:14 +00:00
implicitWidth: 0 // XXX: Workaround for binding loop
2017-09-01 13:13:12 +00:00
Keys.onEscapePressed: closeWindow()
}
}