void AstroCalcDialog::createDialogContent() { ui->setupUi(dialog); #ifdef Q_OS_WIN // Kinetic scrolling for tablet pc and pc QList<QWidget *> addscroll; addscroll << ui->planetaryPositionsTreeWidget; installKineticScrolling(addscroll); #endif //Signals and slots 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))); initListPlanetaryPositions(); initListEphemeris(); initListPhenomena(); populateCelestialBodyList(); populateEphemerisTimeStepsList(); populateMajorPlanetList(); populateGroupCelestialBodyList(); double JD = core->getJD() + StelUtils::getGMTShiftFromQT(core->getJD())/24; ui->dateFromDateTimeEdit->setDateTime(StelUtils::jdToQDateTime(JD)); ui->dateToDateTimeEdit->setDateTime(StelUtils::jdToQDateTime(JD + 30.f)); ui->phenomenFromDateEdit->setDateTime(StelUtils::jdToQDateTime(JD)); ui->phenomenToDateEdit->setDateTime(StelUtils::jdToQDateTime(JD + 365.f)); // bug #1350669 (https://bugs.launchpad.net/stellarium/+bug/1350669) connect(ui->planetaryPositionsTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), ui->planetaryPositionsTreeWidget, SLOT(repaint())); connect(ui->planetaryPositionsTreeWidget, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(selectCurrentPlanetaryPosition(QModelIndex))); connect(ui->ephemerisPushButton, SIGNAL(clicked()), this, SLOT(generateEphemeris())); connect(ui->ephemerisCleanupButton, SIGNAL(clicked()), this, SLOT(cleanupEphemeris())); connect(ui->ephemerisTreeWidget, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(selectCurrentEphemeride(QModelIndex))); connect(ui->ephemerisTreeWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(onChangedEphemerisPosition(QModelIndex))); connect(ui->phenomenaPushButton, SIGNAL(clicked()), this, SLOT(calculatePhenomena())); connect(ui->phenomenaTreeWidget, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(selectCurrentPhenomen(QModelIndex))); // every 5 min, check if it's time to update QTimer* updateTimer = new QTimer(this); updateTimer->setInterval(300000); connect(updateTimer, SIGNAL(timeout()), this, SLOT(currentPlanetaryPositions())); updateTimer->start(); currentPlanetaryPositions(); }
// 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 SolarSystemManagerWindow::createDialogContent() { ui->setupUi(dialog); #ifdef Q_OS_WIN //Kinetic scrolling for tablet pc and pc QList<QWidget *> addscroll; addscroll << ui->listWidgetObjects; installKineticScrolling(addscroll); #endif //Signals 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))); connect(ui->pushButtonCopyFile, SIGNAL(clicked()), this, SLOT(copyConfiguration())); connect(ui->pushButtonReplaceFile, SIGNAL(clicked()), this, SLOT(replaceConfiguration())); connect(ui->pushButtonRemove, SIGNAL(clicked()), this, SLOT(removeObject())); connect(ui->pushButtonImportMPC, SIGNAL(clicked()), this, SLOT(newImportMPC())); //connect(ui->pushButtonManual, SIGNAL(clicked()), this, SLOT(newImportManual())); connect(ssoManager, SIGNAL(solarSystemChanged()), this, SLOT(populateSolarSystemList())); connect(ui->pushButtonReset, SIGNAL(clicked()), ssoManager, SLOT(resetSolarSystemToDefault())); // bug #1350669 (https://bugs.launchpad.net/stellarium/+bug/1350669) connect(ui->listWidgetObjects, SIGNAL(currentRowChanged(int)), ui->listWidgetObjects, SLOT(repaint())); updateTexts(); Q_ASSERT(mpcImportWindow); //Rebuild the list if any planets have been imported connect(mpcImportWindow, SIGNAL(objectsImported()), this, SLOT(populateSolarSystemList())); ui->lineEditUserFilePath->setText(ssoManager->getCustomSolarSystemFilePath()); populateSolarSystemList(); }
// Initialize the dialog widgets and connect the signals/slots void SearchDialog::createDialogContent() { ui->setupUi(dialog); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->lineEditSearchSkyObject, SIGNAL(textChanged(const QString&)), this, SLOT(onSearchTextChanged(const QString&))); connect(ui->pushButtonGotoSearchSkyObject, SIGNAL(clicked()), this, SLOT(gotoObject())); onSearchTextChanged(ui->lineEditSearchSkyObject->text()); connect(ui->lineEditSearchSkyObject, SIGNAL(returnPressed()), this, SLOT(gotoObject())); connect(ui->lineEditSearchSkyObject, SIGNAL(selectionChanged()), this, SLOT(setHasSelectedFlag())); connect(ui->lineEditSearchSkyObject, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); ui->lineEditSearchSkyObject->installEventFilter(this); #ifdef Q_OS_WIN //Kinetic scrolling for tablet pc and pc QList<QWidget *> addscroll; addscroll << ui->objectsListWidget; installKineticScrolling(addscroll); #endif populateCoordinateSystemsList(); populateCoordinateAxis(); int idx = ui->coordinateSystemComboBox->findData(getCurrentCoordinateSystemKey(), Qt::UserRole, Qt::MatchCaseSensitive); if (idx==-1) { // Use equatorialJ2000 as default idx = ui->coordinateSystemComboBox->findData(QVariant("equatorialJ2000"), Qt::UserRole, Qt::MatchCaseSensitive); } ui->coordinateSystemComboBox->setCurrentIndex(idx); connect(ui->coordinateSystemComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setCoordinateSystem(int))); connect(ui->AxisXSpinBox, SIGNAL(valueChanged()), this, SLOT(manualPositionChanged())); connect(ui->AxisYSpinBox, SIGNAL(valueChanged()), this, SLOT(manualPositionChanged())); connect(ui->alphaPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->betaPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->gammaPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->deltaPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->epsilonPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->zetaPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->etaPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->thetaPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->iotaPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->kappaPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->lambdaPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->muPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->nuPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->xiPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->omicronPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->piPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->rhoPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->sigmaPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->tauPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->upsilonPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->phiPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->chiPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->psiPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->omegaPushButton, SIGNAL(clicked(bool)), this, SLOT(greekLetterClicked())); connect(ui->checkBoxUseSimbad, SIGNAL(clicked(bool)), this, SLOT(enableSimbadSearch(bool))); ui->checkBoxUseSimbad->setChecked(useSimbad); populateSimbadServerList(); idx = ui->serverListComboBox->findData(simbadServerUrl, Qt::UserRole, Qt::MatchCaseSensitive); if (idx==-1) { // Use University of Strasbourg as default idx = ui->serverListComboBox->findData(QVariant(DEF_SIMBAD_URL), Qt::UserRole, Qt::MatchCaseSensitive); } ui->serverListComboBox->setCurrentIndex(idx); connect(ui->serverListComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(selectSimbadServer(int))); connect(ui->checkBoxUseStartOfWords, SIGNAL(clicked(bool)), this, SLOT(enableStartOfWordsAutofill(bool))); ui->checkBoxUseStartOfWords->setChecked(useStartOfWords); // list views initialization connect(ui->objectTypeComboBox, SIGNAL(activated(int)), this, SLOT(updateListWidget(int))); connect(ui->searchInListLineEdit, SIGNAL(textChanged(QString)), this, SLOT(searchListChanged(QString))); connect(ui->searchInEnglishCheckBox, SIGNAL(toggled(bool)), this, SLOT(updateListTab())); connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateListTab())); updateListTab(); // Set the focus directly on the line edit if (ui->lineEditSearchSkyObject->isEnabled()) ui->lineEditSearchSkyObject->setFocus(); }
// 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(); }
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 LocationDialog::createDialogContent() { // We try to directly connect to the observer slots as much as we can ui->setupUi(dialog); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); // Init the SpinBox entries ui->longitudeSpinBox->setDisplayFormat(AngleSpinBox::DMSSymbols); ui->longitudeSpinBox->setPrefixType(AngleSpinBox::Longitude); ui->longitudeSpinBox->setMinimum(-180.0, true); ui->longitudeSpinBox->setMaximum( 180.0, true); ui->longitudeSpinBox->setWrapping(true); ui->latitudeSpinBox->setDisplayFormat(AngleSpinBox::DMSSymbols); ui->latitudeSpinBox->setPrefixType(AngleSpinBox::Latitude); ui->latitudeSpinBox->setMinimum(-90.0, true); ui->latitudeSpinBox->setMaximum( 90.0, true); ui->latitudeSpinBox->setWrapping(false); QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this); proxyModel->setSourceModel((QAbstractItemModel*)StelApp::getInstance().getLocationMgr().getModelAll()); proxyModel->sort(0, Qt::AscendingOrder); proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); ui->citiesListView->setModel(proxyModel); #ifdef Q_OS_WIN //Kinetic scrolling for tablet pc and pc QList<QWidget *> addscroll; addscroll << ui->citiesListView; installKineticScrolling(addscroll); #endif populatePlanetList(); populateCountryList(); connect(ui->citySearchLineEdit, SIGNAL(textChanged(const QString&)), proxyModel, SLOT(setFilterWildcard(const QString&))); connect(ui->citiesListView, SIGNAL(clicked(const QModelIndex&)), this, SLOT(setPositionFromList(const QModelIndex&))); // Connect all the QT signals connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint))); connect(ui->mapLabel, SIGNAL(positionChanged(double, double)), this, SLOT(setPositionFromMap(double, double))); connect(ui->addLocationToListPushButton, SIGNAL(clicked()), this, SLOT(addCurrentLocationToList())); connect(ui->deleteLocationFromListPushButton, SIGNAL(clicked()), this, SLOT(deleteCurrentLocationFromList())); connect(ui->resetListPushButton, SIGNAL(clicked()), this, SLOT(resetCompleteList())); connect(ui->countryNameComboBox, SIGNAL(activated(const QString &)), this, SLOT(filterSitesByCountry())); StelCore* core = StelApp::getInstance().getCore(); const StelLocation& currentLocation = core->getCurrentLocation(); bool b = (currentLocation.getID() == core->getDefaultLocationID()); QSettings* conf = StelApp::getInstance().getSettings(); if (conf->value("init_location/location", "auto").toString() == "auto") { ui->useIpQueryCheckBox->setChecked(true); b = false; } setFieldsFromLocation(currentLocation); updateDefaultLocationControls(b); connect(ui->useIpQueryCheckBox, SIGNAL(clicked(bool)), this, SLOT(ipQueryLocation(bool))); connect(ui->useAsDefaultLocationCheckBox, SIGNAL(clicked(bool)), this, SLOT(setDefaultLocation(bool))); connect(ui->pushButtonReturnToDefault, SIGNAL(clicked()), core, SLOT(returnToDefaultLocation())); connectEditSignals(); connect(core, SIGNAL(locationChanged(StelLocation)), this, SLOT(updateFromProgram(StelLocation))); ui->citySearchLineEdit->setFocus(); }
/* ********************************************************************* */ void OcularDialog::createDialogContent() { ui->setupUi(dialog); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); ui->ccdListView->setModel(ccdTableModel); ui->ocularListView->setModel(ocularTableModel); ui->telescopeListView->setModel(telescopeTableModel); ui->lensListView->setModel(lensTableModel); #ifdef Q_OS_WIN //Kinetic scrolling for tablet pc and pc QList<QWidget *> addscroll; addscroll << ui->textBrowser << ui->telescopeListView << ui->ccdListView << ui->ocularListView << ui->lensListView; installKineticScrolling(addscroll); #endif //Now the rest of the actions. connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->scaleImageCircleCheckBox, SIGNAL(stateChanged(int)), this, SLOT(scaleImageCircleStateChanged(int))); connect(ui->requireSelectionCheckBox, SIGNAL(stateChanged(int)), this, SLOT(requireSelectionStateChanged(int))); connect(ui->limitStellarMagnitudeCheckBox, SIGNAL(clicked(bool)), plugin, SLOT(setFlagLimitMagnitude(bool))); connect(ui->checkBoxControlPanel, SIGNAL(clicked(bool)), plugin, SLOT(enableGuiPanel(bool))); connect(ui->checkBoxDecimalDegrees, SIGNAL(clicked(bool)), plugin, SLOT(setFlagDecimalDegrees(bool))); connect(ui->checkBoxInitialFOV, SIGNAL(clicked(bool)), plugin, SLOT(setFlagInitFovUsage(bool))); connect(ui->checkBoxUseFlipForCCD, SIGNAL(clicked(bool)), plugin, SLOT(setFlagUseFlipForCCD(bool))); // The add & delete buttons connect(ui->addCCD, SIGNAL(clicked()), this, SLOT(insertNewCCD())); connect(ui->deleteCCD, SIGNAL(clicked()), this, SLOT(deleteSelectedCCD())); connect(ui->addOcular, SIGNAL(clicked()), this, SLOT(insertNewOcular())); connect(ui->deleteOcular, SIGNAL(clicked()), this, SLOT(deleteSelectedOcular())); connect(ui->addLens, SIGNAL(clicked()), this, SLOT(insertNewLens())); connect(ui->deleteLens, SIGNAL(clicked()), this, SLOT(deleteSelectedLens())); connect(ui->addTelescope, SIGNAL(clicked()), this, SLOT(insertNewTelescope())); connect(ui->deleteTelescope, SIGNAL(clicked()), this, SLOT(deleteSelectedTelescope())); // Validators ui->ccdName->setValidator(validatorName); ui->ocularName->setValidator(validatorName); ui->telescopeName->setValidator(validatorName); ui->lensName->setValidator(validatorName); // The key bindings QString bindingString = Oculars::appSettings()->value("bindings/toggle_oculars", "Ctrl+O").toString(); ui->togglePluginLineEdit->setText(bindingString); bindingString = Oculars::appSettings()->value("bindings/popup_navigator", "Alt+O").toString(); ui->togglePopupNavigatorWindowLineEdit->setText(bindingString); connect(ui->togglePluginLineEdit, SIGNAL(textEdited(const QString&)), this, SLOT(keyBindingTogglePluginChanged(const QString&))); connect(ui->togglePopupNavigatorWindowLineEdit, SIGNAL(textEdited(const QString&)), this, SLOT(keyBindingPopupNavigatorConfigChanged(const QString&))); initAboutText(); connect(ui->togglePluginLineEdit, SIGNAL(textEdited(QString)), this, SLOT(initAboutText())); connect(ui->togglePopupNavigatorWindowLineEdit, SIGNAL(textEdited(QString)), this, SLOT(initAboutText())); connect(ui->pushButtonMoveOcularUp, SIGNAL(pressed()), this, SLOT(moveUpSelectedOcular())); connect(ui->pushButtonMoveOcularDown, SIGNAL(pressed()), this, SLOT(moveDownSelectedOcular())); connect(ui->pushButtonMoveSensorUp, SIGNAL(pressed()), this, SLOT(moveUpSelectedSensor())); connect(ui->pushButtonMoveSensorDown, SIGNAL(pressed()), this, SLOT(moveDownSelectedSensor())); connect(ui->pushButtonMoveTelescopeUp, SIGNAL(pressed()), this, SLOT(moveUpSelectedTelescope())); connect(ui->pushButtonMoveTelescopeDown, SIGNAL(pressed()), this, SLOT(moveDownSelectedTelescope())); connect(ui->pushButtonMoveLensUp, SIGNAL(pressed()), this, SLOT(moveUpSelectedLens())); connect(ui->pushButtonMoveLensDown, SIGNAL(pressed()), this, SLOT(moveDownSelectedLens())); // The CCD mapper ccdMapper = new QDataWidgetMapper(); ccdMapper->setModel(ccdTableModel); ccdMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit); ccdMapper->addMapping(ui->ccdName, 0); ccdMapper->addMapping(ui->ccdChipY, 1); ccdMapper->addMapping(ui->ccdChipX, 2); ccdMapper->addMapping(ui->ccdPixelY, 3); ccdMapper->addMapping(ui->ccdPixelX, 4); ccdMapper->addMapping(ui->ccdResX, 5); ccdMapper->addMapping(ui->ccdResY, 6); ccdMapper->toFirst(); connect(ui->ccdListView->selectionModel() , SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), ccdMapper, SLOT(setCurrentModelIndex(QModelIndex))); ui->ccdListView->setCurrentIndex(ccdTableModel->index(0, 1)); // The ocular mapper ocularMapper = new QDataWidgetMapper(); ocularMapper->setModel(ocularTableModel); ocularMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit); ocularMapper->addMapping(ui->ocularName, 0); ocularMapper->addMapping(ui->ocularAFov, 1); ocularMapper->addMapping(ui->ocularFL, 2); ocularMapper->addMapping(ui->ocularFieldStop, 3); ocularMapper->addMapping(ui->binocularsCheckBox, 4, "checked"); ocularMapper->addMapping(ui->permanentCrosshairCheckBox, 5, "checked"); ocularMapper->toFirst(); connect(ui->ocularListView->selectionModel() , SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), ocularMapper, SLOT(setCurrentModelIndex(QModelIndex))); ui->ocularListView->setCurrentIndex(ocularTableModel->index(0, 1)); // The lens mapper lensMapper = new QDataWidgetMapper(); lensMapper->setModel(lensTableModel); lensMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit); lensMapper->addMapping(ui->lensName, 0); lensMapper->addMapping(ui->lensMultipler, 1); lensMapper->toFirst(); connect(ui->lensListView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), lensMapper, SLOT(setCurrentModelIndex(QModelIndex))); ui->lensListView->setCurrentIndex(lensTableModel->index(0, 1)); // The telescope mapper telescopeMapper = new QDataWidgetMapper(); telescopeMapper->setModel(telescopeTableModel); telescopeMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit); telescopeMapper->addMapping(ui->telescopeName, 0); telescopeMapper->addMapping(ui->telescopeDiameter, 1); telescopeMapper->addMapping(ui->telescopeFL, 2); telescopeMapper->addMapping(ui->telescopeHFlip, 3, "checked"); telescopeMapper->addMapping(ui->telescopeVFlip, 4, "checked"); ocularMapper->toFirst(); connect(ui->telescopeListView->selectionModel() , SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), telescopeMapper, SLOT(setCurrentModelIndex(QModelIndex))); ui->telescopeListView->setCurrentIndex(telescopeTableModel->index(0, 1)); connect(ui->binocularsCheckBox, SIGNAL(toggled(bool)), this, SLOT(setLabelsDescriptionText(bool))); // set the initial state QSettings *settings = Oculars::appSettings(); if (settings->value("require_selection_to_zoom", 1.0).toBool()) { ui->requireSelectionCheckBox->setCheckState(Qt::Checked); } if (settings->value("use_max_exit_circle", 0.0).toBool()) { ui->scaleImageCircleCheckBox->setCheckState(Qt::Checked); } if (settings->value("limit_stellar_magnitude", true).toBool()) { ui->limitStellarMagnitudeCheckBox->setCheckState(Qt::Checked); } if (settings->value("enable_control_panel", false).toBool()) { ui->checkBoxControlPanel->setChecked(true); } if (settings->value("use_decimal_degrees", false).toBool()) { ui->checkBoxDecimalDegrees->setChecked(true); } if (settings->value("use_initial_fov", false).toBool()) { ui->checkBoxInitialFOV->setChecked(true); } if (settings->value("use_ccd_flip", true).toBool()) { ui->checkBoxUseFlipForCCD->setChecked(true); } //Initialize the style updateStyle(); }
// 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); #ifdef Q_OS_WIN //Kinetic scrolling for tablet pc and pc QList<QWidget *> addscroll; addscroll << ui->listEvents << ui->aboutTextBrowser; installKineticScrolling(addscroll); #endif // 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))); connect(treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(repaintTreeWidget())); // 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 refreshMarkersColor(); 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 ExoplanetsDialog::createDialogContent() { ep = GETSTELMODULE(Exoplanets); 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 << ui->infoTextBrowser << ui->websitesTextBrowser; installKineticScrolling(addscroll); #endif // 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(ep, SIGNAL(jsonUpdateComplete(void)), ep, SLOT(reloadCatalog())); 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())); connect(ui->plotDiagram, SIGNAL(clicked()), this, SLOT(drawDiagram())); // 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)); } populateDiagramsList(); updateGuiFromSettings(); }