SatellitesImportDialog.cpp   SatellitesImportDialog.cpp 
skipping to change at line 32 skipping to change at line 32
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelMainGraphicsView.hpp" //for the QFileDialog? Why? #include "StelMainGraphicsView.hpp" //for the QFileDialog? Why?
#include "StelModuleMgr.hpp" // for the GETSTELMODULE macro :( #include "StelModuleMgr.hpp" // for the GETSTELMODULE macro :(
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include <QDesktopServices> #include <QDesktopServices>
#include <QFileDialog> #include <QFileDialog>
#include <QFileInfo> #include <QFileInfo>
#include <QNetworkReply> #include <QNetworkReply>
#include <QProgressBar>
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>
#include <QStandardItemModel> #include <QStandardItemModel>
#include <QTemporaryFile> #include <QTemporaryFile>
SatellitesImportDialog::SatellitesImportDialog() : SatellitesImportDialog::SatellitesImportDialog() :
downloadMgr(0), downloadMgr(0),
progressBar(0) progressBar(0)
{ {
ui = new Ui_satellitesImportDialog; ui = new Ui_satellitesImportDialog;
newSatellitesModel = new QStandardItemModel(this); newSatellitesModel = new QStandardItemModel(this);
skipping to change at line 93 skipping to change at line 94
this, SLOT(close())); this, SLOT(close()));
connect(ui->pushButtonGetData, SIGNAL(clicked()), connect(ui->pushButtonGetData, SIGNAL(clicked()),
this, SLOT(getData())); this, SLOT(getData()));
connect(ui->pushButtonAbort, SIGNAL(clicked()), connect(ui->pushButtonAbort, SIGNAL(clicked()),
this, SLOT(abortDownloads())); this, SLOT(abortDownloads()));
connect(ui->pushButtonAdd, SIGNAL(clicked()), connect(ui->pushButtonAdd, SIGNAL(clicked()),
this, SLOT(acceptNewSatellites())); this, SLOT(acceptNewSatellites()));
connect(ui->pushButtonDiscard, SIGNAL(clicked()), connect(ui->pushButtonDiscard, SIGNAL(clicked()),
this, SLOT(discardNewSatellites())); this, SLOT(discardNewSatellites()));
connect(ui->pushButtonMarkAll, SIGNAL(clicked()),
this, SLOT(markAll()));
connect(ui->pushButtonMarkNone, SIGNAL(clicked()),
this, SLOT(markNone()));
QSortFilterProxyModel * filterProxyModel = new QSortFilterProxyModel (this); filterProxyModel = new QSortFilterProxyModel(this);
filterProxyModel->setSourceModel(newSatellitesModel); filterProxyModel->setSourceModel(newSatellitesModel);
filterProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); filterProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
ui->listView->setModel(filterProxyModel); ui->listView->setModel(filterProxyModel);
connect(ui->lineEditSearch, SIGNAL(textChanged(const QString&)), connect(ui->lineEditSearch, SIGNAL(textChanged(const QString&)),
filterProxyModel, SLOT(setFilterFixedString(const QString&)) ); filterProxyModel, SLOT(setFilterFixedString(const QString&)) );
reset(); reset();
} }
void SatellitesImportDialog::getData() void SatellitesImportDialog::getData()
skipping to change at line 269 skipping to change at line 274
reset(); reset();
close(); close();
} }
void SatellitesImportDialog::discardNewSatellites() void SatellitesImportDialog::discardNewSatellites()
{ {
reset(); reset();
close(); close();
} }
void SatellitesImportDialog::markAll()
{
setCheckState(Qt::Checked);
}
void SatellitesImportDialog::markNone()
{
setCheckState(Qt::Unchecked);
}
void SatellitesImportDialog::reset() void SatellitesImportDialog::reset()
{ {
// Assuming that everything that needs to be stopped is stopped // Assuming that everything that needs to be stopped is stopped
isGettingData = false; isGettingData = false;
ui->stackedWidget->setCurrentIndex(0); ui->stackedWidget->setCurrentIndex(0);
ui->pushButtonGetData->setVisible(true); ui->pushButtonGetData->setVisible(true);
ui->pushButtonAbort->setVisible(false); ui->pushButtonAbort->setVisible(false);
ui->labelMessage->setVisible(false); ui->labelMessage->setVisible(false);
ui->labelMessage->clear(); ui->labelMessage->clear();
ui->groupBoxWorking->setTitle("Get data"); ui->groupBoxWorking->setTitle("Get data");
skipping to change at line 362 skipping to change at line 377
} }
void SatellitesImportDialog::displayMessage(const QString& message) void SatellitesImportDialog::displayMessage(const QString& message)
{ {
if (message.isEmpty()) if (message.isEmpty())
return; return;
ui->labelMessage->setText(message); ui->labelMessage->setText(message);
ui->labelMessage->setVisible(true); ui->labelMessage->setVisible(true);
} }
void SatellitesImportDialog::setCheckState(Qt::CheckState state)
{
Q_ASSERT(filterProxyModel);
int rowCount = filterProxyModel->rowCount();
if (rowCount < 1)
return;
for (int row = 0; row < rowCount; row++)
{
QModelIndex proxyIndex = filterProxyModel->index(row, 0);
QModelIndex index = filterProxyModel->mapToSource(proxyIndex
);
QStandardItem * item = newSatellitesModel->itemFromIndex(ind
ex);
if (item)
{
item->setCheckState(state);
}
}
}
 End of changes. 5 change blocks. 
1 lines changed or deleted 16 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/