Stellarium 0.13.2
LocationDialog.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2008 Guillaume Chereau
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18 */
19 
20 #ifndef _LOCATIONDIALOG_HPP_
21 #define _LOCATIONDIALOG_HPP_
22 
23 #include <QObject>
24 #include "StelDialog.hpp"
25 
26 class Ui_locationDialogForm;
27 class QModelIndex;
28 class StelLocation;
29 
30 class LocationDialog : public StelDialog
31 {
32  Q_OBJECT
33 public:
34  LocationDialog(QObject* parent);
35  virtual ~LocationDialog();
37  void styleChanged();
38 
39 public slots:
40  void retranslate();
41 
42 protected:
44  virtual void createDialogContent();
45  Ui_locationDialogForm* ui;
46 
47 private:
50  void setFieldsFromLocation(const StelLocation& loc);
51 
53  StelLocation locationFromFields() const;
54 
56  bool isEditingNew;
57 
58  void disconnectEditSignals();
59  void connectEditSignals();
60 
62  void setMapForLocation(const StelLocation& loc);
63 
68  void populatePlanetList();
69 
74  void populateCountryList();
75 
76 private slots:
78  void reportEdit();
79 
82  void updateFromProgram(const StelLocation& location);
83 
86  void setPositionFromMap(double longitude, double latitude);
87 
89  void setPositionFromList(const QModelIndex& index);
90 
92  void moveToAnotherPlanet(const QString& text);
94  void setPositionFromCoords(int i=0);
95 
97  void addCurrentLocationToList();
98 
100  void deleteCurrentLocationFromList();
101 
103  void filterSitesByCountry();
104 
106  void resetCompleteList();
107 
109  void ipQueryLocation(bool state);
110 
112  void setDefaultLocation(bool state);
113 
114 private:
115  QString lastPlanet;
117  void updateDefaultLocationControls(bool currentIsDefault);
118 };
119 
120 #endif // _LOCATIONDIALOG_HPP_
Store the informations for a location on a planet.
void styleChanged()
Notify that the application style changed.
Base class for all the GUI windows in Stellarium.
Definition: StelDialog.hpp:45
virtual void createDialogContent()
Initialize the dialog widgets and connect the signals/slots.