SatellitesDialog.cpp   SatellitesDialog.cpp 
skipping to change at line 57 skipping to change at line 57
#include "StelActionMgr.hpp" #include "StelActionMgr.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
SatellitesDialog::SatellitesDialog() SatellitesDialog::SatellitesDialog()
: StelDialog("Satellites") : StelDialog("Satellites")
, satelliteModified(false) , satelliteModified(false)
, updateTimer(Q_NULLPTR) , updateTimer(Q_NULLPTR)
, importWindow(Q_NULLPTR) , importWindow(Q_NULLPTR)
, filterModel(Q_NULLPTR) , filterModel(Q_NULLPTR)
, checkStateRole(Qt::UserRole) , checkStateRole(Qt::UserRole)
, delimiter(", ")
, acEndl("\n")
{ {
ui = new Ui_satellitesDialog; ui = new Ui_satellitesDialog;
iridiumFlaresHeader.clear();
} }
SatellitesDialog::~SatellitesDialog() SatellitesDialog::~SatellitesDialog()
{ {
if (updateTimer) if (updateTimer)
{ {
updateTimer->stop(); updateTimer->stop();
delete updateTimer; delete updateTimer;
updateTimer = Q_NULLPTR; updateTimer = Q_NULLPTR;
} }
skipping to change at line 108 skipping to change at line 111
connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMove dTo(QPoint))); connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMove dTo(QPoint)));
connect(&StelApp::getInstance(), SIGNAL(languageChanged()), connect(&StelApp::getInstance(), SIGNAL(languageChanged()),
this, SLOT(retranslate())); this, SLOT(retranslate()));
Satellites* plugin = GETSTELMODULE(Satellites); Satellites* plugin = GETSTELMODULE(Satellites);
#ifdef Q_OS_WIN #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->satellitesList << ui->sourceList << ui->aboutTextBr owser; addscroll << ui->satellitesList << ui->sourceList << ui->aboutTextBr owser;
installKineticScrolling(addscroll); installKineticScrolling(addscroll);
acEndl="\r\n";
#else
acEndl="\n";
#endif #endif
// Settings tab / updates group // Settings tab / updates group
// These controls are refreshed by updateSettingsPage(), which in // These controls are refreshed by updateSettingsPage(), which in
// turn is triggered by setting any of these values. Because // turn is triggered by setting any of these values. Because
// clicked() is issued only by user input, there's no endless loop. // clicked() is issued only by user input, there's no endless loop.
connect(ui->internetUpdatesCheckbox, SIGNAL(clicked(bool)), connect(ui->internetUpdatesCheckbox, SIGNAL(clicked(bool)),
plugin, SLOT(enableInternetUpdates(bool))); plugin, SLOT(enableInternetUpdates(bool)));
connect(ui->checkBoxAutoAdd, SIGNAL(clicked(bool)), connect(ui->checkBoxAutoAdd, SIGNAL(clicked(bool)),
plugin, SLOT(enableAutoAdd(bool))); plugin, SLOT(enableAutoAdd(bool)));
skipping to change at line 230 skipping to change at line 236
// About tab // About tab
populateAboutPage(); populateAboutPage();
populateFilterMenu(); populateFilterMenu();
populateSourcesList(); populateSourcesList();
initListIridiumFlares(); initListIridiumFlares();
ui->flaresPredictionDepthSpinBox->setValue(plugin->getIridiumFlaresP redictionDepth()); ui->flaresPredictionDepthSpinBox->setValue(plugin->getIridiumFlaresP redictionDepth());
connect(ui->flaresPredictionDepthSpinBox, SIGNAL(valueChanged(int)), plugin, SLOT(setIridiumFlaresPredictionDepth(int))); connect(ui->flaresPredictionDepthSpinBox, SIGNAL(valueChanged(int)), plugin, SLOT(setIridiumFlaresPredictionDepth(int)));
connect(ui->pushButtonPredictIridiumFlares, SIGNAL(clicked()), this, connect(ui->predictIridiumFlaresPushButton, SIGNAL(clicked()), this,
SLOT(predictIridiumFlares())); SLOT(predictIridiumFlares()));
connect(ui->predictedIridiumFlaresSaveButton, SIGNAL(clicked()), thi
s, SLOT(savePredictedIridiumFlares()));
connect(ui->iridiumFlaresTreeWidget, SIGNAL(doubleClicked(QModelInde x)), this, SLOT(selectCurrentIridiumFlare(QModelIndex))); connect(ui->iridiumFlaresTreeWidget, SIGNAL(doubleClicked(QModelInde x)), this, SLOT(selectCurrentIridiumFlare(QModelIndex)));
} }
void SatellitesDialog::savePredictedIridiumFlares()
{
QString filter = q_("CSV (Comma delimited)");
filter.append(" (*.csv)");
QString filePath = QFileDialog::getSaveFileName(0, q_("Save predicte
d Iridium flares as..."), QDir::homePath() + "/iridium_flares.csv", filter)
;
QFile predictedIridiumFlares(filePath);
if (!predictedIridiumFlares.open(QFile::WriteOnly | QFile::Truncate)
)
{
qWarning() << "[Satellites]: Unable to open file"
<< QDir::toNativeSeparators(filePath);
return;
}
QTextStream predictedIridiumFlaresList(&predictedIridiumFlares);
predictedIridiumFlaresList.setCodec("UTF-8");
int count = ui->iridiumFlaresTreeWidget->topLevelItemCount();
predictedIridiumFlaresList << iridiumFlaresHeader.join(delimiter) <<
acEndl;
for (int i = 0; i < count; i++)
{
int columns = iridiumFlaresHeader.size();
for (int j=0; j<columns; j++)
{
predictedIridiumFlaresList << ui->iridiumFlaresTreeW
idget->topLevelItem(i)->text(j);
if (j<columns-1)
predictedIridiumFlaresList << delimiter;
else
predictedIridiumFlaresList << acEndl;
}
}
predictedIridiumFlares.close();
}
void SatellitesDialog::filterListByGroup(int index) void SatellitesDialog::filterListByGroup(int index)
{ {
if (index < 0) if (index < 0)
return; return;
QString groupId = ui->groupFilterCombo->itemData(index).toString(); QString groupId = ui->groupFilterCombo->itemData(index).toString();
if (groupId == "all") if (groupId == "all")
filterModel->setSecondaryFilters(QString(), SatNoFlags); filterModel->setSecondaryFilters(QString(), SatNoFlags);
else if (groupId == "[displayed]") else if (groupId == "[displayed]")
filterModel->setSecondaryFilters(QString(), SatDisplayed); filterModel->setSecondaryFilters(QString(), SatDisplayed);
skipping to change at line 410 skipping to change at line 452
GETSTELMODULE(Satellites)->saveCatalog(); GETSTELMODULE(Satellites)->saveCatalog();
} }
void SatellitesDialog::populateAboutPage() void SatellitesDialog::populateAboutPage()
{ {
QString jsonFileName("<tt>satellites.json</tt>"); QString jsonFileName("<tt>satellites.json</tt>");
QString oldJsonFileName("<tt>satellites.json.old</tt>"); QString oldJsonFileName("<tt>satellites.json.old</tt>");
QString html = "<html><head></head><body>"; QString html = "<html><head></head><body>";
html += "<h2>" + q_("Stellarium Satellites Plugin") + "</h2><table w idth=\"90%\">"; html += "<h2>" + q_("Stellarium Satellites Plugin") + "</h2><table w idth=\"90%\">";
html += "<tr width=\"30%\"><td><strong>" + q_("Version") + "</strong ></td><td>" + SATELLITES_PLUGIN_VERSION + "</td></td>"; html += "<tr width=\"30%\"><td><strong>" + q_("Version") + "</strong ></td><td>" + SATELLITES_PLUGIN_VERSION + "</td></td>";
html += "<tr><td rowspan=4><strong>" + q_("Authors") + "</strong></t html += "<tr><td><strong>" + q_("License") + ":</strong></td><td>" +
d><td>Matthew Gates &lt;matthewg42@gmail.com&gt;</td></td>"; SATELLITES_PLUGIN_LICENSE + "</td></tr>";
html += "<tr><td rowspan=2><strong>" + q_("Authors") + "</strong></t
d><td>Matthew Gates &lt;matthewg42@gmail.com&gt;</td></td>";
html += "<tr><td>Jose Luis Canales &lt;jlcanales.gasco@gmail.com&gt; </td></tr>"; html += "<tr><td>Jose Luis Canales &lt;jlcanales.gasco@gmail.com&gt; </td></tr>";
html += "<tr><td>Bogdan Marinov &lt;bogdan.marinov84@gmail.com&gt;</ html += "<tr><td rowspan=4><strong>" + q_("Contributors") + "</stron
td></tr>"; g></td><td>Bogdan Marinov &lt;bogdan.marinov84@gmail.com&gt;</td></tr>";
html += "<tr><td>Nick Fedoseev &lt;nick.ut2uz@gmail.com&gt; (" + q_( html += "<tr><td>Nick Fedoseev &lt;nick.ut2uz@gmail.com&gt; (" + q_(
"Iridium flares") + ")</td></tr></table>"; "Iridium flares") + ")</td></tr>";
html += "<tr><td>Alexander Wolf &lt;alex.v.wolf@gmail.com&gt;</td></
tr>";
html += "<tr><td>Georg Zotti</td></tr></table>";
html += "<p>" + q_("The Satellites plugin predicts the positions of artificial satellites in Earth orbit.") + "</p>"; html += "<p>" + q_("The Satellites plugin predicts the positions of artificial satellites in Earth orbit.") + "</p>";
html += "<h3>" + q_("Notes for users") + "</h3><p><ul>"; html += "<h3>" + q_("Notes for users") + "</h3><p><ul>";
html += "<li>" + q_("Satellites and their orbits are only shown when the observer is on Earth.") + "</li>"; html += "<li>" + q_("Satellites and their orbits are only shown when the observer is on Earth.") + "</li>";
html += "<li>" + q_("Predicted positions are only good for a fairly short time (on the order of days, weeks or perhaps a month into the past an d future). Expect high weirdness when looking at dates outside this range." ) + "</li>"; html += "<li>" + q_("Predicted positions are only good for a fairly short time (on the order of days, weeks or perhaps a month into the past an d future). Expect high weirdness when looking at dates outside this range." ) + "</li>";
html += "<li>" + q_("Orbital elements go out of date pretty quickly (over mere weeks, sometimes days). To get useful data out, you need to upd ate the TLE data regularly.") + "</li>"; html += "<li>" + q_("Orbital elements go out of date pretty quickly (over mere weeks, sometimes days). To get useful data out, you need to upd ate the TLE data regularly.") + "</li>";
// TRANSLATORS: The translated names of the button and the tab are f illed in automatically. You can check the original names in Stellarium. Fil e names are not translated. // TRANSLATORS: The translated names of the button and the tab are f illed in automatically. You can check the original names in Stellarium. Fil e names are not translated.
QString resetSettingsText = QString(q_("Clicking the \"%1\" button i n the \"%2\" tab of this dialog will revert to the default %3 file. The ol d file will be backed up as %4. This can be found in the user data directo ry, under \"modules/Satellites/\".")) QString resetSettingsText = QString(q_("Clicking the \"%1\" button i n the \"%2\" tab of this dialog will revert to the default %3 file. The ol d file will be backed up as %4. This can be found in the user data directo ry, under \"modules/Satellites/\"."))
.arg(ui->restoreDefaultsButton->text()) .arg(ui->restoreDefaultsButton->text())
skipping to change at line 942 skipping to change at line 987
void SatellitesDialog::enableSatelliteDataForm(bool enabled) void SatellitesDialog::enableSatelliteDataForm(bool enabled)
{ {
// NOTE: I'm still not sure if this is necessary, if the right signa ls are used to trigger changes...--BM // NOTE: I'm still not sure if this is necessary, if the right signa ls are used to trigger changes...--BM
ui->displayedCheckbox->blockSignals(!enabled); ui->displayedCheckbox->blockSignals(!enabled);
ui->orbitCheckbox->blockSignals(!enabled); ui->orbitCheckbox->blockSignals(!enabled);
ui->userCheckBox->blockSignals(!enabled); ui->userCheckBox->blockSignals(!enabled);
} }
void SatellitesDialog::setIridiumFlaresHeaderNames() void SatellitesDialog::setIridiumFlaresHeaderNames()
{ {
QStringList headerStrings; iridiumFlaresHeader.clear();
headerStrings << q_("Time");
headerStrings << q_("Brightness"); iridiumFlaresHeader << q_("Time");
headerStrings << q_("Altitude"); iridiumFlaresHeader << q_("Brightness");
headerStrings << q_("Azimuth"); iridiumFlaresHeader << q_("Altitude");
headerStrings << q_("Satellite"); iridiumFlaresHeader << q_("Azimuth");
iridiumFlaresHeader << q_("Satellite");
ui->iridiumFlaresTreeWidget->setHeaderLabels(headerStrings); ui->iridiumFlaresTreeWidget->setHeaderLabels(iridiumFlaresHeader);
// adjust the column width // adjust the column width
for(int i = 0; i < IridiumFlaresCount; ++i) for(int i = 0; i < IridiumFlaresCount; ++i)
{ {
ui->iridiumFlaresTreeWidget->resizeColumnToContents(i); ui->iridiumFlaresTreeWidget->resizeColumnToContents(i);
} }
// sort-by-date // sort-by-date
ui->iridiumFlaresTreeWidget->sortItems(IridiumFlaresDate, Qt::Ascend ingOrder); ui->iridiumFlaresTreeWidget->sortItems(IridiumFlaresDate, Qt::Ascend ingOrder);
} }
 End of changes. 9 change blocks. 
15 lines changed or deleted 69 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/