120 lines
3.2 KiB
QML
Raw Normal View History

2020-10-18 06:50:26 -05:00
/*
* Copyright (c) 2020-2021 Alex Spataru <https://github.com/alex-spataru>
2020-10-18 06:50:26 -05:00
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import QtQuick 2.12
import QtQuick.Controls 2.12
2021-09-25 21:48:06 -05:00
import "Windows" as Windows
2021-09-05 02:41:48 -05:00
Item {
2021-09-25 21:48:06 -05:00
id: app
//
// Global propeties
//
readonly property int spacing: 8
2021-09-24 15:07:43 -05:00
readonly property string monoFont: "Roboto Mono"
2020-12-27 17:21:19 -06:00
2021-10-01 11:22:11 -05:00
//
// Access to dialogs & windows
//
property Windows.About about: null
property Windows.Donate donations: null
property Windows.CsvPlayer csvPlayer: null
property Windows.MainWindow mainWindow: null
property Windows.JsonEditor jsonEditor: null
property Windows.Acknowledgements acknowledgements: null
2021-10-01 11:22:11 -05:00
2021-09-25 21:48:06 -05:00
//
// Check for updates (non-silent mode)
//
function checkForUpdates() {
Cpp_Updater.setNotifyOnFinish(Cpp_AppUpdaterUrl, true)
Cpp_Updater.checkForUpdates(Cpp_AppUpdaterUrl)
}
//
// MainWindow
//
2021-10-01 11:22:11 -05:00
Loader {
asynchronous: true
sourceComponent: Windows.MainWindow {
2021-11-09 20:18:51 -06:00
Component.onCompleted: {
2021-11-19 11:26:20 -06:00
Cpp_ModuleManager.hideSplashscreen()
app.forceActiveFocus()
2021-11-09 20:18:51 -06:00
app.mainWindow = this
}
2021-10-01 11:22:11 -05:00
}
2021-09-25 21:48:06 -05:00
}
//
// About window
//
2021-10-01 11:22:11 -05:00
Loader {
asynchronous: true
sourceComponent: Windows.About {
Component.onCompleted: app.about = this
}
2021-09-25 21:48:06 -05:00
}
//
// CSV player window
//
2021-10-01 11:22:11 -05:00
Loader {
asynchronous: true
sourceComponent: Windows.CsvPlayer {
Component.onCompleted: app.csvPlayer = this
}
2021-09-25 21:48:06 -05:00
}
//
// JSON Editor dialog
//
2021-10-01 11:22:11 -05:00
Loader {
asynchronous: true
sourceComponent: Windows.JsonEditor {
Component.onCompleted: app.jsonEditor = this
}
2021-09-25 21:48:06 -05:00
}
//
// Donations dialog
//
2021-10-01 11:22:11 -05:00
Loader {
2021-11-18 23:43:12 -06:00
asynchronous: false
2021-10-01 11:22:11 -05:00
sourceComponent: Windows.Donate {
Component.onCompleted: app.donations = this
}
}
//
// Acknowledgements dialog
//
Loader {
asynchronous: true
sourceComponent: Windows.Acknowledgements {
Component.onCompleted: app.acknowledgements = this
}
}
2020-10-18 06:50:26 -05:00
}