kstars
LocationDialog Class Reference
Dialog for changing the geographic location of the observer. More...
#include <locationdialog.h>

Public Slots | |
void | addCity (void) |
void | changeCity (void) |
void | clearFields (void) |
void | dataChanged (void) |
void | filterCity (void) |
void | nameChanged (void) |
void | showTZRules (void) |
void | slotOk () |
Public Member Functions | |
bool | addCityEnabled () |
QPtrList< GeoLocation > * | filteredList () |
void | findCitiesNear (int longitude, int latitude) |
void | initCityList (void) |
LocationDialog (QWidget *parent=0) | |
GeoLocation * | selectedCity () const |
QString | selectedCityName (void) const |
QString | selectedCountryName (void) const |
QString | selectedProvinceName (void) const |
~LocationDialog () |
Detailed Description
Dialog for changing the geographic location of the observer.The dialog is divided into two sections.
The top section allows the location to be selected from a database of 2000 cities. It contains a MapCanvas (showing map of the globe with cities overlaid, with a handler for mouse clicks), a QListBox containing the names of cities in the database, and three KLineEdit widgets, which allow the user to filter the List by the name of the City, Province, and Country. In addition, the List can be filtered by location, by clicking anywhere in the MapCanvas. Doing so will display cities within 2 degrees of the clicked position.
The bottom section allows the location to be specified manually. The Longitude, Latitude, City name, Province/State name, and Country name are entered into KLineEdits. There is also a QPushButton for adding the location to the custom Cities database. If the user selects "Add" without filling in all of the manual entry fields, an error message is displayed. Geographic Location dialog
- Version:
- 1.0
Definition at line 59 of file locationdialog.h.
Constructor & Destructor Documentation
LocationDialog::LocationDialog | ( | QWidget * | parent = 0 |
) |
Constructor.
Create all widgets, and pack them into QLayouts. Connect Signals to Slots. Run initCityList().
Definition at line 39 of file locationdialog.cpp.
LocationDialog::~LocationDialog | ( | ) |
Member Function Documentation
void LocationDialog::addCity | ( | void | ) | [slot] |
When the "Add new city" QPushButton is clicked, add the manually-entered city information to the user's custom city database.
Definition at line 330 of file locationdialog.cpp.
bool LocationDialog::addCityEnabled | ( | ) |
void LocationDialog::changeCity | ( | void | ) | [slot] |
When the selected city in the QListBox changes, repaint the MapCanvas so that the crosshairs icon appears on the newly selected city.
Definition at line 289 of file locationdialog.cpp.
void LocationDialog::clearFields | ( | void | ) | [slot] |
Definition at line 458 of file locationdialog.cpp.
void LocationDialog::dataChanged | ( | void | ) | [slot] |
Definition at line 516 of file locationdialog.cpp.
void LocationDialog::filterCity | ( | void | ) | [slot] |
When text is entered in the City/Province/Country Filter KLineEdits, the List of cities is trimmed to show only cities beginning with the entered text.
Also, the QMemArray of ID numbers is kept in sync with the filtered list.
Definition at line 254 of file locationdialog.cpp.
QPtrList<GeoLocation>* LocationDialog::filteredList | ( | ) | [inline] |
- Returns:
- pointer to the List of filtered city pointers.
Definition at line 86 of file locationdialog.h.
void LocationDialog::findCitiesNear | ( | int | longitude, | |
int | latitude | |||
) |
Show only cities within 3 degrees of point specified by arguments.
- Parameters:
-
longitude the longitude of the search point (int) latitude the latitude of the search point (int)
Definition at line 419 of file locationdialog.cpp.
void LocationDialog::initCityList | ( | void | ) |
Initialize list of cities.
Note that the database is not read in here, that is done in the KStars constructor. This simply loads the local QListBox with the names of the cities from the kstarsData object.
Definition at line 219 of file locationdialog.cpp.
void LocationDialog::nameChanged | ( | void | ) | [slot] |
Definition at line 510 of file locationdialog.cpp.
GeoLocation* LocationDialog::selectedCity | ( | ) | const [inline] |
- Returns:
- pointer to the highlighted city in the List.
Definition at line 82 of file locationdialog.h.
QString LocationDialog::selectedCityName | ( | void | ) | const [inline] |
QString LocationDialog::selectedCountryName | ( | void | ) | const [inline] |
QString LocationDialog::selectedProvinceName | ( | void | ) | const [inline] |
- Returns:
- the province name of the selected location.
Definition at line 100 of file locationdialog.h.
void LocationDialog::showTZRules | ( | void | ) | [slot] |
Definition at line 475 of file locationdialog.cpp.
void LocationDialog::slotOk | ( | void | ) | [slot] |
Definition at line 524 of file locationdialog.cpp.
The documentation for this class was generated from the following files: