-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathTilePackageKreator.qml
169 lines (140 loc) · 7.1 KB
/
TilePackageKreator.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/* Copyright 2021 Esri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import QtQuick 2.15
//------------------------------------------------------------------------------
import ArcGIS.AppFramework 1.0
//------------------------------------------------------------------------------
import "Portal"
import "singletons" as Singletons
//------------------------------------------------------------------------------
App {
// PROPERTIES //////////////////////////////////////////////////////////////
id: app
width: sf(900)
height: sf(675)
property bool calledFromAnotherApp: false
property url incomingUrl
property bool useIconFont: Qt.platform.os !== "windows" ? true : false
property string icons: _icons.status == FontLoader.Ready ? _icons.name : "tilepackage"
property string defaultFontFamily: Qt.application.font.family
property bool settingsChanged: false
property bool allowAllLevels: app.settings.boolValue(Singletons.Constants.kAllowAllZoomLevels, false)
property bool allowNonWebMercatorServices: app.settings.boolValue(Singletons.Constants.kAllowNonWebMercatorServices, false)
property bool timeoutNonResponsiveServices: app.settings.boolValue(Singletons.Constants.kTimeOutUnresponsiveServices, true)
property int timeoutValue: app.settings.numberValue(Singletons.Constants.kTimeOutValue, 7)
property string defaultSearchQuery: '(type:"Map Service" AND owner:esri AND title:(for Export)) OR (type:("Map Service") AND group:(access:org))'
property string currentUserSearchQuery: ""
property bool includeCurrentUserInSearch: app.settings.boolValue(Singletons.Constants.kIncludeCurrentUserInSearch, true);
property string servicesSearchQuery: app.settings.value(Singletons.Constants.kSearchQueryString, defaultSearchQuery);
Component.onCompleted: {
if (!appDatabase.exists()) {
appDatabase.createDatabase();
}
}
// SIGNAL IMPLEMENTATIONS //////////////////////////////////////////////////
onOpenUrl: {
if(url.toString() !== ""){
calledFromAnotherApp = true;
incomingUrl = url;
}
}
onAllowAllLevelsChanged: {
app.settings.setValue(Singletons.Constants.kAllowAllZoomLevels, allowAllLevels);
}
onAllowNonWebMercatorServicesChanged: {
app.settings.setValue(Singletons.Constants.kAllowNonWebMercatorServices, allowNonWebMercatorServices);
}
onTimeoutNonResponsiveServicesChanged: {
settingsChanged = true;
app.settings.setValue(Singletons.Constants.kTimeOutUnresponsiveServices, timeoutNonResponsiveServices);
}
onTimeoutValueChanged: {
settingsChanged = true;
app.settings.setValue(Singletons.Constants.kTimeOutValue, timeoutValue);
}
onServicesSearchQueryChanged: {
settingsChanged = true;
app.settings.setValue(Singletons.Constants.kSearchQueryString, servicesSearchQuery);
}
onIncludeCurrentUserInSearchChanged: {
settingsChanged = true;
app.settings.boolValue(Singletons.Constants.kIncludeCurrentUserInSearch, includeCurrentUserInSearch);
}
// COMPONENTS //////////////////////////////////////////////////////////////
Portal {
id: portal
clientId: app.info.value("deployment").clientId
clientMode: false
settings: app.settings
}
//--------------------------------------------------------------------------
MainView {
anchors.fill: parent
portal: portal
parentApp: app
}
AppDb {
id: appDatabase
}
//--------------------------------------------------------------------------
FontLoader {
id: _icons
source: "fonts/tilepackage.ttf"
readonly property string app_studio: useIconFont ? "\ue904" : "images/appstudio.svg"
property string add_bookmark: useIconFont ? "E" : "images/add-bookmark.svg"
property string bookmark: useIconFont ? "C" : "images/bookmark.svg"
property string chat_bubble: useIconFont ? "g" : "images/feedback.svg"
property string checkmark: useIconFont ? "p" : "images/checkmark.svg"
property string chevron_left: useIconFont ? "A" : "images/left-chevron.svg"
property string chevron_right: useIconFont ? "B" : "images/right-chevron.svg"
property string download: useIconFont ? "z" : "images/download.svg"
property string download_circle: useIconFont ? "n" : "images/updates.svg"
property string draw_extent: useIconFont ? "b" : "images/draw-extent.svg"
property string draw_path: useIconFont ? "y" : "images/draw-path.svg"
property string draw_polygon: useIconFont ? "D" : "images/draw-polygon.svg"
property string draw_tool: useIconFont ? "F" : "images/draw-tool.svg"
property string geojson: useIconFont ? "H" : "images/geojson.svg"
property string happy_face: useIconFont ? "x" : "images/happy.svg"
property string history: useIconFont ? "f" : "images/history.svg"
property string info: useIconFont ? "r" : "images/info.svg"
property string loop: useIconFont ? "\uea2e" : "images/spinner.svg"
property string magnifying_glass: useIconFont ? "l" : "images/search.svg"
property string minus_sign: useIconFont ? "s" : "images/minus.svg"
property string plus_sign: useIconFont ? "t" : "images/plus.svg"
property string question: useIconFont ? "u" : "images/question.svg"
property string redraw_last_path: useIconFont ? "d" : "images/redraw-last.svg"
property string sad_face: useIconFont ? "w" : "images/sad.svg"
property string settings: useIconFont ? "G" : "images/settings.svg"
property string sign_out: useIconFont ? "c" : "images/sign-out.svg"
// property string spinner: "\ue982"
property string spinner2: useIconFont ? "i" : "images/spinner2.svg"
// property string spinner3: "\ue983"
property string trash_bin: useIconFont ? "m" : "images/trash.svg"
property string upload: useIconFont ? "a" : "images/upload.svg"
property string user: useIconFont ? "h" : "images/user.svg"
property string warning: useIconFont ? "v" : "images/warning.svg"
property string x_cross: useIconFont ? "q" : "images/close.svg"
//--------------------------------------------------------------------------
function getIconByName(name){
return this[name];
}
}
// -------------------------------------------------------------------------
function sf(val){
return val * AppFramework.displayScaleFactor;s
}
// END /////////////////////////////////////////////////////////////////////
}