ExportEyepieceView::ExportEyepieceView( const SkyPoint *_sp, const KStarsDateTime &dt, const QPixmap *renderImage, const QPixmap *renderChart, QWidget *parent ) : QDialog( parent ), m_dt( dt ) { #ifdef Q_OS_OSX setWindowFlags(Qt::Tool| Qt::WindowStaysOnTopHint); #endif m_sp = new SkyPoint( *_sp ); // Work on a copy. Q_ASSERT( renderChart ); m_renderChart = new QPixmap( *renderChart ); if( renderImage ) m_renderImage = new QPixmap( *renderImage ); else m_renderImage = 0; setWindowTitle( i18n( "Export eyepiece view" ) ); QWidget *mainWidget = new QWidget( this ); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(mainWidget); setLayout(mainLayout); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Save | QDialogButtonBox::Cancel); mainLayout->addWidget(buttonBox); connect(buttonBox, SIGNAL(rejected()), this, SLOT(slotCloseDialog())); connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotSaveImage())); QVBoxLayout *rows = new QVBoxLayout; mainWidget->setLayout( rows ); QLabel *tickInfoLabel = new QLabel( i18n( "Overlay orientation vs. time ticks: " ), this ); m_tickConfigCombo = new QComboBox( this ); m_tickConfigCombo->addItem( i18n( "None" ) ); m_tickConfigCombo->addItem( i18n( "Towards Zenith" ) ); m_tickConfigCombo->addItem( i18n( "Dobsonian View" ) ); QHBoxLayout *optionsLayout = new QHBoxLayout; optionsLayout->addWidget( tickInfoLabel ); optionsLayout->addWidget( m_tickConfigCombo ); optionsLayout->addStretch(); rows->addLayout( optionsLayout ); m_tickWarningLabel = new QLabel( this ); rows->addWidget( m_tickWarningLabel ); m_outputDisplay = new QLabel; m_outputDisplay->setBackgroundRole( QPalette::Base ); m_outputDisplay->setScaledContents( false ); m_outputDisplay->setMinimumWidth( 400 ); m_outputDisplay->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding ); rows->addWidget( m_outputDisplay ); connect( m_tickConfigCombo, SIGNAL( currentIndexChanged( int ) ), this, SLOT( slotOverlayTicks( int ) ) ); connect( m_tickConfigCombo, SIGNAL( activated( int ) ), this, SLOT( slotOverlayTicks( int ) ) ); render(); show(); }
// // 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(); }