kstars
locationdialog.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef LOCATIONDIALOG_H
00019 #define LOCATIONDIALOG_H
00020
00043 #include <kdialogbase.h>
00044 #include "geolocation.h"
00045
00046 class QVBoxLayout;
00047 class QHBoxLayout;
00048 class QGridLayout;
00049 class QGroupBox;
00050 class QLabel;
00051 class QListBox;
00052 class QListBoxItem;
00053 class QPushButton;
00054 class QComboBox;
00055 class KLineEdit;
00056 class MapCanvas;
00057 class dmsBox;
00058
00059 class LocationDialog : public KDialogBase {
00060 Q_OBJECT
00061
00062 public:
00067 LocationDialog( QWidget* parent = 0 );
00071 ~LocationDialog();
00072
00078 void initCityList( void );
00079
00082 GeoLocation* selectedCity() const { return SelectedCity; }
00083
00086 QPtrList<GeoLocation>* filteredList() { return &filteredCityList; }
00087
00092 void findCitiesNear( int longitude, int latitude );
00093
00096 QString selectedCityName( void ) const { return SelectedCity->translatedName(); }
00097
00100 QString selectedProvinceName( void ) const { return SelectedCity->translatedProvince(); }
00101
00104 QString selectedCountryName( void ) const { return SelectedCity->translatedCountry(); }
00105
00108 bool addCityEnabled();
00109
00110 public slots:
00116 void filterCity( void );
00117
00122 void changeCity( void );
00123
00128 void addCity( void );
00129
00130 void clearFields( void );
00131 void showTZRules( void );
00132 void nameChanged( void );
00133 void dataChanged( void );
00134
00135 void slotOk();
00136
00137 private:
00141 bool checkLongLat( void );
00142
00143 bool dataModified, nameModified, bCityAdded;
00144 QGridLayout *glay, *glay2;
00145 QHBoxLayout *hlay, *hlayCoord, *hlayTZ, *hlayButtons, *hlay3;
00146 QVBoxLayout *RootLay, *CityLay, *CoordLay, *vlay;
00147 QGroupBox *CityBox, *CoordBox;
00148 QLabel *CityFiltLabel, *ProvinceFiltLabel, *CountryFiltLabel;
00149 QLabel *NewCityLabel, *NewProvinceLabel, *NewCountryLabel;
00150 QLabel *LongLabel, *LatLabel, *CountLabel;
00151 QLabel *TZLabel, *TZRuleLabel;
00152 KLineEdit *NewCityName, *NewProvinceName, *NewCountryName;
00153 KLineEdit *CityFilter, *ProvinceFilter, *CountryFilter;
00154 dmsBox *NewLong, *NewLat;
00155 QComboBox *TZBox, *TZRuleBox;
00156 QPushButton *AddCityButton, *ClearFields, *ShowTZRules;
00157 MapCanvas *MapView;
00158 QListBox *GeoBox;
00159
00160 GeoLocation *SelectedCity;
00161 QPtrList<GeoLocation> filteredCityList;
00162 };
00163
00164 #endif