cFlightAnimation::cFlightAnimation(cInterface *_interface, cAnimationFrames *_frames, cImage *_image, QWidget *_imageWidget, cParameterContainer *_params, cFractalContainer *_fractal, QObject *parent) : QObject(parent), mainInterface(_interface), frames(_frames) { if (mainInterface->mainWindow) { ui = mainInterface->mainWindow->ui; // connect flight control buttons connect(ui->pushButton_record_flight, SIGNAL(clicked()), this, SLOT(slotRecordFlight())); connect( ui->pushButton_continue_recording, SIGNAL(clicked()), this, SLOT(slotContinueRecording())); connect(ui->pushButton_render_flight, SIGNAL(clicked()), this, SLOT(slotRenderFlight())); connect(ui->pushButton_delete_all_images, SIGNAL(clicked()), this, SLOT(slotDeleteAllImages())); connect(ui->pushButton_show_animation, SIGNAL(clicked()), this, SLOT(slotShowAnimation())); connect(ui->pushButton_flight_refresh_table, SIGNAL(clicked()), this, SLOT(slotRefreshTable())); connect(ui->pushButton_flight_to_keyframe_export, SIGNAL(clicked()), this, SLOT(slotExportFlightToKeyframes())); connect(ui->button_selectAnimFlightImageDir, SIGNAL(clicked()), this, SLOT(slotSelectAnimFlightImageDir())); connect(ui->tableWidget_flightAnimation, SIGNAL(cellChanged(int, int)), this, SLOT(slotTableCellChanged(int, int))); connect(ui->spinboxInt_flight_first_to_render, SIGNAL(valueChanged(int)), this, SLOT(slotMovedSliderFirstFrame(int))); connect(ui->spinboxInt_flight_last_to_render, SIGNAL(valueChanged(int)), this, SLOT(slotMovedSliderLastFrame(int))); connect(ui->tableWidget_flightAnimation, SIGNAL(cellDoubleClicked(int, int)), this, SLOT(slotCellDoubleClicked(int, int))); // connect renderedImage signals connect(mainInterface->renderedImage, SIGNAL(StrafeChanged(CVector2<double>)), this, SLOT(slotFlightStrafe(CVector2<double>))); connect(mainInterface->renderedImage, SIGNAL(YawAndPitchChanged(CVector2<double>)), this, SLOT(slotFlightYawAndPitch(CVector2<double>))); connect(mainInterface->renderedImage, SIGNAL(SpeedChanged(double)), this, SLOT(slotFlightChangeSpeed(double))); connect(mainInterface->renderedImage, SIGNAL(RotationChanged(double)), this, SLOT(slotFlightRotation(double))); connect(mainInterface->renderedImage, SIGNAL(Pause()), this, SLOT(slotRecordPause())); connect(mainInterface->renderedImage, SIGNAL(ShiftModeChanged(bool)), this, SLOT(slotOrthogonalStrafe(bool))); // connect QuestionMessage signal connect(this, SIGNAL(QuestionMessage(const QString, const QString, QMessageBox::StandardButtons, QMessageBox::StandardButton *)), mainInterface->mainWindow, SLOT(slotQuestionMessage(const QString, const QString, QMessageBox::StandardButtons, QMessageBox::StandardButton *))); table = ui->tableWidget_flightAnimation; }
cKeyframeAnimation::cKeyframeAnimation(cInterface *_interface, cKeyframes *_frames, cImage *_image, QWidget *_imageWidget, cParameterContainer *_params, cFractalContainer *_fractal, QObject *parent) : QObject(parent), mainInterface(_interface), keyframes(_frames) { image = _image; imageWidget = _imageWidget; params = _params; fractalParams = _fractal; if (mainInterface->mainWindow) { ui = mainInterface->mainWindow->ui; QApplication::connect(ui->pushButton_add_keyframe, SIGNAL(clicked()), this, SLOT(slotAddKeyframe())); QApplication::connect(ui->pushButton_insert_keyframe, SIGNAL(clicked()), this, SLOT(slotInsertKeyframe())); QApplication::connect(ui->pushButton_delete_keyframe, SIGNAL(clicked()), this, SLOT(slotDeleteKeyframe())); QApplication::connect(ui->pushButton_modify_keyframe, SIGNAL(clicked()), this, SLOT(slotModifyKeyframe())); QApplication::connect(ui->pushButton_render_keyframe_animation, SIGNAL(clicked()), this, SLOT(slotRenderKeyframes())); QApplication::connect(ui->pushButton_delete_all_keyframe_images, SIGNAL(clicked()), this, SLOT(slotDeleteAllImages())); QApplication::connect(ui->pushButton_show_keyframe_animation, SIGNAL(clicked()), this, SLOT(slotShowAnimation())); QApplication::connect(ui->pushButton_refresh_keyframe_table, SIGNAL(clicked()), this, SLOT(slotRefreshTable())); QApplication::connect(ui->pushButton_keyframe_to_flight_export, SIGNAL(clicked()), this, SLOT(slotExportKeyframesToFlight())); QApplication::connect(ui->pushButton_check_for_collisions, SIGNAL(clicked()), this, SLOT(slotValidate())); QApplication::connect(ui->pushButton_set_constant_target_distance, SIGNAL(clicked()), this, SLOT(slotSetConstantTargetDistance())); QApplication::connect(ui->button_selectAnimKeyframeImageDir, SIGNAL(clicked()), this, SLOT(slotSelectKeyframeAnimImageDir())); QApplication::connect(ui->tableWidget_keyframe_animation, SIGNAL(cellChanged(int, int)), this, SLOT(slotTableCellChanged(int, int))); QApplication::connect(ui->spinboxInt_keyframe_first_to_render, SIGNAL(valueChanged(int)), this, SLOT(slotMovedSliderFirstFrame(int))); QApplication::connect(ui->spinboxInt_keyframe_last_to_render, SIGNAL(valueChanged(int)), this, SLOT(slotMovedSliderLastFrame(int))); QApplication::connect(ui->spinboxInt_frames_per_keyframe, SIGNAL(valueChanged(int)), this, SLOT(UpdateLimitsForFrameRange())); QApplication::connect(ui->tableWidget_keyframe_animation, SIGNAL(cellDoubleClicked(int, int)), this, SLOT(slotCellDoubleClicked(int, int))); QApplication::connect(this, SIGNAL(QuestionMessage(const QString, const QString, QMessageBox::StandardButtons, QMessageBox::StandardButton*)), mainInterface->mainWindow, SLOT(slotQuestionMessage(const QString, const QString, QMessageBox::StandardButtons, QMessageBox::StandardButton*))); table = ui->tableWidget_keyframe_animation; //add default parameters for animation if (keyframes->GetListOfUsedParameters().size() == 0) { keyframes->AddAnimatedParameter("camera", params->GetAsOneParameter("camera")); keyframes->AddAnimatedParameter("target", params->GetAsOneParameter("target")); keyframes->AddAnimatedParameter("camera_top", params->GetAsOneParameter("camera_top")); if (mainInterface->mainWindow) PrepareTable(); } }
// // 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(); }