Merge lp:~daggerstab/stellarium/custom-object-info-gui into lp:stellarium

Proposed by Bogdan Marinov
Status: Merged
Merged at revision: 5450
Proposed branch: lp:~daggerstab/stellarium/custom-object-info-gui
Merge into: lp:stellarium
Diff against target: 1753 lines (+477/-963)
12 files modified
src/CMakeLists.txt (+0/-4)
src/core/StelObject.hpp (+9/-3)
src/core/StelObjectMgr.cpp (+0/-154)
src/core/StelObjectMgr.hpp (+0/-2)
src/gui/ConfigurationDialog.cpp (+100/-40)
src/gui/ConfigurationDialog.hpp (+8/-8)
src/gui/CustomInfoDialog.cpp (+0/-249)
src/gui/CustomInfoDialog.hpp (+0/-96)
src/gui/CustomInfoDialog.ui (+0/-286)
src/gui/SkyGui.cpp (+30/-1)
src/gui/SkyGui.hpp (+2/-0)
src/gui/configurationDialog.ui (+328/-120)
To merge this branch: bzr merge lp:~daggerstab/stellarium/custom-object-info-gui
Reviewer Review Type Date Requested Status
Alexander Wolf Approve
Review via email: mp+115778@code.launchpad.net

Description of the change

I've rewritten the feature allowing customization of the information displayed for a selected object that was introduced before the previous release.

Now instead of a separate window it's a tab in the Configuration window.It also works in a different manner than the original feature, though I've kept the same keys in the configuration file.

A possible modification is moving it to the Sky and viewing options window.

I the changes are approved, I'd like to merge them in the trunk myself.

