Stellarium 0.12.4
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:
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 
85  void setPositionFromMap(double longitude, double latitude);
86 
88  void setPositionFromList(const QModelIndex& index);
89 
91  void moveToAnotherPlanet(const QString& text);
93  void setPositionFromCoords(int i=0);
94 
96  void addCurrentLocationToList();
97 
99  void deleteCurrentLocationFromList();
100 
102  void setDefaultLocation();
103 
104 private:
105  QString lastPlanet;
106  bool lastVisionMode;
107 
109  void updateDefaultLocationControls(bool currentIsDefault);
110 };
111 
112 #endif // _LOCATIONDIALOG_HPP_