Changeset View
Changeset View
Standalone View
Standalone View
kstars/tools/whatsinteresting/wiview.h
Context not available. | |||||
15 | * * | 15 | * * | ||
---|---|---|---|---|---|
16 | ***************************************************************************/ | 16 | ***************************************************************************/ | ||
17 | 17 | | |||
18 | #ifndef WIVIEW_H | 18 | #pragma once | ||
19 | #define WIVIEW_H | | |||
20 | 19 | | |||
21 | class QQuickView; | | |||
22 | class QQuickItem; | | |||
23 | | ||||
24 | #include <QQmlContext> | | |||
25 | #include "skyobject.h" | 20 | #include "skyobject.h" | ||
26 | #include "modelmanager.h" | 21 | #include "modelmanager.h" | ||
27 | #include "skyobjlistmodel.h" | 22 | #include "skyobjlistmodel.h" | ||
28 | #include "obsconditions.h" | 23 | #include "obsconditions.h" | ||
29 | 24 | | |||
25 | class QQmlContext; | ||||
26 | class QQuickView; | ||||
27 | class QQuickItem; | ||||
28 | | ||||
30 | /** | 29 | /** | ||
31 | * \class WIView | 30 | * \class WIView | ||
32 | * \brief Manages the QML user interface for What's Interesting. | 31 | * \brief Manages the QML user interface for What's Interesting. | ||
Context not available. | |||||
44 | * Connect signals from various QML components into public slots. | 43 | * Connect signals from various QML components into public slots. | ||
45 | * Displays the user interface for What's Interesting | 44 | * Displays the user interface for What's Interesting | ||
46 | */ | 45 | */ | ||
47 | WIView(QWidget *parent = 0); | 46 | explicit WIView(QWidget *parent = nullptr); | ||
48 | 47 | | |||
49 | /** | 48 | /** | ||
50 | * \brief Destructor | 49 | * \brief Destructor | ||
51 | */ | 50 | */ | ||
52 | ~WIView(); | 51 | ~WIView(); | ||
53 | 52 | | |||
54 | /** | 53 | /** | ||
55 | * \brief Load details-view for selected sky-object | 54 | * \brief Load details-view for selected sky-object | ||
56 | */ | 55 | */ | ||
57 | void loadDetailsView(SkyObjItem *soitem, int index); | 56 | void loadDetailsView(SkyObjItem *soitem, int index); | ||
58 | 57 | | |||
59 | /** | 58 | /** | ||
60 | * \brief Updates sky-object list models | 59 | * \brief Updates sky-object list models | ||
61 | */ | 60 | */ | ||
62 | void updateModel(ObsConditions *obs); | 61 | void updateModel(ObsConditions& obs); | ||
63 | 62 | | |||
64 | inline QQuickView *getWIBaseView() const { return m_BaseView; } | 63 | inline QQuickView *getWIBaseView() const { return m_BaseView; } | ||
65 | 64 | | |||
66 | public slots: | 65 | public slots: | ||
67 | 66 | | |||
68 | /** | 67 | /** | ||
69 | * \brief public slot - Act upon signal emitted when category of sky-object is selected | 68 | * \brief public slot - Act upon signal emitted when category of sky-object is selected | ||
70 | * from category selection view of the QML UI. | 69 | * from category selection view of the QML UI. | ||
71 | * \param type Category selected | 70 | * \param type Category selected | ||
72 | */ | 71 | */ | ||
73 | void onCategorySelected(QString model); | 72 | void onCategorySelected(QString model); | ||
74 | 73 | | |||
75 | /** | 74 | /** | ||
76 | * \brief public slot - Act upon signal emitted when an item is selected from list of sky-objects. | 75 | * \brief public slot - Act upon signal emitted when an item is selected from list of sky-objects. | ||
77 | * Display details-view for the skyobject selected. | 76 | * Display details-view for the skyobject selected. | ||
78 | * \param type Category selected. | 77 | * \param type Category selected. | ||
79 | * \param typename Name of category selected. | 78 | * \param typename Name of category selected. | ||
80 | * \param index Index of item in the list of skyobjects. | 79 | * \param index Index of item in the list of skyobjects. | ||
81 | */ | 80 | */ | ||
82 | void onSoListItemClicked(int index); | 81 | void onSoListItemClicked(int index); | ||
83 | 82 | | |||
84 | /** | 83 | /** | ||
85 | * \brief public slot - Show details-view for next sky-object from list of current sky-objects's category. | 84 | * \brief public slot - Show details-view for next sky-object from list of current sky-objects's category. | ||
86 | */ | 85 | */ | ||
87 | void onNextObjClicked(); | 86 | void onNextObjClicked(); | ||
88 | 87 | | |||
89 | /** | 88 | /** | ||
90 | * \brief public slot - Show details-view for previous sky-object from list of current sky-objects's category. | 89 | * \brief public slot - Show details-view for previous sky-object from list of current sky-objects's | ||
91 | */ | 90 | * category. | ||
91 | */ | ||||
92 | void onPrevObjClicked(); | 92 | void onPrevObjClicked(); | ||
93 | 93 | | |||
94 | /** | 94 | /** | ||
95 | * \brief public slot - Slew map to current sky-object in the details view. | 95 | * \brief public slot - Slew map to current sky-object in the details view. | ||
96 | */ | 96 | */ | ||
97 | void onCenterButtonClicked(); | 97 | void onCenterButtonClicked(); | ||
98 | 98 | | |||
99 | /** | 99 | /** | ||
100 | * \brief public slot - Slew map to current sky-object in the details view. | 100 | * \brief public slot - Slew map to current sky-object in the details view. | ||
101 | */ | 101 | */ | ||
102 | void onSlewTelescopeButtonClicked(); | 102 | void onSlewTelescopeButtonClicked(); | ||
103 | 103 | | |||
104 | /** | 104 | /** | ||
105 | * \brief public slot - Open Details Dialog to show more details for current sky-object. | 105 | * \brief public slot - Open Details Dialog to show more details for current sky-object. | ||
106 | */ | 106 | */ | ||
107 | void onDetailsButtonClicked(); | 107 | void onDetailsButtonClicked(); | ||
108 | 108 | | |||
109 | /** | 109 | /** | ||
110 | * \brief public slot - Open WI settings dialog. | 110 | * \brief public slot - Open WI settings dialog. | ||
111 | */ | 111 | */ | ||
112 | void onSettingsIconClicked(); | 112 | void onSettingsIconClicked(); | ||
113 | 113 | | |||
114 | void onInspectIconClicked(bool checked) { inspectOnClick = checked; } | 114 | void onInspectIconClicked(bool checked) { inspectOnClick = checked; } | ||
115 | 115 | | |||
116 | /** | 116 | /** | ||
117 | * \brief public slot - Reload list of visible sky-objects. | 117 | * \brief public slot - Reload list of visible sky-objects. | ||
118 | */ | 118 | */ | ||
119 | void onReloadIconClicked(); | 119 | void onReloadIconClicked(); | ||
120 | 120 | | |||
121 | void onVisibleIconClicked(bool checked); | 121 | void onVisibleIconClicked(bool checked); | ||
Context not available. | |||||
132 | void saveInfoURL(SkyObjItem *soitem, QString infoURL); | 132 | void saveInfoURL(SkyObjItem *soitem, QString infoURL); | ||
133 | void saveObjectInfoBoxText(SkyObjItem *soitem, QString type, QString infoText); | 133 | void saveObjectInfoBoxText(SkyObjItem *soitem, QString type, QString infoText); | ||
134 | void downloadWikipediaImage(SkyObjItem *soitem, QString imageURL); | 134 | void downloadWikipediaImage(SkyObjItem *soitem, QString imageURL); | ||
135 | void inspectSkyObject(QString name); | 135 | void inspectSkyObject(const QString& name); | ||
136 | void inspectSkyObjectOnClick(SkyObject *obj); | 136 | void inspectSkyObjectOnClick(SkyObject *obj); | ||
137 | void inspectSkyObject(SkyObject *obj); | 137 | void inspectSkyObject(SkyObject *obj); | ||
138 | bool inspectOnClickIsActive() { return inspectOnClick; } | 138 | bool inspectOnClickIsActive() { return inspectOnClick; } | ||
Context not available. | |||||
153 | QQuickView *m_BaseView; | 153 | QQuickView *m_BaseView; | ||
154 | ObsConditions *m_Obs = nullptr; | 154 | ObsConditions *m_Obs = nullptr; | ||
155 | ModelManager *m_ModManager; | 155 | ModelManager *m_ModManager; | ||
156 | SkyObjItem *m_CurSoItem = nullptr; ///Current sky-object item. | 156 | /// Current sky-object item. | ||
157 | int m_CurIndex; ///Index of current sky-object item in details-view. | 157 | SkyObjItem *m_CurSoItem = nullptr; | ||
158 | QString m_CurrentObjectListName; ///Currently selected category from WI QML view | 158 | /// Index of current sky-object item in Details view. | ||
159 | int m_CurIndex; | ||||
160 | /// Currently selected category from WI QML view | ||||
161 | QString m_CurrentObjectListName; | ||||
159 | QString getWikipediaName(SkyObjItem *soitem); | 162 | QString getWikipediaName(SkyObjItem *soitem); | ||
160 | QNetworkAccessManager *manager; | 163 | QNetworkAccessManager *manager; | ||
161 | bool inspectOnClick; | 164 | bool inspectOnClick; | ||
162 | }; | 165 | }; | ||
163 | | ||||
164 | #endif | | |||
Context not available. |