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);
#ifdef Q_OS_WIN
//Kinetic scrolling for tablet pc and pc //Kinetic scrolling for tablet pc and pc
QList<QWidget *> addscroll; QList<QWidget *> addscroll;
addscroll << ui->citiesListView; addscroll << ui->citiesListView;
installKineticScrolling(addscroll); installKineticScrolling(addscroll);
#endif
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())) ;
skipping to change at line 285 skipping to change at line 287
lastPlanet = loc.planetName; lastPlanet = loc.planetName;
} }
void LocationDialog::populatePlanetList() void LocationDialog::populatePlanetList()
{ {
Q_ASSERT(ui->planetNameComboBox); Q_ASSERT(ui->planetNameComboBox);
QComboBox* planets = ui->planetNameComboBox; QComboBox* planets = ui->planetNameComboBox;
SolarSystem* ssystem = GETSTELMODULE(SolarSystem); SolarSystem* ssystem = GETSTELMODULE(SolarSystem);
QStringList planetNames(ssystem->getAllPlanetEnglishNames()); QStringList planetNames(ssystem->getAllPlanetEnglishNames());
const StelTranslator& trans = StelApp::getInstance().getLocaleMgr(). getSkyTranslator();
//Save the current selection to be restored later //Save the current selection to be restored later
planets->blockSignals(true); planets->blockSignals(true);
int index = planets->currentIndex(); int index = planets->currentIndex();
QVariant selectedPlanetId = planets->itemData(index); QVariant selectedPlanetId = planets->itemData(index);
planets->clear(); planets->clear();
//For each planet, display the localized name and store the original as user //For each planet, display the localized name and store the original as user
//data. Unfortunately, there's no other way to do this than with a c ycle. //data. Unfortunately, there's no other way to do this than with a c ycle.
foreach(const QString& name, planetNames) foreach(const QString& name, planetNames)
{ {
planets->addItem(q_(name), name); planets->addItem(trans.qtranslate(name), name);
} }
//Restore the selection //Restore the selection
index = planets->findData(selectedPlanetId, Qt::UserRole, Qt::MatchC aseSensitive); index = planets->findData(selectedPlanetId, Qt::UserRole, Qt::MatchC aseSensitive);
planets->setCurrentIndex(index); planets->setCurrentIndex(index);
planets->model()->sort(0); planets->model()->sort(0);
planets->blockSignals(false); planets->blockSignals(false);
} }
void LocationDialog::populateCountryList() void LocationDialog::populateCountryList()
{ {
 End of changes. 4 change blocks. 
1 lines changed or deleted 4 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/