Kstars

DetailsDialog.qml
1// SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com>
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4import QtQuick 2.7
5import QtQuick.Window 2.2
6import QtQuick.Controls 2.0
7import QtQuick.Layouts 1.3
8import "helpers"
9import "menus"
10import "../modules"
11import "../constants" 1.0
12
13KSPage {
14 title: SkyMapLite.clickedObjectLite.translatedName + " - " + tabBar.currentItem.text
15 Item {
16 anchors.fill: parent
17
18 TabBar {
19 id: tabBar
20 property bool isTab: true
21 spacing: 20
22 currentIndex: detailsSwipeView.currentIndex
23 anchors {
24 top: parent.top
25 left: parent.left
26 right: parent.right
27 }
28 background: Rectangle {
29 anchors.fill: parent
30 color: Num.sysPalette.base
31 }
32
33 KSTabButton {
34 text: xi18n("General")
35 }
36
37 KSTabButton {
38 text: xi18n("Position")
39 }
40
41 KSTabButton {
42 Component.onCompleted: {
43 var oldParent = parent
44 parent = Qt.binding(function() { return DetailDialogLite.isLinksOn ? oldParent : null })
45 }
46
47 text: xi18n("Links")
48 }
49
50 KSTabButton {
51 Component.onCompleted: {
52 var oldParent = parent
53 parent = Qt.binding(function() { return DetailDialogLite.isLogOn ? oldParent : null })
54 }
55 text: xi18n("Log")
56 }
57 }
58
59 SwipeView {
60 id: detailsSwipeView
61 anchors {
62 top:tabBar.bottom
63 topMargin: 10
64 left: parent.left
65 right: parent.right
66 bottom: parent.bottom
67 }
68
69 currentIndex: tabBar.currentIndex
70 clip: true
71
72 Pane {
73 clip: true
74
75 background: Rectangle {
76 anchors.fill: parent
77 color: Num.sysPalette.base
78 }
79
80 Flickable {
81 anchors.fill: parent
82 ScrollBar.vertical: ScrollBar { }
83 flickableDirection: Flickable.VerticalFlick
84
85 contentHeight: generalCol.height
86
87 Column {
88 id: generalCol
89 width: parent.width
90 spacing: 15
91
92 KSText {
93 text: DetailDialogLite.name
94 font.pointSize: 16
95 width: parent.width
96 wrapMode: Text.Wrap
97 horizontalAlignment: Text.AlignHCenter
98 }
99
100 Image {
101 source: DetailDialogLite.thumbnail
102 anchors.horizontalCenter: parent.horizontalCenter
103 }
104
105 KSText {
106 text: DetailDialogLite.typeInConstellation
107 anchors.horizontalCenter: parent.horizontalCenter
108 font.pointSize: 12
109 }
110
111 Column {
112 id: telescopesCol
113 width: parent.width
114 property var telescopeControls: []
115
116 Connections {
117 target: ClientManagerLite
118 onTelescopeAdded: {
119 var controls = Qt.createComponent("helpers/TelescopeControl.qml")
120 var controlsObj = controls.createObject(telescopesCol)
121 controlsObj.telescope = newTelescope
122 telescopesCol.telescopeControls.push(controlsObj)
123
124 }
125
126 onTelescopeRemoved: {
127 for(var i = 0; i < telescopesCol.telescopeControls.length; ++i) {
128 if(telescopesCol.telescopeControls[i].telescope == delTelescope) {
129 telescopesCol.telescopeControls[i].parent = null
130 telescopesCol.telescopeControls[i].destroy()
131 }
132 }
133 }
134 }
135 }
136
137 DetailsItem {
138 label: xi18n("Magnitude")
139 value: DetailDialogLite.magnitude
140 }
141
142 DetailsItem {
143 label: xi18n("Distance")
144 value: DetailDialogLite.distance
145 }
146
147 DetailsItem {
148 label: xi18n("B - V Index")
149 value: DetailDialogLite.BVindex
150 }
151
152 DetailsItem {
153 label: xi18n("Size")
154 value: DetailDialogLite.angSize
155 }
156
157 DetailsItem {
158 label: xi18n("Illumination")
159 value: DetailDialogLite.illumination
160 }
161
162 DetailsItem {
163 label: xi18n("Perihelion")
164 value: DetailDialogLite.perihelion
165 }
166
167 DetailsItem {
168 label: xi18n("OrbitID")
169 value: DetailDialogLite.orbitID
170 }
171
172 DetailsItem {
173 label: xi18n("NEO")
174 value: DetailDialogLite.NEO
175 }
176
177 DetailsItem {
178 label: xi18n("Diameter")
179 value: DetailDialogLite.diameter
180 }
181
182 DetailsItem {
183 label: xi18n("Rotation period")
184 value: DetailDialogLite.rotation
185 }
186
187 DetailsItem {
188 label: xi18n("EarthMOID")
189 value: DetailDialogLite.earthMOID
190 }
191
192 DetailsItem {
193 label: xi18n("OrbitClass")
194 value: DetailDialogLite.orbitClass
195 }
196
197 DetailsItem {
198 label: xi18n("Albedo")
199 value: DetailDialogLite.albedo
200 }
201
202 DetailsItem {
203 label: xi18n("Dimensions")
204 value: DetailDialogLite.dimensions
205 }
206
207 DetailsItem {
208 label: xi18n("Period")
209 value: DetailDialogLite.period
210 }
211 }
212 }
213 }
214
215 Pane {
216 clip: true
217
218 background: Rectangle {
219 anchors.fill: parent
220 color: Num.sysPalette.base
221 }
222
223 Flickable {
224 anchors.fill: parent
225 ScrollBar.vertical: ScrollBar { }
226 flickableDirection: Flickable.VerticalFlick
227
228 contentHeight: coordinatesCol.height
229
230 Column {
231 id: coordinatesCol
232 width: parent.width
233 spacing: 15
234
235 KSText {
236 text: xi18n("Coordinates")
237 font {
238 pointSize: 16
239 }
240 anchors.horizontalCenter: parent.horizontalCenter
241 }
242
243 DetailsItem {
244 label: DetailDialogLite.RALabel
245 value: DetailDialogLite.RA
246 }
247
248 DetailsItem {
249 label: DetailDialogLite.decLabel
250 value: DetailDialogLite.dec
251 }
252
253 DetailsItem {
254 label: xi18n("RA (J2000.0)")
255 value: DetailDialogLite.RA0
256 }
257
258 DetailsItem {
259 label: xi18n("Dec (J2000.0)")
260 value: DetailDialogLite.dec0
261 }
262
263 DetailsItem {
264 label: xi18n("Azimuth")
265 value: DetailDialogLite.az
266 }
267
268 DetailsItem {
269 label: xi18n("Altitude")
270 value: DetailDialogLite.alt
271 }
272
273 DetailsItem {
274 label: xi18n("Hour angle")
275 value: DetailDialogLite.HA
276 }
277
278 DetailsItem {
279 label: xi18n("Airmass")
280 value: DetailDialogLite.airmass
281 }
282
283 KSText {
284 text: xi18n("Rise/Set/Transit")
285 font {
286 pointSize: 16
287 }
288 anchors.horizontalCenter: parent.horizontalCenter
289 }
290
291 DetailsItem {
292 label: xi18n("Rise time")
293 value: DetailDialogLite.timeRise
294 }
295
296 DetailsItem {
297 label: xi18n("Transit time")
298 value: DetailDialogLite.timeTransit
299 }
300
301 DetailsItem {
302 label: xi18n("Set time")
303 value: DetailDialogLite.timeSet
304 }
305
306 DetailsItem {
307 label: xi18n("Azimuth at rise")
308 value: DetailDialogLite.azRise
309 }
310
311 DetailsItem {
312 label: xi18n("Azimuth at transit")
313 value: DetailDialogLite.altTransit
314 }
315
316 DetailsItem {
317 label: xi18n("Azimuth at set")
318 value: DetailDialogLite.azSet
319 }
320 }
321 }
322 }
323
324 Pane {
325 parent: DetailDialogLite.isLinksOn ? detailsSwipeView : null
326 clip: true
327 id: links
328
329 background: Rectangle {
330 anchors.fill: parent
331 color: Num.sysPalette.base
332 }
333
334 GridLayout {
335 id: linkCol
336 rowSpacing: 15
337 anchors {
338 top: parent.top
339 left: parent.left
340 right: parent.right
341 bottom: addInfoLandscape.top
342 }
343
344 flow: window.isPortrait ? GridLayout.TopToBottom : GridLayout.LeftToRight
345
346 ColumnLayout {
347 id: infoCol
348
349 Layout.fillWidth: true
350 Layout.fillHeight: true
351 Layout.minimumWidth: parent.width/2
352
353 spacing: 10
354
355 KSText {
356 id: infoLabel
357 text: xi18n("Information Links")
358
359 font.pointSize: 16
360 anchors.horizontalCenter: parent.horizontalCenter
361 }
362
363 Rectangle {
364 id: infoSeparator
365 Layout.fillWidth: true
366 height: 1
367 color: "grey"
368 }
369
370 KSListView {
371 Layout.fillHeight: true
372 Layout.fillWidth: true
373
374 model: DetailDialogLite.infoTitleList
375
376 onClicked: {
377 detailsLinkMenu.openForInfo(index)
378 }
379 }
380 }
381
382 ColumnLayout {
383 id: imgCol
384
385 Layout.fillWidth: true
386 Layout.fillHeight: true
387 Layout.minimumWidth: parent.width/2
388
389 spacing: 10
390
391 KSText {
392 id: imgLabel
393 text: xi18n("Image Links")
394
395 font.pointSize: 16
396 anchors.horizontalCenter: parent.horizontalCenter
397 }
398
399 Rectangle {
400 id: imgSeparator
401 Layout.fillWidth: true
402 height: 1
403 color: "grey"
404 }
405
406 KSListView {
407 Layout.fillHeight: true
408 Layout.fillWidth: true
409
410 model: DetailDialogLite.imageTitleList
411
412 onClicked: {
413 detailsLinkMenu.openForImage(index)
414 }
415 }
416 }
417 }
418
419 Button {
420 id: addInfoLandscape
421 text: xi18n("Add Link")
422
423 anchors.bottom: parent.bottom
424
425 onClicked: {
426 detailsAddLink.openAdd()
427 }
428 }
429 }
430
431 Pane {
432 parent: DetailDialogLite.isLogOn ? detailsSwipeView : null
433 clip: true
434
435 background: Rectangle {
436 anchors.fill: parent
437 color: Num.sysPalette.base
438 }
439
440 Flickable {
441 anchors.fill: parent
442 ScrollBar.vertical: ScrollBar { }
443 flickableDirection: Flickable.VerticalFlick
444
445 contentHeight: logCol.height
446
447 Column {
448 id: logCol
449 width: parent.width
450 spacing: 15
451
452 KSText {
453 text: xi18n("Log")
454 font {
455 pointSize: 16
456 }
457 anchors.horizontalCenter: parent.horizontalCenter
458 }
459
460 TextArea {
461 id: logArea
462 placeholderText: i18n("Record here observation logs and/or data on %1.", SkyMapLite.clickedObjectLite.getTranslatedName())
463 padding: 5
464 width: parent.width
465 wrapMode: TextArea.Wrap
466 text: DetailDialogLite.userLog
467
468 Connections {
469 target: DetailDialogLite
470 onUserLogChanged: {
471 logArea.text = DetailDialogLite.userLog
472 }
473 }
474
475 onEditingFinished: {
476 DetailDialogLite.saveLogData(text)
477 }
478
479 background: Rectangle {
480 implicitWidth: parent.width
481 implicitHeight: 40
482 border{
483 color: Num.sysPalette.base
484 width: 2
485 }
486 }
487 }
488 }
489 }
490 }
491 }
492 }
493}
494
495
496
This qml code implements a vertical scrollbar which shall be displayed in listview of sky-objects.
Definition ScrollBar.qml:9
This is the main item that displays all SkyItems.
Definition skymaplite.h:59
Q_INVOKABLE QString getTranslatedName()
QString xi18n(const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
KGUIADDONS_EXPORT QWindow * window(QObject *job)
QString label(StandardShortcut id)
QTextStream & left(QTextStream &stream)
QTextStream & right(QTextStream &stream)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.