SearchDialog.cpp   SearchDialog.cpp 
skipping to change at line 165 skipping to change at line 165
greekLetters.insert("upsilon", QString(QChar(0x03C5))); greekLetters.insert("upsilon", QString(QChar(0x03C5)));
greekLetters.insert("phi", QString(QChar(0x03C6))); greekLetters.insert("phi", QString(QChar(0x03C6)));
greekLetters.insert("chi", QString(QChar(0x03C7))); greekLetters.insert("chi", QString(QChar(0x03C7)));
greekLetters.insert("psi", QString(QChar(0x03C8))); greekLetters.insert("psi", QString(QChar(0x03C8)));
greekLetters.insert("omega", QString(QChar(0x03C9))); greekLetters.insert("omega", QString(QChar(0x03C9)));
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf); Q_ASSERT(conf);
useSimbad = conf->value("search/flag_search_online", true).toBool(); useSimbad = conf->value("search/flag_search_online", true).toBool();
useStartOfWords = conf->value("search/flag_start_words", false).toBo ol();
simbadServerUrl = conf->value("search/simbad_server_url", DEF_SIMBAD _URL).toString(); simbadServerUrl = conf->value("search/simbad_server_url", DEF_SIMBAD _URL).toString();
} }
SearchDialog::~SearchDialog() SearchDialog::~SearchDialog()
{ {
delete ui; delete ui;
if (simbadReply) if (simbadReply)
{ {
simbadReply->deleteLater(); simbadReply->deleteLater();
simbadReply = NULL; simbadReply = NULL;
skipping to change at line 254 skipping to change at line 255
populateSimbadServerList(); populateSimbadServerList();
int idx = ui->serverListComboBox->findData(simbadServerUrl, Qt::User Role, Qt::MatchCaseSensitive); int idx = ui->serverListComboBox->findData(simbadServerUrl, Qt::User Role, Qt::MatchCaseSensitive);
if (idx==-1) if (idx==-1)
{ {
// Use University of Strasbourg as default // Use University of Strasbourg as default
idx = ui->serverListComboBox->findData(QVariant(DEF_SIMBAD_U RL), Qt::UserRole, Qt::MatchCaseSensitive); idx = ui->serverListComboBox->findData(QVariant(DEF_SIMBAD_U RL), Qt::UserRole, Qt::MatchCaseSensitive);
} }
ui->serverListComboBox->setCurrentIndex(idx); ui->serverListComboBox->setCurrentIndex(idx);
connect(ui->serverListComboBox, SIGNAL(currentIndexChanged(int)), th is, SLOT(selectSimbadServer(int))); connect(ui->serverListComboBox, SIGNAL(currentIndexChanged(int)), th is, SLOT(selectSimbadServer(int)));
connect(ui->checkBoxUseStartOfWords, SIGNAL(clicked(bool)), this, SL
OT(enableStartOfWordsAutofill(bool)));
ui->checkBoxUseStartOfWords->setChecked(useStartOfWords);
// list views initialization // list views initialization
connect(ui->objectTypeComboBox, SIGNAL(activated(int)), this, SLOT(u pdateListWidget(int))); connect(ui->objectTypeComboBox, SIGNAL(activated(int)), this, SLOT(u pdateListWidget(int)));
connect(ui->searchInListLineEdit, SIGNAL(textChanged(QString)), this , SLOT(searchListChanged(QString))); connect(ui->searchInListLineEdit, SIGNAL(textChanged(QString)), this , SLOT(searchListChanged(QString)));
connect(ui->searchInEnglishCheckBox, SIGNAL(toggled(bool)), this, SL OT(updateListTab())); connect(ui->searchInEnglishCheckBox, SIGNAL(toggled(bool)), this, SL OT(updateListTab()));
updateListTab(); updateListTab();
} }
void SearchDialog::setHasSelectedFlag() void SearchDialog::setHasSelectedFlag()
{ {
flagHasSelectedText = true; flagHasSelectedText = true;
skipping to change at line 275 skipping to change at line 279
void SearchDialog::enableSimbadSearch(bool enable) void SearchDialog::enableSimbadSearch(bool enable)
{ {
useSimbad = enable; useSimbad = enable;
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf); Q_ASSERT(conf);
conf->setValue("search/flag_search_online", useSimbad); conf->setValue("search/flag_search_online", useSimbad);
} }
void SearchDialog::enableStartOfWordsAutofill(bool enable)
{
useStartOfWords = enable;
QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf);
conf->setValue("search/flag_start_words", useStartOfWords);
}
void SearchDialog::setVisible(bool v) void SearchDialog::setVisible(bool v)
{ {
StelDialog::setVisible(v); StelDialog::setVisible(v);
// Set the focus directly on the line edit // Set the focus directly on the line edit
if (ui->lineEditSearchSkyObject->isVisible()) if (ui->lineEditSearchSkyObject->isVisible())
ui->lineEditSearchSkyObject->setFocus(); ui->lineEditSearchSkyObject->setFocus();
} }
void SearchDialog::setSimpleStyle() void SearchDialog::setSimpleStyle()
skipping to change at line 335 skipping to change at line 348
if (useSimbad) if (useSimbad)
{ {
simbadReply = simbadSearcher->lookup(simbadServerUrl , trimmedText, 3); simbadReply = simbadSearcher->lookup(simbadServerUrl , trimmedText, 3);
onSimbadStatusChanged(); onSimbadStatusChanged();
connect(simbadReply, SIGNAL(statusChanged()), this, SLOT(onSimbadStatusChanged())); connect(simbadReply, SIGNAL(statusChanged()), this, SLOT(onSimbadStatusChanged()));
} }
QString greekText = substituteGreek(trimmedText); QString greekText = substituteGreek(trimmedText);
QStringList matches; QStringList matches;
if(greekText != trimmedText) { if(greekText != trimmedText) {
matches = objectMgr->listMatchingObjectsI18n(trimmed matches = objectMgr->listMatchingObjectsI18n(trimmed
Text, 3); Text, 3, useStartOfWords);
matches += objectMgr->listMatchingObjects(trimmedTex matches += objectMgr->listMatchingObjects(trimmedTex
t, 3); t, 3, useStartOfWords);
matches += objectMgr->listMatchingObjectsI18n(greekT matches += objectMgr->listMatchingObjectsI18n(greekT
ext, (8 - matches.size())); ext, (8 - matches.size()), useStartOfWords);
} else { } else {
matches = objectMgr->listMatchingObjectsI18n(trimmed matches = objectMgr->listMatchingObjectsI18n(trimmed
Text, 5); Text, 5, useStartOfWords);
matches += objectMgr->listMatchingObjects(trimmedTex matches += objectMgr->listMatchingObjects(trimmedTex
t, 5); t, 5, useStartOfWords);
} }
// remove possible duplicates from completion list // remove possible duplicates from completion list
matches.removeDuplicates(); matches.removeDuplicates();
ui->completionLabel->setValues(matches); ui->completionLabel->setValues(matches);
ui->completionLabel->selectFirst(); ui->completionLabel->selectFirst();
// Update push button enabled state // Update push button enabled state
ui->pushButtonGotoSearchSkyObject->setEnabled(true); ui->pushButtonGotoSearchSkyObject->setEnabled(true);
 End of changes. 5 change blocks. 
10 lines changed or deleted 24 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/