SatellitesDialog.cpp   SatellitesDialog.cpp 
skipping to change at line 41 skipping to change at line 41
#include "SatellitesDialog.hpp" #include "SatellitesDialog.hpp"
#include "SatellitesImportDialog.hpp" #include "SatellitesImportDialog.hpp"
#include "SatellitesListModel.hpp" #include "SatellitesListModel.hpp"
#include "SatellitesListFilterModel.hpp" #include "SatellitesListFilterModel.hpp"
#include "Satellites.hpp" #include "Satellites.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelObjectMgr.hpp" #include "StelObjectMgr.hpp"
#include "StelMovementMgr.hpp" #include "StelMovementMgr.hpp"
#include "StelStyle.hpp" #include "StelStyle.hpp"
#include "StelGui.hpp" #include "StelGui.hpp"
#include "StelMainGraphicsView.hpp" #include "StelMainView.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelActionMgr.hpp"
SatellitesDialog::SatellitesDialog() : SatellitesDialog::SatellitesDialog()
updateTimer(0), : satelliteModified(false)
importWindow(0), , updateTimer(0)
filterModel(0), , importWindow(0)
checkStateRole(Qt::UserRole) , filterModel(0)
, checkStateRole(Qt::UserRole)
{ {
ui = new Ui_satellitesDialog; ui = new Ui_satellitesDialog;
} }
SatellitesDialog::~SatellitesDialog() SatellitesDialog::~SatellitesDialog()
{ {
if (updateTimer) if (updateTimer)
{ {
updateTimer->stop(); updateTimer->stop();
delete updateTimer; delete updateTimer;
skipping to change at line 120 skipping to change at line 122
this, SLOT(showUpdateState(Satellites::UpdateState))); this, SLOT(showUpdateState(Satellites::UpdateState)));
connect(plugin, SIGNAL(tleUpdateComplete(int, int, int, int)), connect(plugin, SIGNAL(tleUpdateComplete(int, int, int, int)),
this, SLOT(showUpdateCompleted(int, int, int, int))); this, SLOT(showUpdateCompleted(int, int, int, int)));
updateTimer = new QTimer(this); updateTimer = new QTimer(this);
connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateCountdown() )); connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateCountdown() ));
updateTimer->start(7000); updateTimer->start(7000);
// Settings tab / General settings group // Settings tab / General settings group
// This does call Satellites::setFlagLabels() indirectly. // This does call Satellites::setFlagLabels() indirectly.
QAction* action = dynamic_cast<StelGui*>(StelApp::getInstance().getG ui())->getGuiAction("actionShow_Satellite_Labels"); StelAction* action = StelApp::getInstance().getStelActionManager()-> findAction("actionShow_Satellite_Labels");
connect(ui->labelsGroup, SIGNAL(clicked(bool)), connect(ui->labelsGroup, SIGNAL(clicked(bool)),
action, SLOT(setChecked(bool))); action, SLOT(setChecked(bool)));
connect(ui->fontSizeSpinBox, SIGNAL(valueChanged(int)), connect(ui->fontSizeSpinBox, SIGNAL(valueChanged(int)),
plugin, SLOT(setLabelFontSize(int))); plugin, SLOT(setLabelFontSize(int)));
connect(ui->restoreDefaultsButton, SIGNAL(clicked()), connect(ui->restoreDefaultsButton, SIGNAL(clicked()),
this, SLOT(restoreDefaults())); this, SLOT(restoreDefaults()));
connect(ui->saveSettingsButton, SIGNAL(clicked()), connect(ui->saveSettingsButton, SIGNAL(clicked()),
this, SLOT(saveSettings())); this, SLOT(saveSettings()));
// Settings tab / realistic mode group
connect(ui->realisticGroup, SIGNAL(clicked(bool)),
plugin, SLOT(setFlagRelisticMode(bool)));
// Settings tab / orbit lines group // Settings tab / orbit lines group
connect(ui->orbitLinesGroup, SIGNAL(clicked(bool)), connect(ui->orbitLinesGroup, SIGNAL(clicked(bool)),
plugin, SLOT(setOrbitLinesFlag(bool))); plugin, SLOT(setOrbitLinesFlag(bool)));
connect(ui->orbitSegmentsSpin, SIGNAL(valueChanged(int)), this, SLOT (setOrbitParams())); connect(ui->orbitSegmentsSpin, SIGNAL(valueChanged(int)), this, SLOT (setOrbitParams()));
connect(ui->orbitFadeSpin, SIGNAL(valueChanged(int)), this, SLOT(set OrbitParams())); connect(ui->orbitFadeSpin, SIGNAL(valueChanged(int)), this, SLOT(set OrbitParams()));
connect(ui->orbitDurationSpin, SIGNAL(valueChanged(int)), this, SLOT (setOrbitParams())); connect(ui->orbitDurationSpin, SIGNAL(valueChanged(int)), this, SLOT (setOrbitParams()));
// Settings tab - populate all values // Settings tab - populate all values
updateSettingsPage(); updateSettingsPage();
skipping to change at line 612 skipping to change at line 618
updateCountdown(); updateCountdown();
// Presentation stuff // Presentation stuff
ui->labelsGroup->setChecked(plugin->getFlagLabels()); ui->labelsGroup->setChecked(plugin->getFlagLabels());
ui->fontSizeSpinBox->setValue(plugin->getLabelFontSize()); ui->fontSizeSpinBox->setValue(plugin->getLabelFontSize());
ui->orbitLinesGroup->setChecked(plugin->getOrbitLinesFlag()); ui->orbitLinesGroup->setChecked(plugin->getOrbitLinesFlag());
ui->orbitSegmentsSpin->setValue(Satellite::orbitLineSegments); ui->orbitSegmentsSpin->setValue(Satellite::orbitLineSegments);
ui->orbitFadeSpin->setValue(Satellite::orbitLineFadeSegments); ui->orbitFadeSpin->setValue(Satellite::orbitLineFadeSegments);
ui->orbitDurationSpin->setValue(Satellite::orbitLineSegmentDuration) ; ui->orbitDurationSpin->setValue(Satellite::orbitLineSegmentDuration) ;
ui->realisticGroup->setChecked(plugin->getFlagRealisticMode());
} }
void SatellitesDialog::populateFilterMenu() void SatellitesDialog::populateFilterMenu()
{ {
// Save current selection, if any... // Save current selection, if any...
QString selectedId; QString selectedId;
int index = ui->groupFilterCombo->currentIndex(); int index = ui->groupFilterCombo->currentIndex();
if (ui->groupFilterCombo->count() > 0 && index >= 0) if (ui->groupFilterCombo->count() > 0 && index >= 0)
{ {
selectedId = ui->groupFilterCombo->itemData(index).toString( ); selectedId = ui->groupFilterCombo->itemData(index).toString( );
skipping to change at line 683 skipping to change at line 691
QListWidgetItem* item = new QListWidgetItem(url, ui->sourceL ist); QListWidgetItem* item = new QListWidgetItem(url, ui->sourceL ist);
item->setData(checkStateRole, checked ? Qt::Checked : Qt::Un checked); item->setData(checkStateRole, checked ? Qt::Checked : Qt::Un checked);
} }
ui->sourceList->blockSignals(false); ui->sourceList->blockSignals(false);
if (ui->sourceList->count() > 0) ui->sourceList->setCurrentRow(0); if (ui->sourceList->count() > 0) ui->sourceList->setCurrentRow(0);
} }
void SatellitesDialog::addSpecialGroupItem() void SatellitesDialog::addSpecialGroupItem()
{ {
if (ui->groupsListWidget->count() == 0)
return;
// TRANSLATORS: Displayed in the satellite group selection box. // TRANSLATORS: Displayed in the satellite group selection box.
QListWidgetItem* item = new QListWidgetItem(q_("New group...")); QListWidgetItem* item = new QListWidgetItem(q_("New group..."));
item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsEditable|Qt::ItemIsSelect able); item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsEditable|Qt::ItemIsSelect able);
QFont font = ui->groupsListWidget->item(0)->font(); // Assuming this is also the font used for the list items...
QFont font = ui->groupsListWidget->font();
font.setItalic(true); font.setItalic(true);
item->setFont(font); item->setFont(font);
ui->groupsListWidget->insertItem(0, item); ui->groupsListWidget->insertItem(0, item);
} }
void SatellitesDialog::setGroups() void SatellitesDialog::setGroups()
{ {
QModelIndexList selection = ui->satellitesList->selectionModel()->se lectedIndexes(); QModelIndexList selection = ui->satellitesList->selectionModel()->se lectedIndexes();
if (selection.isEmpty()) if (selection.isEmpty())
return; return;
skipping to change at line 861 skipping to change at line 867
if (!sat->orbitValid) if (!sat->orbitValid)
return; return;
// Turn on Satellite rendering if it is not already on // Turn on Satellite rendering if it is not already on
sat->displayed = true; sat->displayed = true;
// If Satellites are not currently displayed, make them visible. // If Satellites are not currently displayed, make them visible.
if (!SatellitesMgr->getFlagHints()) if (!SatellitesMgr->getFlagHints())
{ {
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance() StelAction* setHintsAction = StelApp::getInstance().getStelA
.getGui()); ctionManager()->findAction("actionShow_Satellite_Hints");
QAction* setHintsAction = gui->getGuiAction("actionShow_Sate
llite_Hints");
Q_ASSERT(setHintsAction); Q_ASSERT(setHintsAction);
setHintsAction->setChecked(true); setHintsAction->setChecked(true);
} }
StelObjectP obj = qSharedPointerDynamicCast<StelObject>(sat); StelObjectP obj = qSharedPointerDynamicCast<StelObject>(sat);
StelObjectMgr& objectMgr = StelApp::getInstance().getStelObjectMgr() ; StelObjectMgr& objectMgr = StelApp::getInstance().getStelObjectMgr() ;
if (objectMgr.setSelectedObject(obj)) if (objectMgr.setSelectedObject(obj))
{ {
GETSTELMODULE(StelMovementMgr)->autoZoomIn(); GETSTELMODULE(StelMovementMgr)->autoZoomIn();
GETSTELMODULE(StelMovementMgr)->setFlagTracking(true); GETSTELMODULE(StelMovementMgr)->setFlagTracking(true);
skipping to change at line 892 skipping to change at line 897
} }
void SatellitesDialog::updateTLEs(void) void SatellitesDialog::updateTLEs(void)
{ {
if(GETSTELMODULE(Satellites)->getUpdatesEnabled()) if(GETSTELMODULE(Satellites)->getUpdatesEnabled())
{ {
GETSTELMODULE(Satellites)->updateFromOnlineSources(); GETSTELMODULE(Satellites)->updateFromOnlineSources();
} }
else else
{ {
QStringList updateFiles = QFileDialog::getOpenFileNames(&Ste lMainGraphicsView::getInstance(), QStringList updateFiles = QFileDialog::getOpenFileNames(&Ste lMainView::getInstance(),
q_(" Select TLE Update File"), q_(" Select TLE Update File"),
Stel FileMgr::getDesktopDir(), Stel FileMgr::getDesktopDir(),
"*.* "); "*.* ");
GETSTELMODULE(Satellites)->updateFromFiles(updateFiles, fals e); GETSTELMODULE(Satellites)->updateFromFiles(updateFiles, fals e);
} }
} }
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
 End of changes. 10 change blocks. 
16 lines changed or deleted 20 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/