ThumbnailPicker::ThumbnailPicker( SkyObject *o, const QPixmap ¤t, QWidget *parent, double _w, double _h, QString cap ) : KDialog( parent ), SelectedImageIndex(-1), dd((DetailDialog*)parent), Object(o), bImageFound( false ) { wid = _w; ht = _h; Image = new QPixmap( current ); ImageRect = new QRect( 0, 0, 200, 200 ); ui = new ThumbnailPickerUI( this ); setMainWidget( ui ); setCaption( cap ); setButtons( KDialog::Ok|KDialog::Cancel ); ui->CurrentImage->setPixmap( *Image ); connect( ui->EditButton, SIGNAL( clicked() ), this, SLOT( slotEditImage() ) ); connect( ui->UnsetButton, SIGNAL( clicked() ), this, SLOT( slotUnsetImage() ) ); connect( ui->ImageList, SIGNAL( currentRowChanged( int ) ), this, SLOT( slotSetFromList( int ) ) ); connect( ui->ImageURLBox, SIGNAL( urlSelected( const KUrl& ) ), this, SLOT( slotSetFromURL() ) ); connect( ui->ImageURLBox, SIGNAL( returnPressed() ), this, SLOT( slotSetFromURL() ) ); ui->ImageURLBox->lineEdit()->setTrapReturnKey( true ); ui->EditButton->setEnabled( false ); slotFillList(); }
ThumbnailPicker::ThumbnailPicker( SkyObject *o, const QPixmap ¤t, QWidget *parent, double _w, double _h, QString cap ) : QDialog( parent ), SelectedImageIndex(-1), dd((DetailDialog*)parent), Object(o), bImageFound( false ) { wid = _w; ht = _h; Image = new QPixmap( current ); ImageRect = new QRect( 0, 0, 200, 200 ); ui = new ThumbnailPickerUI( this ); setWindowTitle( cap ); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(ui); setLayout(mainLayout); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); mainLayout->addWidget(buttonBox); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); ui->CurrentImage->setPixmap( *Image ); connect( ui->EditButton, SIGNAL( clicked() ), this, SLOT( slotEditImage() ) ); connect( ui->UnsetButton, SIGNAL( clicked() ), this, SLOT( slotUnsetImage() ) ); connect( ui->ImageList, SIGNAL( currentRowChanged( int ) ), this, SLOT( slotSetFromList( int ) ) ); connect( ui->ImageURLBox, SIGNAL( urlSelected( const QUrl& ) ), this, SLOT( slotSetFromURL() ) ); connect( ui->ImageURLBox, SIGNAL( returnPressed() ), this, SLOT( slotSetFromURL() ) ); //ui->ImageURLBox->lineEdit()->setTrapReturnKey( true ); ui->EditButton->setEnabled( false ); slotFillList(); }