TelescopeConfigurationDialog.cpp   TelescopeConfigurationDialog.cpp 
/* /*
* Stellarium TelescopeControl Plug-in * Stellarium TelescopeControl Plug-in
* *
* Copyright (C) 2009 Bogdan Marinov (this file) * Copyright (C) 2009-2010 Bogdan Marinov (this file)
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* 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.
skipping to change at line 39 skipping to change at line 39
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelStyle.hpp" #include "StelStyle.hpp"
#include <QDebug> #include <QDebug>
#include <QCompleter> #include <QCompleter>
#include <QFrame> #include <QFrame>
#include <QTimer> #include <QTimer>
TelescopeConfigurationDialog::TelescopeConfigurationDialog() TelescopeConfigurationDialog::TelescopeConfigurationDialog()
{ {
ui = new Ui_telescopeConfigurationDialogForm; ui = new Ui_telescopeConfigurationDialog;
telescopeManager = GETSTELMODULE(TelescopeControl); telescopeManager = GETSTELMODULE(TelescopeControl);
tcpPortValidator = new QIntValidator(0, 65535, this);//AFAIK, this i s the port number range
telescopeNameValidator = new QRegExpValidator (QRegExp("[^:\"]+"), t his);//Test the update for JSON telescopeNameValidator = new QRegExpValidator (QRegExp("[^:\"]+"), t his);//Test the update for JSON
hostNameValidator = new QRegExpValidator (QRegExp("[a-zA-Z0-9\\-\\.] +"), this);//TODO: Write a proper host/IP regexp? hostNameValidator = new QRegExpValidator (QRegExp("[a-zA-Z0-9\\-\\.] +"), this);//TODO: Write a proper host/IP regexp?
circleListValidator = new QRegExpValidator (QRegExp("[0-9,\\.\\s]+") , this); circleListValidator = new QRegExpValidator (QRegExp("[0-9,\\.\\s]+") , this);
#ifdef WIN32 #ifdef Q_OS_WIN32
serialPortValidator = new QRegExpValidator (QRegExp("COM[0-9]+"), th is); serialPortValidator = new QRegExpValidator (QRegExp("COM[0-9]+"), th is);
#else #else
serialPortValidator = new QRegExpValidator (QRegExp("/dev/*"), this) ; serialPortValidator = new QRegExpValidator (QRegExp("/dev/.*"), this );
#endif #endif
} }
TelescopeConfigurationDialog::~TelescopeConfigurationDialog() TelescopeConfigurationDialog::~TelescopeConfigurationDialog()
{ {
delete ui; delete ui;
delete tcpPortValidator;
delete telescopeNameValidator; delete telescopeNameValidator;
delete hostNameValidator; delete hostNameValidator;
delete circleListValidator; delete circleListValidator;
delete serialPortValidator;
} }
void TelescopeConfigurationDialog::languageChanged() void TelescopeConfigurationDialog::languageChanged()
{ {
if (dialog) if (dialog)
ui->retranslateUi(dialog); ui->retranslateUi(dialog);
} }
// Initialize the dialog widgets and connect the signals/slots // Initialize the dialog widgets and connect the signals/slots
void TelescopeConfigurationDialog::createDialogContent() void TelescopeConfigurationDialog::createDialogContent()
{ {
ui->setupUi(dialog); ui->setupUi(dialog);
//Inherited connect //Inherited connect
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(buttonDis cardPressed())); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(buttonDis cardPressed()));
connect(dialog, SIGNAL(rejected()), this, SLOT(buttonDiscardPressed( ))); connect(dialog, SIGNAL(rejected()), this, SLOT(buttonDiscardPressed( )));
//Connect: sender, signal, receiver, member //Connect: sender, signal, receiver, member
connect(ui->checkBoxCircles, SIGNAL(stateChanged(int)), this, SLOT(t connect(ui->radioButtonTelescopeLocal, SIGNAL(toggled(bool)), this,
oggleCircles(int))); SLOT(toggleTypeLocal(bool)));
connect(ui->radioButtonTelescopeLocal, SIGNAL(toggled(bool)), this,
SLOT(toggleTypeServer(bool)));
connect(ui->radioButtonTelescopeConnection, SIGNAL(toggled(bool)), t his, SLOT(toggleTypeConnection(bool))); connect(ui->radioButtonTelescopeConnection, SIGNAL(toggled(bool)), t his, SLOT(toggleTypeConnection(bool)));
connect(ui->radioButtonTelescopeVirtual, SIGNAL(toggled(bool)), this , SLOT(toggleTypeVirtual(bool)));
connect(ui->pushButtonSave, SIGNAL(clicked()), this, SLOT(buttonSave Pressed())); connect(ui->pushButtonSave, SIGNAL(clicked()), this, SLOT(buttonSave Pressed()));
connect(ui->pushButtonDiscard, SIGNAL(clicked()), this, SLOT(buttonD iscardPressed())); connect(ui->pushButtonDiscard, SIGNAL(clicked()), this, SLOT(buttonD iscardPressed()));
connect(ui->comboBoxDeviceModel, SIGNAL(currentIndexChanged(const QS tring&)), this, SLOT(deviceModelSelected(const QString&))); connect(ui->comboBoxDeviceModel, SIGNAL(currentIndexChanged(const QS tring&)), this, SLOT(deviceModelSelected(const QString&)));
//Setting validators //Setting validators
ui->lineEditTCPPort->setValidator(tcpPortValidator);
ui->lineEditTelescopeName->setValidator(telescopeNameValidator); ui->lineEditTelescopeName->setValidator(telescopeNameValidator);
ui->lineEditHostName->setValidator(hostNameValidator); ui->lineEditHostName->setValidator(hostNameValidator);
ui->lineEditCircleList->setValidator(circleListValidator); ui->lineEditCircleList->setValidator(circleListValidator);
ui->lineEditSerialPort->setValidator(serialPortValidator);
ui->comboBoxSerialPort->completer()->setModelSorting(QCompleter::Cas
eSensitivelySortedModel);
//Initialize the style //Initialize the style
setStelStyle(*StelApp::getInstance().getCurrentStelStyle()); updateStyle();
} }
//Set the configuration panel in a predictable state //Set the configuration panel in a predictable state
//TODO: Rewrite this and/or put it somewhere else
// - All the "Type" radio buttons are enabled (none is selected)
// - The "Name" field is empty
// - The "Serial port" should be visible
// - The "Device Type" combo box should list the available servers
// - The "Host" field should be disabled but empty
// - The "FOV circles" checkbox should be unchecked
// - and the list of circles should be empty and disabled
void TelescopeConfigurationDialog::initConfigurationDialog() void TelescopeConfigurationDialog::initConfigurationDialog()
{ {
//Reusing code used in both methods that call this one //Reusing code used in both methods that call this one
deviceModelNames = telescopeManager->getDeviceModels().keys(); deviceModelNames = telescopeManager->getDeviceModels().keys();
//Type //Type
ui->radioButtonTelescopeLocal->setEnabled(true); ui->radioButtonTelescopeLocal->setEnabled(true);
ui->radioButtonTelescopeConnection->setEnabled(true);
//Name //Name
ui->lineEditTelescopeName->clear(); ui->lineEditTelescopeName->clear();
//Connect at startup
ui->checkBoxConnectAtStartup->setChecked(false);
//Serial port //Serial port
ui->comboBoxSerialPort->clear(); ui->lineEditSerialPort->clear();
ui->comboBoxSerialPort->addItems(SERIAL_PORT_NAMES); ui->lineEditSerialPort->setCompleter(new QCompleter(SERIAL_PORT_NAME
S, this));
ui->lineEditSerialPort->setText(SERIAL_PORT_NAMES.value(0));
//Populating the list of available servers //Populating the list of available devices
ui->labelDeviceModel->setVisible(true);
ui->labelDeviceModelDescription->setVisible(true);
ui->comboBoxDeviceModel->setVisible(true);
ui->comboBoxDeviceModel->clear(); ui->comboBoxDeviceModel->clear();
if (!deviceModelNames.isEmpty()) if (!deviceModelNames.isEmpty())
{ {
deviceModelNames.sort(); deviceModelNames.sort();
ui->comboBoxDeviceModel->addItems(deviceModelNames); ui->comboBoxDeviceModel->addItems(deviceModelNames);
} }
ui->comboBoxDeviceModel->setCurrentIndex(0); ui->comboBoxDeviceModel->setCurrentIndex(0);
//Host
ui->lineEditHostName->setEnabled(false);
ui->lineEditHostName->clear();
//TCP port (is this necessary?)
ui->lineEditTCPPort->clear();
//FOV circles //FOV circles
ui->checkBoxCircles->setChecked(false); ui->checkBoxCircles->setChecked(false);
ui->labelCircles->setEnabled(false);
ui->lineEditCircleList->setEnabled(false);
ui->lineEditCircleList->clear(); ui->lineEditCircleList->clear();
} }
void TelescopeConfigurationDialog::initNewTelescopeConfiguration(int slot) void TelescopeConfigurationDialog::initNewTelescopeConfiguration(int slot)
{ {
configuredSlot = slot; configuredSlot = slot;
initConfigurationDialog(); initConfigurationDialog();
ui->stelWindowTitle->setText("Add New Telescope"); ui->stelWindowTitle->setText("Add New Telescope");
ui->lineEditTelescopeName->setText(QString("New Telescope %1").arg(Q String::number(configuredSlot))); ui->lineEditTelescopeName->setText(QString("New Telescope %1").arg(Q String::number(configuredSlot)));
if(deviceModelNames.isEmpty()) if(deviceModelNames.isEmpty())
{ {
ui->radioButtonTelescopeLocal->setEnabled(false); ui->radioButtonTelescopeLocal->setEnabled(false);
ui->radioButtonTelescopeConnection->setChecked(true); ui->radioButtonTelescopeConnection->setChecked(true);
toggleTypeConnection(true);//Reusing code, may cause problem s toggleTypeConnection(true);//Not called if the button is alr eady checked
} }
else else
{ {
ui->radioButtonTelescopeLocal->setEnabled(true); ui->radioButtonTelescopeLocal->setEnabled(true);
ui->radioButtonTelescopeLocal->setChecked(true); ui->radioButtonTelescopeLocal->setChecked(true);
toggleTypeServer(true);//Reusing code, may cause problems toggleTypeLocal(true);//Not called if the button is already checked
} }
ui->doubleSpinBoxTelescopeDelay->setValue(SECONDS_FROM_MICROSECONDS( DEFAULT_DELAY)); ui->doubleSpinBoxTelescopeDelay->setValue(SECONDS_FROM_MICROSECONDS( DEFAULT_DELAY));
} }
void TelescopeConfigurationDialog::initExistingTelescopeConfiguration(int s lot) void TelescopeConfigurationDialog::initExistingTelescopeConfiguration(int s lot)
{ {
configuredSlot = slot; configuredSlot = slot;
initConfigurationDialog(); initConfigurationDialog();
ui->stelWindowTitle->setText("Configure Telescope"); ui->stelWindowTitle->setText("Configure Telescope");
//Read the telescope properties //Read the telescope properties
QString name; QString name;
ConnectionType connectionType;
QString host; QString host;
int portTCP; int portTCP;
int delay; int delay;
bool connectAtStartup; bool connectAtStartup;
QList<double> circles; QList<double> circles;
QString deviceModelName; QString deviceModelName;
QString serialPortName; QString serialPortName;
if(!telescopeManager->getTelescopeAtSlot(slot, name, host, portTCP, delay, connectAtStartup, circles, deviceModelName, serialPortName)) if(!telescopeManager->getTelescopeAtSlot(slot, connectionType, name, host, portTCP, delay, connectAtStartup, circles, deviceModelName, serialPo rtName))
{ {
//TODO: Add debug //TODO: Add debug
return; return;
} }
ui->lineEditTelescopeName->setText(name); ui->lineEditTelescopeName->setText(name);
if(!deviceModelName.isEmpty()) if(!deviceModelName.isEmpty())
{ {
ui->radioButtonTelescopeLocal->setChecked(true); ui->radioButtonTelescopeLocal->setChecked(true);
//ui->radioButtonTelescopeConnection->setEnabled(false);
ui->lineEditHostName->setText("localhost");//TODO: Remove ma gic word! ui->lineEditHostName->setText("localhost");//TODO: Remove ma gic word!
//Make the current device model selected in the list //Make the current device model selected in the list
int index = ui->comboBoxDeviceModel->findText(deviceModelNam e); int index = ui->comboBoxDeviceModel->findText(deviceModelNam e);
if(index < 0) if(index < 0)
{ {
qDebug() << "TelescopeConfigurationDialog: Current d evice model is not in the list?"; qDebug() << "TelescopeConfigurationDialog: Current d evice model is not in the list?";
emit discardChanges(); emit changesDiscarded();
return; return;
} }
else else
{ {
ui->comboBoxDeviceModel->setCurrentIndex(index); ui->comboBoxDeviceModel->setCurrentIndex(index);
} }
//Initialize the serial port value //Initialize the serial port value
index = ui->comboBoxSerialPort->findText(serialPortName); ui->lineEditSerialPort->setText(serialPortName);
if(index < 0)
{
//If the serial port's name is not in the list, add
it and make it selected
ui->comboBoxSerialPort->insertItem(0, serialPortName
);
ui->comboBoxSerialPort->setCurrentIndex(0);
qDebug() << "TelescopeConfigurationDialog: Adding to
serial port list:" << serialPortName;
}
else
ui->comboBoxSerialPort->setCurrentIndex(index);
} }
else //Local or remote connection else //Local or remote connection
{ {
//ui->radioButtonTelescopeLocal->setEnabled(false); ui->radioButtonTelescopeConnection->setChecked(true);//Calls
//ui->radioButtonTelescopeConnection->setEnabled(false); toggleTypeConnection(true)
ui->radioButtonTelescopeConnection->setChecked(true); if (connectionType == ConnectionRemote)
ui->lineEditHostName->setText(host);
ui->toolBoxSettings->setItemEnabled(ui->toolBoxSettings->ind
exOf(ui->pageDeviceSettings), false);
ui->labelHost->setEnabled(true);
ui->lineEditHostName->setText(host);
ui->lineEditHostName->setEnabled(true);
} }
//Circles //Circles
if(!circles.isEmpty()) if(!circles.isEmpty())
{ {
ui->checkBoxCircles->setChecked(true); ui->checkBoxCircles->setChecked(true);
ui->labelCircles->setEnabled(true);
ui->lineEditCircleList->setEnabled(true);
QStringList circleList; QStringList circleList;
for(int i = 0; i < circles.size(); i++) for(int i = 0; i < circles.size(); i++)
circleList.append(QString::number(circles[i])); circleList.append(QString::number(circles[i]));
ui->lineEditCircleList->setText(circleList.join(", ")); ui->lineEditCircleList->setText(circleList.join(", "));
} }
//TCP port //TCP port
ui->lineEditTCPPort->setText(QString::number(portTCP)); ui->spinBoxTCPPort->setValue(portTCP);
//Delay //Delay
ui->doubleSpinBoxTelescopeDelay->setValue(SECONDS_FROM_MICROSECONDS( delay));//Microseconds to seconds ui->doubleSpinBoxTelescopeDelay->setValue(SECONDS_FROM_MICROSECONDS( delay));//Microseconds to seconds
//Connect at startup //Connect at startup
ui->checkBoxConnectAtStartup->setChecked(connectAtStartup); ui->checkBoxConnectAtStartup->setChecked(connectAtStartup);
} }
void TelescopeConfigurationDialog::toggleTypeServer(bool isChecked) void TelescopeConfigurationDialog::toggleTypeLocal(bool isChecked)
{ {
if(isChecked) if(isChecked)
{ {
//Re-initialize values that may have been changed
ui->comboBoxDeviceModel->setCurrentIndex(0);
ui->lineEditSerialPort->setText(SERIAL_PORT_NAMES.value(0));
ui->lineEditHostName->setText("localhost");
ui->spinBoxTCPPort->setValue(DEFAULT_TCP_PORT_FOR_SLOT(confi
guredSlot));
//Enable/disable controls
ui->labelHost->setEnabled(false); ui->labelHost->setEnabled(false);
ui->lineEditHostName->setEnabled(false); ui->lineEditHostName->setEnabled(false);
ui->lineEditHostName->setText("localhost");
ui->toolBoxSettings->setItemEnabled(ui->toolBoxSettings->ind ui->toolBoxSettings->setCurrentIndex(ui->toolBoxSettings->in
exOf(ui->pageDeviceSettings), true); dexOf(ui->pageTelescopeProperties));
ui->toolBoxSettings->setCurrentIndex(ui->toolBoxSettings->in }
dexOf(ui->pageDeviceSettings)); else
ui->comboBoxDeviceModel->setCurrentIndex(0);//Topmost device {
ui->lineEditTCPPort->setText(QString::number(DEFAULT_TCP_POR ui->labelHost->setEnabled(true);
T_FOR_SLOT(configuredSlot))); ui->lineEditHostName->setEnabled(true);
} }
} }
void TelescopeConfigurationDialog::toggleTypeConnection(bool isChecked) void TelescopeConfigurationDialog::toggleTypeConnection(bool isChecked)
{ {
if(isChecked) if(isChecked)
{ {
ui->labelHost->setEnabled(true); //Re-initialize values that may have been changed
ui->lineEditHostName->setEnabled(true);
ui->lineEditHostName->setText("localhost"); ui->lineEditHostName->setText("localhost");
ui->spinBoxTCPPort->setValue(DEFAULT_TCP_PORT_FOR_SLOT(confi
guredSlot));
ui->toolBoxSettings->setItemEnabled(ui->toolBoxSettings->ind exOf(ui->pageDeviceSettings), false); ui->toolBoxSettings->setItemEnabled(ui->toolBoxSettings->ind exOf(ui->pageDeviceSettings), false);
ui->lineEditTCPPort->setText(QString::number(DEFAULT_TCP_POR
T_FOR_SLOT(configuredSlot))); ui->toolBoxSettings->setCurrentIndex(ui->toolBoxSettings->in
dexOf(ui->pageTelescopeProperties));
}
else
{
ui->toolBoxSettings->setItemEnabled(ui->toolBoxSettings->ind
exOf(ui->pageDeviceSettings), true);
} }
} }
void TelescopeConfigurationDialog::toggleCircles(int state) void TelescopeConfigurationDialog::toggleTypeVirtual(bool isChecked)
{ {
if(state == Qt::Checked) if(isChecked)
{ {
ui->labelCircles->setEnabled(true); ui->toolBoxSettings->setItemEnabled(ui->toolBoxSettings->ind
ui->lineEditCircleList->setEnabled(true); exOf(ui->pageDeviceSettings), false);
ui->lineEditCircleList->setFocus(); ui->toolBoxSettings->setItemEnabled(ui->toolBoxSettings->ind
exOf(ui->pageConnectionSettings), false);
ui->toolBoxSettings->setCurrentIndex(ui->toolBoxSettings->in
dexOf(ui->pageTelescopeProperties));
} }
else else
{ {
ui->labelCircles->setEnabled(false); ui->toolBoxSettings->setItemEnabled(ui->toolBoxSettings->ind
ui->lineEditCircleList->clear(); exOf(ui->pageDeviceSettings), true);
ui->lineEditCircleList->setEnabled(false); ui->toolBoxSettings->setItemEnabled(ui->toolBoxSettings->ind
exOf(ui->pageConnectionSettings), true);
} }
} }
void TelescopeConfigurationDialog::buttonSavePressed() void TelescopeConfigurationDialog::buttonSavePressed()
{ {
//Main telescope properties //Main telescope properties
QString name = ui->lineEditTelescopeName->text().trimmed(); QString name = ui->lineEditTelescopeName->text().trimmed();
if(name.isEmpty()) if(name.isEmpty())
return; return;
QString host = ui->lineEditHostName->text(); QString host = ui->lineEditHostName->text();
if(host.isEmpty())//TODO: Validate host if(host.isEmpty())//TODO: Validate host
return; return;
int delay = MICROSECONDS_FROM_SECONDS(ui->doubleSpinBoxTelescopeDela y->value()); int delay = MICROSECONDS_FROM_SECONDS(ui->doubleSpinBoxTelescopeDela y->value());
int portTCP = ui->lineEditTCPPort->text().toInt(); int portTCP = ui->spinBoxTCPPort->value();
bool connectAtStartup = ui->checkBoxConnectAtStartup->isChecked(); bool connectAtStartup = ui->checkBoxConnectAtStartup->isChecked();
//Circles //Circles
//TODO: This will change if there is a validator for that field //TODO: This will change if there is a validator for that field
QList<double> circles; QList<double> circles;
QString rawCircles = ui->lineEditCircleList->text().trimmed(); QString rawCircles = ui->lineEditCircleList->text().trimmed();
QStringList circleStrings; QStringList circleStrings;
if(ui->checkBoxCircles->isChecked() && !(rawCircles.isEmpty())) if(ui->checkBoxCircles->isChecked() && !(rawCircles.isEmpty()))
{ {
circleStrings = rawCircles.simplified().remove(' ').split(', ', QString::SkipEmptyParts); circleStrings = rawCircles.simplified().remove(' ').split(', ', QString::SkipEmptyParts);
skipping to change at line 344 skipping to change at line 322
if(i >= MAX_CIRCLE_COUNT) if(i >= MAX_CIRCLE_COUNT)
break; break;
double circle = circleStrings.at(i).toDouble(); double circle = circleStrings.at(i).toDouble();
if(circle > 0.0) if(circle > 0.0)
circles.append(circle); circles.append(circle);
} }
} }
//Type and server properties //Type and server properties
//TODO: When adding, check for success! //TODO: When adding, check for success!
TelescopeConnection type = ConnectionNA; ConnectionType type = ConnectionNA;
if(ui->radioButtonTelescopeLocal->isChecked()) if(ui->radioButtonTelescopeLocal->isChecked())
{ {
//Read the serial port //Read the serial port
QString serialPortName = ui->comboBoxSerialPort->currentText (); QString serialPortName = ui->lineEditSerialPort->text();
if(!serialPortName.startsWith(SERIAL_PORT_PREFIX)) if(!serialPortName.startsWith(SERIAL_PORT_PREFIX))
return;//TODO: Add more validation! return;//TODO: Add more validation!
type = ConnectionLocalInternal; type = ConnectionInternal;
telescopeManager->addTelescopeAtSlot(configuredSlot, name, h telescopeManager->addTelescopeAtSlot(configuredSlot, type, n
ost, portTCP, delay, connectAtStartup, circles, ui->comboBoxDeviceModel->cu ame, host, portTCP, delay, connectAtStartup, circles, ui->comboBoxDeviceMod
rrentText(), serialPortName); el->currentText(), serialPortName);
} }
else if (ui->radioButtonTelescopeConnection->isChecked()) else if (ui->radioButtonTelescopeConnection->isChecked())
{ {
if(host == "localhost") if(host == "localhost")
type = ConnectionLocalExternal; type = ConnectionLocal;
else else
type = ConnectionRemote; type = ConnectionRemote;
telescopeManager->addTelescopeAtSlot(configuredSlot, name, h telescopeManager->addTelescopeAtSlot(configuredSlot, type, n
ost, portTCP, delay, connectAtStartup, circles); ame, host, portTCP, delay, connectAtStartup, circles);
}
else if (ui->radioButtonTelescopeVirtual->isChecked())
{
type = ConnectionVirtual;
telescopeManager->addTelescopeAtSlot(configuredSlot, type, n
ame, QString(), portTCP, delay, connectAtStartup, circles);
} }
emit saveChanges(name, type); emit changesSaved(name, type);
} }
void TelescopeConfigurationDialog::buttonDiscardPressed() void TelescopeConfigurationDialog::buttonDiscardPressed()
{ {
emit discardChanges(); emit changesDiscarded();
} }
void TelescopeConfigurationDialog::deviceModelSelected(const QString& devic eModelName) void TelescopeConfigurationDialog::deviceModelSelected(const QString& devic eModelName)
{ {
ui->labelDeviceModelDescription->setText(telescopeManager->getDevice Models().value(deviceModelName).description); ui->labelDeviceModelDescription->setText(telescopeManager->getDevice Models().value(deviceModelName).description);
ui->doubleSpinBoxTelescopeDelay->setValue(SECONDS_FROM_MICROSECONDS( telescopeManager->getDeviceModels().value(deviceModelName).defaultDelay)); ui->doubleSpinBoxTelescopeDelay->setValue(SECONDS_FROM_MICROSECONDS( telescopeManager->getDeviceModels().value(deviceModelName).defaultDelay));
} }
void TelescopeConfigurationDialog::setStelStyle(const StelStyle& style) void TelescopeConfigurationDialog::updateStyle()
{ {
if(dialog) if (dialog)
dialog->setStyleSheet(telescopeManager->getModuleStyleSheet( {
style.confSectionName)); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance()
.getGui());
Q_ASSERT(gui);
dialog->setStyleSheet(telescopeManager->getModuleStyleSheet(
gui->getStelStyle()).qtStyleSheet);
}
} }
 End of changes. 49 change blocks. 
107 lines changed or deleted 98 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/