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(); }
modCalcAltAz::modCalcAltAz(QWidget *parentSplit) : QFrame(parentSplit) { setupUi(this); KStarsData *data = KStarsData::Instance(); RA->setDegType(false); //Initialize Date/Time and Location data geoPlace = data->geo(); LocationButton->setText( geoPlace->fullName() ); //Make sure slotDateTime() gets called, so that LST will be set connect(DateTime, SIGNAL(dateTimeChanged(const QDateTime&)), this, SLOT(slotDateTimeChanged(const QDateTime&))); DateTime->setDateTime( data->lt().dateTime() ); connect(NowButton, SIGNAL(clicked()), this, SLOT(slotNow())); connect(LocationButton, SIGNAL(clicked()), this, SLOT(slotLocation())); connect(ObjectButton, SIGNAL(clicked()), this, SLOT(slotObject())); connect(RA, SIGNAL(editingFinished()), this, SLOT(slotCompute())); connect(Dec, SIGNAL(editingFinished()), this, SLOT(slotCompute())); connect(Az, SIGNAL(editingFinished()), this, SLOT(slotCompute())); connect(Alt, SIGNAL(editingFinished()), this, SLOT(slotCompute())); show(); }
modCalcDayLength::modCalcDayLength(QWidget *parentSplit) : QFrame(parentSplit) { setupUi(this); showCurrentDate(); initGeo(); slotComputeAlmanac(); connect( Date, SIGNAL(dateChanged(const QDate&)), this, SLOT(slotComputeAlmanac() ) ); connect( Location, SIGNAL( clicked() ), this, SLOT( slotLocation() ) ); connect( LocationBatch, SIGNAL( clicked() ), this, SLOT( slotLocationBatch() ) ); connect( InputFileBatch, SIGNAL(urlSelected(const QUrl&)), this, SLOT(slotCheckFiles()) ); connect( OutputFileBatch, SIGNAL(urlSelected(const QUrl&)), this, SLOT(slotCheckFiles()) ); connect( RunButtonBatch, SIGNAL(clicked()), this, SLOT(slotRunBatch()) ); connect( ViewButtonBatch, SIGNAL(clicked()), this, SLOT(slotViewBatch()) ); RunButtonBatch->setEnabled( false ); ViewButtonBatch->setEnabled( false ); show(); }
Execute::Execute() { QWidget *w = new QWidget; ui.setupUi( w ); #ifdef Q_OS_OSX setWindowFlags(Qt::Tool| Qt::WindowStaysOnTopHint); #endif QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(w); setLayout(mainLayout); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); mainLayout->addWidget(buttonBox); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); QPushButton *execB = new QPushButton(i18n("End Session")); QPushButton *addObs = new QPushButton(i18n("Manage Observers")); execB->setToolTip(i18n("Save and End the current session")); buttonBox->addButton(execB, QDialogButtonBox::ActionRole); buttonBox->addButton(addObs, QDialogButtonBox::ActionRole); connect(execB, SIGNAL(clicked()), this, SLOT(slotEndSession())); connect(addObs,SIGNAL(clicked()),this,SLOT(slotObserverAdd())); setWindowTitle( i18n( "Execute Session" ) ); currentTarget = NULL; currentObserver = NULL; currentScope = NULL; currentEyepiece = NULL; currentLens = NULL; currentFilter = NULL; currentSession = NULL; nextSession = 0; nextObservation = 0; nextSite = 0; //initialize the global logObject logObject = KStarsData::Instance()->logObject(); //initialize the lists and parameters init(); ui.Target->hide(); ui.AddObject->hide(); ui.RemoveObject->hide(); ui.NextButton->hide(); ui.NextButton->setEnabled( false ); ui.Slew->setEnabled( false ); //make connections connect( ui.NextButton, SIGNAL( clicked() ), this, SLOT( slotNext() ) ); connect( ui.Slew, SIGNAL( clicked() ), this, SLOT( slotSlew() ) ); connect( ui.Location, SIGNAL( clicked() ), this, SLOT( slotLocation() ) ); connect( ui.Target, SIGNAL( currentTextChanged(const QString) ), this, SLOT( slotSetTarget(QString) ) ); connect( ui.SessionURL, SIGNAL( leftClickedUrl() ), this, SLOT( slotShowSession() ) ); connect( ui.ObservationsURL, SIGNAL( leftClickedUrl() ), this, SLOT( slotShowTargets() ) ); connect( ui.AddObject, SIGNAL( leftClickedUrl() ), this, SLOT( slotAddObject() ) ); connect( ui.RemoveObject, SIGNAL( leftClickedUrl() ), this, SLOT( slotRemoveObject() ) ); }
// // ObservingList // --------------------------------- ObservingList::ObservingList( KStars *_ks ) : KDialog( (QWidget*)_ks ), ks( _ks ), LogObject(0), m_CurrentObject(0), isModified(false), bIsLarge(true) { ui = new ObservingListUI( this ); setMainWidget( ui ); setCaption( i18n( "Observation Planner" ) ); setButtons( KDialog::Close ); dt = KStarsDateTime::currentDateTime(); setFocusPolicy(Qt::StrongFocus); geo = ks->data()->geo(); sessionView = false; FileName = ""; pmenu = new ObsListPopupMenu(); //Set up the Table Views m_Model = new QStandardItemModel( 0, 5, this ); m_Session = new QStandardItemModel( 0, 5 ); m_Model->setHorizontalHeaderLabels( QStringList() << i18n( "Name" ) << i18nc( "Right Ascension", "RA" ) << i18nc( "Declination", "Dec" ) << i18nc( "Magnitude", "Mag" ) << i18n( "Type" ) ); m_Session->setHorizontalHeaderLabels( QStringList() << i18n( "Name" ) << i18nc( "Right Ascension", "RA" ) << i18nc( "Declination", "Dec" ) << i18nc( "Magnitude", "Mag" ) << i18n( "Type" ) << i18n( "Time" ) << i18nc( "Altitude", "Alt" ) << i18nc( "Azimuth", "Az" )); m_SortModel = new QSortFilterProxyModel( this ); m_SortModel->setSourceModel( m_Model ); m_SortModel->setDynamicSortFilter( true ); ui->TableView->setModel( m_SortModel ); ui->TableView->horizontalHeader()->setStretchLastSection( true ); ui->TableView->horizontalHeader()->setResizeMode( QHeaderView::ResizeToContents ); m_SortModelSession = new SessionSortFilterProxyModel; m_SortModelSession->setSourceModel( m_Session ); m_SortModelSession->setDynamicSortFilter( true ); ui->SessionView->setModel( m_SortModelSession ); ui->SessionView->horizontalHeader()->setStretchLastSection( true ); ui->SessionView->horizontalHeader()->setResizeMode( QHeaderView::ResizeToContents ); ksal = new KSAlmanac; ksal->setLocation(geo); ui->View->setSunRiseSetTimes(ksal->getSunRise(),ksal->getSunSet()); ui->View->setLimits( -12.0, 12.0, -90.0, 90.0 ); ui->View->axis(KPlotWidget::BottomAxis)->setTickLabelFormat( 't' ); ui->View->axis(KPlotWidget::BottomAxis)->setLabel( i18n( "Local Time" ) ); ui->View->axis(KPlotWidget::TopAxis)->setTickLabelFormat( 't' ); ui->View->axis(KPlotWidget::TopAxis)->setTickLabelsShown( true ); ui->DateEdit->setDate(dt.date()); ui->SetLocation->setText( geo -> fullName() ); ui->ImagePreview->installEventFilter( this ); ui->TableView->viewport()->installEventFilter( this ); ui->TableView->installEventFilter( this ); ui->SessionView->viewport()->installEventFilter( this ); ui->SessionView->installEventFilter( this ); // setDefaultImage(); //Connections connect( this, SIGNAL( closeClicked() ), this, SLOT( slotClose() ) ); connect( ui->TableView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( slotCenterObject() ) ); connect( ui->TableView->selectionModel(), SIGNAL( selectionChanged(const QItemSelection&, const QItemSelection&) ), this, SLOT( slotNewSelection() ) ); connect( ui->SessionView->selectionModel(), SIGNAL( selectionChanged(const QItemSelection&, const QItemSelection&) ), this, SLOT( slotNewSelection() ) ); connect( ui->WUTButton, SIGNAL( clicked() ), this, SLOT( slotWUT() ) ); connect( ui->FindButton, SIGNAL( clicked() ), this, SLOT( slotFind() ) ); connect( ui->OpenButton, SIGNAL( clicked() ), this, SLOT( slotOpenList() ) ); connect( ui->SaveButton, SIGNAL( clicked() ), this, SLOT( slotSaveSession() ) ); connect( ui->SaveAsButton, SIGNAL( clicked() ), this, SLOT( slotSaveSessionAs() ) ); connect( ui->WizardButton, SIGNAL( clicked() ), this, SLOT( slotWizard() ) ); connect( ui->MiniButton, SIGNAL( clicked() ), this, SLOT( slotToggleSize() ) ); connect( ui->SetLocation, SIGNAL( clicked() ), this, SLOT( slotLocation() ) ); connect( ui->Update, SIGNAL( clicked() ), this, SLOT( slotUpdate() ) ); connect( ui->SaveImage, SIGNAL( clicked() ), this, SLOT( slotSaveImage() ) ); connect( ui->DeleteImage, SIGNAL( clicked() ), this, SLOT( slotDeleteCurrentImage() ) ); connect( ui->GoogleImage, SIGNAL( clicked() ), this, SLOT( slotGoogleImage() ) ); connect( ui->SetTime, SIGNAL( clicked() ), this, SLOT( slotSetTime() ) ); connect( ui->tabWidget, SIGNAL( currentChanged(int) ), this, SLOT( slotChangeTab(int) ) ); connect( ui->saveImages, SIGNAL( clicked() ), this, SLOT( slotSaveAllImages() ) ); connect( ui->DeleteAllImages, SIGNAL( clicked() ), this, SLOT( slotDeleteAllImages() ) ); connect( ui->OALExport, SIGNAL( clicked() ), this, SLOT( slotOALExport() ) ); //Add icons to Push Buttons ui->OpenButton->setIcon( KIcon("document-open") ); ui->SaveButton->setIcon( KIcon("document-save") ); ui->SaveAsButton->setIcon( KIcon("document-save-as") ); ui->WizardButton->setIcon( KIcon("games-solve") ); //is there a better icon for this button? ui->MiniButton->setIcon( KIcon("view-restore") ); noSelection = true; showScope = false; ui->NotesLabel->setEnabled( false ); ui->NotesEdit->setEnabled( false ); ui->SetTime->setEnabled( false ); ui->TimeEdit->setEnabled( false ); ui->GoogleImage->setEnabled( false ); ui->saveImages->setEnabled( false ); ui->SaveImage->setEnabled( false ); ui->DeleteImage->setEnabled( false ); ui->OALExport->setEnabled( false ); slotLoadWishList(); //Load the wishlist from disk if present m_CurrentObject = 0; setSaveImagesButton(); //Hide the MiniButton until I can figure out how to resize the Dialog! // ui->MiniButton->hide(); }
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(); }