void SolarSystemManagerWindow::createDialogContent() { ui->setupUi(dialog); #ifdef Q_OS_WIN //Kinetic scrolling for tablet pc and pc QList<QWidget *> addscroll; addscroll << ui->listWidgetObjects; installKineticScrolling(addscroll); #endif //Signals connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint))); connect(ui->pushButtonCopyFile, SIGNAL(clicked()), this, SLOT(copyConfiguration())); connect(ui->pushButtonReplaceFile, SIGNAL(clicked()), this, SLOT(replaceConfiguration())); connect(ui->pushButtonRemove, SIGNAL(clicked()), this, SLOT(removeObject())); connect(ui->pushButtonImportMPC, SIGNAL(clicked()), this, SLOT(newImportMPC())); //connect(ui->pushButtonManual, SIGNAL(clicked()), this, SLOT(newImportManual())); connect(ssoManager, SIGNAL(solarSystemChanged()), this, SLOT(populateSolarSystemList())); connect(ui->pushButtonReset, SIGNAL(clicked()), ssoManager, SLOT(resetSolarSystemToDefault())); // bug #1350669 (https://bugs.launchpad.net/stellarium/+bug/1350669) connect(ui->listWidgetObjects, SIGNAL(currentRowChanged(int)), ui->listWidgetObjects, SLOT(repaint())); updateTexts(); Q_ASSERT(mpcImportWindow); //Rebuild the list if any planets have been imported connect(mpcImportWindow, SIGNAL(objectsImported()), this, SLOT(populateSolarSystemList())); ui->lineEditUserFilePath->setText(ssoManager->getCustomSolarSystemFilePath()); populateSolarSystemList(); }
struct Configuration * getNewConfigurationFromSetup(struct Context *context) { struct Configuration *newconfig; double tmpvalue; newconfig = copyConfiguration(context->config); sprintf(newconfig->file, "%s", gtk_entry_get_text(GTK_ENTRY (file_entry))); tmpvalue = gtk_spin_button_get_value(GTK_SPIN_BUTTON (xspinner)); if (tmpvalue > 0.0 || tmpvalue < 0.0) { newconfig->xmin = tmpvalue; } tmpvalue = gtk_spin_button_get_value(GTK_SPIN_BUTTON (x2spinner)); if (tmpvalue > 0.0 || tmpvalue < 0.0) { newconfig->xmax = tmpvalue; } tmpvalue = gtk_spin_button_get_value(GTK_SPIN_BUTTON (yspinner)); if (tmpvalue > 0.0 || tmpvalue < 0.0) { newconfig->ymin = tmpvalue; } tmpvalue = gtk_spin_button_get_value(GTK_SPIN_BUTTON (y2spinner)); if (tmpvalue > 0.0 || tmpvalue < 0.0) { newconfig->ymax = tmpvalue; } tmpvalue = gtk_spin_button_get_value(GTK_SPIN_BUTTON (zspinner)); if (tmpvalue > 0.0 || tmpvalue < 0.0) { newconfig->zmin = tmpvalue; } tmpvalue = gtk_spin_button_get_value(GTK_SPIN_BUTTON (z2spinner)); if (tmpvalue > 0.0 || tmpvalue < 0.0) { newconfig->zmax = tmpvalue; } tmpvalue = gtk_spin_button_get_value(GTK_SPIN_BUTTON (cubespinner)); if (tmpvalue > 0.0) { if (newconfig->xmin == 65535.0) { newconfig->xmin = -tmpvalue; newconfig->xmax = tmpvalue; } if (newconfig->ymin == 65535.0) { newconfig->ymin = -tmpvalue; newconfig->ymax = tmpvalue; } if (newconfig->zmin == 65535.0) { newconfig->zmin = -tmpvalue; newconfig->zmax = tmpvalue; } } newconfig->radius = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON (dspinner)); newconfig->xcolumn = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON (xcspinner)); newconfig->ycolumn = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON (ycspinner)); newconfig->zcolumn = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON (zcspinner)); newconfig->tcolumn = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON (tcspinner)); newconfig->absxsize = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON (ssxspinner)); newconfig->absysize = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON (ssyspinner)); tmpvalue = 1000.0 * gtk_spin_button_get_value(GTK_SPIN_BUTTON (sleepspinner)); if (tmpvalue < MININTERVAL) newconfig->interval = MININTERVAL; else newconfig->interval = (gint) tmpvalue; if (usescol) { sprintf(newconfig->fstring, "%s", gtk_entry_get_text(GTK_ENTRY (scol_entry))); newconfig->scol = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON (scolspinner)); } else { newconfig->scol = 0; } if (usedump) { sprintf(newconfig->dumpname, "%s", gtk_entry_get_text(GTK_ENTRY (dump_entry))); } else { *(newconfig->dumpname) = '\0'; } sprintf(newconfig->timedelim, "%s", gtk_entry_get_text(GTK_ENTRY (timedel_entry))); newconfig->inputFormatXYZ = setupConfig.inputFormatXYZ; newconfig->mode = setupConfig.mode; newconfig->vary = setupConfig.vary; newconfig->colorset = setupConfig.colorset; newconfig->erasePreviousFrame = setupConfig.erasePreviousFrame; newconfig->backgroundWhite = setupConfig.backgroundWhite; newconfig->dumpnum = setupConfig.dumpnum; newconfig->sort = setupConfig.sort; newconfig->tifjpg = setupConfig.tifjpg; newconfig->useTypesForColoring = setupConfig.useTypesForColoring; return newconfig; }