LocationDialog.cpp   LocationDialog.cpp 
skipping to change at line 90 skipping to change at line 90
ui->longitudeSpinBox->setPrefixType(AngleSpinBox::Longitude); ui->longitudeSpinBox->setPrefixType(AngleSpinBox::Longitude);
ui->latitudeSpinBox->setDisplayFormat(AngleSpinBox::DMSSymbols); ui->latitudeSpinBox->setDisplayFormat(AngleSpinBox::DMSSymbols);
ui->latitudeSpinBox->setPrefixType(AngleSpinBox::Latitude); ui->latitudeSpinBox->setPrefixType(AngleSpinBox::Latitude);
QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this); QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
proxyModel->setSourceModel((QAbstractItemModel*)StelApp::getInstance ().getLocationMgr().getModelAll()); proxyModel->setSourceModel((QAbstractItemModel*)StelApp::getInstance ().getLocationMgr().getModelAll());
proxyModel->sort(0, Qt::AscendingOrder); proxyModel->sort(0, Qt::AscendingOrder);
proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
ui->citiesListView->setModel(proxyModel); ui->citiesListView->setModel(proxyModel);
//Kinetic scrolling for tablet pc and pc
QList<QWidget *> addscroll;
addscroll << ui->citiesListView;
installKineticScrolling(addscroll);
populatePlanetList(); populatePlanetList();
populateCountryList(); populateCountryList();
connect(ui->citySearchLineEdit, SIGNAL(textChanged(const QString&)), proxyModel, SLOT(setFilterWildcard(const QString&))); connect(ui->citySearchLineEdit, SIGNAL(textChanged(const QString&)), proxyModel, SLOT(setFilterWildcard(const QString&)));
connect(ui->citiesListView, SIGNAL(clicked(const QModelIndex&)), connect(ui->citiesListView, SIGNAL(clicked(const QModelIndex&)),
this, SLOT(setPositionFromList(const QModelIndex&))); this, SLOT(setPositionFromList(const QModelIndex&)));
// Connect all the QT signals // Connect all the QT signals
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ; connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ;
connect(ui->mapLabel, SIGNAL(positionChanged(double, double)), this, SLOT(setPositionFromMap(double, double))); connect(ui->mapLabel, SIGNAL(positionChanged(double, double)), this, SLOT(setPositionFromMap(double, double)));
connect(ui->addLocationToListPushButton, SIGNAL(clicked()), this, SL OT(addCurrentLocationToList())); connect(ui->addLocationToListPushButton, SIGNAL(clicked()), this, SL OT(addCurrentLocationToList()));
connect(ui->deleteLocationFromListPushButton, SIGNAL(clicked()), thi s, SLOT(deleteCurrentLocationFromList())); connect(ui->deleteLocationFromListPushButton, SIGNAL(clicked()), thi s, SLOT(deleteCurrentLocationFromList()));
connect(ui->resetListPushButton, SIGNAL(clicked()), this, SLOT(reset
CompleteList()));
connect(ui->countryNameComboBox, SIGNAL(activated(const QString &)),
this, SLOT(filterSitesByCountry()));
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
const StelLocation& currentLocation = core->getCurrentLocation(); const StelLocation& currentLocation = core->getCurrentLocation();
setFieldsFromLocation(currentLocation); bool b = (currentLocation.getID() == core->getDefaultLocationID());
QSettings* conf = StelApp::getInstance().getSettings();
if (conf->value("init_location/location", "auto").toString() == "aut
o")
{
ui->useIpQueryCheckBox->setChecked(true);
b = false;
}
const bool b = (currentLocation.getID() == core->getDefaultLocationI D()); setFieldsFromLocation(currentLocation);
updateDefaultLocationControls(b); updateDefaultLocationControls(b);
connect(ui->useAsDefaultLocationCheckBox, SIGNAL(clicked()), this, S
LOT(setDefaultLocation())); connect(ui->useIpQueryCheckBox, SIGNAL(clicked(bool)), this, SLOT(ip
connect(ui->pushButtonReturnToDefault, SIGNAL(clicked()), QueryLocation(bool)));
core, SLOT(returnToDefaultLocation())); connect(ui->useAsDefaultLocationCheckBox, SIGNAL(clicked(bool)), thi
s, SLOT(setDefaultLocation(bool)));
connect(ui->pushButtonReturnToDefault, SIGNAL(clicked()), core, SLOT
(returnToDefaultLocation()));
connectEditSignals(); connectEditSignals();
connect(core, SIGNAL(locationChanged(StelLocation)), connect(core, SIGNAL(locationChanged(StelLocation)), this, SLOT(upda
this, SLOT(updateFromProgram(StelLocation))); teFromProgram(StelLocation)));
ui->citySearchLineEdit->setFocus(); ui->citySearchLineEdit->setFocus();
} }
// Update the widget to make sure it is synchrone if the location is change d programmatically // Update the widget to make sure it is synchrone if the location is change d programmatically
void LocationDialog::updateFromProgram(const StelLocation& currentLocation) void LocationDialog::updateFromProgram(const StelLocation& currentLocation)
{ {
if (!dialog->isVisible()) if (!dialog->isVisible())
return; return;
StelCore* stelCore = StelApp::getInstance().getCore(); StelCore* stelCore = StelApp::getInstance().getCore();
//const StelLocation& currentLocation = stelCore->getCurrentLocation
();
// Hack to avoid the coord spinbox receiving the focus and triggerin
g
// "new location" editing mode.
// Disable hack below because it change behaviour of spinboxes and a
dded difficulties of changes for this spinboxes --AW
// ui->citySearchLineEdit->setFocus();
isEditingNew = false; isEditingNew = false;
// Check that the use as default check box needs to be updated // Check that the use as default check box needs to be updated
// Move to setFieldsFromLocation()? --BM? // Move to setFieldsFromLocation()? --BM?
const bool b = currentLocation.getID() == stelCore->getDefaultLocati onID(); const bool b = currentLocation.getID() == stelCore->getDefaultLocati onID();
updateDefaultLocationControls(b); QSettings* conf = StelApp::getInstance().getSettings();
if (conf->value("init_location/location", "auto").toString() != ("au
to"))
{
updateDefaultLocationControls(b);
ui->pushButtonReturnToDefault->setEnabled(!b);
}
const QString& key1 = currentLocation.getID(); const QString& key1 = currentLocation.getID();
const QString& key2 = locationFromFields().getID(); const QString& key2 = locationFromFields().getID();
if (key1!=key2) if (key1!=key2)
{ {
setFieldsFromLocation(currentLocation); setFieldsFromLocation(currentLocation);
} }
LandscapeMgr *lmgr = GETSTELMODULE(LandscapeMgr); LandscapeMgr *lmgr = GETSTELMODULE(LandscapeMgr);
if (lmgr->getFlagUseLightPollutionFromDatabase()) if (lmgr->getFlagUseLightPollutionFromDatabase())
skipping to change at line 170 skipping to change at line 182
} }
} }
void LocationDialog::disconnectEditSignals() void LocationDialog::disconnectEditSignals()
{ {
disconnect(ui->longitudeSpinBox, SIGNAL(valueChanged()), this, SLOT( setPositionFromCoords())); disconnect(ui->longitudeSpinBox, SIGNAL(valueChanged()), this, SLOT( setPositionFromCoords()));
disconnect(ui->latitudeSpinBox, SIGNAL(valueChanged()), this, SLOT(s etPositionFromCoords())); disconnect(ui->latitudeSpinBox, SIGNAL(valueChanged()), this, SLOT(s etPositionFromCoords()));
disconnect(ui->altitudeSpinBox, SIGNAL(valueChanged(int)), this, SLO T(setPositionFromCoords(int))); disconnect(ui->altitudeSpinBox, SIGNAL(valueChanged(int)), this, SLO T(setPositionFromCoords(int)));
disconnect(ui->planetNameComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(moveToAnotherPlanet(const QString&))); disconnect(ui->planetNameComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(moveToAnotherPlanet(const QString&)));
disconnect(ui->countryNameComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(reportEdit())); disconnect(ui->countryNameComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(reportEdit()));
// Why an edit should be reported even if the country is not changed disconnect(ui->cityNameLineEdit, SIGNAL(textEdited(const QString&)),
? --BM this, SLOT(reportEdit()));
//disconnect(ui->countryNameComboBox, SIGNAL(activated(const QString
&)), this, SLOT(comboBoxChanged(const QString&)));
disconnect(ui->cityNameLineEdit, SIGNAL(textEdited(const QString&)),
this, SLOT(reportEdit()));
} }
void LocationDialog::connectEditSignals() void LocationDialog::connectEditSignals()
{ {
connect(ui->longitudeSpinBox, SIGNAL(valueChanged()), this, SLOT(set PositionFromCoords())); connect(ui->longitudeSpinBox, SIGNAL(valueChanged()), this, SLOT(set PositionFromCoords()));
connect(ui->latitudeSpinBox, SIGNAL(valueChanged()), this, SLOT(setP ositionFromCoords())); connect(ui->latitudeSpinBox, SIGNAL(valueChanged()), this, SLOT(setP ositionFromCoords()));
connect(ui->altitudeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(s etPositionFromCoords(int))); connect(ui->altitudeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(s etPositionFromCoords(int)));
connect(ui->planetNameComboBox, SIGNAL(currentIndexChanged(const QSt ring&)), this, SLOT(moveToAnotherPlanet(const QString&))); connect(ui->planetNameComboBox, SIGNAL(currentIndexChanged(const QSt ring&)), this, SLOT(moveToAnotherPlanet(const QString&)));
connect(ui->countryNameComboBox, SIGNAL(currentIndexChanged(const QS tring&)), this, SLOT(reportEdit())); connect(ui->countryNameComboBox, SIGNAL(currentIndexChanged(const QS tring&)), this, SLOT(reportEdit()));
// Why an edit should be reported even if the country is not changed connect(ui->cityNameLineEdit, SIGNAL(textEdited(const QString&)), th
? --BM is, SLOT(reportEdit()));
//connect(ui->countryNameComboBox, SIGNAL(activated(const QString&))
, this, SLOT(comboBoxChanged(const QString&)));
connect(ui->cityNameLineEdit, SIGNAL(textEdited(const QString&)),
this, SLOT(reportEdit()));
} }
void LocationDialog::setFieldsFromLocation(const StelLocation& loc) void LocationDialog::setFieldsFromLocation(const StelLocation& loc)
{ {
// Deactivate edit signals // Deactivate edit signals
disconnectEditSignals(); disconnectEditSignals();
ui->cityNameLineEdit->setText(loc.name); ui->cityNameLineEdit->setText(loc.name);
int idx = ui->countryNameComboBox->findData(loc.country, Qt::UserRol e, Qt::MatchCaseSensitive); int idx = ui->countryNameComboBox->findData(loc.country, Qt::UserRol e, Qt::MatchCaseSensitive);
if (idx==-1) if (idx==-1)
skipping to change at line 226 skipping to change at line 232
// Set pointer position // Set pointer position
ui->mapLabel->setCursorPos(loc.longitude, loc.latitude); ui->mapLabel->setCursorPos(loc.longitude, loc.latitude);
ui->deleteLocationFromListPushButton->setEnabled(StelApp::getInstanc e().getLocationMgr().canDeleteUserLocation(loc.getID())); ui->deleteLocationFromListPushButton->setEnabled(StelApp::getInstanc e().getLocationMgr().canDeleteUserLocation(loc.getID()));
SolarSystem* ssm = GETSTELMODULE(SolarSystem); SolarSystem* ssm = GETSTELMODULE(SolarSystem);
PlanetP p = ssm->searchByEnglishName(loc.planetName); PlanetP p = ssm->searchByEnglishName(loc.planetName);
LandscapeMgr* ls = GETSTELMODULE(LandscapeMgr); LandscapeMgr* ls = GETSTELMODULE(LandscapeMgr);
if (ls->getFlagAtmosphereAutoEnable()) if (ls->getFlagAtmosphereAutoEnable())
{ {
QSettings* conf = StelApp::getInstance().getSettings(); if (loc.planetName != StelApp::getInstance().getCore()->getC
ls->setFlagAtmosphere(p->hasAtmosphere() & conf->value("land urrentLocation().planetName)
scape/flag_atmosphere", true).toBool()); {
ls->setFlagFog(p->hasAtmosphere() & conf->value("landscape/f QSettings* conf = StelApp::getInstance().getSettings
lag_fog", true).toBool()); ();
ls->setFlagAtmosphere(p->hasAtmosphere() & conf->val
ue("landscape/flag_atmosphere", true).toBool());
ls->setFlagFog(p->hasAtmosphere() & conf->value("lan
dscape/flag_fog", true).toBool());
}
} }
// Reactivate edit signals // Reactivate edit signals
connectEditSignals(); connectEditSignals();
} }
// Update the map for the given location. // Update the map for the given location.
void LocationDialog::setMapForLocation(const StelLocation& loc) void LocationDialog::setMapForLocation(const StelLocation& loc)
{ {
// Avoids usless processing // Avoids useless processing
if (lastPlanet==loc.planetName) if (lastPlanet==loc.planetName)
return; return;
QPixmap pixmap; QPixmap pixmap;
// Try to set the proper planet map image // Try to set the proper planet map image
if (loc.planetName=="Earth") if (loc.planetName=="Earth")
{ {
// Special case for earth, we don't want to see the clouds // Special case for earth, we don't want to see the clouds
pixmap = QPixmap(":/graphicGui/world.png"); pixmap = QPixmap(":/graphicGui/world.png");
} }
skipping to change at line 361 skipping to change at line 370
} }
void LocationDialog::setPositionFromMap(double longitude, double latitude) void LocationDialog::setPositionFromMap(double longitude, double latitude)
{ {
reportEdit(); reportEdit();
StelLocation loc = locationFromFields(); StelLocation loc = locationFromFields();
loc.latitude = latitude; loc.latitude = latitude;
loc.longitude = longitude; loc.longitude = longitude;
setFieldsFromLocation(loc); setFieldsFromLocation(loc);
StelApp::getInstance().getCore()->moveObserverTo(loc, 0.); StelApp::getInstance().getCore()->moveObserverTo(loc, 0.);
// GZ: Filter location list for nearby sites. I assume Earth locatio
ns are better known. With only few locations on other planets in the list,
30 degrees seem OK.
StelApp::getInstance().getLocationMgr().pickLocationsNearby(loc.plan
etName, longitude, latitude, loc.planetName=="Earth" ? 3.0f: 30.0f);
QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
proxyModel->setSourceModel((QAbstractItemModel*)StelApp::getInstance
().getLocationMgr().getModelPicked());
proxyModel->sort(0, Qt::AscendingOrder);
proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
ui->citiesListView->setModel(proxyModel);
ui->citySearchLineEdit->clear();
connect(ui->citySearchLineEdit, SIGNAL(textChanged(const QString&)),
proxyModel, SLOT(setFilterWildcard(const QString&)));
} }
// Called when the planet name is changed by hand // Called when the planet name is changed by hand
void LocationDialog::moveToAnotherPlanet(const QString&) void LocationDialog::moveToAnotherPlanet(const QString&)
{ {
reportEdit(); reportEdit();
StelLocation loc = locationFromFields(); StelLocation loc = locationFromFields();
StelCore* stelCore = StelApp::getInstance().getCore(); StelCore* stelCore = StelApp::getInstance().getCore();
LandscapeMgr* ls = GETSTELMODULE(LandscapeMgr); LandscapeMgr* ls = GETSTELMODULE(LandscapeMgr);
if (loc.planetName != stelCore->getCurrentLocation().planetName) if (loc.planetName != stelCore->getCurrentLocation().planetName)
skipping to change at line 383 skipping to change at line 401
if (ls->getFlagLandscapeAutoSelection()) if (ls->getFlagLandscapeAutoSelection())
{ {
// If we have a landscape for selected planet then s et it, otherwise use default landscape // If we have a landscape for selected planet then s et it, otherwise use default landscape
// Details: https://bugs.launchpad.net/stellarium/+b ug/1173254 // Details: https://bugs.launchpad.net/stellarium/+b ug/1173254
if (ls->getAllLandscapeNames().indexOf(loc.planetNam e)>0) if (ls->getAllLandscapeNames().indexOf(loc.planetNam e)>0)
ls->setCurrentLandscapeName(loc.planetName); ls->setCurrentLandscapeName(loc.planetName);
else else
ls->setCurrentLandscapeID(ls->getDefaultLand scapeID()); ls->setCurrentLandscapeID(ls->getDefaultLand scapeID());
} }
// GZ populate site list with sites only from that planet, o
r full list for Earth (faster than removing the ~50 non-Earth positions...)
.
StelLocationMgr &locMgr=StelApp::getInstance().getLocationMg
r();
QSortFilterProxyModel *proxyModel = new QSortFilterProxyMode
l(this);
if (loc.planetName == "Earth")
{
proxyModel->setSourceModel((QAbstractItemModel*)locM
gr.getModelAll());
}
else
{
locMgr.pickLocationsNearby(loc.planetName, 0.0f, 0.0
f, 180.0f);
proxyModel->setSourceModel((QAbstractItemModel*)locM
gr.getModelPicked());
}
proxyModel->sort(0, Qt::AscendingOrder);
proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
ui->citiesListView->setModel(proxyModel);
ui->citySearchLineEdit->clear();
connect(ui->citySearchLineEdit, SIGNAL(textChanged(const QSt
ring&)), proxyModel, SLOT(setFilterWildcard(const QString&)));
ui->citySearchLineEdit->setFocus();
} }
// Planet transition time also set to null to prevent uglyness when // Planet transition time also set to null to prevent uglyness when
// "use landscape location" is enabled for that planet's landscape. --BM // "use landscape location" is enabled for that planet's landscape. --BM
// NOTE: I think it also makes sense in the other cases. --BM // NOTE: I think it also makes sense in the other cases. --BM
// FIXME: Avoid the unnecessary change of the location anyway. --BM // FIXME: Avoid the unnecessary change of the location anyway. --BM
stelCore->moveObserverTo(loc, 0., 0.); stelCore->moveObserverTo(loc, 0., 0.);
} }
void LocationDialog::setPositionFromCoords(int ) void LocationDialog::setPositionFromCoords(int )
{ {
skipping to change at line 432 skipping to change at line 468
{ {
ui->cityNameLineEdit->setText(""); ui->cityNameLineEdit->setText("");
ui->cityNameLineEdit->selectAll(); ui->cityNameLineEdit->selectAll();
loc = locationFromFields(); loc = locationFromFields();
} }
} }
ui->addLocationToListPushButton->setEnabled(isEditingNew && canSave) ; ui->addLocationToListPushButton->setEnabled(isEditingNew && canSave) ;
ui->deleteLocationFromListPushButton->setEnabled(locationMgr.canDele teUserLocation(loc.getID())); ui->deleteLocationFromListPushButton->setEnabled(locationMgr.canDele teUserLocation(loc.getID()));
} }
// Called when the user clic on the save button // Called when the user clicks on the save button
void LocationDialog::addCurrentLocationToList() void LocationDialog::addCurrentLocationToList()
{ {
const StelLocation& loc = locationFromFields(); const StelLocation& loc = locationFromFields();
ui->citySearchLineEdit->clear(); ui->citySearchLineEdit->clear();
StelApp::getInstance().getLocationMgr().saveUserLocation(loc); StelApp::getInstance().getLocationMgr().saveUserLocation(loc);
isEditingNew=false; isEditingNew=false;
ui->addLocationToListPushButton->setEnabled(false); ui->addLocationToListPushButton->setEnabled(false);
const QAbstractItemModel* model = ui->citiesListView->model(); const QAbstractItemModel* model = ui->citiesListView->model();
const QString id = loc.getID(); const QString id = loc.getID();
skipping to change at line 459 skipping to change at line 495
setPositionFromList(model->index(i,0)); setPositionFromList(model->index(i,0));
disconnectEditSignals(); disconnectEditSignals();
ui->citySearchLineEdit->setFocus(); ui->citySearchLineEdit->setFocus();
connectEditSignals(); connectEditSignals();
break; break;
} }
} }
} }
// Called when the user wants to use the current location as default // Called when the user wants to use the current location as default
void LocationDialog::setDefaultLocation() void LocationDialog::setDefaultLocation(bool state)
{ {
StelCore* core = StelApp::getInstance().getCore(); if (state)
QString currentLocationId = core->getCurrentLocation().getID(); {
core->setDefaultLocationID(currentLocationId); StelCore* core = StelApp::getInstance().getCore();
QString currentLocationId = core->getCurrentLocation().getID
// Why this code even exists? After the previous code, this should a ();
lways core->setDefaultLocationID(currentLocationId);
// be true, except if setting the default location somehow fails. --
BM // Why this code even exists? After the previous code, this
bool isDefault = (currentLocationId == core->getDefaultLocationID()) should always
; // be true, except if setting the default location somehow f
disconnectEditSignals(); ails. --BM
updateDefaultLocationControls(isDefault); bool isDefault = (currentLocationId == core->getDefaultLocat
//The focus need to be switched to another control, otherwise ionID());
//ui->latitudeSpinBox receives it and emits a valueChanged() signal disconnectEditSignals();
when updateDefaultLocationControls(isDefault);
//the window is closed. ui->pushButtonReturnToDefault->setEnabled(!isDefault);
ui->citySearchLineEdit->setFocus(); ui->useIpQueryCheckBox->setChecked(!state);
connectEditSignals(); ui->citySearchLineEdit->setFocus();
connectEditSignals();
}
} }
// Called when the user clicks on the delete button // Called when the user clicks on the delete button
void LocationDialog::deleteCurrentLocationFromList() void LocationDialog::deleteCurrentLocationFromList()
{ {
const StelLocation& loc = locationFromFields(); const StelLocation& loc = locationFromFields();
StelApp::getInstance().getLocationMgr().deleteUserLocation(loc.getID ()); StelApp::getInstance().getLocationMgr().deleteUserLocation(loc.getID ());
} }
void LocationDialog::updateDefaultLocationControls(bool currentIsDefault) void LocationDialog::updateDefaultLocationControls(bool currentIsDefault)
{ {
ui->useAsDefaultLocationCheckBox->setChecked(currentIsDefault); ui->useAsDefaultLocationCheckBox->setChecked(currentIsDefault);
ui->useAsDefaultLocationCheckBox->setEnabled(!currentIsDefault); ui->useAsDefaultLocationCheckBox->setEnabled(!currentIsDefault);
ui->pushButtonReturnToDefault->setEnabled(!currentIsDefault); }
// called when the user clicks on the IP Query button
void LocationDialog::ipQueryLocation(bool state)
{
if (state)
{
QSettings* conf = StelApp::getInstance().getSettings();
conf->setValue("init_location/location", "auto");
disconnectEditSignals();
resetCompleteList(); // in case we are on Moon/Mars, we must
get list back to show all (earth) locations...
StelLocationMgr &locMgr=StelApp::getInstance().getLocationMg
r();
locMgr.locationFromIP(); // This just triggers asynchronous
lookup.
ui->useAsDefaultLocationCheckBox->setChecked(!state);
ui->pushButtonReturnToDefault->setEnabled(!state);
connectEditSignals();
ui->citySearchLineEdit->setFocus();
}
}
// called when user clicks "reset list"
void LocationDialog::resetCompleteList()
{
QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
proxyModel->setSourceModel((QAbstractItemModel*)StelApp::getInstance
().getLocationMgr().getModelAll());
proxyModel->sort(0, Qt::AscendingOrder);
proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
ui->citiesListView->setModel(proxyModel);
ui->citySearchLineEdit->clear();
connect(ui->citySearchLineEdit, SIGNAL(textChanged(const QString&)),
proxyModel, SLOT(setFilterWildcard(const QString&)));
ui->citySearchLineEdit->setFocus();
}
// called when user clicks in the country combobox and selects a country. T
he locations in the list are updated to select only sites in that country.
void LocationDialog::filterSitesByCountry()
{
QString country=ui->countryNameComboBox->currentData().toString();
QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
StelLocationMgr &locMgr=StelApp::getInstance().getLocationMgr();
locMgr.pickLocationsInCountry(country);
proxyModel->setSourceModel((QAbstractItemModel*)locMgr.getModelPicke
d());
proxyModel->sort(0, Qt::AscendingOrder);
proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
ui->citiesListView->setModel(proxyModel);
ui->citySearchLineEdit->clear();
connect(ui->citySearchLineEdit, SIGNAL(textChanged(const QString&)),
proxyModel, SLOT(setFilterWildcard(const QString&)));
ui->citySearchLineEdit->setFocus();
} }
 End of changes. 18 change blocks. 
57 lines changed or deleted 168 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/