OcularDialog.cpp   OcularDialog.cpp 
skipping to change at line 20 skipping to change at line 20
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#include "Ocular.hpp" #include "Ocular.hpp"
#include "Oculars.hpp"
#include "OcularDialog.hpp" #include "OcularDialog.hpp"
#include "ui_ocularDialog.h" #include "ui_ocularDialog.h"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelGui.hpp" #include "StelGui.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelModuleMgr.hpp"
#include "StelMainGraphicsView.hpp" #include "StelMainGraphicsView.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include <QDataWidgetMapper> #include <QDataWidgetMapper>
#include <QDebug> #include <QDebug>
#include <QFrame> #include <QFrame>
#include <QModelIndex> #include <QModelIndex>
#include <QSettings> #include <QSettings>
#include <QSqlError> #include <QSqlError>
#include <QSqlField> #include <QSqlField>
#include <QSqlDatabase> #include <QSqlDatabase>
#include <QSqlRecord> #include <QSqlRecord>
#include <QSqlTableModel> #include <QSqlTableModel>
#include <limits>
OcularDialog::OcularDialog(QSqlTableModel *ocularsTableModel, QSqlTableMode l *telescopesTableModel) OcularDialog::OcularDialog(QSqlTableModel *CCDsTableModel, QSqlTableModel * ocularsTableModel, QSqlTableModel *telescopesTableModel)
{ {
ui = new Ui_ocularDialogForm; ui = new Ui_ocularDialogForm;
this->CCDsTableModel = CCDsTableModel;
this->ocularsTableModel = ocularsTableModel; this->ocularsTableModel = ocularsTableModel;
this->telescopesTableModel = telescopesTableModel; this->telescopesTableModel = telescopesTableModel;
validatorPositiveInt = new QIntValidator(0, std::numeric_limits<int>
::max(), this);
validatorPositiveDouble = new QDoubleValidator(.0, std::numeric_limi
ts<double>::max(), 24, this);
validatorOcularAFOV = new QIntValidator(35, 100, this); validatorOcularAFOV = new QIntValidator(35, 100, 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()
{ {
//These exist only if the window has been shown once:
if (dialog)
{
ui->ocularAFov->setValidator(0);
ui->ocularFL->setValidator(0);
ui->telescopeFL->setValidator(0);
ui->telescopeDiameter->setValidator(0);
ui->ocularName->setValidator(0);
ui->telescopeName->setValidator(0);
ui->ocularName->setValidator(0);
ui->CCDName->setValidator(0);
ui->CCDResX->setValidator(0);
ui->CCDResY->setValidator(0);
ui->CCDChipX->setValidator(0);
ui->CCDChipY->setValidator(0);
ui->CCDPixelX->setValidator(0);
ui->CCDPixelX->setValidator(0);
delete CCDMapper;
CCDMapper = NULL;
delete ocularMapper;
ocularMapper = NULL;
delete telescopeMapper;
telescopeMapper = NULL;
}
delete ui; delete ui;
ui = NULL; ui = NULL;
delete validatorPositiveInt;
ui->ocularAFov->setValidator(0); validatorPositiveInt = NULL;
ui->ocularFL->setValidator(0); delete validatorPositiveDouble;
ui->telescopeFL->setValidator(0); validatorPositiveDouble = NULL;
ui->telescopeDiameter->setValidator(0);
ui->ocularName->setValidator(0);
ui->telescopeName->setValidator(0);
delete ocularMapper;
ocularMapper = NULL;
delete telescopeMapper;
telescopeMapper = NULL;
delete validatorOcularAFOV; delete validatorOcularAFOV;
validatorOcularAFOV = NULL; validatorOcularAFOV = NULL;
delete validatorOcularEFL; delete validatorOcularEFL;
validatorOcularEFL = NULL; validatorOcularEFL = NULL;
delete validatorTelescopeDiameter; delete validatorTelescopeDiameter;
validatorTelescopeDiameter = NULL; validatorTelescopeDiameter = NULL;
delete validatorTelescopeFL; delete validatorTelescopeFL;
validatorTelescopeFL = NULL; validatorTelescopeFL = NULL;
delete validatorName; delete validatorName;
validatorName = NULL; validatorName = NULL;
skipping to change at line 94 skipping to change at line 117
#pragma mark StelModule Methods #pragma mark StelModule Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
void OcularDialog::languageChanged() void OcularDialog::languageChanged()
{ {
if (dialog) { if (dialog) {
ui->retranslateUi(dialog); ui->retranslateUi(dialog);
} }
} }
void OcularDialog::setStelStyle(const StelStyle& style) void OcularDialog::updateStyle()
{ {
if(dialog) { if(dialog) {
dialog->setStyleSheet(style.qtStyleSheet); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance()
.getGui());
Q_ASSERT(gui);
const StelStyle pluginStyle = GETSTELMODULE(Oculars)->getMod
uleStyleSheet(gui->getStelStyle());
dialog->setStyleSheet(pluginStyle.qtStyleSheet);
ui->textBrowser->document()->setDefaultStyleSheet(QString(pl
uginStyle.htmlStyleSheet));
} }
} }
void OcularDialog::styleChanged() void OcularDialog::styleChanged()
{ {
// Nothing for now // Nothing for now
} }
/* ********************************************************************* */ /* ********************************************************************* */
#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);
StelMainGraphicsView::getInstance().scene()->setActiveWindow(0); StelMainGraphicsView::getInstance().scene()->setActiveWindow(0);
} }
void OcularDialog::deleteSelectedCCD()
{
QModelIndex selection = ui->ccdListView->currentIndex();
if (selection.row() != -1 && CCDsTableModel->rowCount() > 1) {
CCDsTableModel->removeRows(selection.row(), 1);
ui->ccdListView->setCurrentIndex(CCDsTableModel->index(0, 1)
);
}
}
void OcularDialog::deleteSelectedOcular() void OcularDialog::deleteSelectedOcular()
{ {
QModelIndex selection = ui->ocularListView->currentIndex(); QModelIndex selection = ui->ocularListView->currentIndex();
if (selection.row() != -1 && ocularsTableModel->rowCount() > 1) { if (selection.row() != -1 && ocularsTableModel->rowCount() > 1) {
ocularsTableModel->removeRows(selection.row(), 1); ocularsTableModel->removeRows(selection.row(), 1);
ui->ocularListView->setCurrentIndex(ocularsTableModel->index (0, 1)); ui->ocularListView->setCurrentIndex(ocularsTableModel->index (0, 1));
} }
} }
void OcularDialog::deleteSelectedTelescope() void OcularDialog::deleteSelectedTelescope()
{ {
QModelIndex selection = ui->telescopeListView->currentIndex(); QModelIndex selection = ui->telescopeListView->currentIndex();
if (selection.row() != -1 && telescopesTableModel->rowCount() > 1) { if (selection.row() != -1 && telescopesTableModel->rowCount() > 1) {
telescopesTableModel->removeRows(selection.row(), 1); telescopesTableModel->removeRows(selection.row(), 1);
ui->telescopeListView->setCurrentIndex(telescopesTableModel- >index(0, 1)); ui->telescopeListView->setCurrentIndex(telescopesTableModel- >index(0, 1));
} }
} }
void OcularDialog::insertNewCCD()
{
QSqlField field1("name", QVariant::String);
QSqlField field2("resolution_x", QVariant::Int);
QSqlField field3("resolution_y", QVariant::Int);
QSqlField field4("chip_width", QVariant::Double);
QSqlField field5("chip_height", QVariant::Double);
QSqlField field6("pixel_width", QVariant::Double);
QSqlField field7("pixel_height", QVariant::Double);
field1.setValue(QVariant("New Sensor"));
field2.setValue(QVariant(4096));
field3.setValue(QVariant(4096));
field4.setValue(QVariant(36.8));
field5.setValue(QVariant(36.8));
field6.setValue(QVariant(9));
field7.setValue(QVariant(9));
QSqlRecord newRecord = QSqlRecord();
newRecord.append(field1);
newRecord.append(field2);
newRecord.append(field3);
newRecord.append(field4);
newRecord.append(field5);
newRecord.append(field6);
newRecord.append(field7);
if (CCDsTableModel->insertRecord(-1, newRecord)) {
ui->ccdListView->setCurrentIndex(CCDsTableModel->index(CCDsT
ableModel->rowCount() - 1, 1));
} else {
qWarning() << "Oculars: could not insert new sensor. The er
ror is: " << CCDsTableModel->lastError();
}
}
void OcularDialog::insertNewOcular() void OcularDialog::insertNewOcular()
{ {
QSqlField field1("name", QVariant::String); QSqlField field1("name", QVariant::String);
QSqlField field2("afov", QVariant::Double); QSqlField field2("afov", QVariant::Double);
QSqlField field3("efl", QVariant::Double); QSqlField field3("efl", QVariant::Double);
QSqlField field4("fieldStop", QVariant::Double); QSqlField field4("fieldStop", QVariant::Double);
field1.setValue(QVariant("New Ocular")); field1.setValue(QVariant("New Ocular"));
field2.setValue(QVariant(82)); field2.setValue(QVariant(82));
field3.setValue(QVariant(32)); field3.setValue(QVariant(32));
field4.setValue(QVariant(0)); field4.setValue(QVariant(0));
QSqlRecord newRecord = QSqlRecord(); QSqlRecord newRecord = QSqlRecord();
newRecord.append(field1); newRecord.append(field1);
newRecord.append(field2); newRecord.append(field2);
newRecord.append(field3); newRecord.append(field3);
newRecord.append(field4); newRecord.append(field4);
if (ocularsTableModel->insertRecord(-1, newRecord)) { if (ocularsTableModel->insertRecord(-1, newRecord)) {
ui->ocularListView->setCurrentIndex(ocularsTableModel->index (ocularsTableModel->rowCount() - 1, 1)); ui->ocularListView->setCurrentIndex(ocularsTableModel->index (ocularsTableModel->rowCount() - 1, 1));
} else { } else {
qWarning() << "Oculars: could not insert new ocular. The er ror is: " << ocularsTableModel->lastError(); qWarning() << "Oculars: could not insert new ocular. The er ror is: " << ocularsTableModel->lastError();
} }
} }
void OcularDialog::insertNewTelescope() void OcularDialog::insertNewTelescope()
{ {
QSqlField field1("name", QVariant::String); QSqlField field1("name", QVariant::String);
QSqlField field2("focalLength", QVariant::Double); QSqlField field2("focalLength", QVariant::Double);
QSqlField field3("diameter", QVariant::Double); QSqlField field3("diameter", QVariant::Double);
QSqlField field4("vFlip", QVariant::String); QSqlField field4("vFlip", QVariant::String);
QSqlField field5("hFlip", QVariant::String); QSqlField field5("hFlip", QVariant::String);
field1.setValue(QVariant("New Telescope")); field1.setValue(QVariant("New Telescope"));
field2.setValue(QVariant(500)); field2.setValue(QVariant(500));
field3.setValue(QVariant(80)); field3.setValue(QVariant(80));
field4.setValue(QVariant("false")); field4.setValue(QVariant("false"));
field5.setValue(QVariant("false")); field5.setValue(QVariant("false"));
QSqlRecord newRecord = QSqlRecord(); QSqlRecord newRecord = QSqlRecord();
newRecord.append(field1); newRecord.append(field1);
newRecord.append(field2); newRecord.append(field2);
newRecord.append(field3); newRecord.append(field3);
newRecord.append(field4); newRecord.append(field4);
newRecord.append(field5); newRecord.append(field5);
if (telescopesTableModel->insertRecord(-1, newRecord)) { if (telescopesTableModel->insertRecord(-1, newRecord)) {
ui->telescopeListView->setCurrentIndex(telescopesTableModel- >index(telescopesTableModel->rowCount() - 1, 1)); ui->telescopeListView->setCurrentIndex(telescopesTableModel- >index(telescopesTableModel->rowCount() - 1, 1));
} else { } else {
qWarning() << "Oculars: could not insert new telescope. The error is: " << telescopesTableModel->lastError(); qWarning() << "Oculars: could not insert new telescope. The error is: " << telescopesTableModel->lastError();
} }
} }
void OcularDialog::ocularSelected(const QModelIndex &index) void OcularDialog::CCDSelected(const QModelIndex &)
{
}
void OcularDialog::ocularSelected(const QModelIndex &)
{
}
void OcularDialog::telescopeSelected(const QModelIndex &)
{ {
} }
void OcularDialog::telescopeSelected(const QModelIndex &index) void OcularDialog::updateCCD()
{ {
int selectionIndex = ui->ccdListView->currentIndex().row();
if (CCDMapper->submit()) {
ui->ccdListView->setCurrentIndex(CCDsTableModel->index(selec
tionIndex, 1));
} else {
qWarning() << "Oculars: error saving modified sensor. Error
is: " << CCDsTableModel->lastError();
}
} }
void OcularDialog::updateOcular() void OcularDialog::updateOcular()
{ {
int selectionIndex = ui->ocularListView->currentIndex().row(); int selectionIndex = ui->ocularListView->currentIndex().row();
if (ocularMapper->submit()) { if (ocularMapper->submit()) {
ui->ocularListView->setCurrentIndex(ocularsTableModel->index (selectionIndex, 1)); ui->ocularListView->setCurrentIndex(ocularsTableModel->index (selectionIndex, 1));
} else { } else {
qWarning() << "Oculars: error saving modified ocular. Error is: " << ocularsTableModel->lastError(); qWarning() << "Oculars: error saving modified ocular. Error is: " << ocularsTableModel->lastError();
} }
skipping to change at line 246 skipping to change at line 327
#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);
//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->updateCCDButton, SIGNAL(clicked()), this, SLOT(updateCCD ()));
connect(ui->updateOcularButton, SIGNAL(clicked()), this, SLOT(update Ocular())); connect(ui->updateOcularButton, SIGNAL(clicked()), this, SLOT(update Ocular()));
connect(ui->updateTelescopeButton, SIGNAL(clicked()), this, SLOT(upd ateTelescope())); connect(ui->updateTelescopeButton, SIGNAL(clicked()), this, SLOT(upd ateTelescope()));
connect(ui->scaleImageCircleCheckBox, SIGNAL(stateChanged(int)), thi s, SLOT(scaleImageCircleStateChanged(int))); connect(ui->scaleImageCircleCheckBox, SIGNAL(stateChanged(int)), thi s, SLOT(scaleImageCircleStateChanged(int)));
// The add & delete buttons // The add & delete buttons
connect(ui->addCCD, SIGNAL(clicked()), this, SLOT(insertNewCCD()));
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->addTelescope, SIGNAL(clicked()), this, SLOT(insertNewTel escope())); connect(ui->addTelescope, SIGNAL(clicked()), this, SLOT(insertNewTel escope()));
connect(ui->deleteTelescope, SIGNAL(clicked()), this, SLOT(deleteSel ectedTelescope())); connect(ui->deleteTelescope, SIGNAL(clicked()), this, SLOT(deleteSel ectedTelescope()));
// Oculars model // Oculars model
ui->ccdListView->setModel(CCDsTableModel);
ui->ccdListView->setModelColumn(1);
connect(ui->ccdListView, SIGNAL(clicked(const QModelIndex &)), this,
SLOT(CCDSelected(const QModelIndex &)));
ui->ocularListView->setModel(ocularsTableModel); ui->ocularListView->setModel(ocularsTableModel);
ui->ocularListView->setModelColumn(1); ui->ocularListView->setModelColumn(1);
connect(ui->ocularListView, SIGNAL(clicked(const QModelIndex &)), th is, SLOT(ocularSelected(const QModelIndex &))); connect(ui->ocularListView, SIGNAL(clicked(const QModelIndex &)), th is, SLOT(ocularSelected(const QModelIndex &)));
ui->telescopeListView->setModel(telescopesTableModel); ui->telescopeListView->setModel(telescopesTableModel);
ui->telescopeListView->setModelColumn(1); ui->telescopeListView->setModelColumn(1);
connect(ui->telescopeListView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(telescopeSelected(const QModelIndex &))); connect(ui->telescopeListView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(telescopeSelected(const QModelIndex &)));
// Validators // Validators
ui->CCDName->setValidator(validatorName);
ui->CCDResX->setValidator(validatorPositiveInt);
ui->CCDResY->setValidator(validatorPositiveInt);
ui->CCDChipX->setValidator(validatorPositiveDouble);
ui->CCDChipY->setValidator(validatorPositiveDouble);
ui->CCDPixelX->setValidator(validatorPositiveDouble);
ui->CCDPixelY->setValidator(validatorPositiveDouble);
ui->ocularAFov->setValidator(validatorOcularAFOV); ui->ocularAFov->setValidator(validatorOcularAFOV);
ui->ocularFL->setValidator(validatorOcularEFL); ui->ocularFL->setValidator(validatorOcularEFL);
ui->ocularFieldStop->setValidator(validatorOcularEFL); ui->ocularFieldStop->setValidator(validatorOcularEFL);
ui->telescopeFL->setValidator(validatorTelescopeFL); ui->telescopeFL->setValidator(validatorTelescopeFL);
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 CCD mapper
CCDMapper = new QDataWidgetMapper();
CCDMapper->setModel(CCDsTableModel);
// CCDMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit);
CCDMapper->addMapping(ui->CCDID, CCDsTableModel->fieldIndex("id"), "
text");
CCDMapper->addMapping(ui->CCDName, CCDsTableModel->fieldIndex("name"
));
CCDMapper->addMapping(ui->CCDResX, CCDsTableModel->fieldIndex("resol
ution_x"));
CCDMapper->addMapping(ui->CCDResY, CCDsTableModel->fieldIndex("resol
ution_y"));
CCDMapper->addMapping(ui->CCDChipX, CCDsTableModel->fieldIndex("chip
_width"));
CCDMapper->addMapping(ui->CCDChipY, CCDsTableModel->fieldIndex("chip
_height"));
CCDMapper->addMapping(ui->CCDPixelX, CCDsTableModel->fieldIndex("pix
el_width"));
CCDMapper->addMapping(ui->CCDPixelY, CCDsTableModel->fieldIndex("pix
el_height"));
CCDMapper->toFirst();
connect(ui->ccdListView->selectionModel() , SIGNAL(currentRowChanged
(QModelIndex, QModelIndex)),
CCDMapper, SLOT(setCurrentModelIndex(QModelIndex)));
ui->ccdListView->setCurrentIndex(CCDsTableModel->index(0, 1));
// The ocular mapper // The ocular mapper
ocularMapper = new QDataWidgetMapper(); ocularMapper = new QDataWidgetMapper();
ocularMapper->setModel(ocularsTableModel); ocularMapper->setModel(ocularsTableModel);
// ocularMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit); // ocularMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit);
ocularMapper->addMapping(ui->ocularID, ocularsTableModel->fieldIndex ("id"), "text"); ocularMapper->addMapping(ui->ocularID, ocularsTableModel->fieldIndex ("id"), "text");
ocularMapper->addMapping(ui->ocularName, ocularsTableModel->fieldInd ex("name")); ocularMapper->addMapping(ui->ocularName, ocularsTableModel->fieldInd ex("name"));
ocularMapper->addMapping(ui->ocularAFov, ocularsTableModel->fieldInd ex("afov")); ocularMapper->addMapping(ui->ocularAFov, ocularsTableModel->fieldInd ex("afov"));
ocularMapper->addMapping(ui->ocularFL, ocularsTableModel->fieldIndex ("efl")); ocularMapper->addMapping(ui->ocularFL, ocularsTableModel->fieldIndex ("efl"));
ocularMapper->addMapping(ui->ocularFieldStop, ocularsTableModel->fie ldIndex("fieldStop")); ocularMapper->addMapping(ui->ocularFieldStop, ocularsTableModel->fie ldIndex("fieldStop"));
ocularMapper->toFirst(); ocularMapper->toFirst();
ui->ocularListView->setCurrentIndex(ocularsTableModel->index(0, 1));
connect(ui->ocularListView->selectionModel() , SIGNAL(currentRowChan ged(QModelIndex, QModelIndex)), connect(ui->ocularListView->selectionModel() , SIGNAL(currentRowChan ged(QModelIndex, QModelIndex)),
ocularMapper, SLOT(setCurrentModelIndex(QModelIndex) )); ocularMapper, SLOT(setCurrentModelIndex(QModelIndex) ));
ui->ocularListView->setCurrentIndex(ocularsTableModel->index(0, 1));
// The telescope mapper // The telescope mapper
telescopeMapper = new QDataWidgetMapper(); telescopeMapper = new QDataWidgetMapper();
telescopeMapper->setModel(telescopesTableModel); telescopeMapper->setModel(telescopesTableModel);
// telescopeMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit); // telescopeMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit);
telescopeMapper->addMapping(ui->telescopeID, telescopesTableModel->f ieldIndex("id"), "text"); telescopeMapper->addMapping(ui->telescopeID, telescopesTableModel->f ieldIndex("id"), "text");
telescopeMapper->addMapping(ui->telescopeName, telescopesTableModel- >fieldIndex("name")); telescopeMapper->addMapping(ui->telescopeName, telescopesTableModel- >fieldIndex("name"));
telescopeMapper->addMapping(ui->telescopeDiameter, telescopesTableMo del->fieldIndex("diameter")); telescopeMapper->addMapping(ui->telescopeDiameter, telescopesTableMo del->fieldIndex("diameter"));
telescopeMapper->addMapping(ui->telescopeFL, telescopesTableModel->f ieldIndex("focalLength")); telescopeMapper->addMapping(ui->telescopeFL, telescopesTableModel->f ieldIndex("focalLength"));
telescopeMapper->addMapping(ui->telescopeVFlip, telescopesTableModel ->fieldIndex("vFlip"), "checked"); telescopeMapper->addMapping(ui->telescopeVFlip, telescopesTableModel ->fieldIndex("vFlip"), "checked");
telescopeMapper->addMapping(ui->telescopeHFlip, telescopesTableModel ->fieldIndex("hFlip"), "checked"); telescopeMapper->addMapping(ui->telescopeHFlip, telescopesTableModel ->fieldIndex("hFlip"), "checked");
ocularMapper->toFirst(); ocularMapper->toFirst();
ui->telescopeListView->setCurrentIndex(telescopesTableModel->index(0 , 1));
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(setCurrentModelIndex(QModelInd ex)));
ui->telescopeListView->setCurrentIndex(telescopesTableModel->index(0 , 1));
// set the initial state // set the initial state
StelFileMgr::Flags flags = (StelFileMgr::Flags)(StelFileMgr::Directo ry|StelFileMgr::Writable); StelFileMgr::Flags flags = (StelFileMgr::Flags)(StelFileMgr::Directo ry|StelFileMgr::Writable);
QString ocularIniPath = StelFileMgr::findFile("modules/Oculars/", fl ags) + "ocular.ini"; QString ocularIniPath = StelFileMgr::findFile("modules/Oculars/", fl ags) + "ocular.ini";
QSettings settings(ocularIniPath, QSettings::IniFormat); QSettings settings(ocularIniPath, QSettings::IniFormat);
bool useMaxImageCircle = settings.value("use_max_exit_circle", false ).toBool(); bool useMaxImageCircle = settings.value("use_max_exit_circle", false ).toBool();
if (useMaxImageCircle) { if (useMaxImageCircle) {
ui->scaleImageCircleCheckBox->setCheckState(Qt::Checked); ui->scaleImageCircleCheckBox->setCheckState(Qt::Checked);
} }
//Initialize the style //Initialize the style
setStelStyle(*StelApp::getInstance().getCurrentStelStyle()); updateStyle();
} }
 End of changes. 28 change blocks. 
29 lines changed or deleted 162 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/