Skip to content

Commit

Permalink
Tweak startup performance
Browse files Browse the repository at this point in the history
  • Loading branch information
gschwann committed Oct 11, 2016
1 parent d630b86 commit cb39e37
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 13 deletions.
40 changes: 40 additions & 0 deletions src/ShutDownDialog.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
** This file is part of the Baugeschichte.at project.
**
** The MIT License (MIT)
**
** 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.4
import QtQuick.Dialogs 1.2

MessageDialog {
id: shutDownDialog
icon: StandardIcon.Question
standardButtons: StandardButton.Yes | StandardButton.No
modality: Qt.WindowModal
title: qsTr("Baugeschichte App beenden?")
onYes: {
Qt.quit();
}
onNo: {
visible = false;
}
}
27 changes: 14 additions & 13 deletions src/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import QtQuick.Controls.Styles 1.4
import QtPositioning 5.5
import QtLocation 5.5
import Qt.labs.settings 1.0
import QtQuick.Dialogs 1.2
import "./"

Item {
Expand Down Expand Up @@ -220,17 +219,14 @@ Item {
// PositionSource
property variant locationGraz: QtPositioning.coordinate(47.0666667, 15.45)

MessageDialog {
Loader {
id: shutDownDialog
icon: StandardIcon.Question
standardButtons: StandardButton.Yes | StandardButton.No
modality: Qt.WindowModal
title: qsTr("Baugeschichte App beenden?")
onYes: {
Qt.quit();
}
onNo: {
visible = false;

function open() {
if (source == "") {
source = "ShutDownDialog.qml";
}
item.visible = true;
}
}

Expand All @@ -252,7 +248,7 @@ Item {
if (uiStack.depth > 1) {
uiStack.pop()
} else {
shutDownDialog.visible = true
shutDownDialog.open();
}
}
}
Expand Down Expand Up @@ -312,7 +308,7 @@ Item {
}
}

DetailsView {
Loader {
id: details

x: visible ? (parent.splitScreen ? parent.width / 2 : 0) : parent.width
Expand All @@ -321,6 +317,11 @@ Item {

clip: true
visible: appCore.showDetails
onVisibleChanged: {
if (visible && source == "") {
setSource("DetailsView.qml");
}
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@
<file>resources/arrow-right.svg</file>
<file>SearchModel.qml</file>
<file>qmldir</file>
<file>ShutDownDialog.qml</file>
</qresource>
</RCC>

0 comments on commit cb39e37

Please sign in to comment.