Stellarium 0.15.0
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 QSortFilterProxyModel;
29 class QStringListModel;
30 class StelLocation;
31 
32 class LocationDialog : public StelDialog
33 {
34  Q_OBJECT
35 public:
36  LocationDialog(QObject* parent);
37  virtual ~LocationDialog();
39  void styleChanged();
40 
41 public slots:
42  void retranslate();
43 
44 protected:
46  virtual void createDialogContent();
47  Ui_locationDialogForm* ui;
48 
49 private:
52  void setFieldsFromLocation(const StelLocation& loc);
53 
55  StelLocation locationFromFields() const;
56 
58  bool isEditingNew;
59 
60  void disconnectEditSignals();
61  void connectEditSignals();
62 
64  void setMapForLocation(const StelLocation& loc);
65 
70  void populatePlanetList();
71 
76  void populateCountryList();
77 
78 private slots:
80  void reloadLocations();
81 
83  void reportEdit();
84 
87  void updateFromProgram(const StelLocation& location);
88 
91  void setPositionFromMap(double longitude, double latitude);
92 
94  void setPositionFromList(const QModelIndex& index);
95 
97  void moveToAnotherPlanet(const QString& text);
99  void setPositionFromCoords(int i=0);
100 
102  void addCurrentLocationToList();
103 
105  void deleteCurrentLocationFromList();
106 
108  void filterSitesByCountry();
109 
111  void resetCompleteList();
112 
114  void ipQueryLocation(bool state);
115 
117  void setDefaultLocation(bool state);
118 
119 private:
120  QString lastPlanet;
121  QStringListModel* allModel;
122  QStringListModel* pickedModel;
123  QSortFilterProxyModel *proxyModel;
124 
126  void updateDefaultLocationControls(bool currentIsDefault);
127 };
128 
129 #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:67
virtual void createDialogContent()
Initialize the dialog widgets and connect the signals/slots.