OcularDialog.cpp   OcularDialog.cpp 
skipping to change at line 49 skipping to change at line 49
#include <limits> #include <limits>
OcularDialog::OcularDialog(Oculars* pluginPtr, QList<CCD *>* ccds, QList<Oc ular *>* oculars, QList<Telescope *>* telescopes) : OcularDialog::OcularDialog(Oculars* pluginPtr, QList<CCD *>* ccds, QList<Oc ular *>* oculars, QList<Telescope *>* telescopes) :
plugin(pluginPtr) plugin(pluginPtr)
{ {
ui = new Ui_ocularDialogForm; ui = new Ui_ocularDialogForm;
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->property ccdModel,
Map());
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) ,
ocularMode l, ocularModel->propertyMap()); ocularModel, ocularModel->propertyMap());
this->telescopes = telescopes; this->telescopes = telescopes;
telescopeTableModel = new PropertyBasedTableModel(this); telescopeTableModel = new PropertyBasedTableModel(this);
Telescope* telescopeModel = Telescope::telescopeModel(); Telescope* telescopeModel = Telescope::telescopeModel();
telescopeTableModel->init(reinterpret_cast<QList<QObject *>* >(teles copes), telescopeTableModel->init(reinterpret_cast<QList<QObject *>* >(teles copes),
te
lescopeModel, telescopeModel,
te
lescopeModel->propertyMap()); telescopeModel->propertyMap());
validatorPositiveInt = new QIntValidator(0, std::numeric_limits<int> ::max(), this); validatorPositiveInt = new QIntValidator(0, std::numeric_limits<int> ::max(), this);
validatorPositiveDouble = new QDoubleValidator(.0, std::numeric_limi ts<double>::max(), 24, this); validatorPositiveDouble = new QDoubleValidator(.0, std::numeric_limi ts<double>::max(), 24, this);
validatorOcularAFOV = new QDoubleValidator(1.0, 120.0, 1, this); validatorOcularAFOV = new QDoubleValidator(1.0, 120.0, 1, this);
validatorOcularEFL = new QDoubleValidator(1.0, 60.0, 1, this); validatorOcularEFL = new QDoubleValidator(1.0, 60.0, 1, this);
validatorTelescopeDiameter = new QDoubleValidator(1.0, 1000.0, 1, th is); validatorTelescopeDiameter = new QDoubleValidator(1.0, 1000.0, 1, th is);
validatorTelescopeFL = new QDoubleValidator(1.0, 10000.0, 1, this); validatorTelescopeFL = new QDoubleValidator(1.0, 10000.0, 1, this);
QRegExp nameExp("^\\S.*"); QRegExp nameExp("^\\S.*");
validatorName = new QRegExpValidator(nameExp, this); validatorName = new QRegExpValidator(nameExp, this);
} }
OcularDialog::~OcularDialog() OcularDialog::~OcularDialog()
{ {
ocularTableModel->disconnect();
telescopeTableModel->disconnect();
ccdTableModel->disconnect();
delete ui; delete ui;
ui = NULL; ui = NULL;
} }
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark StelModule Methods #pragma mark StelModule Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
skipping to change at line 238 skipping to change at line 242
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Private Slot Methods #pragma mark Private Slot Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
void OcularDialog::keyBindingTogglePluginChanged(const QString& newString) void OcularDialog::keyBindingTogglePluginChanged(const QString& newString)
{ {
Oculars::appSettings()->setValue("bindings/toggle_oculars", newStrin g); Oculars::appSettings()->setValue("bindings/toggle_oculars", newStrin g);
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( )); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( ));
Q_ASSERT(gui); Q_ASSERT(gui);
QAction* action = gui->getGuiActions("actionShow_Ocular"); QAction* action = gui->getGuiAction("actionShow_Ocular");
if (action != NULL) { if (action != NULL) {
action->setShortcut(QKeySequence(newString.trimmed())); action->setShortcut(QKeySequence(newString.trimmed()));
} }
} }
void OcularDialog::keyBindingPopupNavigatorConfigChanged(const QString& new String) void OcularDialog::keyBindingPopupNavigatorConfigChanged(const QString& new String)
{ {
Oculars::appSettings()->setValue("bindings/popup_navigator", newStri ng); Oculars::appSettings()->setValue("bindings/popup_navigator", newStri ng);
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( )); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( ));
Q_ASSERT(gui); Q_ASSERT(gui);
QAction* action = gui->getGuiActions("actionShow_Ocular_Menu"); QAction* action = gui->getGuiAction("actionShow_Ocular_Menu");
if (action != NULL) { if (action != NULL) {
action->setShortcut(QKeySequence(newString.trimmed())); action->setShortcut(QKeySequence(newString.trimmed()));
} }
} }
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", 1.0).toBool();
if (requireSelection != requireSelectionToZoom) { if (requireSelection != requireSelectionToZoom) {
skipping to change at line 287 skipping to change at line 291
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Protected Methods #pragma mark Protected Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
void OcularDialog::createDialogContent() void OcularDialog::createDialogContent()
{ {
ui->setupUi(dialog); ui->setupUi(dialog);
connect(&StelApp::getInstance(), SIGNAL(languageChanged()), connect(&StelApp::getInstance(), SIGNAL(languageChanged()),
this, SLOT(retranslate())); this, SLOT(retranslate()));
ui->ccdListView->setModel(ccdTableModel); ui->ccdListView->setModel(ccdTableModel);
ui->ocularListView->setModel(ocularTableModel); ui->ocularListView->setModel(ocularTableModel);
ui->telescopeListView->setModel(telescopeTableModel); ui->telescopeListView->setModel(telescopeTableModel);
//Now the rest of the actions. //Now the rest of the actions.
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ; connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ;
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->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)));
skipping to change at line 329 skipping to change at line 333
ui->telescopeDiameter->setValidator(validatorTelescopeDiameter); ui->telescopeDiameter->setValidator(validatorTelescopeDiameter);
ui->ocularName->setValidator(validatorName); ui->ocularName->setValidator(validatorName);
ui->telescopeName->setValidator(validatorName); ui->telescopeName->setValidator(validatorName);
// The key bindings // The key bindings
QString bindingString = Oculars::appSettings()->value("bindings/togg le_oculars", "Ctrl+O").toString(); QString bindingString = Oculars::appSettings()->value("bindings/togg le_oculars", "Ctrl+O").toString();
ui->togglePluginLineEdit->setText(bindingString); ui->togglePluginLineEdit->setText(bindingString);
bindingString = Oculars::appSettings()->value("bindings/popup_naviga tor", "Alt+O").toString(); bindingString = Oculars::appSettings()->value("bindings/popup_naviga tor", "Alt+O").toString();
ui->togglePopupNavigatorWindowLineEdit->setText(bindingString); ui->togglePopupNavigatorWindowLineEdit->setText(bindingString);
connect(ui->togglePluginLineEdit, SIGNAL(textEdited(const QString&)) , connect(ui->togglePluginLineEdit, SIGNAL(textEdited(const QString&)) ,
this, SLOT(keyBindingTogglePluginChanged(const QString&))); this, SLOT(keyBindingTogglePluginCha nged(const QString&)));
connect(ui->togglePopupNavigatorWindowLineEdit, SIGNAL(textEdited(co nst QString&)), connect(ui->togglePopupNavigatorWindowLineEdit, SIGNAL(textEdited(co nst QString&)),
this, SLOT(keyBindingPopupNavigatorConfigChanged(const QStri ng&))); this, SLOT(keyBindingPopupNavigatorC onfigChanged(const QString&)));
initAboutText(); initAboutText();
connect(ui->togglePluginLineEdit, SIGNAL(textEdited(QString)), connect(ui->togglePluginLineEdit, SIGNAL(textEdited(QString)),
this, SLOT(initAboutText())); this, SLOT(initAboutText()));
connect(ui->togglePopupNavigatorWindowLineEdit, SIGNAL(textEdited(QS tring)), connect(ui->togglePopupNavigatorWindowLineEdit, SIGNAL(textEdited(QS tring)),
this, SLOT(initAboutText())); this, SLOT(initAboutText()));
connect(ui->pushButtonMoveOcularUp, SIGNAL(pressed()), connect(ui->pushButtonMoveOcularUp, SIGNAL(pressed()),
this, SLOT(moveUpSelectedOcular())); this, SLOT(moveUpSelectedOcular()));
connect(ui->pushButtonMoveOcularDown, SIGNAL(pressed()), connect(ui->pushButtonMoveOcularDown, SIGNAL(pressed()),
this, SLOT(moveDownSelectedOcular())); this, SLOT(moveDownSelectedOcular()) );
connect(ui->pushButtonMoveSensorUp, SIGNAL(pressed()), connect(ui->pushButtonMoveSensorUp, SIGNAL(pressed()),
this, SLOT(moveUpSelectedSensor())); this, SLOT(moveUpSelectedSensor()));
connect(ui->pushButtonMoveSensorDown, SIGNAL(pressed()), connect(ui->pushButtonMoveSensorDown, SIGNAL(pressed()),
this, SLOT(moveDownSelectedSensor())); this, SLOT(moveDownSelectedSensor()) );
connect(ui->pushButtonMoveTelescopeUp, SIGNAL(pressed()), connect(ui->pushButtonMoveTelescopeUp, SIGNAL(pressed()),
this, SLOT(moveUpSelectedTelescope())); this, SLOT(moveUpSelectedTelescope() ));
connect(ui->pushButtonMoveTelescopeDown, SIGNAL(pressed()), connect(ui->pushButtonMoveTelescopeDown, SIGNAL(pressed()),
this, SLOT(moveDownSelectedTelescope())); this, SLOT(moveDownSelectedTelescope ()));
// The CCD mapper // The CCD mapper
ccdMapper = new QDataWidgetMapper(); ccdMapper = new QDataWidgetMapper();
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->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)));
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);
ocularMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit); ocularMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit);
ocularMapper->addMapping(ui->ocularName, 0); ocularMapper->addMapping(ui->ocularName, 0);
ocularMapper->addMapping(ui->ocularAFov, 1); ocularMapper->addMapping(ui->ocularAFov, 1);
ocularMapper->addMapping(ui->ocularFL, 2); ocularMapper->addMapping(ui->ocularFL, 2);
ocularMapper->addMapping(ui->ocularFieldStop, 3); ocularMapper->addMapping(ui->ocularFieldStop, 3);
ocularMapper->addMapping(ui->binocularsCheckBox, 4, "checked"); ocularMapper->addMapping(ui->binocularsCheckBox, 4, "checked");
ocularMapper->toFirst(); ocularMapper->toFirst();
connect(ui->ocularListView->selectionModel() , SIGNAL(currentRowChan ged(QModelIndex, QModelIndex)), connect(ui->ocularListView->selectionModel() , SIGNAL(currentRowChan ged(QModelIndex, QModelIndex)),
ocularMapper, SLOT(setCurrentModelIndex(QModelInde x))); ocularMapper, SLOT(setCurrentModelIn dex(QModelIndex)));
ui->ocularListView->setCurrentIndex(ocularTableModel->index(0, 1)); ui->ocularListView->setCurrentIndex(ocularTableModel->index(0, 1));
// The telescope mapper // The telescope mapper
telescopeMapper = new QDataWidgetMapper(); telescopeMapper = new QDataWidgetMapper();
telescopeMapper->setModel(telescopeTableModel); telescopeMapper->setModel(telescopeTableModel);
telescopeMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit); telescopeMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit);
telescopeMapper->addMapping(ui->telescopeName, 0); telescopeMapper->addMapping(ui->telescopeName, 0);
telescopeMapper->addMapping(ui->telescopeDiameter, 1); telescopeMapper->addMapping(ui->telescopeDiameter, 1);
telescopeMapper->addMapping(ui->telescopeFL, 2); telescopeMapper->addMapping(ui->telescopeFL, 2);
telescopeMapper->addMapping(ui->telescopeHFlip, 3, "checked"); telescopeMapper->addMapping(ui->telescopeHFlip, 3, "checked");
telescopeMapper->addMapping(ui->telescopeVFlip, 4, "checked"); telescopeMapper->addMapping(ui->telescopeVFlip, 4, "checked");
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(QModelInd ex))); telescopeMapper, SLOT(setCurrentMode lIndex(QModelIndex)));
ui->telescopeListView->setCurrentIndex(telescopeTableModel->index(0, 1)); ui->telescopeListView->setCurrentIndex(telescopeTableModel->index(0, 1));
// set the initial state // set the initial state
if (Oculars::appSettings()->value("require_selection_to_zoom", 1.0). toBool()) { if (Oculars::appSettings()->value("require_selection_to_zoom", 1.0). toBool()) {
ui->requireSelectionCheckBox->setCheckState(Qt::Checked); ui->requireSelectionCheckBox->setCheckState(Qt::Checked);
} }
if (Oculars::appSettings()->value("use_max_exit_circle", 0.0).toBool ()) { if (Oculars::appSettings()->value("use_max_exit_circle", 0.0).toBool ()) {
ui->scaleImageCircleCheckBox->setCheckState(Qt::Checked); ui->scaleImageCircleCheckBox->setCheckState(Qt::Checked);
} }
if (Oculars::appSettings()->value("enable_control_panel", false).toB ool()) if (Oculars::appSettings()->value("enable_control_panel", false).toB ool())
skipping to change at line 441 skipping to change at line 445
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 General Tab.") + "</p>";
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( )); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( ));
Q_ASSERT(gui); Q_ASSERT(gui);
QAction* actionOcular = gui->getGuiActions("actionShow_Ocular"); QAction* actionOcular = gui->getGuiAction("actionShow_Ocular");
Q_ASSERT(actionOcular); Q_ASSERT(actionOcular);
QAction* actionMenu = gui->getGuiActions("actionShow_Ocular_Menu"); QAction* actionMenu = gui->getGuiAction("actionShow_Ocular_Menu");
Q_ASSERT(actionMenu); Q_ASSERT(actionMenu);
QKeySequence ocularShortcut = actionOcular->shortcut(); QKeySequence ocularShortcut = actionOcular->shortcut();
QString ocularString = ocularShortcut.toString(QKeySequence::NativeT ext); QString ocularString = ocularShortcut.toString(QKeySequence::NativeT ext);
ocularString = Qt::escape(ocularString); ocularString = Qt::escape(ocularString);
if (ocularString.isEmpty()) if (ocularString.isEmpty())
ocularString = q_("[no key defined]"); ocularString = q_("[no key defined]");
QKeySequence menuShortcut = actionMenu->shortcut(); QKeySequence menuShortcut = actionMenu->shortcut();
QString menuString = menuShortcut.toString(QKeySequence::NativeText) ; QString menuString = menuShortcut.toString(QKeySequence::NativeText) ;
menuString = Qt::escape(menuString); menuString = Qt::escape(menuString);
if (menuString.isEmpty()) if (menuString.isEmpty())
 End of changes. 22 change blocks. 
26 lines changed or deleted 31 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/