CntServiceEditView::CntServiceEditView( CntAbstractServiceProvider& aServiceProvider ) : CntEditView(), mProvider( aServiceProvider ) { connect( this, SIGNAL(contactUpdated(int)), this, SLOT(doContactUpdated(int)) ); connect( this, SIGNAL(contactRemoved(bool)), this, SLOT(doContactRemoved(bool)) ); connect( this, SIGNAL(changesDiscarded()), this, SLOT(doChangesDiscarded()) ); }
void TelescopeConfigurationDialog::buttonDiscardPressed() { emit changesDiscarded(); }
void TelescopeConfigurationDialog::initExistingTelescopeConfiguration(int slot) { configuredSlot = slot; initConfigurationDialog(); ui->stelWindowTitle->setText(q_("Configure Telescope")); //Read the telescope properties QString name; ConnectionType connectionType; QString equinox; QString host; int portTCP; int delay; bool connectAtStartup; QList<double> circles; QString deviceModelName; QString serialPortName; if(!telescopeManager->getTelescopeAtSlot(slot, connectionType, name, equinox, host, portTCP, delay, connectAtStartup, circles, deviceModelName, serialPortName)) { //TODO: Add debug return; } ui->lineEditTelescopeName->setText(name); if(!deviceModelName.isEmpty()) { ui->radioButtonTelescopeLocal->setChecked(true); ui->lineEditHostName->setText("localhost");//TODO: Remove magic word! //Make the current device model selected in the list int index = ui->comboBoxDeviceModel->findText(deviceModelName); if(index < 0) { qDebug() << "TelescopeConfigurationDialog: Current device model is not in the list?"; emit changesDiscarded(); return; } else { ui->comboBoxDeviceModel->setCurrentIndex(index); } //Initialize the serial port value ui->lineEditSerialPort->setText(serialPortName); } else if (connectionType == ConnectionRemote) { ui->radioButtonTelescopeConnection->setChecked(true);//Calls toggleTypeConnection(true) ui->lineEditHostName->setText(host); } else if (connectionType == ConnectionLocal) { ui->radioButtonTelescopeConnection->setChecked(true); ui->lineEditHostName->setText("localhost"); } else { ui->radioButtonTelescopeVirtual->setChecked(true); } //Equinox if (equinox == "JNow") ui->radioButtonJNow->setChecked(true); else ui->radioButtonJ2000->setChecked(true); //Circles if(!circles.isEmpty()) { ui->checkBoxCircles->setChecked(true); QStringList circleList; for(int i = 0; i < circles.size(); i++) circleList.append(QString::number(circles[i])); ui->lineEditCircleList->setText(circleList.join(", ")); } //TCP port ui->spinBoxTCPPort->setValue(portTCP); //Delay ui->doubleSpinBoxTelescopeDelay->setValue(SECONDS_FROM_MICROSECONDS(delay));//Microseconds to seconds //Connect at startup ui->checkBoxConnectAtStartup->setChecked(connectAtStartup); }