void AngleMeasureDialog::createDialogContent() { am = GETSTELMODULE(AngleMeasure); ui->setupUi(dialog); // Kinetic scrolling kineticScrollingList << ui->aboutTextBrowser; StelGui* gui= static_cast<StelGui*>(StelApp::getInstance().getGui()); enableKineticScrolling(gui->getFlagUseKineticScrolling()); connect(gui, SIGNAL(flagUseKineticScrollingChanged(bool)), this, SLOT(enableKineticScrolling(bool))); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint))); ui->useDmsFormatCheckBox->setChecked(am->isDmsFormat()); connect(ui->useDmsFormatCheckBox, SIGNAL(toggled(bool)), am, SLOT(useDmsFormat(bool))); ui->showPositionAngleCheckBox->setChecked(am->isPaDisplayed()); connect(ui->showPositionAngleCheckBox, SIGNAL(toggled(bool)), am, SLOT(showPositionAngle(bool))); ui->showPositionAngleHorizontalCheckBox->setChecked(am->isHorPaDisplayed()); connect(ui->showPositionAngleHorizontalCheckBox, SIGNAL(toggled(bool)), am, SLOT(showPositionAngleHor(bool))); ui->showEquatorial_GroupBox->setChecked(am->isEquatorial()); connect(ui->showEquatorial_GroupBox, SIGNAL(toggled(bool)), am, SLOT(showEquatorial(bool))); ui->showHorizontal_GroupBox->setChecked(am->isHorizontal()); connect(ui->showHorizontal_GroupBox, SIGNAL(toggled(bool)), am, SLOT(showHorizontal(bool))); ui->azAltStartOnSkyCheckBox->setChecked(am->isHorizontalStartSkylinked()); connect(ui->azAltStartOnSkyCheckBox, SIGNAL(toggled(bool)), am, SLOT(showHorizontalStartSkylinked(bool))); ui->azAltEndOnSkyCheckBox->setChecked(am->isHorizontalEndSkylinked()); connect(ui->azAltEndOnSkyCheckBox, SIGNAL(toggled(bool)), am, SLOT(showHorizontalEndSkylinked(bool))); connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(resetAngleMeasureSettings())); setAboutHtml(); }
// Initialize the dialog widgets and connect the signals/slots void SupernovaeDialog::createDialogContent() { ui->setupUi(dialog); ui->tabs->setCurrentIndex(0); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); // Settings tab / updates group connect(ui->internetUpdatesCheckbox, SIGNAL(stateChanged(int)), this, SLOT(setUpdatesEnabled(int))); connect(ui->updateButton, SIGNAL(clicked()), this, SLOT(updateJSON())); connect(GETSTELMODULE(Supernovae), SIGNAL(updateStateChanged(Supernovae::UpdateState)), this, SLOT(updateStateReceiver(Supernovae::UpdateState))); connect(GETSTELMODULE(Supernovae), SIGNAL(jsonUpdateComplete(void)), this, SLOT(updateCompleteReceiver(void))); connect(ui->updateFrequencySpinBox, SIGNAL(valueChanged(int)), this, SLOT(setUpdateValues(int))); refreshUpdateValues(); // fetch values for last updated and so on // if the state didn't change, setUpdatesEnabled will not be called, so we force it setUpdatesEnabled(ui->internetUpdatesCheckbox->checkState()); updateTimer = new QTimer(this); connect(updateTimer, SIGNAL(timeout()), this, SLOT(refreshUpdateValues())); updateTimer->start(7000); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults())); connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings())); // About tab setAboutHtml(); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); Q_ASSERT(gui); ui->aboutTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet)); updateGuiFromSettings(); }
// Initialize the dialog widgets and connect the signals/slots void ObservabilityDialog::createDialogContent() { ui->setupUi(dialog); ui->tabs->setCurrentIndex(0); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); // Settings: connect(ui->Today, SIGNAL(stateChanged(int)), this, SLOT(setTodayFlag(int))); connect(ui->AcroCos, SIGNAL(stateChanged(int)), this, SLOT(setAcroCosFlag(int))); connect(ui->Opposition, SIGNAL(stateChanged(int)), this, SLOT(setOppositionFlag(int))); connect(ui->Goods, SIGNAL(stateChanged(int)), this, SLOT(setGoodDatesFlag(int))); connect(ui->FullMoon, SIGNAL(stateChanged(int)), this, SLOT(setFullMoonFlag(int))); // connect(ui->Crescent, SIGNAL(stateChanged(int)), this, SLOT(setCrescentMoonFlag(int))); // connect(ui->SuperMoon, SIGNAL(stateChanged(int)), this, SLOT(setSuperMoonFlag(int))); connect(ui->Red, SIGNAL(sliderMoved(int)), this, SLOT(setRed(int))); connect(ui->Green, SIGNAL(sliderMoved(int)), this, SLOT(setGreen(int))); connect(ui->Blue, SIGNAL(sliderMoved(int)), this, SLOT(setBlue(int))); connect(ui->fontSize, SIGNAL(sliderMoved(int)), this, SLOT(setSize(int))); connect(ui->SunAltitude, SIGNAL(sliderMoved(int)), this, SLOT(setAltitude(int))); connect(ui->HorizAltitude, SIGNAL(sliderMoved(int)), this, SLOT(setHorizon(int))); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults())); connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings())); // About tab setAboutHtml(); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); Q_ASSERT(gui); ui->aboutTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet)); updateGuiFromSettings(); }
void ArchaeoLinesDialog::retranslate() { if (dialog) { ui->retranslateUi(dialog); setAboutHtml(); } }
void RemoteControlDialog::retranslate() { if (dialog) { ui->retranslateUi(dialog); setAboutHtml(); } }
void AngleMeasureDialog::retranslate() { if (dialog) { ui->retranslateUi(dialog); setAboutHtml(); } }
void ObservabilityDialog::retranslate() { if (dialog) { ui->retranslateUi(dialog); setAboutHtml(); } }
void QuasarsDialog::retranslate() { if (dialog) { ui->retranslateUi(dialog); refreshUpdateValues(); setAboutHtml(); } }
void SupernovaeDialog::retranslate() { if (dialog) { ui->retranslateUi(dialog); refreshUpdateValues(); setAboutHtml(); } }
void ObservabilityDialog::retranslate() { if (dialog) { ui->retranslateUi(dialog); setAboutHtml(); updateControls(); // Also re-translate the dynamic slider labels } }
void ExoplanetsDialog::retranslate() { if (dialog) { ui->retranslateUi(dialog); refreshUpdateValues(); setAboutHtml(); setInfoHtml(); setWebsitesHtml(); } }
void RemoteControlDialog::createDialogContent() { rc = GETSTELMODULE(RemoteControl); ui->setupUi(dialog); // Kinetic scrolling kineticScrollingList << ui->aboutTextBrowser; StelGui* gui= dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); if (gui) { enableKineticScrolling(gui->getFlagUseKineticScrolling()); connect(gui, SIGNAL(flagUseKineticScrollingChanged(bool)), this, SLOT(enableKineticScrolling(bool))); } connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint))); // TODO Fill other buttons connectCheckBox(ui->enabledCheckbox,"actionShow_Remote_Control"); connect(ui->enabledCheckbox, SIGNAL(clicked(bool)), this, SLOT(updateIPlabel(bool))); updateIPlabel(ui->enabledCheckbox->isChecked()); ui->activateOnStartCheckBox->setChecked(rc->getFlagAutoStart()); connect(ui->activateOnStartCheckBox, SIGNAL(toggled(bool)), rc, SLOT(setFlagAutoStart(bool))); connect(rc, SIGNAL(flagAutoStartChanged(bool)), ui->activateOnStartCheckBox, SLOT(setChecked(bool))); ui->passwordCheckBox->setChecked(rc->getFlagUsePassword()); connect(ui->passwordCheckBox, SIGNAL(toggled(bool)), rc, SLOT(setFlagUsePassword(bool))); connect(rc, SIGNAL(flagUsePasswordChanged(bool)), ui->passwordCheckBox, SLOT(setChecked(bool))); ui->passwordEdit->setEnabled(rc->getFlagUsePassword()); ui->passwordEdit->setText(rc->getPassword()); connect(rc,SIGNAL(flagUsePasswordChanged(bool)),ui->passwordEdit,SLOT(setEnabled(bool))); connect(ui->passwordEdit, SIGNAL(textChanged(QString)), rc, SLOT(setPassword(QString))); ui->portNumberSpinBox->setValue(rc->getPort()); connect(ui->portNumberSpinBox, SIGNAL(valueChanged(int)), rc, SLOT(setPort(int))); ui->restartPanel->setVisible(false); connect(rc, SIGNAL(flagUsePasswordChanged(bool)), this, SLOT(requiresRestart())); connect(rc, SIGNAL(passwordChanged(QString)), this, SLOT(requiresRestart())); connect(rc, SIGNAL(portChanged(int)), this, SLOT(requiresRestart())); connect(ui->resetButton, SIGNAL(clicked(bool)),this,SLOT(restart())); connect(ui->saveSettingsButton, SIGNAL(clicked()), rc, SLOT(saveSettings())); connect(ui->restoreDefaultsButton, SIGNAL(clicked()), rc, SLOT(restoreDefaultSettings())); setAboutHtml(); }
// Initialize the dialog widgets and connect the signals/slots void ExoplanetsDialog::createDialogContent() { ep = GETSTELMODULE(Exoplanets); ui->setupUi(dialog); ui->tabs->setCurrentIndex(0); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); // Settings tab / updates group ui->displayAtStartupCheckBox->setChecked(ep->getEnableAtStartup()); connect(ui->displayAtStartupCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setDisplayAtStartupEnabled(int))); ui->displayModeCheckBox->setChecked(ep->getDisplayMode()); connect(ui->displayModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setDistributionEnabled(int))); ui->displayShowExoplanetsButton->setChecked(ep->getFlagShowExoplanetsButton()); connect(ui->displayShowExoplanetsButton, SIGNAL(stateChanged(int)), this, SLOT(setDisplayShowExoplanetsButton(int))); ui->timelineModeCheckBox->setChecked(ep->getTimelineMode()); connect(ui->timelineModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setTimelineEnabled(int))); ui->habitableModeCheckBox->setChecked(ep->getHabitableMode()); connect(ui->habitableModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setHabitableEnabled(int))); connect(ui->internetUpdatesCheckbox, SIGNAL(stateChanged(int)), this, SLOT(setUpdatesEnabled(int))); connect(ui->updateButton, SIGNAL(clicked()), this, SLOT(updateJSON())); connect(ep, SIGNAL(updateStateChanged(Exoplanets::UpdateState)), this, SLOT(updateStateReceiver(Exoplanets::UpdateState))); connect(ep, SIGNAL(jsonUpdateComplete(void)), this, SLOT(updateCompleteReceiver(void))); connect(ui->updateFrequencySpinBox, SIGNAL(valueChanged(int)), this, SLOT(setUpdateValues(int))); refreshUpdateValues(); // fetch values for last updated and so on // if the state didn't change, setUpdatesEnabled will not be called, so we force it setUpdatesEnabled(ui->internetUpdatesCheckbox->checkState()); updateTimer = new QTimer(this); connect(updateTimer, SIGNAL(timeout()), this, SLOT(refreshUpdateValues())); updateTimer->start(7000); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults())); connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings())); // About & Info tabs setAboutHtml(); setInfoHtml(); setWebsitesHtml(); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); if(gui!=NULL) { ui->aboutTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet)); ui->infoTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet)); ui->websitesTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet)); } updateGuiFromSettings(); }
void ExoplanetsDialog::retranslate() { if (dialog) { ui->retranslateUi(dialog); refreshUpdateValues(); setAboutHtml(); setInfoHtml(); setWebsitesHtml(); populateDiagramsList(); populateTemperatureScales(); } }
void SatellitesDialog::retranslate() { if (dialog) { ui->retranslateUi(dialog); refreshUpdateValues(); setAboutHtml(); // This may be a problem if we add group name translations, as the // sorting order may be different. --BM int index = ui->groupsCombo->currentIndex(); populateGroupsList(); ui->groupsCombo->setCurrentIndex(index); } }
// Initialize the dialog widgets and connect the signals/slots void NovaeDialog::createDialogContent() { nova = GETSTELMODULE(Novae); ui->setupUi(dialog); ui->tabs->setCurrentIndex(0); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); #ifdef Q_OS_WIN //Kinetic scrolling for tablet pc and pc QList<QWidget *> addscroll; addscroll << ui->aboutTextBrowser; installKineticScrolling(addscroll); #endif // Settings tab / updates group connect(ui->internetUpdatesCheckbox, SIGNAL(stateChanged(int)), this, SLOT(setUpdatesEnabled(int))); connect(ui->updateButton, SIGNAL(clicked()), this, SLOT(updateJSON())); connect(nova, SIGNAL(updateStateChanged(Novae::UpdateState)), this, SLOT(updateStateReceiver(Novae::UpdateState))); connect(nova, SIGNAL(jsonUpdateComplete(void)), this, SLOT(updateCompleteReceiver(void))); connect(ui->updateFrequencySpinBox, SIGNAL(valueChanged(int)), this, SLOT(setUpdateValues(int))); refreshUpdateValues(); // fetch values for last updated and so on // if the state didn't change, setUpdatesEnabled will not be called, so we force it setUpdatesEnabled(ui->internetUpdatesCheckbox->checkState()); updateTimer = new QTimer(this); connect(updateTimer, SIGNAL(timeout()), this, SLOT(refreshUpdateValues())); updateTimer->start(7000); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint))); connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults())); connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings())); // About tab setAboutHtml(); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); if(gui!=NULL) ui->aboutTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet)); updateGuiFromSettings(); }
void MeteorShowerDialog::retranslate() { if (dialog) { ui->retranslateUi(dialog); refreshUpdateValues(); setAboutHtml(); setHeaderNames(); //Retranslate name and datatype strings QTreeWidgetItemIterator it(treeWidget); while (*it) { //Name (*it)->setText(ColumnName, q_((*it)->text(ColumnName))); //Data type (*it)->setText(ColumnDataType, q_((*it)->text(ColumnDataType))); ++it; } } }
// Initialize the dialog widgets and connect the signals/slots void MeteorShowerDialog::createDialogContent() { ui->setupUi(dialog); ui->tabs->setCurrentIndex(0); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); plugin = GETSTELMODULE(MeteorShowers); // Settings tab / updates group connect(ui->internetUpdates, SIGNAL(clicked(bool)), this, SLOT(setUpdatesEnabled(bool))); connect(ui->updateButton, SIGNAL(clicked()), this, SLOT(updateJSON())); connect(plugin, SIGNAL(updateStateChanged(MeteorShowers::UpdateState)), this, SLOT(updateStateReceiver(MeteorShowers::UpdateState))); connect(plugin, SIGNAL(jsonUpdateComplete(void)), this, SLOT(updateCompleteReceiver(void))); connect(ui->updateFrequencySpinBox, SIGNAL(valueChanged(int)), this, SLOT(setUpdateValues(int))); refreshUpdateValues(); // fetch values for last updated and so on updateTimer = new QTimer(this); connect(updateTimer, SIGNAL(timeout()), this, SLOT(refreshUpdateValues())); updateTimer->start(7000); // Settings tab / event group connect(ui->searchButton, SIGNAL(clicked()), this, SLOT(checkDates())); refreshRangeDates(); treeWidget = ui->listEvents; initListEvents(); connect(treeWidget, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(selectEvent(QModelIndex))); // Settings tab / radiant group ui->displayRadiant->setChecked(plugin->getFlagRadiant()); connect(ui->displayRadiant, SIGNAL(clicked(bool)), plugin, SLOT(setFlagRadiant(bool))); ui->activeRadiantsOnly->setChecked(plugin->getFlagActiveRadiant()); connect(ui->activeRadiantsOnly, SIGNAL(clicked(bool)), plugin, SLOT(setFlagActiveRadiant(bool))); ui->radiantLabels->setChecked(plugin->getFlagLabels()); connect(ui->radiantLabels, SIGNAL(clicked(bool)), plugin, SLOT(setFlagLabels(bool))); ui->fontSizeSpinBox->setValue(plugin->getLabelFontSize()); connect(ui->fontSizeSpinBox, SIGNAL(valueChanged(int)), plugin, SLOT(setLabelFontSize(int))); // Settings tab / meteor showers group ui->displayMeteorShower->setChecked(plugin->getEnableAtStartup()); connect(ui->displayMeteorShower, SIGNAL(clicked(bool)), plugin, SLOT(setEnableAtStartup(bool))); ui->displayShowMeteorShowerButton->setChecked(plugin->getFlagShowMSButton()); connect(ui->displayShowMeteorShowerButton, SIGNAL(clicked(bool)), plugin, SLOT(setFlagShowMSButton(bool))); // ///////////////////////////////////////// connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults())); connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings())); // Markers tab refreshColorMarkers(); connect(ui->changeColorARG, SIGNAL(clicked()), this, SLOT(setColorARG())); connect(ui->changeColorARR, SIGNAL(clicked()), this, SLOT(setColorARR())); connect(ui->changeColorIR, SIGNAL(clicked()), this, SLOT(setColorIR())); // About tab setAboutHtml(); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); if (gui != NULL) { ui->aboutTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet)); } updateGuiFromSettings(); }
// Initialize the dialog widgets and connect the signals/slots void ObservabilityDialog::createDialogContent() { ui->setupUi(dialog); ui->tabs->setCurrentIndex(0); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); Observability* plugin = GETSTELMODULE(Observability); #ifdef Q_OS_WIN //Kinetic scrolling for tablet pc and pc QList<QWidget *> addscroll; addscroll << ui->aboutTextBrowser; installKineticScrolling(addscroll); #endif // Settings: // clicked() is called only when the user makes an input, // so we avoid an endless loop when setting the value in updateControls(). connect(ui->todayCheckBox, SIGNAL(clicked(bool)), plugin, SLOT(enableTodayField(bool))); connect(ui->acroCosCheckBox, SIGNAL(clicked(bool)), plugin, SLOT(enableAcroCosField(bool))); connect(ui->oppositionCheckBox, SIGNAL(clicked(bool)), plugin, SLOT(enableOppositionField(bool))); connect(ui->goodNightsCheckBox, SIGNAL(clicked(bool)), plugin, SLOT(enableGoodNightsField(bool))); connect(ui->fullMoonCheckBox, SIGNAL(clicked(bool)), plugin, SLOT(enableFullMoonField(bool))); connect(ui->redSlider, SIGNAL(sliderMoved(int)), this, SLOT(setColor())); connect(ui->greenSlider, SIGNAL(sliderMoved(int)), this, SLOT(setColor())); connect(ui->blueSlider, SIGNAL(sliderMoved(int)), this, SLOT(setColor())); // Isn't valueChanged() better? But then we'll have to block // signlas when settting the slider values. connect(ui->fontSize, SIGNAL(sliderMoved(int)), plugin, SLOT(setFontSize(int))); connect(ui->sunAltitudeSlider, SIGNAL(sliderMoved(int)), plugin, SLOT(setTwilightAltitude(int))); connect(ui->sunAltitudeSlider, SIGNAL(sliderMoved(int)), this, SLOT(updateAltitudeLabel(int))); connect(ui->horizonAltitudeSlider, SIGNAL(sliderMoved(int)), plugin, SLOT(setHorizonAltitude(int))); connect(ui->horizonAltitudeSlider, SIGNAL(sliderMoved(int)), this, SLOT(updateHorizonLabel(int))); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint))); connect(ui->restoreDefaultsButton, SIGNAL(clicked()), plugin, SLOT(resetConfiguration())); // TODO: The plug-in should emit a signal when settings are changed. // This works, because slots are called in the order they were connected. connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(updateControls())); connect(ui->saveSettingsButton, SIGNAL(clicked()), plugin, SLOT(saveConfiguration())); // About tab setAboutHtml(); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); if(gui!=NULL) ui->aboutTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet)); updateControls(); }
// Initialize the dialog widgets and connect the signals/slots void ExoplanetsDialog::createDialogContent() { ep = GETSTELMODULE(Exoplanets); ui->setupUi(dialog); ui->tabs->setCurrentIndex(0); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); // Kinetic scrolling kineticScrollingList << ui->aboutTextBrowser << ui->infoTextBrowser << ui->websitesTextBrowser; StelGui* gui= dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); if (gui) { enableKineticScrolling(gui->getFlagUseKineticScrolling()); connect(gui, SIGNAL(flagUseKineticScrollingChanged(bool)), this, SLOT(enableKineticScrolling(bool))); } // Settings tab / updates group ui->displayAtStartupCheckBox->setChecked(ep->getEnableAtStartup()); connect(ui->displayAtStartupCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setDisplayAtStartupEnabled(int))); ui->displayModeCheckBox->setChecked(ep->getDisplayMode()); connect(ui->displayModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setDistributionEnabled(int))); ui->displayShowExoplanetsButton->setChecked(ep->getFlagShowExoplanetsButton()); connect(ui->displayShowExoplanetsButton, SIGNAL(stateChanged(int)), this, SLOT(setDisplayShowExoplanetsButton(int))); ui->timelineModeCheckBox->setChecked(ep->getTimelineMode()); connect(ui->timelineModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setTimelineEnabled(int))); ui->habitableModeCheckBox->setChecked(ep->getHabitableMode()); connect(ui->habitableModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setHabitableEnabled(int))); ui->displayShowDesignationsCheckBox->setChecked(ep->getFlagShowExoplanetsDesignations()); connect(ui->displayShowDesignationsCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setDisplayShowExoplanetsDesignations(int))); connect(ui->internetUpdatesCheckbox, SIGNAL(stateChanged(int)), this, SLOT(setUpdatesEnabled(int))); connect(ui->updateButton, SIGNAL(clicked()), this, SLOT(updateJSON())); connect(ep, SIGNAL(updateStateChanged(Exoplanets::UpdateState)), this, SLOT(updateStateReceiver(Exoplanets::UpdateState))); connect(ep, SIGNAL(jsonUpdateComplete(void)), this, SLOT(updateCompleteReceiver(void))); connect(ui->updateFrequencySpinBox, SIGNAL(valueChanged(int)), this, SLOT(setUpdateValues(int))); refreshUpdateValues(); // fetch values for last updated and so on // if the state didn't change, setUpdatesEnabled will not be called, so we force it setUpdatesEnabled(ui->internetUpdatesCheckbox->checkState()); connectColorButton(ui->exoplanetMarkerColor, "Exoplanets.markerColor", "Exoplanets/exoplanet_marker_color"); connectColorButton(ui->habitableExoplanetMarkerColor, "Exoplanets.habitableColor", "Exoplanets/habitable_exoplanet_marker_color"); updateTimer = new QTimer(this); connect(updateTimer, SIGNAL(timeout()), this, SLOT(refreshUpdateValues())); updateTimer->start(7000); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint))); connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults())); connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings())); connect(ui->plotDiagram, SIGNAL(clicked()), this, SLOT(drawDiagram())); populateTemperatureScales(); int idx = ui->temperatureScaleComboBox->findData(ep->getCurrentTemperatureScaleKey(), Qt::UserRole, Qt::MatchCaseSensitive); if (idx==-1) { // Use Celsius as default idx = ui->temperatureScaleComboBox->findData(QVariant("Celsius"), Qt::UserRole, Qt::MatchCaseSensitive); } ui->temperatureScaleComboBox->setCurrentIndex(idx); connect(ui->temperatureScaleComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setTemperatureScale(int))); // About & Info tabs setAboutHtml(); setInfoHtml(); setWebsitesHtml(); if(gui!=Q_NULLPTR) { ui->aboutTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet)); ui->infoTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet)); ui->websitesTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet)); } populateDiagramsList(); updateGuiFromSettings(); }
void ArchaeoLinesDialog::createDialogContent() { al = GETSTELMODULE(ArchaeoLines); ui->setupUi(dialog); #ifdef Q_OS_WIN //Kinetic scrolling for tablet pc and pc QList<QWidget *> addscroll; addscroll << ui->aboutTextBrowser; installKineticScrolling(addscroll); #endif connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint))); //ui->useDmsFormatCheckBox->setChecked(al->isDmsFormat()); //connect(ui->useDmsFormatCheckBox, SIGNAL(toggled(bool)), al, SLOT(useDmsFormat(bool))); ui->equinoxCheckBox->setChecked(al->isEquinoxDisplayed()); connect(ui->equinoxCheckBox, SIGNAL(toggled(bool)), al, SLOT(showEquinox(bool))); ui->solsticesCheckBox->setChecked(al->isSolsticesDisplayed()); connect(ui->solsticesCheckBox, SIGNAL(toggled(bool)), al, SLOT(showSolstices(bool))); ui->crossquarterCheckBox->setChecked(al->isCrossquartersDisplayed()); connect(ui->crossquarterCheckBox, SIGNAL(toggled(bool)), al, SLOT(showCrossquarters(bool))); ui->majorStandstillCheckBox->setChecked(al->isMajorStandstillsDisplayed()); connect(ui->majorStandstillCheckBox, SIGNAL(toggled(bool)), al, SLOT(showMajorStandstills(bool))); ui->minorStandstillCheckBox->setChecked(al->isMinorStandstillsDisplayed()); connect(ui->minorStandstillCheckBox, SIGNAL(toggled(bool)), al, SLOT(showMinorStandstills(bool))); ui->zenithPassageCheckBox->setChecked(al->isZenithPassageDisplayed()); connect(ui->zenithPassageCheckBox, SIGNAL(toggled(bool)), al, SLOT(showZenithPassage(bool))); ui->nadirPassageCheckBox->setChecked(al->isNadirPassageDisplayed()); connect(ui->nadirPassageCheckBox, SIGNAL(toggled(bool)), al, SLOT(showNadirPassage(bool))); ui->selectedObjectCheckBox->setChecked(al->isSelectedObjectDisplayed()); connect(ui->selectedObjectCheckBox, SIGNAL(toggled(bool)), al, SLOT(showSelectedObject(bool))); ui->currentSunCheckBox->setChecked(al->isCurrentSunDisplayed()); connect(ui->currentSunCheckBox, SIGNAL(toggled(bool)), al, SLOT(showCurrentSun(bool))); ui->currentMoonCheckBox->setChecked(al->isCurrentMoonDisplayed()); connect(ui->currentMoonCheckBox, SIGNAL(toggled(bool)), al, SLOT(showCurrentMoon(bool))); // Planet ComboBox requires special handling! setCurrentPlanetFromApp(); connect(al, SIGNAL(currentPlanetChanged(ArchaeoLine::Line)), this, SLOT(setCurrentPlanetFromApp())); connect(ui->currentPlanetComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setCurrentPlanetFromGUI(int))); ui->customAzimuth1CheckBox->setChecked(al->isCustomAzimuth1Displayed()); connect(ui->customAzimuth1CheckBox, SIGNAL(toggled(bool)), al, SLOT(showCustomAzimuth1(bool))); ui->customAzimuth2CheckBox->setChecked(al->isCustomAzimuth2Displayed()); connect(ui->customAzimuth2CheckBox, SIGNAL(toggled(bool)), al, SLOT(showCustomAzimuth2(bool))); ui->customAzimuth1DoubleSpinBox->setValue(al->getLineAngle(ArchaeoLine::CustomAzimuth1)); ui->customAzimuth2DoubleSpinBox->setValue(al->getLineAngle(ArchaeoLine::CustomAzimuth2)); connect(ui->customAzimuth1DoubleSpinBox, SIGNAL(valueChanged(double)), al, SLOT(setCustomAzimuth1(double))); connect(ui->customAzimuth2DoubleSpinBox, SIGNAL(valueChanged(double)), al, SLOT(setCustomAzimuth2(double))); ui->customAzimuth1LineEdit->setText(al->getLineLabel(ArchaeoLine::CustomAzimuth1)); ui->customAzimuth2LineEdit->setText(al->getLineLabel(ArchaeoLine::CustomAzimuth2)); connect(ui->customAzimuth1LineEdit, SIGNAL(textChanged(QString)), al, SLOT(setCustomAzimuth1Label(QString))); connect(ui->customAzimuth2LineEdit, SIGNAL(textChanged(QString)), al, SLOT(setCustomAzimuth2Label(QString))); equinoxColor = al->getLineColor(ArchaeoLine::Equinox); solsticeColor = al->getLineColor(ArchaeoLine::Solstices); crossquarterColor = al->getLineColor(ArchaeoLine::Crossquarters); majorStandstillColor = al->getLineColor(ArchaeoLine::MajorStandstill); minorStandstillColor = al->getLineColor(ArchaeoLine::MinorStandstill); zenithPassageColor = al->getLineColor(ArchaeoLine::ZenithPassage); nadirPassageColor = al->getLineColor(ArchaeoLine::NadirPassage); selectedObjectColor = al->getLineColor(ArchaeoLine::SelectedObject); currentSunColor = al->getLineColor(ArchaeoLine::CurrentSun); currentMoonColor = al->getLineColor(ArchaeoLine::CurrentMoon); currentPlanetColor = al->getLineColor(ArchaeoLine::CurrentPlanetNone); customAzimuth1Color = al->getLineColor(ArchaeoLine::CustomAzimuth1); customAzimuth2Color = al->getLineColor(ArchaeoLine::CustomAzimuth2); equinoxColorPixmap=QPixmap(48, 12); equinoxColorPixmap.fill(equinoxColor); ui->equinoxColorToolButton->setIconSize(QSize(48, 12)); ui->equinoxColorToolButton->setIcon(QIcon(equinoxColorPixmap)); solsticeColorPixmap=QPixmap(48, 12); solsticeColorPixmap.fill(solsticeColor); ui->solsticesColorToolButton->setIconSize(QSize(48, 12)); ui->solsticesColorToolButton->setIcon(QIcon(solsticeColorPixmap)); crossquarterColorPixmap=QPixmap(48, 12); crossquarterColorPixmap.fill(crossquarterColor); ui->crossquarterColorToolButton->setIconSize(QSize(48, 12)); ui->crossquarterColorToolButton->setIcon(QIcon(crossquarterColorPixmap)); minorStandstillColorPixmap=QPixmap(48, 12); minorStandstillColorPixmap.fill(minorStandstillColor); ui->minorStandstillColorToolButton->setIconSize(QSize(48, 12)); ui->minorStandstillColorToolButton->setIcon(QIcon(minorStandstillColorPixmap)); majorStandstillColorPixmap=QPixmap(48, 12); majorStandstillColorPixmap.fill(majorStandstillColor); ui->majorStandstillColorToolButton->setIconSize(QSize(48, 12)); ui->majorStandstillColorToolButton->setIcon(QIcon(majorStandstillColorPixmap)); zenithPassageColorPixmap=QPixmap(48, 12); zenithPassageColorPixmap.fill(zenithPassageColor); ui->zenithPassageColorToolButton->setIconSize(QSize(48, 12)); ui->zenithPassageColorToolButton->setIcon(QIcon(zenithPassageColorPixmap)); nadirPassageColorPixmap=QPixmap(48, 12); nadirPassageColorPixmap.fill(nadirPassageColor); ui->nadirPassageColorToolButton->setIconSize(QSize(48, 12)); ui->nadirPassageColorToolButton->setIcon(QIcon(nadirPassageColorPixmap)); selectedObjectColorPixmap=QPixmap(48, 12); selectedObjectColorPixmap.fill(selectedObjectColor); ui->selectedObjectColorToolButton->setIconSize(QSize(48, 12)); ui->selectedObjectColorToolButton->setIcon(QIcon(selectedObjectColorPixmap)); currentSunColorPixmap=QPixmap(48, 12); currentSunColorPixmap.fill(currentSunColor); ui->currentSunColorToolButton->setIconSize(QSize(48, 12)); ui->currentSunColorToolButton->setIcon(QIcon(currentSunColorPixmap)); currentMoonColorPixmap=QPixmap(48, 12); currentMoonColorPixmap.fill(currentMoonColor); ui->currentMoonColorToolButton->setIconSize(QSize(48, 12)); ui->currentMoonColorToolButton->setIcon(QIcon(currentMoonColorPixmap)); currentPlanetColorPixmap=QPixmap(48, 12); currentPlanetColorPixmap.fill(currentPlanetColor); ui->currentPlanetColorToolButton->setIconSize(QSize(48, 12)); ui->currentPlanetColorToolButton->setIcon(QIcon(currentPlanetColorPixmap)); customAzimuth1ColorPixmap=QPixmap(48, 12); customAzimuth1ColorPixmap.fill(customAzimuth1Color); ui->customAzimuth1ColorToolButton->setIconSize(QSize(48, 12)); ui->customAzimuth1ColorToolButton->setIcon(QIcon(customAzimuth1ColorPixmap)); customAzimuth2ColorPixmap=QPixmap(48, 12); customAzimuth2ColorPixmap.fill(customAzimuth2Color); ui->customAzimuth2ColorToolButton->setIconSize(QSize(48, 12)); ui->customAzimuth2ColorToolButton->setIcon(QIcon(customAzimuth2ColorPixmap)); connect(ui->equinoxColorToolButton, SIGNAL(released()), this, SLOT(askEquinoxColor())); connect(ui->solsticesColorToolButton, SIGNAL(released()), this, SLOT(askSolsticeColor())); connect(ui->crossquarterColorToolButton, SIGNAL(released()), this, SLOT(askCrossquarterColor())); connect(ui->majorStandstillColorToolButton, SIGNAL(released()), this, SLOT(askMajorStandstillColor())); connect(ui->minorStandstillColorToolButton, SIGNAL(released()), this, SLOT(askMinorStandstillColor())); connect(ui->zenithPassageColorToolButton, SIGNAL(released()), this, SLOT(askZenithPassageColor())); connect(ui->nadirPassageColorToolButton, SIGNAL(released()), this, SLOT(askNadirPassageColor())); connect(ui->selectedObjectColorToolButton, SIGNAL(released()), this, SLOT(askSelectedObjectColor())); connect(ui->currentSunColorToolButton, SIGNAL(released()), this, SLOT(askCurrentSunColor())); connect(ui->currentMoonColorToolButton, SIGNAL(released()), this, SLOT(askCurrentMoonColor())); connect(ui->currentPlanetColorToolButton, SIGNAL(released()), this, SLOT(askCurrentPlanetColor())); connect(ui->customAzimuth1ColorToolButton, SIGNAL(released()), this, SLOT(askCustomAzimuth1Color())); connect(ui->customAzimuth2ColorToolButton, SIGNAL(released()), this, SLOT(askCustomAzimuth2Color())); connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(resetArchaeoLinesSettings())); // We must apparently warn about a potential problem, but only on Windows. (QTBUG-35302) #ifndef Q_OS_WIN ui->switchToWindowedModeLabel->hide(); #endif setAboutHtml(); }
// Initialize the dialog widgets and connect the signals/slots void SatellitesDialog::createDialogContent() { ui->setupUi(dialog); ui->tabs->setCurrentIndex(0); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); // Settings tab / updates group connect(ui->internetUpdatesCheckbox, SIGNAL(stateChanged(int)), this, SLOT(setUpdatesEnabled(int))); connect(ui->updateButton, SIGNAL(clicked()), this, SLOT(updateTLEs())); connect(GETSTELMODULE(Satellites), SIGNAL(updateStateChanged(Satellites::UpdateState)), this, SLOT(updateStateReceiver(Satellites::UpdateState))); connect(GETSTELMODULE(Satellites), SIGNAL(tleUpdateComplete(int, int, int)), this, SLOT(updateCompleteReceiver(int, int, int))); connect(ui->updateFrequencySpinBox, SIGNAL(valueChanged(int)), this, SLOT(setUpdateValues(int))); refreshUpdateValues(); // fetch values for last updated and so on // if the state didn't change, setUpdatesEnabled will not be called, so we force it setUpdatesEnabled(ui->internetUpdatesCheckbox->checkState()); updateTimer = new QTimer(this); connect(updateTimer, SIGNAL(timeout()), this, SLOT(refreshUpdateValues())); updateTimer->start(7000); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); // Settings tab / General settings group connect(ui->labelsGroup, SIGNAL(toggled(bool)), dynamic_cast<StelGui*>(StelApp::getInstance().getGui())->getGuiAction("actionShow_Satellite_Labels"), SLOT(setChecked(bool))); connect(ui->fontSizeSpinBox, SIGNAL(valueChanged(int)), GETSTELMODULE(Satellites), SLOT(setLabelFontSize(int))); connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults())); connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings())); // Settings tab / orbit lines group ui->orbitLinesGroup->setChecked(GETSTELMODULE(Satellites)->getOrbitLinesFlag()); ui->orbitSegmentsSpin->setValue(Satellite::orbitLineSegments); ui->orbitFadeSpin->setValue(Satellite::orbitLineFadeSegments); ui->orbitDurationSpin->setValue(Satellite::orbitLineSegmentDuration); connect(ui->orbitLinesGroup, SIGNAL(toggled(bool)), GETSTELMODULE(Satellites), SLOT(setOrbitLinesFlag(bool))); connect(ui->orbitSegmentsSpin, SIGNAL(valueChanged(int)), this, SLOT(setOrbitParams())); connect(ui->orbitFadeSpin, SIGNAL(valueChanged(int)), this, SLOT(setOrbitParams())); connect(ui->orbitDurationSpin, SIGNAL(valueChanged(int)), this, SLOT(setOrbitParams())); // Satellites tab filterProxyModel = new QSortFilterProxyModel(this); filterProxyModel->setSourceModel(satellitesModel); filterProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); ui->satellitesList->setModel(filterProxyModel); connect(ui->lineEditSearch, SIGNAL(textEdited(QString)), filterProxyModel, SLOT(setFilterWildcard(QString))); QItemSelectionModel* selectionModel = ui->satellitesList->selectionModel(); connect(selectionModel, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(updateSelectedInfo(QModelIndex,QModelIndex))); connect(ui->satellitesList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(handleDoubleClick(QModelIndex))); connect(ui->groupsCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(listSatelliteGroup(int))); connect(ui->saveSatellitesButton, SIGNAL(clicked()), this, SLOT(saveSatellites())); connect(ui->removeSatellitesButton, SIGNAL(clicked()), this, SLOT(removeSatellites())); connectSatelliteGuiForm(); importWindow = new SatellitesImportDialog(); connect(ui->addSatellitesButton, SIGNAL(clicked()), importWindow, SLOT(setVisible())); connect(importWindow, SIGNAL(satellitesAccepted(TleDataList)), this, SLOT(addSatellites(TleDataList))); // Sources tab connect(ui->sourceList, SIGNAL(currentTextChanged(const QString&)), ui->sourceEdit, SLOT(setText(const QString&))); connect(ui->sourceEdit, SIGNAL(editingFinished()), this, SLOT(sourceEditingDone())); connect(ui->deleteSourceButton, SIGNAL(clicked()), this, SLOT(deleteSourceRow())); connect(ui->addSourceButton, SIGNAL(clicked()), this, SLOT(addSourceRow())); // About tab setAboutHtml(); updateGuiFromSettings(); }