OcularDialog.cpp   OcularDialog.cpp 
skipping to change at line 46 skipping to change at line 46
#include <QModelIndex> #include <QModelIndex>
#include <QSettings> #include <QSettings>
#include <QStandardItemModel> #include <QStandardItemModel>
#include <limits> #include <limits>
OcularDialog::OcularDialog(Oculars* pluginPtr, OcularDialog::OcularDialog(Oculars* pluginPtr,
QList<CCD *>* ccds, QList<CCD *>* ccds,
QList<Ocular *>* oculars, QList<Ocular *>* oculars,
QList<Telescope *>* telescopes, QList<Telescope *>* telescopes,
QList<Lens *> *lense) QList<Lens *> *lense)
: plugin(pluginPtr) : StelDialog("Oculars")
, plugin(pluginPtr)
, ccdMapper(NULL) , ccdMapper(NULL)
, ocularMapper(NULL) , ocularMapper(NULL)
, telescopeMapper(NULL) , telescopeMapper(NULL)
, lensMapper(NULL) , lensMapper(NULL)
{ {
ui = new Ui_ocularDialogForm; ui = new Ui_ocularDialogForm;
dialogName = "Oculars";
this->ccds = ccds; this->ccds = ccds;
ccdTableModel = new PropertyBasedTableModel(this); ccdTableModel = new PropertyBasedTableModel(this);
CCD* ccdModel = CCD::ccdModel(); CCD* ccdModel = CCD::ccdModel();
ccdTableModel->init(reinterpret_cast<QList<QObject *>* >(ccds), ccdTableModel->init(reinterpret_cast<QList<QObject *>* >(ccds),
ccdModel, ccdModel,
ccdModel->propertyMap()); ccdModel->propertyMap());
this->oculars = oculars; this->oculars = oculars;
ocularTableModel = new PropertyBasedTableModel(this); ocularTableModel = new PropertyBasedTableModel(this);
Ocular* ocularModel = Ocular::ocularModel(); Ocular* ocularModel = Ocular::ocularModel();
ocularTableModel->init(reinterpret_cast<QList<QObject *>* >(oculars) , ocularTableModel->init(reinterpret_cast<QList<QObject *>* >(oculars) ,
skipping to change at line 109 skipping to change at line 109
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
void OcularDialog::retranslate() void OcularDialog::retranslate()
{ {
if (dialog) { if (dialog) {
ui->retranslateUi(dialog); ui->retranslateUi(dialog);
initAboutText(); initAboutText();
} }
} }
void OcularDialog::styleChanged()
{
// Nothing for now
}
void OcularDialog::updateStyle()
{
if(dialog) {
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance()
.getGui());
Q_ASSERT(gui);
const StelStyle pluginStyle = plugin->getModuleStyleSheet(gu
i->getStelStyle());
dialog->setStyleSheet(pluginStyle.qtStyleSheet);
ui->textBrowser->document()->setDefaultStyleSheet(QString(pl
uginStyle.htmlStyleSheet));
}
}
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Slot Methods #pragma mark Slot Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
void OcularDialog::closeWindow() void OcularDialog::closeWindow()
{ {
setVisible(false); setVisible(false);
StelMainView::getInstance().scene()->setActiveWindow(0); StelMainView::getInstance().scene()->setActiveWindow(0);
skipping to change at line 290 skipping to change at line 274
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Private Slot Methods #pragma mark Private Slot Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
void OcularDialog::requireSelectionStateChanged(int state) void OcularDialog::requireSelectionStateChanged(int state)
{ {
bool requireSelection = (state == Qt::Checked); bool requireSelection = (state == Qt::Checked);
bool requireSelectionToZoom = Oculars::appSettings()->value("require _selection_to_zoom", 1.0).toBool(); bool requireSelectionToZoom = Oculars::appSettings()->value("require _selection_to_zoom", true).toBool();
if (requireSelection != requireSelectionToZoom) if (requireSelection != requireSelectionToZoom)
{ {
Oculars::appSettings()->setValue("require_selection_to_zoom" , requireSelection); Oculars::appSettings()->setValue("require_selection_to_zoom" , requireSelection);
Oculars::appSettings()->sync(); Oculars::appSettings()->sync();
emit(requireSelectionChanged(requireSelection)); emit(requireSelectionChanged(requireSelection));
} }
} }
void OcularDialog::scaleImageCircleStateChanged(int state) void OcularDialog::scaleImageCircleStateChanged(int state)
{ {
bool shouldScale = (state == Qt::Checked); bool shouldScale = (state == Qt::Checked);
bool useMaxImageCircle = Oculars::appSettings()->value("use_max_exit _circle", 0.0).toBool(); bool useMaxImageCircle = Oculars::appSettings()->value("use_max_exit _circle", false).toBool();
if (shouldScale != useMaxImageCircle) if (shouldScale != useMaxImageCircle)
{ {
Oculars::appSettings()->setValue("use_max_exit_circle", shou ldScale); Oculars::appSettings()->setValue("use_max_exit_circle", shou ldScale);
Oculars::appSettings()->sync(); Oculars::appSettings()->sync();
emit(scaleImageCircleChanged(shouldScale)); emit(scaleImageCircleChanged(shouldScale));
} }
} }
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
skipping to change at line 345 skipping to change at line 329
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ; connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ;
connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMove dTo(QPoint))); connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMove dTo(QPoint)));
connect(ui->scaleImageCircleCheckBox, SIGNAL(stateChanged(int)), thi s, SLOT(scaleImageCircleStateChanged(int))); connect(ui->scaleImageCircleCheckBox, SIGNAL(stateChanged(int)), thi s, SLOT(scaleImageCircleStateChanged(int)));
connect(ui->requireSelectionCheckBox, SIGNAL(stateChanged(int)), thi s, SLOT(requireSelectionStateChanged(int))); connect(ui->requireSelectionCheckBox, SIGNAL(stateChanged(int)), thi s, SLOT(requireSelectionStateChanged(int)));
connect(ui->limitStellarMagnitudeCheckBox, SIGNAL(clicked(bool)), pl ugin, SLOT(setFlagLimitMagnitude(bool))); connect(ui->limitStellarMagnitudeCheckBox, SIGNAL(clicked(bool)), pl ugin, SLOT(setFlagLimitMagnitude(bool)));
connect(ui->semiTransparencyCheckBox, SIGNAL(clicked(bool)), plugin, SLOT(setFlagUseSemiTransparency(bool))); connect(ui->semiTransparencyCheckBox, SIGNAL(clicked(bool)), plugin, SLOT(setFlagUseSemiTransparency(bool)));
connect(ui->hideGridsLinesCheckBox, SIGNAL(clicked(bool)), plugin, S LOT(setFlagHideGridsLines(bool))); connect(ui->hideGridsLinesCheckBox, SIGNAL(clicked(bool)), plugin, S LOT(setFlagHideGridsLines(bool)));
connect(ui->checkBoxControlPanel, SIGNAL(clicked(bool)), plugin, SLO T(enableGuiPanel(bool))); connect(ui->checkBoxControlPanel, SIGNAL(clicked(bool)), plugin, SLO T(enableGuiPanel(bool)));
connect(ui->checkBoxDecimalDegrees, SIGNAL(clicked(bool)), plugin, S LOT(setFlagDecimalDegrees(bool))); connect(ui->checkBoxDecimalDegrees, SIGNAL(clicked(bool)), plugin, S LOT(setFlagDecimalDegrees(bool)));
connect(ui->checkBoxInitialFOV, SIGNAL(clicked(bool)), plugin, SLOT( setFlagInitFovUsage(bool))); connect(ui->checkBoxInitialFOV, SIGNAL(clicked(bool)), plugin, SLOT( setFlagInitFovUsage(bool)));
connect(ui->checkBoxInitialDirection, SIGNAL(clicked(bool)), plugin, SLOT(setFlagInitDirectionUsage(bool)));
connect(ui->checkBoxTypeOfMount, SIGNAL(clicked(bool)), plugin, SLOT (setFlagAutosetMountForCCD(bool))); connect(ui->checkBoxTypeOfMount, SIGNAL(clicked(bool)), plugin, SLOT (setFlagAutosetMountForCCD(bool)));
// The add & delete buttons // The add & delete buttons
connect(ui->addCCD, SIGNAL(clicked()), this, SLOT(insertNewCCD())); connect(ui->addCCD, SIGNAL(clicked()), this, SLOT(insertNewCCD()));
connect(ui->deleteCCD, SIGNAL(clicked()), this, SLOT(deleteSelectedC CD())); connect(ui->deleteCCD, SIGNAL(clicked()), this, SLOT(deleteSelectedC CD()));
connect(ui->addOcular, SIGNAL(clicked()), this, SLOT(insertNewOcular ())); connect(ui->addOcular, SIGNAL(clicked()), this, SLOT(insertNewOcular ()));
connect(ui->deleteOcular, SIGNAL(clicked()), this, SLOT(deleteSelect edOcular())); connect(ui->deleteOcular, SIGNAL(clicked()), this, SLOT(deleteSelect edOcular()));
connect(ui->addLens, SIGNAL(clicked()), this, SLOT(insertNewLens())) ; connect(ui->addLens, SIGNAL(clicked()), this, SLOT(insertNewLens())) ;
connect(ui->deleteLens, SIGNAL(clicked()), this, SLOT(deleteSelected Lens())); connect(ui->deleteLens, SIGNAL(clicked()), this, SLOT(deleteSelected Lens()));
connect(ui->addTelescope, SIGNAL(clicked()), this, SLOT(insertNewTel escope())); connect(ui->addTelescope, SIGNAL(clicked()), this, SLOT(insertNewTel escope()));
skipping to change at line 394 skipping to change at line 379
ccdMapper->setModel(ccdTableModel); ccdMapper->setModel(ccdTableModel);
ccdMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit); ccdMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit);
ccdMapper->addMapping(ui->ccdName, 0); ccdMapper->addMapping(ui->ccdName, 0);
ccdMapper->addMapping(ui->ccdChipY, 1); ccdMapper->addMapping(ui->ccdChipY, 1);
ccdMapper->addMapping(ui->ccdChipX, 2); ccdMapper->addMapping(ui->ccdChipX, 2);
ccdMapper->addMapping(ui->ccdPixelY, 3); ccdMapper->addMapping(ui->ccdPixelY, 3);
ccdMapper->addMapping(ui->ccdPixelX, 4); ccdMapper->addMapping(ui->ccdPixelX, 4);
ccdMapper->addMapping(ui->ccdResX, 5); ccdMapper->addMapping(ui->ccdResX, 5);
ccdMapper->addMapping(ui->ccdResY, 6); ccdMapper->addMapping(ui->ccdResY, 6);
ccdMapper->addMapping(ui->ccdRotAngle, 7); ccdMapper->addMapping(ui->ccdRotAngle, 7);
ccdMapper->addMapping(ui->OAG_checkBox, 8); ccdMapper->addMapping(ui->ccdBinningX, 8);
ccdMapper->addMapping(ui->OAGPrismH, 9); ccdMapper->addMapping(ui->ccdBinningY, 9);
ccdMapper->addMapping(ui->OAGPrismW, 10); ccdMapper->addMapping(ui->OAG_checkBox, 10);
ccdMapper->addMapping(ui->OAGDist, 11); ccdMapper->addMapping(ui->OAGPrismH, 11);
ccdMapper->addMapping(ui->OAGPrismPA, 12); ccdMapper->addMapping(ui->OAGPrismW, 12);
ccdMapper->addMapping(ui->OAGDist, 13);
ccdMapper->addMapping(ui->OAGPrismPA, 14);
ccdMapper->toFirst(); ccdMapper->toFirst();
connect(ui->ccdListView->selectionModel() , SIGNAL(currentRowChanged (QModelIndex, QModelIndex)), connect(ui->ccdListView->selectionModel() , SIGNAL(currentRowChanged (QModelIndex, QModelIndex)),
ccdMapper, SLOT(setCurrentModelIndex(QModelIndex))); ccdMapper, SLOT(setCurrentModelIndex(QModelIndex)));
connect(ui->ccdRotAngle, SIGNAL(editingFinished()), this, SLOT(selec tedCCDRotationAngleChanged())); connect(ui->ccdRotAngle, SIGNAL(editingFinished()), this, SLOT(selec tedCCDRotationAngleChanged()));
ui->ccdListView->setSelectionBehavior(QAbstractItemView::SelectRows) ; ui->ccdListView->setSelectionBehavior(QAbstractItemView::SelectRows) ;
ui->ccdListView->setCurrentIndex(ccdTableModel->index(0, 1)); ui->ccdListView->setCurrentIndex(ccdTableModel->index(0, 1));
// The ocular mapper // The ocular mapper
ocularMapper = new QDataWidgetMapper(); ocularMapper = new QDataWidgetMapper();
ocularMapper->setModel(ocularTableModel); ocularMapper->setModel(ocularTableModel);
skipping to change at line 454 skipping to change at line 441
ocularMapper->toFirst(); ocularMapper->toFirst();
connect(ui->telescopeListView->selectionModel() , SIGNAL(currentRowC hanged(QModelIndex, QModelIndex)), connect(ui->telescopeListView->selectionModel() , SIGNAL(currentRowC hanged(QModelIndex, QModelIndex)),
telescopeMapper, SLOT(setCurrentModelIndex(QModelIndex))); telescopeMapper, SLOT(setCurrentModelIndex(QModelIndex)));
ui->telescopeListView->setSelectionBehavior(QAbstractItemView::Selec tRows); ui->telescopeListView->setSelectionBehavior(QAbstractItemView::Selec tRows);
ui->telescopeListView->setCurrentIndex(telescopeTableModel->index(0, 1)); ui->telescopeListView->setCurrentIndex(telescopeTableModel->index(0, 1));
connect(ui->binocularsCheckBox, SIGNAL(toggled(bool)), this, SLOT(se tLabelsDescriptionText(bool))); connect(ui->binocularsCheckBox, SIGNAL(toggled(bool)), this, SLOT(se tLabelsDescriptionText(bool)));
// set the initial state // set the initial state
QSettings *settings = Oculars::appSettings(); QSettings *settings = Oculars::appSettings();
if (settings->value("require_selection_to_zoom", 1.0).toBool()) { if (settings->value("require_selection_to_zoom", true).toBool())
{
ui->requireSelectionCheckBox->setCheckState(Qt::Checked); ui->requireSelectionCheckBox->setCheckState(Qt::Checked);
} }
if (settings->value("use_max_exit_circle", 0.0).toBool()) { if (settings->value("use_max_exit_circle", false).toBool())
{
ui->scaleImageCircleCheckBox->setCheckState(Qt::Checked); ui->scaleImageCircleCheckBox->setCheckState(Qt::Checked);
} }
if (settings->value("limit_stellar_magnitude", true).toBool()) { if (settings->value("limit_stellar_magnitude", true).toBool())
{
ui->limitStellarMagnitudeCheckBox->setCheckState(Qt::Checked ); ui->limitStellarMagnitudeCheckBox->setCheckState(Qt::Checked );
} }
if (settings->value("enable_control_panel", false).toBool()) if (settings->value("enable_control_panel", false).toBool())
{ {
ui->checkBoxControlPanel->setChecked(true); ui->checkBoxControlPanel->setChecked(true);
} }
if (settings->value("use_decimal_degrees", false).toBool()) if (settings->value("use_decimal_degrees", false).toBool())
{ {
ui->checkBoxDecimalDegrees->setChecked(true); ui->checkBoxDecimalDegrees->setChecked(true);
} }
if (settings->value("use_initial_fov", false).toBool()) if (settings->value("use_initial_fov", false).toBool())
{ {
ui->checkBoxInitialFOV->setChecked(true); ui->checkBoxInitialFOV->setChecked(true);
} }
if (settings->value("use_initial_direction", false).toBool())
{
ui->checkBoxInitialDirection->setChecked(true);
}
if (settings->value("use_semi_transparency", true).toBool()) if (settings->value("use_semi_transparency", true).toBool())
{ {
ui->semiTransparencyCheckBox->setChecked(true); ui->semiTransparencyCheckBox->setChecked(true);
} }
if (settings->value("hide_grids_and_lines", true).toBool()) if (settings->value("hide_grids_and_lines", true).toBool())
{ {
ui->hideGridsLinesCheckBox->setChecked(true); ui->hideGridsLinesCheckBox->setChecked(true);
} }
//Initialize the style
updateStyle();
} }
void OcularDialog::selectedCCDRotationAngleChanged() void OcularDialog::selectedCCDRotationAngleChanged()
{ {
emit(plugin->selectedCCDChanged()); if (plugin->getEnableCCD())
emit(plugin->selectedCCDChanged());
} }
void OcularDialog::setLabelsDescriptionText(bool state) void OcularDialog::setLabelsDescriptionText(bool state)
{ {
if (state) if (state)
{ {
// TRANSLATORS: tFOV for binoculars (tFOV = True Field of Vi ew) // TRANSLATORS: tFOV for binoculars (tFOV = True Field of Vi ew)
ui->labelFOV->setText(q_("tFOV:")); ui->labelFOV->setText(q_("tFOV:"));
// TRANSLATORS: Magnification factor for binoculars // TRANSLATORS: Magnification factor for binoculars
ui->labelFL->setText(q_("Magnification factor:")); ui->labelFL->setText(q_("Magnification factor:"));
skipping to change at line 537 skipping to change at line 529
html += q_("This is intended to show you a better comparison of what one eyepiece/telescope combination will be like when compared to a nother.") + " "; html += q_("This is intended to show you a better comparison of what one eyepiece/telescope combination will be like when compared to a nother.") + " ";
html += q_("The same eyepiece in two different telescopes of differing focal length will produce two different exit pupils, changing th e view somewhat.") + " "; html += q_("The same eyepiece in two different telescopes of differing focal length will produce two different exit pupils, changing th e view somewhat.") + " ";
html += q_("The trade-off of this is that, with the image sc aled, a large part of the screen can be wasted.") + " "; html += q_("The trade-off of this is that, with the image sc aled, a large part of the screen can be wasted.") + " ";
html += q_("Therefore I recommend that you leave it off, unl ess you feel you have a need of it.") + "</p>"; html += q_("Therefore I recommend that you leave it off, unl ess you feel you have a need of it.") + "</p>";
html += "<p>" + q_("You can toggle a crosshair in the view. Ideally , I wanted this to be aligned to North. I've been unable to do so. So cur rently it aligns to the top of the screen.") + "</p>"; html += "<p>" + q_("You can toggle a crosshair in the view. Ideally , I wanted this to be aligned to North. I've been unable to do so. So cur rently it aligns to the top of the screen.") + "</p>";
html += "<p>" + QString(q_("You can toggle a Telrad finder; this can only be done when you have not turned on the Ocular view. This feature dr aws three concentric circles of 0.5%1, 2.0%1, and 4.0%1, helping you see wh at you would expect to see with the naked eye through the Telrad (or simila r) finder.")).arg(QChar(0x00B0)) + "</p>"; html += "<p>" + QString(q_("You can toggle a Telrad finder; this can only be done when you have not turned on the Ocular view. This feature dr aws three concentric circles of 0.5%1, 2.0%1, and 4.0%1, helping you see wh at you would expect to see with the naked eye through the Telrad (or simila r) finder.")).arg(QChar(0x00B0)) + "</p>";
html += "<p>" + q_("If you find any issues, please let me know. Enj oy!") + "</p>"; html += "<p>" + q_("If you find any issues, please let me know. Enj oy!") + "</p>";
//Keys //Keys
html += "<h2>" + q_("Hot Keys") + "</h2>"; html += "<h2>" + q_("Hot Keys") + "</h2>";
html += "<p>" + q_("The plug-in's key bindings can be edited in the General Tab.") + "</p>"; html += "<p>" + q_("The plug-in's key bindings can be edited in the Keyboard shortcuts editor (F7).") + "</p>";
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( )); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( ));
Q_ASSERT(gui); Q_ASSERT(gui);
StelActionMgr* actionMgr = StelApp::getInstance().getStelActionManag er(); StelActionMgr* actionMgr = StelApp::getInstance().getStelActionManag er();
Q_ASSERT(actionMgr); Q_ASSERT(actionMgr);
StelAction* actionOcular = actionMgr->findAction("actionShow_Ocular" ); StelAction* actionOcular = actionMgr->findAction("actionShow_Ocular" );
Q_ASSERT(actionOcular); Q_ASSERT(actionOcular);
StelAction* actionMenu = actionMgr->findAction("actionShow_Ocular_Me nu"); StelAction* actionMenu = actionMgr->findAction("actionShow_Ocular_Me nu");
Q_ASSERT(actionMenu); Q_ASSERT(actionMenu);
QKeySequence ocularShortcut = actionOcular->getShortcut(); QKeySequence ocularShortcut = actionOcular->getShortcut();
skipping to change at line 566 skipping to change at line 558
menuString = q_("[no key defined]"); menuString = q_("[no key defined]");
html += "<ul>"; html += "<ul>";
html += "<li>"; html += "<li>";
html += QString("<strong>%1:</strong> %2").arg(ocularString).arg(q_( "Switches on/off the ocular overlay.")); html += QString("<strong>%1:</strong> %2").arg(ocularString).arg(q_( "Switches on/off the ocular overlay."));
html += "</li>"; html += "</li>";
html += "<li>"; html += "<li>";
html += QString("<strong>%1:</strong> %2").arg(menuString).arg(q_("O pens the pop-up navigation menu.")); html += QString("<strong>%1:</strong> %2").arg(menuString).arg(q_("O pens the pop-up navigation menu."));
html += "</li>"; html += "</li>";
html += "<li>";
html += QString("<strong>%1:</strong> %2").arg("Alt+M").arg(q_("Rota
te reticle pattern of the eyepiece clockwise."));
html += "</li>";
html += "<li>";
html += QString("<strong>%1:</strong> %2").arg("Shift+Alt+M").arg(q_
("Rotate reticle pattern of the eyepiece сounterclockwise."));
html += "</li>";
html += "</ul>"; html += "</ul>";
html += "</body></html>"; html += "</body></html>";
QString htmlStyleSheet(gui->getStelStyle().htmlStyleSheet); QString htmlStyleSheet(gui->getStelStyle().htmlStyleSheet);
ui->textBrowser->document()->setDefaultStyleSheet(htmlStyleSheet); ui->textBrowser->document()->setDefaultStyleSheet(htmlStyleSheet);
ui->textBrowser->setHtml(html); ui->textBrowser->setHtml(html);
} }
 End of changes. 15 change blocks. 
36 lines changed or deleted 36 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/