MSSearchDialog.cpp   MSSearchDialog.cpp 
skipping to change at line 33 skipping to change at line 33
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelMovementMgr.hpp" #include "StelMovementMgr.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "ui_MSSearchDialog.h" #include "ui_MSSearchDialog.h"
MSSearchDialog::MSSearchDialog(MeteorShowersMgr* mgr) MSSearchDialog::MSSearchDialog(MeteorShowersMgr* mgr)
: m_mgr(mgr) : m_mgr(mgr)
, m_ui(new Ui_MSSearchDialog) , m_ui(new Ui_MSSearchDialog)
{ {
dialogName = "MeteorShowersSearch";
} }
MSSearchDialog::~MSSearchDialog() MSSearchDialog::~MSSearchDialog()
{ {
delete m_ui; delete m_ui;
} }
void MSSearchDialog::retranslate() void MSSearchDialog::retranslate()
{ {
if (dialog) if (dialog)
skipping to change at line 76 skipping to change at line 77
QList<QWidget *> addscroll; QList<QWidget *> addscroll;
addscroll << m_ui->listEvents; addscroll << m_ui->listEvents;
installKineticScrolling(addscroll); installKineticScrolling(addscroll);
#endif #endif
connect(this, SIGNAL(visibleChanged(bool)), this, SLOT(refreshRangeD ates())); connect(this, SIGNAL(visibleChanged(bool)), this, SLOT(refreshRangeD ates()));
connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SL OT(retranslate())); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SL OT(retranslate()));
connect(m_ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close() )); connect(m_ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close() ));
connect(m_ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMo vedTo(QPoint)));
connect(m_ui->searchButton, SIGNAL(clicked()), this, SLOT(checkDates ())); connect(m_ui->searchButton, SIGNAL(clicked()), this, SLOT(checkDates ()));
connect(m_ui->listEvents, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(selectEvent(QModelIndex))); connect(m_ui->listEvents, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(selectEvent(QModelIndex)));
// bug #1350669 (https://bugs.launchpad.net/stellarium/+bug/1350669) // bug #1350669 (https://bugs.launchpad.net/stellarium/+bug/1350669)
connect(m_ui->listEvents, SIGNAL(currentItemChanged(QTreeWidgetItem* ,QTreeWidgetItem*)), connect(m_ui->listEvents, SIGNAL(currentItemChanged(QTreeWidgetItem* ,QTreeWidgetItem*)),
m_ui->listEvents, SLOT(repaint())); m_ui->listEvents, SLOT(repaint()));
refreshRangeDates(); refreshRangeDates();
skipping to change at line 130 skipping to change at line 132
searchResult = m_mgr->getMeteorShowers()->searchEvents(m_ui->dateFro m->date(), m_ui->dateTo->date()); searchResult = m_mgr->getMeteorShowers()->searchEvents(m_ui->dateFro m->date(), m_ui->dateTo->date());
//Fill list of events //Fill list of events
initListEvents(); initListEvents();
foreach (const MeteorShowers::SearchResult& r, searchResult) foreach (const MeteorShowers::SearchResult& r, searchResult)
{ {
MSTreeWidgetItem *treeItem = new MSTreeWidgetItem(m_ui->list Events); MSTreeWidgetItem *treeItem = new MSTreeWidgetItem(m_ui->list Events);
treeItem->setText(ColumnName, r.name); treeItem->setText(ColumnName, r.name);
treeItem->setText(ColumnZHR, r.zhr); treeItem->setText(ColumnZHR, r.zhr);
treeItem->setText(ColumnDataType, r.type); treeItem->setText(ColumnDataType, r.type);
treeItem->setText(ColumnPeak, r.peak.toString("dd/MMM/yyyy") ); treeItem->setText(ColumnPeak, r.peak.toString("d MMMM yyyy") );
} }
// adjust the column width // adjust the column width
for(int i = 0; i < ColumnCount; ++i) for(int i = 0; i < ColumnCount; ++i)
{ {
m_ui->listEvents->resizeColumnToContents(i); m_ui->listEvents->resizeColumnToContents(i);
} }
// sort-by-date // sort-by-date
m_ui->listEvents->sortItems(ColumnPeak, Qt::AscendingOrder); m_ui->listEvents->sortItems(ColumnPeak, Qt::AscendingOrder);
skipping to change at line 153 skipping to change at line 155
void MSSearchDialog::selectEvent(const QModelIndex &modelIndex) void MSSearchDialog::selectEvent(const QModelIndex &modelIndex)
{ {
// plugin is disabled ? enable it automatically // plugin is disabled ? enable it automatically
if (!m_mgr->getEnablePlugin()) if (!m_mgr->getEnablePlugin())
{ {
m_mgr->setEnablePlugin(true); m_mgr->setEnablePlugin(true);
} }
// Change date // Change date
QString peak = modelIndex.sibling(modelIndex.row(), ColumnPeak).data ().toString(); QString peak = modelIndex.sibling(modelIndex.row(), ColumnPeak).data ().toString();
StelApp::getInstance().getCore()->setJD(QDate::fromString(peak, "dd/ MMM/yyyy").toJulianDay()); StelApp::getInstance().getCore()->setJD(QDate::fromString(peak, "d M MMM yyyy").toJulianDay());
m_mgr->repaint(); m_mgr->repaint();
// Find the object // Find the object
QString nameI18n = modelIndex.sibling(modelIndex.row(), ColumnName). data().toString(); QString nameI18n = modelIndex.sibling(modelIndex.row(), ColumnName). data().toString();
StelObjectP obj = m_mgr->getMeteorShowers()->searchByNameI18n(nameI1 8n); StelObjectP obj = m_mgr->getMeteorShowers()->searchByNameI18n(nameI1 8n);
if (!obj) if (!obj)
{ {
obj = m_mgr->getMeteorShowers()->searchByName(nameI18n); obj = m_mgr->getMeteorShowers()->searchByName(nameI18n);
} }
 End of changes. 4 change blocks. 
2 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/