To post a comment you must log in.
Revision history for this message
Alexander Wolf (alexwolf) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/CMakeLists.txt'
2--- src/CMakeLists.txt 2012-06-14 03:22:36 +0000
3+++ src/CMakeLists.txt 2012-07-19 16:10:25 +0000
4@@ -415,8 +415,6 @@
5 gui/AddRemoveLandscapesDialog.cpp
6 gui/AtmosphereDialog.hpp
7 gui/AtmosphereDialog.cpp
8- gui/CustomInfoDialog.hpp
9- gui/CustomInfoDialog.cpp
10 gui/StelDialog.hpp
11 gui/StelDialog.cpp)
12
13@@ -436,7 +434,6 @@
14 gui/ConfigurationDialog.hpp
15 gui/AddRemoveLandscapesDialog.hpp
16 gui/AtmosphereDialog.hpp
17- gui/CustomInfoDialog.hpp
18 gui/StelDialog.hpp)
19
20 ################# compiles .ui files ############
21@@ -448,7 +445,6 @@
22 gui/searchDialogGui.ui
23 gui/configurationDialog.ui
24 gui/AtmosphereDialog.ui
25- gui/CustomInfoDialog.ui
26 gui/addRemoveLandscapesDialog.ui)
27
28 IF(ENABLE_SCRIPT_CONSOLE)
29
30=== modified file 'src/core/StelObject.hpp'
31--- src/core/StelObject.hpp 2012-04-13 16:42:43 +0000
32+++ src/core/StelObject.hpp 2012-07-19 16:10:25 +0000
33@@ -20,6 +20,7 @@
34 #ifndef _STELOBJECT_HPP_
35 #define _STELOBJECT_HPP_
36
37+#include <QFlags>
38 #include <QString>
39 #include "VecMath.hpp"
40 #include "StelObjectType.hpp"
41@@ -38,7 +39,8 @@
42 //! filter results of getInfoString. The precise definition of these should
43 //! be documented in the getInfoString documentation for the derived classes
44 //! for all specifiers which are defined in that derivative.
45- enum InfoStringGroup
46+ //! Use InfoStringGroup instead.
47+ enum InfoStringGroupFlags
48 {
49 Name = 0x00000001, //!< An object's name
50 CatalogNumber = 0x00000002, //!< Catalog numbers
51@@ -55,11 +57,13 @@
52 HourAngle = 0x00001000, //!< The hour angle + DE (of date)
53 AbsoluteMagnitude = 0x00002000 //!< The absolute magnitude
54 };
55+ typedef QFlags<InfoStringGroupFlags> InfoStringGroup;
56+ Q_FLAGS(InfoStringGroup)
57
58 //! A pre-defined set of specifiers for the getInfoString flags argument to getInfoString
59- static const InfoStringGroup AllInfo = (InfoStringGroup)(Name|CatalogNumber|Magnitude|RaDecJ2000|RaDecOfDate|AltAzi|Distance|Size|Extra1|Extra2|Extra3|HourAngle|AbsoluteMagnitude);
60+ static const InfoStringGroupFlags AllInfo = (InfoStringGroupFlags)(Name|CatalogNumber|Magnitude|RaDecJ2000|RaDecOfDate|AltAzi|Distance|Size|Extra1|Extra2|Extra3|HourAngle|AbsoluteMagnitude);
61 //! A pre-defined set of specifiers for the getInfoString flags argument to getInfoString
62- static const InfoStringGroup ShortInfo = (InfoStringGroup)(Name|CatalogNumber|Magnitude|RaDecJ2000);
63+ static const InfoStringGroupFlags ShortInfo = (InfoStringGroupFlags)(Name|CatalogNumber|Magnitude|RaDecJ2000);
64
65 virtual ~StelObject() {}
66
67@@ -148,4 +152,6 @@
68 void postProcessInfoString(QString& str, const InfoStringGroup& flags) const;
69 };
70
71+Q_DECLARE_OPERATORS_FOR_FLAGS(StelObject::InfoStringGroup)
72+
73 #endif // _STELOBJECT_HPP_
74
75=== modified file 'src/core/StelObjectMgr.cpp'
76--- src/core/StelObjectMgr.cpp 2012-04-13 16:50:19 +0000
77+++ src/core/StelObjectMgr.cpp 2012-07-19 16:10:25 +0000
78@@ -32,7 +32,6 @@
79 #include <QString>
80 #include <QDebug>
81 #include <QStringList>
82-#include <QSettings>
83
84 StelObjectMgr::StelObjectMgr() : searchRadiusPixel(30.f), distanceWeight(1.f)
85 {
86@@ -245,156 +244,3 @@
87 result.sort();
88 return result;
89 }
90-
91-int StelObjectMgr::getCustomInfoString(void)
92-{
93- QSettings* conf = StelApp::getInstance().getSettings();
94-
95- bool Name = conf->value("custom_selected_info/flag_show_name", false).toBool();
96- bool CatalogNumber = conf->value("custom_selected_info/flag_show_catalognumber", false).toBool();
97- bool Magnitude = conf->value("custom_selected_info/flag_show_magnitude", false).toBool();
98- bool RaDecJ2000 = conf->value("custom_selected_info/flag_show_radecj2000", false).toBool();
99- bool RaDecOfDate = conf->value("custom_selected_info/flag_show_radecofdate", false).toBool();
100- bool AltAz = conf->value("custom_selected_info/flag_show_altaz", false).toBool();
101- bool Distance = conf->value("custom_selected_info/flag_show_distance", false).toBool();
102- bool Size = conf->value("custom_selected_info/flag_show_size", false).toBool();
103- bool Extra1 = conf->value("custom_selected_info/flag_show_extra1", false).toBool();
104- bool Extra2 = conf->value("custom_selected_info/flag_show_extra2", false).toBool();
105- bool Extra3 = conf->value("custom_selected_info/flag_show_extra3", false).toBool();
106- bool HourAngle = conf->value("custom_selected_info/flag_show_hourangle", false).toBool();
107- bool AbsoluteMagnitude = conf->value("custom_selected_info/flag_show_absolutemagnitude", false).toBool();
108-
109- int OctZero = 0x00000000;
110-
111- int NameOct;
112- if (Name)
113- {
114- NameOct = StelObject::Name;
115- }
116- else
117- {
118- NameOct = OctZero;
119- }
120-
121- int CatalogNumberOct;
122- if (CatalogNumber)
123- {
124- CatalogNumberOct = StelObject::CatalogNumber;
125- }
126- else
127- {
128- CatalogNumberOct = OctZero;
129- }
130-
131- int MagnitudeOct;
132- if (Magnitude)
133- {
134- MagnitudeOct = StelObject::Magnitude;
135- }
136- else
137- {
138- MagnitudeOct = OctZero;
139- }
140-
141- int RaDecJ2000Oct;
142- if (RaDecJ2000)
143- {
144- RaDecJ2000Oct = StelObject::RaDecJ2000;
145- }
146- else
147- {
148- RaDecJ2000Oct = OctZero;
149- }
150-
151- int RaDecOfDateOct;
152- if (RaDecOfDate)
153- {
154- RaDecOfDateOct = StelObject::RaDecOfDate;
155- }
156- else
157- {
158- RaDecOfDateOct = OctZero;
159- }
160-
161- int AltAzOct;
162- if (AltAz)
163- {
164- AltAzOct = StelObject::AltAzi;
165- }
166- else
167- {
168- AltAzOct = OctZero;
169- }
170-
171- int DistanceOct;
172- if (Distance)
173- {
174- DistanceOct = StelObject::Distance;
175- }
176- else
177- {
178- DistanceOct = OctZero;
179- }
180-
181- int SizeOct;
182- if (Size)
183- {
184- SizeOct = StelObject::Size;
185- }
186- else
187- {
188- SizeOct = OctZero;
189- }
190-
191- int Extra1Oct;
192- if (Extra1)
193- {
194- Extra1Oct = StelObject::Extra1;
195- }
196- else
197- {
198- Extra1Oct = OctZero;
199- }
200-
201- int Extra2Oct;
202- if (Extra2)
203- {
204- Extra2Oct = StelObject::Extra2;
205- }
206- else
207- {
208- Extra2Oct = OctZero;
209- }
210-
211- int Extra3Oct;
212- if (Extra3)
213- {
214- Extra3Oct = StelObject::Extra3;
215- }
216- else
217- {
218- Extra3Oct = OctZero;
219- }
220-
221- int HourAngleOct;
222- if (HourAngle)
223- {
224- HourAngleOct = StelObject::HourAngle;
225- }
226- else
227- {
228- HourAngleOct = OctZero;
229- }
230-
231- int AbsoluteMagnitudeOct;
232- if (AbsoluteMagnitude)
233- {
234- AbsoluteMagnitudeOct = StelObject::AbsoluteMagnitude;
235- }
236- else
237- {
238- AbsoluteMagnitudeOct = OctZero;
239- }
240-
241- return (NameOct|CatalogNumberOct|MagnitudeOct|RaDecJ2000Oct|RaDecOfDateOct|AltAzOct|DistanceOct|SizeOct|Extra1Oct|Extra2Oct|Extra3Oct|HourAngleOct|AbsoluteMagnitudeOct);
242-}
243
244=== modified file 'src/core/StelObjectMgr.hpp'
245--- src/core/StelObjectMgr.hpp 2012-04-13 16:42:43 +0000
246+++ src/core/StelObjectMgr.hpp 2012-07-19 16:10:25 +0000
247@@ -126,8 +126,6 @@
248 //! Default to 1.
249 void setDistanceWeight(float newDistanceWeight) {distanceWeight=newDistanceWeight;}
250
251- int getCustomInfoString(void);
252-
253 signals:
254 //! Indicate that the selected StelObjects has changed.
255 //! @param action define if the user requested that the objects are added to the selection or just replace it
256
257=== modified file 'src/gui/ConfigurationDialog.cpp'
258--- src/gui/ConfigurationDialog.cpp 2012-06-29 14:07:11 +0000
259+++ src/gui/ConfigurationDialog.cpp 2012-07-19 16:10:25 +0000
260@@ -2,6 +2,7 @@
261 * Stellarium
262 * Copyright (C) 2008 Fabien Chereau
263 * Copyright (C) 2012 Timothy Reaves
264+ * Copyright (C) 2012 Bogdan Marinov
265 *
266 * This program is free software; you can redistribute it and/or
267 * modify it under the terms of the GNU General Public License
268@@ -20,7 +21,6 @@
269
270 #include "Dialog.hpp"
271 #include "ConfigurationDialog.hpp"
272-#include "CustomInfoDialog.hpp"
273 #include "StelMainGraphicsView.hpp"
274 #include "StelMainWindow.hpp"
275 #include "ui_configurationDialog.h"
276@@ -64,7 +64,6 @@
277 ConfigurationDialog::ConfigurationDialog(StelGui* agui) : StelDialog(agui), starCatalogDownloadReply(NULL), currentDownloadFile(NULL), progressBar(NULL), gui(agui)
278 {
279 ui = new Ui_configurationDialogForm;
280- customInfoDialog = NULL;
281 hasDownloadedStarCatalog = false;
282 isDownloadingStarCatalog = false;
283 savedProjectionType = StelApp::getInstance().getCore()->getCurrentProjectionType();
284@@ -73,9 +72,7 @@
285 ConfigurationDialog::~ConfigurationDialog()
286 {
287 delete ui;
288- ui=NULL;
289- delete customInfoDialog;
290- customInfoDialog = NULL;
291+ ui = 0;
292 }
293
294 void ConfigurationDialog::retranslate()
295@@ -150,34 +147,30 @@
296 resetStarCatalogControls();
297
298 // Selected object info
299- if (gui->getInfoTextFilters() == (StelObject::InfoStringGroup)0)
300+ if (gui->getInfoTextFilters() == StelObject::InfoStringGroup(0))
301 {
302 ui->noSelectedInfoRadio->setChecked(true);
303- ui->pushButtonCustomInfoDialog->setEnabled(false);
304 }
305- else if (gui->getInfoTextFilters() == StelObject::InfoStringGroup(StelObject::ShortInfo))
306+ else if (gui->getInfoTextFilters() == StelObject::ShortInfo)
307 {
308 ui->briefSelectedInfoRadio->setChecked(true);
309- ui->pushButtonCustomInfoDialog->setEnabled(false);
310 }
311- else if (gui->getInfoTextFilters() == StelObject::InfoStringGroup(StelObject::AllInfo))
312+ else if (gui->getInfoTextFilters() == StelObject::AllInfo)
313 {
314 ui->allSelectedInfoRadio->setChecked(true);
315- ui->pushButtonCustomInfoDialog->setEnabled(false);
316 }
317 else
318 {
319 ui->customSelectedInfoRadio->setChecked(true);
320- ui->pushButtonCustomInfoDialog->setEnabled(true);
321 }
322-
323+ updateSelectedInfoCheckBoxes();
324+
325 connect(ui->noSelectedInfoRadio, SIGNAL(released()), this, SLOT(setNoSelectedInfo()));
326 connect(ui->allSelectedInfoRadio, SIGNAL(released()), this, SLOT(setAllSelectedInfo()));
327 connect(ui->briefSelectedInfoRadio, SIGNAL(released()), this, SLOT(setBriefSelectedInfo()));
328- connect(ui->customSelectedInfoRadio, SIGNAL(released()), this, SLOT(setCustomSelectedInfo()));
329-
330- connect(ui->pushButtonCustomInfoDialog, SIGNAL(clicked()), this, SLOT(showCustomInfoDialog()));
331-
332+ connect(ui->buttonGroupDisplayedFields, SIGNAL(buttonClicked(int)),
333+ this, SLOT(setSelectedInfoFromCheckBoxes()));
334+
335 // Navigation tab
336 // Startup time
337 if (core->getStartupTimeMode()=="actual")
338@@ -262,8 +255,6 @@
339 connect(ui->pluginConfigureButton, SIGNAL(clicked()), this, SLOT(pluginConfigureCurrentSelection()));
340 populatePluginsList();
341
342-
343- connect(ui->stackListWidget, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*)));
344 updateConfigLabels();
345 }
346
347@@ -315,25 +306,58 @@
348 void ConfigurationDialog::setNoSelectedInfo(void)
349 {
350 gui->setInfoTextFilters(StelObject::InfoStringGroup(0));
351- ui->pushButtonCustomInfoDialog->setEnabled(false);
352+ updateSelectedInfoCheckBoxes();
353 }
354
355 void ConfigurationDialog::setAllSelectedInfo(void)
356 {
357 gui->setInfoTextFilters(StelObject::InfoStringGroup(StelObject::AllInfo));
358- ui->pushButtonCustomInfoDialog->setEnabled(false);
359+ updateSelectedInfoCheckBoxes();
360 }
361
362 void ConfigurationDialog::setBriefSelectedInfo(void)
363 {
364 gui->setInfoTextFilters(StelObject::InfoStringGroup(StelObject::ShortInfo));
365- ui->pushButtonCustomInfoDialog->setEnabled(false);
366+ updateSelectedInfoCheckBoxes();
367 }
368
369-void ConfigurationDialog::setCustomSelectedInfo(void)
370+void ConfigurationDialog::setSelectedInfoFromCheckBoxes()
371 {
372- gui->setInfoTextFilters(StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString()));
373- ui->pushButtonCustomInfoDialog->setEnabled(true);
374+ // As this signal will be called when a checbox is toggled,
375+ // change the general mode to Custom.
376+ if (!ui->customSelectedInfoRadio->isChecked())
377+ ui->customSelectedInfoRadio->setChecked(true);
378+
379+ StelObject::InfoStringGroup flags(0);
380+
381+ if (ui->checkBoxName->isChecked())
382+ flags |= StelObject::Name;
383+ if (ui->checkBoxCatalogNumbers->isChecked())
384+ flags |= StelObject::CatalogNumber;
385+ if (ui->checkBoxVisualMag->isChecked())
386+ flags |= StelObject::Magnitude;
387+ if (ui->checkBoxAbsoluteMag->isChecked())
388+ flags |= StelObject::AbsoluteMagnitude;
389+ if (ui->checkBoxRaDecJ2000->isChecked())
390+ flags |= StelObject::RaDecJ2000;
391+ if (ui->checkBoxRaDecOfDate->isChecked())
392+ flags |= StelObject::RaDecOfDate;
393+ if (ui->checkBoxHourAngle->isChecked())
394+ flags |= StelObject::HourAngle;
395+ if (ui->checkBoxAltAz->isChecked())
396+ flags |= StelObject::AltAzi;
397+ if (ui->checkBoxDistance->isChecked())
398+ flags |= StelObject::Distance;
399+ if (ui->checkBoxSize->isChecked())
400+ flags |= StelObject::Size;
401+ if (ui->checkBoxExtra1->isChecked())
402+ flags |= StelObject::Extra1;
403+ if (ui->checkBoxExtra2->isChecked())
404+ flags |= StelObject::Extra2;
405+ if (ui->checkBoxExtra3->isChecked())
406+ flags |= StelObject::Extra3;
407+
408+ gui->setInfoTextFilters(flags);
409 }
410
411
412@@ -463,14 +487,46 @@
413 langName = StelApp::getInstance().getLocaleMgr().getSkyLanguage();
414 conf->setValue("localization/sky_locale", StelTranslator::nativeNameToIso639_1Code(langName));
415
416- if (gui->getInfoTextFilters() == (StelObject::InfoStringGroup)0)
417+ // configuration dialog / selected object info tab
418+ const StelObject::InfoStringGroup& flags = gui->getInfoTextFilters();
419+ if (flags == StelObject::InfoStringGroup(0))
420 conf->setValue("gui/selected_object_info", "none");
421- else if (gui->getInfoTextFilters() == StelObject::InfoStringGroup(StelObject::ShortInfo))
422+ else if (flags == StelObject::InfoStringGroup(StelObject::ShortInfo))
423 conf->setValue("gui/selected_object_info", "short");
424- else if (gui->getInfoTextFilters() == StelObject::InfoStringGroup(StelObject::AllInfo))
425+ else if (flags == StelObject::InfoStringGroup(StelObject::AllInfo))
426 conf->setValue("gui/selected_object_info", "all");
427 else
428+ {
429 conf->setValue("gui/selected_object_info", "custom");
430+
431+ conf->beginGroup("custom_selected_info");
432+ conf->setValue("flag_show_name", (bool) (flags & StelObject::Name));
433+ conf->setValue("flag_show_catalognumber",
434+ (bool) (flags & StelObject::CatalogNumber));
435+ conf->setValue("flag_show_magnitude",
436+ (bool) (flags & StelObject::Magnitude));
437+ conf->setValue("flag_show_absolutemagnitude",
438+ (bool) (flags & StelObject::AbsoluteMagnitude));
439+ conf->setValue("flag_show_radecj2000",
440+ (bool) (flags & StelObject::RaDecJ2000));
441+ conf->setValue("flag_show_radecofdate",
442+ (bool) (flags & StelObject::RaDecOfDate));
443+ conf->setValue("flag_show_hourangle",
444+ (bool) (flags & StelObject::HourAngle));
445+ conf->setValue("flag_show_altaz",
446+ (bool) (flags & StelObject::AltAzi));
447+ conf->setValue("flag_show_distance",
448+ (bool) (flags & StelObject::Distance));
449+ conf->setValue("flag_show_size",
450+ (bool) (flags & StelObject::Size));
451+ conf->setValue("flag_show_extra1",
452+ (bool) (flags & StelObject::Extra1));
453+ conf->setValue("flag_show_extra2",
454+ (bool) (flags & StelObject::Extra2));
455+ conf->setValue("flag_show_extra3",
456+ (bool) (flags & StelObject::Extra3));
457+ conf->endGroup();
458+ }
459
460 // toolbar auto-hide status
461 conf->setValue("gui/auto_hide_horizontal_toolbar", gui->getAutoHideHorizontalButtonBar());
462@@ -710,13 +766,6 @@
463 setStartupTimeMode();
464 }
465
466-void ConfigurationDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous)
467-{
468- if (!current)
469- current = previous;
470- ui->configurationStackedWidget->setCurrentIndex(ui->stackListWidget->row(current));
471-}
472-
473
474 void ConfigurationDialog::resetStarCatalogControls()
475 {
476@@ -936,10 +985,21 @@
477 resetStarCatalogControls();
478 }
479
480-void ConfigurationDialog::showCustomInfoDialog()
481+void ConfigurationDialog::updateSelectedInfoCheckBoxes()
482 {
483- if(customInfoDialog == NULL)
484- customInfoDialog = new CustomInfoDialog();
485-
486- customInfoDialog->setVisible(true);
487+ const StelObject::InfoStringGroup& flags = gui->getInfoTextFilters();
488+
489+ ui->checkBoxName->setChecked(flags & StelObject::Name);
490+ ui->checkBoxCatalogNumbers->setChecked(flags & StelObject::CatalogNumber);
491+ ui->checkBoxVisualMag->setChecked(flags & StelObject::Magnitude);
492+ ui->checkBoxAbsoluteMag->setChecked(flags & StelObject::AbsoluteMagnitude);
493+ ui->checkBoxRaDecJ2000->setChecked(flags & StelObject::RaDecJ2000);
494+ ui->checkBoxRaDecOfDate->setChecked(flags & StelObject::RaDecOfDate);
495+ ui->checkBoxHourAngle->setChecked(flags & StelObject::HourAngle);
496+ ui->checkBoxAltAz->setChecked(flags & StelObject::AltAzi);
497+ ui->checkBoxDistance->setChecked(flags & StelObject::Distance);
498+ ui->checkBoxSize->setChecked(flags & StelObject::Size);
499+ ui->checkBoxExtra1->setChecked(flags & StelObject::Extra1);
500+ ui->checkBoxExtra2->setChecked(flags & StelObject::Extra2);
501+ ui->checkBoxExtra3->setChecked(flags & StelObject::Extra3);
502 }
503
504=== modified file 'src/gui/ConfigurationDialog.hpp'
505--- src/gui/ConfigurationDialog.hpp 2012-04-13 18:02:25 +0000
506+++ src/gui/ConfigurationDialog.hpp 2012-07-19 16:10:25 +0000
507@@ -32,7 +32,6 @@
508 class QNetworkAccessManager;
509 class QListWidgetItem;
510 class StelGui;
511-class CustomInfoDialog;
512
513 class ConfigurationDialog : public StelDialog
514 {
515@@ -77,7 +76,11 @@
516 void setNoSelectedInfo(void);
517 void setAllSelectedInfo(void);
518 void setBriefSelectedInfo(void);
519- void setCustomSelectedInfo(void);
520+ //! Set the selected object info fields from the "Displayed Fields" boxes.
521+ //! Called when any of the boxes has been clicked. Sets the
522+ //! "selected info" mode to "Custom".
523+ void setSelectedInfoFromCheckBoxes();
524+
525 void selectLanguage(const QString& languageCode);
526 void setStartupTimeMode();
527 void setDiskViewport(bool);
528@@ -131,16 +134,13 @@
529 #endif
530 void setFixedDateTimeToCurrent();
531
532- void changePage(QListWidgetItem *current, QListWidgetItem *previous);
533-
534- void showCustomInfoDialog();
535-
536 private:
537 StelGui* gui;
538
539 int savedProjectionType;
540-
541- CustomInfoDialog* customInfoDialog;
542+
543+ //! Set the displayed fields checkboxes from the current displayed fields.
544+ void updateSelectedInfoCheckBoxes();
545 };
546
547 #endif // _CONFIGURATIONDIALOG_HPP_
548
549=== removed file 'src/gui/CustomInfoDialog.cpp'
550--- src/gui/CustomInfoDialog.cpp 2012-04-13 18:02:25 +0000
551+++ src/gui/CustomInfoDialog.cpp 1970-01-01 00:00:00 +0000
552@@ -1,249 +0,0 @@
553-/*
554- * This program is distributed in the hope that it will be useful,
555- * but WITHOUT ANY WARRANTY; without even the implied warranty of
556- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
557- * GNU General Public License for more details.
558- * You should have received a copy of the GNU General Public License
559- * along with this program; if not, write to the Free Software
560- * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
561-*/
562-
563-#include "CustomInfoDialog.hpp"
564-#include "ui_CustomInfoDialog.h"
565-
566-#include "Dialog.hpp"
567-#include "StelApp.hpp"
568-#include "StelObjectMgr.hpp"
569-
570-#include <QDebug>
571-
572-CustomInfoDialog::CustomInfoDialog()
573-{
574- ui = new Ui_CustomInfoDialogForm;
575- conf = StelApp::getInstance().getSettings();
576- gui = StelApp::getInstance().getGui();
577-}
578-
579-CustomInfoDialog::~CustomInfoDialog()
580-{
581- delete ui;
582- ui=NULL;
583-}
584-
585-void CustomInfoDialog::retranslate()
586-{
587- if (dialog)
588- ui->retranslateUi(dialog);
589-}
590-
591-
592-void CustomInfoDialog::createDialogContent()
593-{
594- ui->setupUi(dialog);
595-
596- //Signals and slots
597- connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
598- connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
599-
600- //An object's name
601- ui->nameCheckBox->setChecked(getNameCustomInfoFlag());
602- connect(ui->nameCheckBox, SIGNAL(toggled(bool)), this, SLOT(setNameCustomInfoFlag(bool)));
603-
604- //Catalog numbers
605- ui->catalogNumberCheckBox->setChecked(getCatalogNumberCustomInfoFlag());
606- connect(ui->catalogNumberCheckBox, SIGNAL(toggled(bool)), this, SLOT(setCatalogNumberCustomInfoFlag(bool)));
607-
608- //Magnitude related data
609- ui->magnitudeCheckBox->setChecked(getMagnitudeCustomInfoFlag());
610- connect(ui->magnitudeCheckBox, SIGNAL(toggled(bool)), this, SLOT(setMagnitudeCustomInfoFlag(bool)));
611-
612- //The equatorial position (J2000 ref)
613- ui->raDecJ2000CheckBox->setChecked(getRaDecJ2000CustomInfoFlag());
614- connect(ui->raDecJ2000CheckBox, SIGNAL(toggled(bool)), this, SLOT(setRaDecJ2000CustomInfoFlag(bool)));
615-
616- //The equatorial position (of date)
617- ui->raDecOfDateCheckBox->setChecked(getRaDecOfDateCustomInfoFlag());
618- connect(ui->raDecOfDateCheckBox, SIGNAL(toggled(bool)), this, SLOT(setRaDecOfDateCustomInfoFlag(bool)));
619-
620- //The position (Altitude/Azimuth)
621- ui->altAzCheckBox->setChecked(getAltAzCustomInfoFlag());
622- connect(ui->altAzCheckBox, SIGNAL(toggled(bool)), this, SLOT(setAltAzCustomInfoFlag(bool)));
623-
624- //Info about an object's distance
625- ui->distanceCheckBox->setChecked(getDistanceCustomInfoFlag());
626- connect(ui->distanceCheckBox, SIGNAL(toggled(bool)), this, SLOT(setDistanceCustomInfoFlag(bool)));
627-
628- //Info about an object's size
629- ui->sizeCheckBox->setChecked(getSizeCustomInfoFlag());
630- connect(ui->sizeCheckBox, SIGNAL(toggled(bool)), this, SLOT(setSizeCustomInfoFlag(bool)));
631-
632- //Derived class-specific extra fields
633- ui->extra1CheckBox->setChecked(getExtra1CustomInfoFlag());
634- connect(ui->extra1CheckBox, SIGNAL(toggled(bool)), this, SLOT(setExtra1CustomInfoFlag(bool)));
635-
636- //Derived class-specific extra fields
637- ui->extra2CheckBox->setChecked(getExtra2CustomInfoFlag());
638- connect(ui->extra2CheckBox, SIGNAL(toggled(bool)), this, SLOT(setExtra2CustomInfoFlag(bool)));
639-
640- //Derived class-specific extra fields
641- ui->extra3CheckBox->setChecked(getExtra3CustomInfoFlag());
642- connect(ui->extra3CheckBox, SIGNAL(toggled(bool)), this, SLOT(setExtra3CustomInfoFlag(bool)));
643-
644- //The hour angle + DE (of date)
645- ui->hourAngleCheckBox->setChecked(getHourAngleCustomInfoFlag());
646- connect(ui->hourAngleCheckBox, SIGNAL(toggled(bool)), this, SLOT(setHourAngleCustomInfoFlag(bool)));
647-
648- //The absolute magnitude
649- ui->absoluteMagnitudeCheckBox->setChecked(getAbsoluteMagnitudeCustomInfoFlag());
650- connect(ui->absoluteMagnitudeCheckBox, SIGNAL(toggled(bool)), this, SLOT(setAbsoluteMagnitudeCustomInfoFlag(bool)));
651-
652-}
653-
654-void CustomInfoDialog::setVisible(bool v)
655-{
656- StelDialog::setVisible(v);
657-}
658-
659-bool CustomInfoDialog::getNameCustomInfoFlag()
660-{
661- return conf->value("custom_selected_info/flag_show_name", false).toBool();
662-}
663-
664-void CustomInfoDialog::setNameCustomInfoFlag(bool flag)
665-{
666- conf->setValue("custom_selected_info/flag_show_name", flag);
667- gui->setInfoTextFilters(StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString()));
668-}
669-
670-bool CustomInfoDialog::getCatalogNumberCustomInfoFlag()
671-{
672- return conf->value("custom_selected_info/flag_show_catalognumber", false).toBool();
673-}
674-
675-void CustomInfoDialog::setCatalogNumberCustomInfoFlag(bool flag)
676-{
677- conf->setValue("custom_selected_info/flag_show_catalognumber", flag);
678- gui->setInfoTextFilters(StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString()));
679-}
680-
681-bool CustomInfoDialog::getMagnitudeCustomInfoFlag()
682-{
683- return conf->value("custom_selected_info/flag_show_magnitude", false).toBool();
684-}
685-
686-void CustomInfoDialog::setMagnitudeCustomInfoFlag(bool flag)
687-{
688- conf->setValue("custom_selected_info/flag_show_magnitude", flag);
689- gui->setInfoTextFilters(StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString()));
690-}
691-
692-bool CustomInfoDialog::getRaDecJ2000CustomInfoFlag()
693-{
694- return conf->value("custom_selected_info/flag_show_radecj2000", false).toBool();
695-}
696-
697-void CustomInfoDialog::setRaDecJ2000CustomInfoFlag(bool flag)
698-{
699- conf->setValue("custom_selected_info/flag_show_radecj2000", flag);
700- gui->setInfoTextFilters(StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString()));
701-}
702-
703-bool CustomInfoDialog::getRaDecOfDateCustomInfoFlag()
704-{
705- return conf->value("custom_selected_info/flag_show_radecofdate", false).toBool();
706-}
707-
708-void CustomInfoDialog::setRaDecOfDateCustomInfoFlag(bool flag)
709-{
710- conf->setValue("custom_selected_info/flag_show_radecofdate", flag);
711- gui->setInfoTextFilters(StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString()));
712-}
713-
714-bool CustomInfoDialog::getAltAzCustomInfoFlag()
715-{
716- return conf->value("custom_selected_info/flag_show_altaz", false).toBool();
717-}
718-
719-void CustomInfoDialog::setAltAzCustomInfoFlag(bool flag)
720-{
721- conf->setValue("custom_selected_info/flag_show_altaz", flag);
722- gui->setInfoTextFilters(StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString()));
723-}
724-
725-bool CustomInfoDialog::getDistanceCustomInfoFlag()
726-{
727- return conf->value("custom_selected_info/flag_show_distance", false).toBool();
728-}
729-
730-void CustomInfoDialog::setDistanceCustomInfoFlag(bool flag)
731-{
732- conf->setValue("custom_selected_info/flag_show_distance", flag);
733- gui->setInfoTextFilters(StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString()));
734-}
735-
736-bool CustomInfoDialog::getSizeCustomInfoFlag()
737-{
738- return conf->value("custom_selected_info/flag_show_size", false).toBool();
739-}
740-
741-void CustomInfoDialog::setSizeCustomInfoFlag(bool flag)
742-{
743- conf->setValue("custom_selected_info/flag_show_size", flag);
744- gui->setInfoTextFilters(StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString()));
745-}
746-
747-bool CustomInfoDialog::getExtra1CustomInfoFlag()
748-{
749- return conf->value("custom_selected_info/flag_show_extra1", false).toBool();
750-}
751-
752-void CustomInfoDialog::setExtra1CustomInfoFlag(bool flag)
753-{
754- conf->setValue("custom_selected_info/flag_show_extra1", flag);
755- gui->setInfoTextFilters(StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString()));
756-}
757-
758-bool CustomInfoDialog::getExtra2CustomInfoFlag()
759-{
760- return conf->value("custom_selected_info/flag_show_extra2", false).toBool();
761-}
762-
763-void CustomInfoDialog::setExtra2CustomInfoFlag(bool flag)
764-{
765- conf->setValue("custom_selected_info/flag_show_extra2", flag);
766- gui->setInfoTextFilters(StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString()));
767-}
768-
769-bool CustomInfoDialog::getExtra3CustomInfoFlag()
770-{
771- return conf->value("custom_selected_info/flag_show_extra3", false).toBool();
772-}
773-
774-void CustomInfoDialog::setExtra3CustomInfoFlag(bool flag)
775-{
776- conf->setValue("custom_selected_info/flag_show_extra3", flag);
777- gui->setInfoTextFilters(StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString()));
778-}
779-
780-bool CustomInfoDialog::getHourAngleCustomInfoFlag()
781-{
782- return conf->value("custom_selected_info/flag_show_hourangle", false).toBool();
783-}
784-
785-void CustomInfoDialog::setHourAngleCustomInfoFlag(bool flag)
786-{
787- conf->setValue("custom_selected_info/flag_show_hourangle", flag);
788- gui->setInfoTextFilters(StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString()));
789-}
790-
791-bool CustomInfoDialog::getAbsoluteMagnitudeCustomInfoFlag()
792-{
793- return conf->value("custom_selected_info/flag_show_absolutemagnitude", false).toBool();
794-}
795-
796-void CustomInfoDialog::setAbsoluteMagnitudeCustomInfoFlag(bool flag)
797-{
798- conf->setValue("custom_selected_info/flag_show_absolutemagnitude", flag);
799- gui->setInfoTextFilters(StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString()));
800-}
801-
802
803=== removed file 'src/gui/CustomInfoDialog.hpp'
804--- src/gui/CustomInfoDialog.hpp 2012-04-13 18:02:25 +0000
805+++ src/gui/CustomInfoDialog.hpp 1970-01-01 00:00:00 +0000
806@@ -1,96 +0,0 @@
807-/*
808- * Stellarium
809- *
810- * Copyright (C) 2012 Alexander Wolf
811- *
812- * This program is free software; you can redistribute it and/or
813- * modify it under the terms of the GNU General Public License
814- * as published by the Free Software Foundation; either version 2
815- * of the License, or (at your option) any later version.
816- *
817- * This program is distributed in the hope that it will be useful,
818- * but WITHOUT ANY WARRANTY; without even the implied warranty of
819- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
820- * GNU General Public License for more details.
821- * You should have received a copy of the GNU General Public License
822- * along with this program; if not, write to the Free Software
823- * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
824-*/
825-
826-// AW: Methods copied largely from AddRemoveLandscapesDialog
827-
828-#ifndef _CUSTOMINFODIALOG_HPP_
829-#define _CUSTOMINFODIALOG_HPP_
830-
831-#include <QObject>
832-#include <QSettings>
833-#include "StelDialog.hpp"
834-#include "StelGui.hpp"
835-
836-class Ui_CustomInfoDialogForm;
837-
838-//! @class CustomInfoDialog
839-class CustomInfoDialog : public StelDialog
840-{
841- Q_OBJECT
842-
843-public:
844- CustomInfoDialog();
845- virtual ~CustomInfoDialog();
846-
847-public slots:
848- void retranslate();
849- void setVisible(bool);
850-
851-protected:
852- //! Initialize the dialog widgets and connect the signals/slots.
853- virtual void createDialogContent();
854- Ui_CustomInfoDialogForm *ui;
855-
856-private slots:
857- bool getNameCustomInfoFlag();
858- void setNameCustomInfoFlag(bool flag);
859-
860- bool getCatalogNumberCustomInfoFlag();
861- void setCatalogNumberCustomInfoFlag(bool flag);
862-
863- bool getMagnitudeCustomInfoFlag();
864- void setMagnitudeCustomInfoFlag(bool flag);
865-
866- bool getRaDecJ2000CustomInfoFlag();
867- void setRaDecJ2000CustomInfoFlag(bool flag);
868-
869- bool getRaDecOfDateCustomInfoFlag();
870- void setRaDecOfDateCustomInfoFlag(bool flag);
871-
872- bool getAltAzCustomInfoFlag();
873- void setAltAzCustomInfoFlag(bool flag);
874-
875- bool getDistanceCustomInfoFlag();
876- void setDistanceCustomInfoFlag(bool flag);
877-
878- bool getSizeCustomInfoFlag();
879- void setSizeCustomInfoFlag(bool flag);
880-
881- bool getExtra1CustomInfoFlag();
882- void setExtra1CustomInfoFlag(bool flag);
883-
884- bool getExtra2CustomInfoFlag();
885- void setExtra2CustomInfoFlag(bool flag);
886-
887- bool getExtra3CustomInfoFlag();
888- void setExtra3CustomInfoFlag(bool flag);
889-
890- bool getHourAngleCustomInfoFlag();
891- void setHourAngleCustomInfoFlag(bool flag);
892-
893- bool getAbsoluteMagnitudeCustomInfoFlag();
894- void setAbsoluteMagnitudeCustomInfoFlag(bool flag);
895-
896-private:
897- StelGuiBase* gui;
898- QSettings* conf;
899-
900-};
901-
902-#endif // _CUSTOMINFODIALOG_HPP_
903
904=== removed file 'src/gui/CustomInfoDialog.ui'
905--- src/gui/CustomInfoDialog.ui 2012-04-02 16:56:13 +0000
906+++ src/gui/CustomInfoDialog.ui 1970-01-01 00:00:00 +0000
907@@ -1,286 +0,0 @@
908-<?xml version="1.0" encoding="UTF-8"?>
909-<ui version="4.0">
910- <class>CustomInfoDialogForm</class>
911- <widget class="QWidget" name="CustomInfoDialogForm">
912- <property name="sizePolicy">
913- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
914- <horstretch>0</horstretch>
915- <verstretch>0</verstretch>
916- </sizepolicy>
917- </property>
918- <layout class="QVBoxLayout" name="verticalLayout">
919- <property name="spacing">
920- <number>0</number>
921- </property>
922- <property name="margin">
923- <number>0</number>
924- </property>
925- <item>
926- <widget class="BarFrame" name="TitleBar">
927- <property name="minimumSize">
928- <size>
929- <width>16</width>
930- <height>25</height>
931- </size>
932- </property>
933- <property name="maximumSize">
934- <size>
935- <width>16777215</width>
936- <height>25</height>
937- </size>
938- </property>
939- <property name="frameShape">
940- <enum>QFrame::StyledPanel</enum>
941- </property>
942- <layout class="QHBoxLayout">
943- <property name="leftMargin">
944- <number>0</number>
945- </property>
946- <property name="topMargin">
947- <number>0</number>
948- </property>
949- <property name="rightMargin">
950- <number>4</number>
951- </property>
952- <property name="bottomMargin">
953- <number>0</number>
954- </property>
955- <item>
956- <spacer>
957- <property name="orientation">
958- <enum>Qt::Horizontal</enum>
959- </property>
960- <property name="sizeHint" stdset="0">
961- <size>
962- <width>40</width>
963- <height>20</height>
964- </size>
965- </property>
966- </spacer>
967- </item>
968- <item>
969- <widget class="QLabel" name="stelWindowTitle">
970- <property name="palette">
971- <palette>
972- <active/>
973- <inactive/>
974- <disabled/>
975- </palette>
976- </property>
977- <property name="font">
978- <font/>
979- </property>
980- <property name="text">
981- <string>Selected object information</string>
982- </property>
983- </widget>
984- </item>
985- <item>
986- <spacer>
987- <property name="orientation">
988- <enum>Qt::Horizontal</enum>
989- </property>
990- <property name="sizeHint" stdset="0">
991- <size>
992- <width>40</width>
993- <height>20</height>
994- </size>
995- </property>
996- </spacer>
997- </item>
998- <item>
999- <widget class="QPushButton" name="closeStelWindow">
1000- <property name="minimumSize">
1001- <size>
1002- <width>16</width>
1003- <height>16</height>
1004- </size>
1005- </property>
1006- <property name="maximumSize">
1007- <size>
1008- <width>16</width>
1009- <height>16</height>
1010- </size>
1011- </property>
1012- <property name="focusPolicy">
1013- <enum>Qt::NoFocus</enum>
1014- </property>
1015- <property name="text">
1016- <string/>
1017- </property>
1018- </widget>
1019- </item>
1020- </layout>
1021- </widget>
1022- </item>
1023- <item>
1024- <widget class="QGroupBox" name="customInfoGroupBox">
1025- <property name="title">
1026- <string>Custom Info Settings</string>
1027- </property>
1028- <property name="alignment">
1029- <set>Qt::AlignCenter</set>
1030- </property>
1031- <layout class="QVBoxLayout" name="verticalLayout_3">
1032- <property name="margin">
1033- <number>0</number>
1034- </property>
1035- <item>
1036- <widget class="QCheckBox" name="nameCheckBox">
1037- <property name="toolTip">
1038- <string>Display info about an object's name</string>
1039- </property>
1040- <property name="text">
1041- <string>An object's name</string>
1042- </property>
1043- </widget>
1044- </item>
1045- <item>
1046- <widget class="QCheckBox" name="catalogNumberCheckBox">
1047- <property name="toolTip">
1048- <string>Display info about a catalog numbers</string>
1049- </property>
1050- <property name="text">
1051- <string>Catalog numbers</string>
1052- </property>
1053- </widget>
1054- </item>
1055- <item>
1056- <widget class="QCheckBox" name="magnitudeCheckBox">
1057- <property name="toolTip">
1058- <string>Display info about a visual magnitude</string>
1059- </property>
1060- <property name="text">
1061- <string>Visual magnitude</string>
1062- </property>
1063- </widget>
1064- </item>
1065- <item>
1066- <widget class="QCheckBox" name="absoluteMagnitudeCheckBox">
1067- <property name="toolTip">
1068- <string>Display info about an absolute magnitude</string>
1069- </property>
1070- <property name="text">
1071- <string>Absolute magnitude</string>
1072- </property>
1073- </widget>
1074- </item>
1075- <item>
1076- <widget class="QCheckBox" name="raDecJ2000CheckBox">
1077- <property name="toolTip">
1078- <string>Display the equatorial position (J2000 ref)</string>
1079- </property>
1080- <property name="text">
1081- <string>The equatorial coordinates (J2000 ref)</string>
1082- </property>
1083- </widget>
1084- </item>
1085- <item>
1086- <widget class="QCheckBox" name="raDecOfDateCheckBox">
1087- <property name="toolTip">
1088- <string>Display the equatorial position (of date)</string>
1089- </property>
1090- <property name="text">
1091- <string>The equatorial coordinates (of date)</string>
1092- </property>
1093- </widget>
1094- </item>
1095- <item>
1096- <widget class="QCheckBox" name="altAzCheckBox">
1097- <property name="toolTip">
1098- <string>Display the altitude and azimuth position</string>
1099- </property>
1100- <property name="text">
1101- <string>The alt-azimuthal coordinates</string>
1102- </property>
1103- </widget>
1104- </item>
1105- <item>
1106- <widget class="QCheckBox" name="hourAngleCheckBox">
1107- <property name="toolTip">
1108- <string>Display the hour angle + DE (of date)</string>
1109- </property>
1110- <property name="text">
1111- <string>The hour angle</string>
1112- </property>
1113- </widget>
1114- </item>
1115- <item>
1116- <widget class="QCheckBox" name="distanceCheckBox">
1117- <property name="toolTip">
1118- <string>Display info about an object's distance</string>
1119- </property>
1120- <property name="text">
1121- <string>Object's distance</string>
1122- </property>
1123- </widget>
1124- </item>
1125- <item>
1126- <widget class="QCheckBox" name="sizeCheckBox">
1127- <property name="toolTip">
1128- <string>Display info about an object's size</string>
1129- </property>
1130- <property name="text">
1131- <string>Object's size</string>
1132- </property>
1133- </widget>
1134- </item>
1135- <item>
1136- <widget class="QCheckBox" name="extra1CheckBox">
1137- <property name="toolTip">
1138- <string>Display a derived class-specific extra fields</string>
1139- </property>
1140- <property name="text">
1141- <string>Additional info (Extra 1)</string>
1142- </property>
1143- </widget>
1144- </item>
1145- <item>
1146- <widget class="QCheckBox" name="extra2CheckBox">
1147- <property name="toolTip">
1148- <string>Display a derived class-specific extra fields</string>
1149- </property>
1150- <property name="text">
1151- <string>Additional info (Extra 2)</string>
1152- </property>
1153- </widget>
1154- </item>
1155- <item>
1156- <widget class="QCheckBox" name="extra3CheckBox">
1157- <property name="toolTip">
1158- <string>Display a derived class-specific extra fields</string>
1159- </property>
1160- <property name="text">
1161- <string>Additional info (Extra 3)</string>
1162- </property>
1163- </widget>
1164- </item>
1165- <item>
1166- <spacer name="verticalSpacer">
1167- <property name="orientation">
1168- <enum>Qt::Vertical</enum>
1169- </property>
1170- <property name="sizeHint" stdset="0">
1171- <size>
1172- <width>20</width>
1173- <height>40</height>
1174- </size>
1175- </property>
1176- </spacer>
1177- </item>
1178- </layout>
1179- </widget>
1180- </item>
1181- </layout>
1182- </widget>
1183- <customwidgets>
1184- <customwidget>
1185- <class>BarFrame</class>
1186- <extends>QFrame</extends>
1187- <header>Dialog.hpp</header>
1188- <container>1</container>
1189- </customwidget>
1190- </customwidgets>
1191- <resources/>
1192- <connections/>
1193-</ui>
1194
1195=== modified file 'src/gui/SkyGui.cpp'
1196--- src/gui/SkyGui.cpp 2012-04-13 16:50:19 +0000
1197+++ src/gui/SkyGui.cpp 2012-07-19 16:10:25 +0000
1198@@ -49,7 +49,36 @@
1199 }
1200 else if (objectInfo == "custom")
1201 {
1202- infoTextFilters = StelObject::InfoStringGroup(StelApp::getInstance().getStelObjectMgr().getCustomInfoString());
1203+ infoTextFilters = StelObject::InfoStringGroup(0);
1204+
1205+ conf->beginGroup("custom_selected_info");
1206+ if (conf->value("flag_show_name", false).toBool())
1207+ infoTextFilters |= StelObject::Name;
1208+ if (conf->value("flag_show_catalognumber", false).toBool())
1209+ infoTextFilters |= StelObject::CatalogNumber;
1210+ if (conf->value("flag_show_magnitude", false).toBool())
1211+ infoTextFilters |= StelObject::Magnitude;
1212+ if (conf->value("flag_show_absolutemagnitude", false).toBool())
1213+ infoTextFilters |= StelObject::AbsoluteMagnitude;
1214+ if (conf->value("flag_show_radecj2000", false).toBool())
1215+ infoTextFilters |= StelObject::RaDecJ2000;
1216+ if (conf->value("flag_show_radecofdate", false).toBool())
1217+ infoTextFilters |= StelObject::RaDecOfDate;
1218+ if (conf->value("flag_show_hourangle", false).toBool())
1219+ infoTextFilters |= StelObject::HourAngle;
1220+ if (conf->value("flag_show_altaz", false).toBool())
1221+ infoTextFilters |= StelObject::AltAzi;
1222+ if (conf->value("flag_show_distance", false).toBool())
1223+ infoTextFilters |= StelObject::Distance;
1224+ if (conf->value("flag_show_size", false).toBool())
1225+ infoTextFilters |= StelObject::Size;
1226+ if (conf->value("flag_show_extra1", false).toBool())
1227+ infoTextFilters |= StelObject::Extra1;
1228+ if (conf->value("flag_show_extra2", false).toBool())
1229+ infoTextFilters |= StelObject::Extra2;
1230+ if (conf->value("flag_show_extra3", false).toBool())
1231+ infoTextFilters |= StelObject::Extra3;
1232+ conf->endGroup();
1233 }
1234 else
1235 {
1236
1237=== modified file 'src/gui/SkyGui.hpp'
1238--- src/gui/SkyGui.hpp 2012-02-19 00:21:59 +0000
1239+++ src/gui/SkyGui.hpp 2012-07-19 16:10:25 +0000
1240@@ -38,6 +38,8 @@
1241 class InfoPanel : public QGraphicsTextItem
1242 {
1243 public:
1244+ //! Reads "gui/selected_object_info", etc from the configuration file.
1245+ //! @todo Bad idea to read from the configuration file in a constructor? --BM
1246 InfoPanel(QGraphicsItem* parent);
1247 void setInfoTextFilters(const StelObject::InfoStringGroup& aflags) {infoTextFilters=aflags;}
1248 const StelObject::InfoStringGroup& getInfoTextFilters(void) const {return infoTextFilters;}
1249
1250=== modified file 'src/gui/configurationDialog.ui'
1251--- src/gui/configurationDialog.ui 2012-06-29 14:07:11 +0000
1252+++ src/gui/configurationDialog.ui 2012-07-19 16:10:25 +0000
1253@@ -6,13 +6,10 @@
1254 <rect>
1255 <x>0</x>
1256 <y>0</y>
1257- <width>428</width>
1258- <height>463</height>
1259+ <width>525</width>
1260+ <height>465</height>
1261 </rect>
1262 </property>
1263- <property name="styleSheet">
1264- <string notr="true"/>
1265- </property>
1266 <layout class="QVBoxLayout">
1267 <property name="spacing">
1268 <number>0</number>
1269@@ -132,9 +129,6 @@
1270 </property>
1271 <item row="1" column="0">
1272 <widget class="QStackedWidget" name="configurationStackedWidget">
1273- <property name="currentIndex">
1274- <number>1</number>
1275- </property>
1276 <widget class="QWidget" name="page">
1277 <layout class="QVBoxLayout" name="verticalLayout_10">
1278 <property name="spacing">
1279@@ -145,18 +139,6 @@
1280 </property>
1281 <item>
1282 <widget class="QGroupBox" name="groupBox_2">
1283- <property name="sizePolicy">
1284- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
1285- <horstretch>0</horstretch>
1286- <verstretch>0</verstretch>
1287- </sizepolicy>
1288- </property>
1289- <property name="minimumSize">
1290- <size>
1291- <width>0</width>
1292- <height>0</height>
1293- </size>
1294- </property>
1295 <property name="title">
1296 <string>Program language</string>
1297 </property>
1298@@ -190,106 +172,7 @@
1299 </widget>
1300 </item>
1301 <item>
1302- <widget class="QGroupBox" name="groupBox_4">
1303- <property name="sizePolicy">
1304- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
1305- <horstretch>0</horstretch>
1306- <verstretch>0</verstretch>
1307- </sizepolicy>
1308- </property>
1309- <property name="font">
1310- <font>
1311- <weight>50</weight>
1312- <bold>false</bold>
1313- <kerning>true</kerning>
1314- </font>
1315- </property>
1316- <property name="title">
1317- <string>Selected object information</string>
1318- </property>
1319- <layout class="QVBoxLayout" name="verticalLayout_5">
1320- <property name="margin">
1321- <number>0</number>
1322- </property>
1323- <item>
1324- <layout class="QHBoxLayout" name="horizontalLayout_13">
1325- <item>
1326- <widget class="QRadioButton" name="allSelectedInfoRadio">
1327- <property name="toolTip">
1328- <string>Display all information available</string>
1329- </property>
1330- <property name="text">
1331- <string>All available</string>
1332- </property>
1333- </widget>
1334- </item>
1335- <item>
1336- <widget class="QRadioButton" name="briefSelectedInfoRadio">
1337- <property name="toolTip">
1338- <string>Display less information</string>
1339- </property>
1340- <property name="text">
1341- <string>Short</string>
1342- </property>
1343- </widget>
1344- </item>
1345- </layout>
1346- </item>
1347- <item>
1348- <layout class="QHBoxLayout" name="horizontalLayout_14">
1349- <item>
1350- <layout class="QHBoxLayout" name="horizontalLayout_16">
1351- <item>
1352- <widget class="QRadioButton" name="customSelectedInfoRadio">
1353- <property name="toolTip">
1354- <string>Display user settings information</string>
1355- </property>
1356- <property name="text">
1357- <string>Customized</string>
1358- </property>
1359- </widget>
1360- </item>
1361- <item>
1362- <widget class="QPushButton" name="pushButtonCustomInfoDialog">
1363- <property name="enabled">
1364- <bool>true</bool>
1365- </property>
1366- <property name="text">
1367- <string notr="true">...</string>
1368- </property>
1369- </widget>
1370- </item>
1371- </layout>
1372- </item>
1373- <item>
1374- <widget class="QRadioButton" name="noSelectedInfoRadio">
1375- <property name="toolTip">
1376- <string>Display no information</string>
1377- </property>
1378- <property name="text">
1379- <string>None</string>
1380- </property>
1381- </widget>
1382- </item>
1383- </layout>
1384- </item>
1385- </layout>
1386- </widget>
1387- </item>
1388- <item>
1389 <widget class="QGroupBox" name="groupBox_6">
1390- <property name="sizePolicy">
1391- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
1392- <horstretch>0</horstretch>
1393- <verstretch>0</verstretch>
1394- </sizepolicy>
1395- </property>
1396- <property name="font">
1397- <font>
1398- <weight>50</weight>
1399- <bold>false</bold>
1400- </font>
1401- </property>
1402 <property name="title">
1403 <string>Default options</string>
1404 </property>
1405@@ -405,6 +288,243 @@
1406 </item>
1407 </layout>
1408 </widget>
1409+ <widget class="QWidget" name="pageSelectedObjectInfo">
1410+ <layout class="QVBoxLayout" name="verticalLayout_2">
1411+ <property name="spacing">
1412+ <number>0</number>
1413+ </property>
1414+ <property name="margin">
1415+ <number>0</number>
1416+ </property>
1417+ <item>
1418+ <widget class="QGroupBox" name="groupBox_4">
1419+ <property name="sizePolicy">
1420+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
1421+ <horstretch>0</horstretch>
1422+ <verstretch>0</verstretch>
1423+ </sizepolicy>
1424+ </property>
1425+ <property name="title">
1426+ <string>Selected object information</string>
1427+ </property>
1428+ <layout class="QVBoxLayout" name="verticalLayout_5">
1429+ <property name="margin">
1430+ <number>0</number>
1431+ </property>
1432+ <item>
1433+ <widget class="QRadioButton" name="allSelectedInfoRadio">
1434+ <property name="toolTip">
1435+ <string>Display all information available</string>
1436+ </property>
1437+ <property name="text">
1438+ <string>All available</string>
1439+ </property>
1440+ </widget>
1441+ </item>
1442+ <item>
1443+ <widget class="QRadioButton" name="briefSelectedInfoRadio">
1444+ <property name="toolTip">
1445+ <string>Display less information</string>
1446+ </property>
1447+ <property name="text">
1448+ <string>Short</string>
1449+ </property>
1450+ </widget>
1451+ </item>
1452+ <item>
1453+ <widget class="QRadioButton" name="noSelectedInfoRadio">
1454+ <property name="toolTip">
1455+ <string>Display no information</string>
1456+ </property>
1457+ <property name="text">
1458+ <string>None</string>
1459+ </property>
1460+ </widget>
1461+ </item>
1462+ <item>
1463+ <widget class="QRadioButton" name="customSelectedInfoRadio">
1464+ <property name="toolTip">
1465+ <string>Display user settings information</string>
1466+ </property>
1467+ <property name="text">
1468+ <string>Customized</string>
1469+ </property>
1470+ </widget>
1471+ </item>
1472+ </layout>
1473+ </widget>
1474+ </item>
1475+ <item>
1476+ <widget class="QGroupBox" name="groupBoxDisplayedFields">
1477+ <property name="sizePolicy">
1478+ <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
1479+ <horstretch>0</horstretch>
1480+ <verstretch>0</verstretch>
1481+ </sizepolicy>
1482+ </property>
1483+ <property name="title">
1484+ <string>Displayed fields</string>
1485+ </property>
1486+ <layout class="QGridLayout" name="gridLayoutDisplayedFields">
1487+ <property name="margin">
1488+ <number>0</number>
1489+ </property>
1490+ <item row="0" column="1">
1491+ <widget class="QCheckBox" name="checkBoxVisualMag">
1492+ <property name="text">
1493+ <string>Visual magnitude</string>
1494+ </property>
1495+ <attribute name="buttonGroup">
1496+ <string notr="true">buttonGroupDisplayedFields</string>
1497+ </attribute>
1498+ </widget>
1499+ </item>
1500+ <item row="6" column="0">
1501+ <widget class="QCheckBox" name="checkBoxExtra1">
1502+ <property name="toolTip">
1503+ <string>Spectral class, nebula type, etc.</string>
1504+ </property>
1505+ <property name="text">
1506+ <string>Additional information 1</string>
1507+ </property>
1508+ <attribute name="buttonGroup">
1509+ <string notr="true">buttonGroupDisplayedFields</string>
1510+ </attribute>
1511+ </widget>
1512+ </item>
1513+ <item row="7" column="0" colspan="2">
1514+ <widget class="QCheckBox" name="checkBoxExtra3">
1515+ <property name="text">
1516+ <string>Additional information 3</string>
1517+ </property>
1518+ <attribute name="buttonGroup">
1519+ <string notr="true">buttonGroupDisplayedFields</string>
1520+ </attribute>
1521+ </widget>
1522+ </item>
1523+ <item row="1" column="0">
1524+ <widget class="QCheckBox" name="checkBoxCatalogNumbers">
1525+ <property name="text">
1526+ <string>Catalog number(s)</string>
1527+ </property>
1528+ <attribute name="buttonGroup">
1529+ <string notr="true">buttonGroupDisplayedFields</string>
1530+ </attribute>
1531+ </widget>
1532+ </item>
1533+ <item row="0" column="0">
1534+ <widget class="QCheckBox" name="checkBoxName">
1535+ <property name="text">
1536+ <string>Name</string>
1537+ </property>
1538+ <attribute name="buttonGroup">
1539+ <string notr="true">buttonGroupDisplayedFields</string>
1540+ </attribute>
1541+ </widget>
1542+ </item>
1543+ <item row="6" column="1">
1544+ <widget class="QCheckBox" name="checkBoxExtra2">
1545+ <property name="toolTip">
1546+ <string/>
1547+ </property>
1548+ <property name="text">
1549+ <string>Additional information 2</string>
1550+ </property>
1551+ <attribute name="buttonGroup">
1552+ <string notr="true">buttonGroupDisplayedFields</string>
1553+ </attribute>
1554+ </widget>
1555+ </item>
1556+ <item row="1" column="1">
1557+ <widget class="QCheckBox" name="checkBoxAbsoluteMag">
1558+ <property name="text">
1559+ <string>Absolute magnitude</string>
1560+ </property>
1561+ <attribute name="buttonGroup">
1562+ <string notr="true">buttonGroupDisplayedFields</string>
1563+ </attribute>
1564+ </widget>
1565+ </item>
1566+ <item row="4" column="1">
1567+ <widget class="QCheckBox" name="checkBoxAltAz">
1568+ <property name="toolTip">
1569+ <string>Horizontal coordinates</string>
1570+ </property>
1571+ <property name="text">
1572+ <string>Altitude/Azimuth</string>
1573+ </property>
1574+ <attribute name="buttonGroup">
1575+ <string notr="true">buttonGroupDisplayedFields</string>
1576+ </attribute>
1577+ </widget>
1578+ </item>
1579+ <item row="5" column="1">
1580+ <widget class="QCheckBox" name="checkBoxSize">
1581+ <property name="toolTip">
1582+ <string>Angular or physical size</string>
1583+ </property>
1584+ <property name="text">
1585+ <string>Size</string>
1586+ </property>
1587+ <attribute name="buttonGroup">
1588+ <string notr="true">buttonGroupDisplayedFields</string>
1589+ </attribute>
1590+ </widget>
1591+ </item>
1592+ <item row="3" column="0" colspan="2">
1593+ <widget class="QCheckBox" name="checkBoxRaDecOfDate">
1594+ <property name="toolTip">
1595+ <string>Geocentric equatorial coordinates, equinox of date</string>
1596+ </property>
1597+ <property name="text">
1598+ <string>Right ascension/Declination (of date)</string>
1599+ </property>
1600+ <attribute name="buttonGroup">
1601+ <string notr="true">buttonGroupDisplayedFields</string>
1602+ </attribute>
1603+ </widget>
1604+ </item>
1605+ <item row="5" column="0">
1606+ <widget class="QCheckBox" name="checkBoxDistance">
1607+ <property name="text">
1608+ <string>Distance</string>
1609+ </property>
1610+ <attribute name="buttonGroup">
1611+ <string notr="true">buttonGroupDisplayedFields</string>
1612+ </attribute>
1613+ </widget>
1614+ </item>
1615+ <item row="2" column="0" colspan="2">
1616+ <widget class="QCheckBox" name="checkBoxRaDecJ2000">
1617+ <property name="toolTip">
1618+ <string>Geocentric equatorial coordinates, equinox of J2000.0</string>
1619+ </property>
1620+ <property name="text">
1621+ <string>Right ascension/Declination (J2000)</string>
1622+ </property>
1623+ <attribute name="buttonGroup">
1624+ <string notr="true">buttonGroupDisplayedFields</string>
1625+ </attribute>
1626+ </widget>
1627+ </item>
1628+ <item row="4" column="0">
1629+ <widget class="QCheckBox" name="checkBoxHourAngle">
1630+ <property name="toolTip">
1631+ <string>Topocentric equatorial coordinates</string>
1632+ </property>
1633+ <property name="text">
1634+ <string>Hour angle/Declination</string>
1635+ </property>
1636+ <attribute name="buttonGroup">
1637+ <string notr="true">buttonGroupDisplayedFields</string>
1638+ </attribute>
1639+ </widget>
1640+ </item>
1641+ </layout>
1642+ </widget>
1643+ </item>
1644+ </layout>
1645+ </widget>
1646 <widget class="QWidget" name="page_2">
1647 <layout class="QVBoxLayout" name="verticalLayout_11">
1648 <property name="spacing">
1649@@ -1131,6 +1251,18 @@
1650 </item>
1651 <item>
1652 <property name="text">
1653+ <string>Information</string>
1654+ </property>
1655+ <property name="toolTip">
1656+ <string>Selected object information</string>
1657+ </property>
1658+ <property name="icon">
1659+ <iconset resource="../../data/gui/guiRes.qrc">
1660+ <normaloff>:/graphicGui/tabicon-info.png</normaloff>:/graphicGui/tabicon-info.png</iconset>
1661+ </property>
1662+ </item>
1663+ <item>
1664+ <property name="text">
1665 <string>Navigation</string>
1666 </property>
1667 <property name="icon">
1668@@ -1183,8 +1315,84 @@
1669 <container>1</container>
1670 </customwidget>
1671 </customwidgets>
1672+ <tabstops>
1673+ <tabstop>programLanguageComboBox</tabstop>
1674+ <tabstop>setViewingOptionAsDefaultPushButton</tabstop>
1675+ <tabstop>restoreDefaultsButton</tabstop>
1676+ <tabstop>allSelectedInfoRadio</tabstop>
1677+ <tabstop>briefSelectedInfoRadio</tabstop>
1678+ <tabstop>noSelectedInfoRadio</tabstop>
1679+ <tabstop>customSelectedInfoRadio</tabstop>
1680+ <tabstop>checkBoxName</tabstop>
1681+ <tabstop>checkBoxCatalogNumbers</tabstop>
1682+ <tabstop>checkBoxVisualMag</tabstop>
1683+ <tabstop>checkBoxAbsoluteMag</tabstop>
1684+ <tabstop>checkBoxRaDecJ2000</tabstop>
1685+ <tabstop>checkBoxRaDecOfDate</tabstop>
1686+ <tabstop>checkBoxHourAngle</tabstop>
1687+ <tabstop>checkBoxAltAz</tabstop>
1688+ <tabstop>checkBoxDistance</tabstop>
1689+ <tabstop>checkBoxSize</tabstop>
1690+ <tabstop>checkBoxExtra1</tabstop>
1691+ <tabstop>checkBoxExtra2</tabstop>
1692+ <tabstop>checkBoxExtra3</tabstop>
1693+ <tabstop>enableKeysNavigationCheckBox</tabstop>
1694+ <tabstop>enableMouseNavigationCheckBox</tabstop>
1695+ <tabstop>systemTimeRadio</tabstop>
1696+ <tabstop>todayRadio</tabstop>
1697+ <tabstop>todayTimeSpinBox</tabstop>
1698+ <tabstop>fixedTimeRadio</tabstop>
1699+ <tabstop>fixedDateTimeEdit</tabstop>
1700+ <tabstop>fixedDateTimeCurrentButton</tabstop>
1701+ <tabstop>mouseTimeoutCheckbox</tabstop>
1702+ <tabstop>mouseTimeoutSpinBox</tabstop>
1703+ <tabstop>showFlipButtonsCheckbox</tabstop>
1704+ <tabstop>showNebulaBgButtonCheckbox</tabstop>
1705+ <tabstop>sphericMirrorCheckbox</tabstop>
1706+ <tabstop>diskViewportCheckbox</tabstop>
1707+ <tabstop>gravityLabelCheckbox</tabstop>
1708+ <tabstop>selectSingleConstellationButton</tabstop>
1709+ <tabstop>autoZoomResetsDirectionCheckbox</tabstop>
1710+ <tabstop>screenshotBrowseButton</tabstop>
1711+ <tabstop>screenshotDirEdit</tabstop>
1712+ <tabstop>invertScreenShotColorsCheckBox</tabstop>
1713+ <tabstop>getStarsButton</tabstop>
1714+ <tabstop>downloadRetryButton</tabstop>
1715+ <tabstop>downloadCancelButton</tabstop>
1716+ <tabstop>scriptInfoBrowser</tabstop>
1717+ <tabstop>runScriptButton</tabstop>
1718+ <tabstop>stopScriptButton</tabstop>
1719+ <tabstop>closeWindowAtScriptRunCheckbox</tabstop>
1720+ <tabstop>pluginsInfoBrowser</tabstop>
1721+ <tabstop>pluginLoadAtStartupCheckBox</tabstop>
1722+ <tabstop>pluginConfigureButton</tabstop>
1723+ </tabstops>
1724 <resources>
1725 <include location="../../data/gui/guiRes.qrc"/>
1726 </resources>
1727- <connections/>
1728+ <connections>
1729+ <connection>
1730+ <sender>stackListWidget</sender>
1731+ <signal>currentRowChanged(int)</signal>
1732+ <receiver>configurationStackedWidget</receiver>
1733+ <slot>setCurrentIndex(int)</slot>
1734+ <hints>
1735+ <hint type="sourcelabel">
1736+ <x>237</x>
1737+ <y>62</y>
1738+ </hint>
1739+ <hint type="destinationlabel">
1740+ <x>237</x>
1741+ <y>281</y>
1742+ </hint>
1743+ </hints>
1744+ </connection>
1745+ </connections>
1746+ <buttongroups>
1747+ <buttongroup name="buttonGroupDisplayedFields">
1748+ <property name="exclusive">
1749+ <bool>false</bool>
1750+ </property>
1751+ </buttongroup>
1752+ </buttongroups>
1753 </ui>