modCalcVlsr::modCalcVlsr(QWidget *parentSplit) : QFrame(parentSplit), velocityFlag(0) { setupUi(this); RA->setDegType(false); Date->setDateTime( KStarsDateTime::currentDateTime().dateTime() ); initGeo(); VLSR->setValidator( new QDoubleValidator( VLSR ) ); VHelio->setValidator( new QDoubleValidator( VHelio ) ); VGeo->setValidator( new QDoubleValidator( VGeo ) ); VTopo->setValidator( new QDoubleValidator( VTopo ) ); // signals and slots connections connect(Date, SIGNAL( dateTimeChanged( const QDateTime & ) ), this, SLOT( slotCompute() ) ); connect(NowButton, SIGNAL( clicked() ), this, SLOT( slotNow() ) ); connect(LocationButton, SIGNAL( clicked() ), this, SLOT( slotLocation() ) ); connect(ObjectButton, SIGNAL( clicked() ), this, SLOT( slotFindObject() ) ); connect(RA, SIGNAL( editingFinished() ), this, SLOT( slotCompute() ) ); connect(Dec, SIGNAL( editingFinished() ), this, SLOT( slotCompute() ) ); connect(VLSR, SIGNAL( editingFinished() ), this, SLOT( slotCompute() ) ); connect(VHelio, SIGNAL( editingFinished() ), this, SLOT( slotCompute() ) ); connect(VGeo, SIGNAL( editingFinished() ), this, SLOT( slotCompute() ) ); connect(VTopo, SIGNAL( editingFinished() ), this, SLOT( slotCompute() ) ); connect(RunButtonBatch, SIGNAL(clicked()), this, SLOT(slotRunBatch())); show(); }
ConjunctionsTool::ConjunctionsTool(QWidget *parentSplit) : QFrame(parentSplit), Object1( 0 ), Object2( 0 ) { setupUi(this); KStarsData *kd = KStarsData::Instance(); KStarsDateTime dtStart ( KStarsDateTime::currentDateTime() ); KStarsDateTime dtStop ( dtStart.djd() + 365.24 ); // TODO: Refine //startDate -> setDateTime( dtStart.dateTime() ); //stopDate -> setDateTime( dtStop.dateTime() ); //TODO Check if this change works startDate -> setDateTime( dtStart ); stopDate -> setDateTime( dtStop ); geoPlace = kd -> geo(); LocationButton -> setText( geoPlace -> fullName() ); // Init filter type combobox FilterTypeComboBox->addItem( i18n ("Single Object...") ); FilterTypeComboBox->addItem( i18n ("Any") ); FilterTypeComboBox->addItem( i18n ("Stars") ); FilterTypeComboBox->addItem( i18n ("Solar System") ); FilterTypeComboBox->addItem( i18n ("Planets") ); FilterTypeComboBox->addItem( i18n ("Comets") ); FilterTypeComboBox->addItem( i18n ("Asteroids") ); FilterTypeComboBox->addItem( i18n ("Open Clusters") ); FilterTypeComboBox->addItem( i18n ("Globular Clusters") ); FilterTypeComboBox->addItem( i18n ("Gaseous Nebulae") ); FilterTypeComboBox->addItem( i18n ("Planetary Nebulae") ); FilterTypeComboBox->addItem( i18n ("Galaxies") ); pNames[KSPlanetBase::MERCURY] = i18n("Mercury"); pNames[KSPlanetBase::VENUS] = i18n("Venus"); pNames[KSPlanetBase::MARS] = i18n("Mars"); pNames[KSPlanetBase::JUPITER] = i18n("Jupiter"); pNames[KSPlanetBase::SATURN] = i18n("Saturn"); pNames[KSPlanetBase::URANUS] = i18n("Uranus"); pNames[KSPlanetBase::NEPTUNE] = i18n("Neptune"); //pNames[KSPlanetBase::PLUTO] = i18n("Pluto"); pNames[KSPlanetBase::SUN] = i18n("Sun"); pNames[KSPlanetBase::MOON] = i18n("Moon"); for ( int i=0; i<KSPlanetBase::UNKNOWN_PLANET; ++i ) { // Obj1ComboBox->insertItem( i, pNames[i] ); Obj2ComboBox->insertItem( i, pNames[i] ); } // Initialize the Maximum Separation box to 1 degree maxSeparationBox->setDegType( true ); maxSeparationBox->setDMS( "01 00 00.0" ); //Set up the Table Views m_Model = new QStandardItemModel( 0, 5, this ); m_Model->setHorizontalHeaderLabels( QStringList() << i18n( "Conjunction/Opposition" ) << i18n( "Date & Time (UT)" ) << i18n( "Object 1" ) << i18n( "Object 2" ) << i18n( "Separation" ) ); m_SortModel = new QSortFilterProxyModel( this ); m_SortModel->setSourceModel( m_Model ); OutputList->setModel( m_SortModel ); OutputList->setSortingEnabled(true); OutputList->horizontalHeader()->setStretchLastSection( true ); OutputList->horizontalHeader()->setSectionResizeMode( QHeaderView::Interactive ); OutputList->horizontalHeader()->resizeSection(2, 100); OutputList->horizontalHeader()->resizeSection(3, 100); OutputList->horizontalHeader()->resizeSection(4, 120); //is it bad way to fix default size of columns ? //FilterEdit->showClearButton = true; ClearFilterButton->setIcon( QIcon::fromTheme( "edit-clear" , QIcon(":/icons/breeze/default/edit-clear.svg") ) ); m_index = 0; // signals and slots connections connect(LocationButton, SIGNAL(clicked()), this, SLOT(slotLocation())); connect(Obj1FindButton, SIGNAL(clicked()), this, SLOT(slotFindObject())); connect(ComputeButton, SIGNAL(clicked()), this, SLOT(slotCompute())); connect( FilterTypeComboBox, SIGNAL( currentIndexChanged(int) ), SLOT( slotFilterType(int) ) ); connect( ClearButton, SIGNAL( clicked() ), this, SLOT( slotClear() ) ); connect( ExportButton, SIGNAL( clicked() ), this, SLOT( slotExport() ) ); connect( OutputList, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( slotGoto() ) ); connect( ClearFilterButton, SIGNAL( clicked() ), FilterEdit, SLOT( clear() ) ); connect( FilterEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( slotFilterReg( const QString & ) ) ); show(); }