예제 #1
0
void VLMDialog::saveModifications()
{
    VLMAWidget *vlmObj = vlmItems.at( currentIndex );
    if( vlmObj )
    {
        vlmObj->input = ui.inputLedit->text();
        vlmObj->output = ui.outputLedit->text().remove( ":sout=" );
        vlmObj->setChecked( ui.enableCheck->isChecked() );
        vlmObj->b_enabled = ui.enableCheck->isChecked();
        switch( vlmObj->type )
        {
        case QVLM_Broadcast:
            (qobject_cast<VLMBroadcast *>(vlmObj))->b_looped = ui.loopBCast->isChecked();
            break;
        case QVLM_VOD:
            (qobject_cast<VLMVod *>(vlmObj))->mux = ui.muxLedit->text();
            break;
        case QVLM_Schedule:
            (qobject_cast<VLMSchedule *>(vlmObj))->schetime = time->dateTime();
            (qobject_cast<VLMSchedule *>(vlmObj))->schedate = date->dateTime();
            (qobject_cast<VLMSchedule *>(vlmObj))->rNumber = scherepeatnumber->value();
            (qobject_cast<VLMSchedule *>(vlmObj))->rDays = repeatDays->value();
            break;
           //           vlmObj->
        }
        vlmObj->update();
    }
    clearWidgets();
}
예제 #2
0
void Window::setupMain(bool anim, const MTPUser *self) {
	Local::readRecentStickers();

	QPixmap bg = anim ? myGrab(this, QRect(0, st::titleHeight, width(), height() - st::titleHeight)) : QPixmap();
	clearWidgets();
	main = new MainWidget(this);
	main->move(0, st::titleHeight);
	if (anim) {
		main->animShow(bg);
	} else {
		main->activate();
	}
	if (self) {
		main->start(*self);
	} else {
		MTP::send(MTPusers_GetUsers(MTP_vector<MTPInputUser>(1, MTP_inputUserSelf())), main->rpcDone(&MainWidget::startFull));
	}
	title->resizeEvent(0);

	fixOrder();

	updateTitleStatus();

	_mediaView = new MediaView();
}
예제 #3
0
void EditFunction::initDialog( int id )
{
	m_id = id;
	if( m_id == -1 ) clearWidgets(); //new function, so clear all values
	else setWidgets();
	editfunctionpage->equation->setFocus();
}
예제 #4
0
void BitcoinGUI::gotoOverviewPage()
{
    overviewAction->setChecked(true);

    clearWidgets();
    centralStackedWidget->setCurrentWidget(overviewPage);

    exportAction->setEnabled(false);
    disconnect(exportAction, SIGNAL(triggered()), 0, 0);
}
예제 #5
0
void VLMDialog::mediasPopulator()
{
    if( p_vlm )
    {
        int i_nMedias;
        QString typeShortName;
        int vlmItemCount;
        vlm_media_t ***ppp_dsc = (vlm_media_t ***)malloc( sizeof( vlm_media_t ) );

        /* Get medias information and numbers */
        vlm_Control( p_vlm, VLM_GET_MEDIAS, ppp_dsc, &i_nMedias );

        /* Loop on all of them */
        for( int i = 0; i < i_nMedias; i++ )
        {
            VLMAWidget * vlmAwidget;
            vlmItemCount = vlmItems.count();

            QString mediaName = qfu( (*ppp_dsc)[i]->psz_name );
            /* It may have several inputs, we take the first one by default
                 - an evolution will be to manage these inputs in the gui */
            QString inputText = qfu( (*ppp_dsc)[i]->ppsz_input[0] );

            QString outputText = qfu( (*ppp_dsc)[i]->psz_output );

            /* Schedule media is a quite especial, maybe there is another way to grab information */
            if( (*ppp_dsc)[i]->b_vod )
            {
                typeShortName = "VOD";
                QString mux = qfu( (*ppp_dsc)[i]->vod.psz_mux );
                vlmAwidget = new VLMVod( mediaName, inputText, inputOptions,
                                         outputText, (*ppp_dsc)[i]->b_enabled,
                                         mux, this );
            }
            else
            {
                typeShortName = "Bcast";
                vlmAwidget = new VLMBroadcast( mediaName, inputText, inputOptions,
                                               outputText, (*ppp_dsc)[i]->b_enabled,
                                               (*ppp_dsc)[i]->broadcast.b_loop, this );
            }
            /* Add an Item of the Side List */
            ui.vlmListItem->addItem( typeShortName + " : " + mediaName );
            ui.vlmListItem->setCurrentRow( vlmItemCount - 1 );

            /* Add a new VLMAWidget on the main List */
            vlmItemLayout->insertWidget( vlmItemCount, vlmAwidget );
            vlmItems.append( vlmAwidget );
            clearWidgets();
        }
        free( ppp_dsc );
    }
}
예제 #6
0
void ImageViewer::loadFile(const QString &fileName, const QString& extension, bool loadInfo) {
    fileName_ = fileName;
    extension_ = extension.trimmed().toLower();

    clearWidgets();
    
    if(fileName.isEmpty() || extension.isEmpty()) return;
    
    if (!QFileInfo(fileName).exists()) {
        setText(notFoundMessage_); 
        return;
    }
    
    if (loadInfo) {
        if (extension_ == "mrc" || extension_ == "map" || extension_ == "mrcs") {
            mrcHeader header(fileName);
            mrcInfo->setHeader(fileName, header);
            widgets->setCurrentWidget(mrcInfo);
        } else {
            fileInfo->setFile(fileName);
            widgets->setCurrentWidget(fileInfo);
        }
    } else {
        QImage image;
        if (extension_ == "mrc") {
            
            //Check if a png preview is available
            if(QFileInfo(fileName+".png").exists()) {
                if(QFileInfo(fileName).lastModified().toMSecsSinceEpoch() <= QFileInfo(fileName+".png").lastModified().toMSecsSinceEpoch()) {
                    image = QImage(fileName+".png");
                } else {
                    qDebug() << fileName << "had PNG, but is older, Time(MRC, PNG): " << QFileInfo(fileName).lastModified().toMSecsSinceEpoch() << QFileInfo(fileName+".png").lastModified().toMSecsSinceEpoch();
                    mrcImage tempImage(fileName);
                    image = *(tempImage.getImage());
                }
            } else {
                mrcImage tempImage(fileName);
                image = *(tempImage.getImage());
            }
        } else {
            image = QImage(fileName);
        }

        if (image.isNull()) {
            setNotSupportedText();
            return;
        }
        imageLabel->setPixmap(QPixmap::fromImage(image));
        resizeWidgets();
    }
}
예제 #7
0
void ServiceBlock::on_pbDelete_clicked()
{
    if(Database::isOpen()) {
        QSqlQuery qry;
        qry.prepare("DELETE FROM service WHERE idService=:_idS");
        qry.bindValue(":_idS", idService);
        if( !qry.exec() )
            QMessageBox::warning(this,tr("Uwaga!"),"Usuwanie nie powiodło się.\nERROR: "+qry.lastError().text()+"");
        else {
            QMessageBox::information(this,tr("Informacja"),tr("Usunięto naprawę!"));
            clearWidgets();
            emit deleted();
        }
    }
    else QMessageBox::critical(this,tr("Błąd!"), tr("Utracono połączenie z bazą danych!"));
}
예제 #8
0
void BitcoinGUI::gotoReceiveCoinsPage()
{
    receiveCoinsAction->setChecked(true);
    clearWidgets();
    receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);
    receiveCoinsPage->setOptionsModel(this->clientModel->getOptionsModel());
    receiveCoinsPage->setModel(this->walletModel->getAddressTableModel());
    // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab
    connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));
    centralStackedWidget->addWidget(receiveCoinsPage);
    centralStackedWidget->setCurrentWidget(receiveCoinsPage);

    exportAction->setEnabled(true);
    disconnect(exportAction, SIGNAL(triggered()), 0, 0);
    connect(exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked()));
}
예제 #9
0
void BitcoinGUI::gotoAddressBookPage()
{
    addressBookAction->setChecked(true);
    clearWidgets();
    addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);
    addressBookPage->setOptionsModel(this->clientModel->getOptionsModel());
    addressBookPage->setModel(this->walletModel->getAddressTableModel());
    // Clicking on "Verify Message" in the address book sends you to the verify message tab
    connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
    centralStackedWidget->addWidget(addressBookPage);
    centralStackedWidget->setCurrentWidget(addressBookPage);

    exportAction->setEnabled(true);
    disconnect(exportAction, SIGNAL(triggered()), 0, 0);
    connect(exportAction, SIGNAL(triggered()), addressBookPage, SLOT(exportClicked()));
}
예제 #10
0
void Window::setupIntro(bool anim) {
	if (intro && (intro->animating() || intro->isVisible()) && !main) return;

	QPixmap bg = myGrab(this, QRect(0, st::titleHeight, width(), height() - st::titleHeight));

	clearWidgets();
	intro = new IntroWidget(this);
	intro->move(0, st::titleHeight);
	if (anim) {
		intro->animShow(bg);
	}

	fixOrder();

	updateTitleStatus();
}
예제 #11
0
파일: window.cpp 프로젝트: cesczuo/tdesktop
void Window::setupMain(bool anim) {
	QPixmap bg = myGrab(this, QRect(0, st::titleHeight, width(), height() - st::titleHeight));
	clearWidgets();
	main = new MainWidget(this);
	main->move(0, st::titleHeight);
	if (anim) {
		main->animShow(bg);
	} else {
		MTP::send(MTPusers_GetUsers(MTP_vector<MTPInputUser>(QVector<MTPInputUser>(1, MTP_inputUserSelf()))), main->rpcDone(&MainWidget::startFull));
		main->activate();
	}

	fixOrder();

	updateTitleStatus();
}
예제 #12
0
void ServiceBlock::loadData()
{
    if(ui->lvServices->currentIndex().data(Qt::DisplayRole ).toString() == "Dodaj naprawę ...")
        clearWidgets();
    else {
        ui->pbDelete->setVisible(true);
        idService = serviceTable->index(0,0).data().toInt();
        ui->leName->setText( serviceTable->index(0,1).data().toString() );
        ui->cbCategory->setCurrentText( serviceTable->index(0,2).data().toString() );
        ui->deEvent->setDate( serviceTable->index(0,3).data().toDate() );
        ui->deGuarantee->setDate( serviceTable->index(0,4).data().toDate() );
        ui->deBegin->setDate( serviceTable->index(0,5).data().toDate() );
        ui->deEnd->setDate( serviceTable->index(0,6).data().toDate() );
        ui->leCost->setText( serviceTable->index(0,7).data().toString() );
        ui->teNotes->setText( serviceTable->index(0,8).data().toString() );
    }
}
예제 #13
0
QgsMessageBar::QgsMessageBar( QWidget *parent )
    : QFrame( parent ), mCurrentItem( NULL )
{
  QPalette pal = palette();
  pal.setBrush( backgroundRole(), pal.window() );
  setPalette( pal );
  setAutoFillBackground( true );
  setFrameShape( QFrame::StyledPanel );
  setFrameShadow( QFrame::Plain );

  mLayout = new QGridLayout( this );
  mLayout->setContentsMargins( 9, 1, 9, 1 );
  setLayout( mLayout );

  mItemCount = new QLabel( this );
  mItemCount->setObjectName( "mItemCount" );
  mItemCount->setToolTip( tr( "Remaining messages" ) );
  mItemCount->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred );
  mLayout->addWidget( mItemCount, 0, 1, 1, 1 );

  mCloseMenu = new QMenu( this );
  mCloseMenu->setObjectName( "mCloseMenu" );
  mActionCloseAll = new QAction( tr( "Close all" ), this );
  mCloseMenu->addAction( mActionCloseAll );
  connect( mActionCloseAll, SIGNAL( triggered() ), this, SLOT( clearWidgets() ) );

  mCloseBtn = new QToolButton( this );
  mCloseBtn->setToolTip( tr( "Close" ) );
  mCloseBtn->setMinimumWidth( 36 );
  mCloseBtn->setStyleSheet(
    "QToolButton { background-color: rgba(255, 255, 255, 0); } "
    "QToolButton::menu-indicator { subcontrol-position: right bottom; subcontrol-origin: padding; bottom: 6px; }" );
  mCloseBtn->setCursor( Qt::PointingHandCursor );
  mCloseBtn->setIcon( QgsApplication::getThemeIcon( "/mIconClose.png" ) );
  mCloseBtn->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred );
  mCloseBtn->setMenu( mCloseMenu );
  connect( mCloseBtn, SIGNAL( clicked() ), this, SLOT( popWidget() ) );
  mLayout->addWidget( mCloseBtn, 0, 2, 1, 1 );

  connect( this, SIGNAL( widgetAdded( QWidget* ) ), this, SLOT( updateItemCount() ) );
  connect( this, SIGNAL( widgetRemoved( QWidget* ) ), this, SLOT( updateItemCount() ) );

  // start hidden
  setVisible( false );
}
예제 #14
0
void SequenceDisplayer::showSequences(std::vector<sequenceProgressData> progressPairs)
{
    // Clear the current active widgets.
    clearWidgets();
    activeSequencesIdToDataMap.clear();

    std::vector<sequenceProgressData>::iterator it;

    for (it = progressPairs.begin(); it != progressPairs.end(); ++it)
    {
        sequenceData seqData = sequenceIdToDataMap[it->seqId];
        seqData.seqPosLabel->setText(tr("%1 / %2").arg(QString::number(it->progress),
            QString::number(seqData.sequenceImages.size())));
        seqData.imageOffset = it->progress;
        activeSequencesIdToDataMap[it->seqId] = seqData;
    }

    updateSequences();
}
예제 #15
0
void BitcoinGUI::gotoHistoryPage()
{
    historyAction->setChecked(true);
    clearWidgets();

    transactionsPage = new QWidget(this);
    QVBoxLayout *vbox = new QVBoxLayout();
    transactionView = new TransactionView(this);
    vbox->addWidget(transactionView);
    transactionsPage->setLayout(vbox);
    centralStackedWidget->addWidget(transactionsPage);
    centralStackedWidget->setCurrentWidget(transactionsPage);

    connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));

    transactionView->setModel(this->walletModel);

    exportAction->setEnabled(true);
    disconnect(exportAction, SIGNAL(triggered()), 0, 0);
    connect(exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked()));
}
예제 #16
0
void Window::setupIntro(bool anim) {
	cSetContactsReceived(false);
	if (intro && (intro->animating() || intro->isVisible()) && !main) return;

	QPixmap bg = anim ? myGrab(this, QRect(0, st::titleHeight, width(), height() - st::titleHeight)) : QPixmap();

	clearWidgets();
	intro = new IntroWidget(this);
	intro->move(0, st::titleHeight);
	if (anim) {
		intro->animShow(bg);
	}

	fixOrder();

	updateTitleStatus();

	_delayedServiceMsgs.clear();
	if (_serviceHistoryRequest) {
		MTP::cancel(_serviceHistoryRequest);
		_serviceHistoryRequest = 0;
	}
}
예제 #17
0
void ServiceBlock::on_pbSave_clicked()
{
     if(Database::isOpen()) {
         // insert new repair
         if(!isDateCorrect())
             return;

         if(ui->lvServices->currentIndex().data(Qt::DisplayRole ).toString() == "Dodaj naprawę ...") {
             QSqlQuery qry;
             qry.prepare("INSERT INTO service(Name,ComponentCategory,EventDate,GuaranteeDate,"
                                         "BeginDate,EndDate,Cost,Notes,idCar)"
                          "VALUES(:_Name,:_ComponentCategory,:_EventDate,:_GuaranteeDate,"
                          ":_BeginDate,:_EndDate,:_Cost,:_Notes,:_idCar)");

             if(ui->leName->text()!="") qry.bindValue(":_Name", ui->leName->text());
             qry.bindValue(":_ComponentCategory", ui->cbCategory->currentText());
             qry.bindValue(":_EventDate", ui->deEvent->date());
             qry.bindValue(":_GuaranteeDate", ui->deGuarantee->date());
             qry.bindValue(":_BeginDate", ui->deBegin->date());
             qry.bindValue(":_EndDate", ui->deEnd->date());
             qry.bindValue(":_Cost", ui->leCost->text() );
             qry.bindValue(":_Notes", ui->teNotes->toPlainText());
             qry.bindValue(":_idCar", idCar);
             if(!qry.exec())
                 QMessageBox::warning(this,tr("Uwaga!"),"Dodawanie nie powiodło się.\nERROR: "+qry.lastError().text()+"");
             else {

                 QSqlQueryModel lastInserted;
                 lastInserted.setQuery(QString("SELECT * FROM service WHERE idCar = %1 WHERE idCar = 1 AND idService = (SELECT MAX(idService) FROM service);").arg(idCar));
                 lwiVector.push_back(new QListWidgetItem(ui->leName->text()));
                 lwiVector.back()->setData(0, lastInserted.index(0,0).data().toInt());

                 clearWidgets();
                 ui->lvServices->item(0)->setSelected(true);
                 updateView();
                 QMessageBox::information(this,"Informacja","Dodano naprawę!");
             }
         }

         // update repair
         else {
             QSqlQuery qry;
             qry.prepare("UPDATE service SET Name=:_Name,ComponentCategory=:_ComponentCategory,"
                         "EventDate=:_EventDate,GuaranteeDate=:_GuaranteeDate,"
                         "BeginDate=:_BeginDate,EndDate=:_EndDate,Cost=:_Cost,Notes=:_Notes WHERE idService=:_idS");
             if(ui->leName->text()!="") qry.bindValue(":_Name", ui->leName->text());
             qry.bindValue(":_ComponentCategory", ui->cbCategory->currentText());
             qry.bindValue(":_EventDate", ui->deEvent->date());
             qry.bindValue(":_GuaranteeDate", ui->deGuarantee->date());
             qry.bindValue(":_BeginDate", ui->deBegin->date());
             qry.bindValue(":_EndDate", ui->deEnd->date());
             qry.bindValue(":_Cost", ui->leCost->text() );
             qry.bindValue(":_Notes", ui->teNotes->toPlainText());
             qry.bindValue(":_idS", idService);
             if( !qry.exec() )
                 QMessageBox::warning(this,tr("Uwaga!"),"Aktualizacja nie powiodła się.\nERROR: "+qry.lastError().text()+"");
             else {
                 QMessageBox::information(this,tr("Informacja"),tr("Zaktualizowano!"));
                 clearWidgets();
                 emit saved();
             }
         }
     }
     else QMessageBox::critical(this,tr("Błąd!"), tr("Utracono połączenie z bazą danych!"));
}
예제 #18
0
QgsMessageBar::QgsMessageBar( QWidget *parent )
    : QFrame( parent ), mCurrentItem( NULL )
{
  QPalette pal = palette();
  pal.setBrush( backgroundRole(), pal.window() );
  setPalette( pal );
  setAutoFillBackground( true );
  setFrameShape( QFrame::StyledPanel );
  setFrameShadow( QFrame::Plain );

  mLayout = new QGridLayout( this );
  mLayout->setContentsMargins( 9, 1, 9, 1 );
  setLayout( mLayout );

  mCountProgress = new QProgressBar( this );
  mCountStyleSheet = QString( "QProgressBar { border: 1px solid rgba(0, 0, 0, 75%);"
                              " border-radius: 2px; background: rgba(0, 0, 0, 0);"
                              " image: url(:/images/themes/default/%1) }"
                              "QProgressBar::chunk { background-color: rgba(0, 0, 0, 30%); width: 5px; }" );

  mCountProgress->setStyleSheet( mCountStyleSheet.arg( "mIconTimerPause.png" ) );
  mCountProgress->setObjectName( "mCountdown" );
  mCountProgress->setFixedSize( 25, 14 );
  mCountProgress->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
  mCountProgress->setTextVisible( false );
  mCountProgress->setRange( 0, 5 );
  mCountProgress->setHidden( true );
  mLayout->addWidget( mCountProgress, 0, 0, 1, 1 );

  mItemCount = new QLabel( this );
  mItemCount->setObjectName( "mItemCount" );
  mItemCount->setToolTip( tr( "Remaining messages" ) );
  mItemCount->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred );
  mLayout->addWidget( mItemCount, 0, 2, 1, 1 );

  mCloseMenu = new QMenu( this );
  mCloseMenu->setObjectName( "mCloseMenu" );
  mActionCloseAll = new QAction( tr( "Close all" ), this );
  mCloseMenu->addAction( mActionCloseAll );
  connect( mActionCloseAll, SIGNAL( triggered() ), this, SLOT( clearWidgets() ) );

  mCloseBtn = new QToolButton( this );
  mCloseMenu->setObjectName( "mCloseMenu" );
  mCloseBtn->setToolTip( tr( "Close" ) );
  mCloseBtn->setMinimumWidth( 40 );
  mCloseBtn->setStyleSheet(
    "QToolButton { background-color: rgba(255, 255, 255, 0); } "
    "QToolButton::menu-indicator { subcontrol-position: right bottom; subcontrol-origin: padding; bottom: 2px; }" );
  mCloseBtn->setCursor( Qt::PointingHandCursor );
  mCloseBtn->setIcon( QgsApplication::getThemeIcon( "/mIconClose.png" ) );
  mCloseBtn->setIconSize( QSize( 18, 18 ) );
  mCloseBtn->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
  mCloseBtn->setMenu( mCloseMenu );
  connect( mCloseBtn, SIGNAL( clicked() ), this, SLOT( popWidget() ) );
  mLayout->addWidget( mCloseBtn, 0, 3, 1, 1 );

  mCountdownTimer = new QTimer( this );
  mCountdownTimer->setInterval( 1000 );
  connect( mCountdownTimer, SIGNAL( timeout() ), this, SLOT( updateCountdown() ) );

  connect( this, SIGNAL( widgetAdded( QgsMessageBarItem* ) ), this, SLOT( updateItemCount() ) );
  connect( this, SIGNAL( widgetRemoved( QgsMessageBarItem* ) ), this, SLOT( updateItemCount() ) );

  // start hidden
  setVisible( false );
}
예제 #19
0
void KEditPolar::initDialog( int id )
{
	m_id = id;
	if( m_id == -1 ) clearWidgets();
	else setWidgets();
}
예제 #20
0
VLMDialog::VLMDialog( intf_thread_t *_p_intf ) : QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf )
{
    p_vlm = vlm_New( p_intf );

    if( !p_vlm )
    {
        msg_Warn( p_intf, "Couldn't build VLM object ");
        return;
    }
    vlmWrapper = new VLMWrapper( p_vlm );

    // UI stuff
    ui.setupUi( this );
    ui.saveButton->hide();

#define ADDMEDIATYPES( str, type ) ui.mediaType->addItem( qtr( str ), QVariant( type ) );
    ADDMEDIATYPES( N_("Broadcast"), QVLM_Broadcast );
    ADDMEDIATYPES( N_("Schedule"), QVLM_Schedule );
    ADDMEDIATYPES( N_("Video On Demand ( VOD )"), QVLM_VOD );
#undef ADDMEDIATYPES

    /* Schedule Stuffs */
    QGridLayout *schetimelayout = new QGridLayout( ui.schedBox );
    QLabel *schetimelabel = new QLabel( qtr( "Hours / Minutes / Seconds:" ) );
    schetimelayout->addWidget( schetimelabel, 0, 0 );
    QLabel *schedatelabel = new QLabel( qtr( "Day / Month / Year:" ) );
    schetimelayout->addWidget( schedatelabel, 1, 0 );
    QLabel *scherepeatLabel = new QLabel( qtr( "Repeat:" ) );
    schetimelayout->addWidget( scherepeatLabel, 2, 0 );
    QLabel *scherepeatTimeLabel = new QLabel( qtr( "Repeat delay:" ) );
    schetimelayout->addWidget( scherepeatTimeLabel, 3, 0 );

    time = new QDateTimeEdit( QTime::currentTime() );
    time->setAlignment( Qt::AlignRight );
    time->setDisplayFormat( "hh:mm:ss" );
    schetimelayout->addWidget( time, 0, 1, 1, 3 );

    date = new QDateTimeEdit( QDate::currentDate() );
    date->setAlignment( Qt::AlignRight );
    date->setCalendarPopup( true );
#ifdef WIN32
    date->setDisplayFormat( "dd MM yyyy" );
#else
    date->setDisplayFormat( "dd MMMM yyyy" );
#endif
    schetimelayout->addWidget( date, 1, 1, 1, 3 );

    scherepeatnumber = new QSpinBox;
    scherepeatnumber->setAlignment( Qt::AlignRight );
    schetimelayout->addWidget( scherepeatnumber, 2, 1, 1, 3 );

    repeatDays = new QSpinBox;
    repeatDays->setAlignment( Qt::AlignRight );
    schetimelayout->addWidget( repeatDays, 3, 1, 1, 1 );
    repeatDays->setSuffix( qtr(" days") );

    repeatTime = new QDateTimeEdit;
    repeatTime->setAlignment( Qt::AlignRight );
    schetimelayout->addWidget( repeatTime, 3, 2, 1, 2 );
    repeatTime->setDisplayFormat( "hh:mm:ss" );

    /* scrollArea */
    ui.vlmItemScroll->setFrameStyle( QFrame::NoFrame );
    ui.vlmItemScroll->setWidgetResizable( true );
    vlmItemWidget = new QWidget;
    vlmItemLayout = new QVBoxLayout( vlmItemWidget );
    vlmItemWidget->setLayout( vlmItemLayout );
    ui.vlmItemScroll->setWidget( vlmItemWidget );

    QSpacerItem *spacer =
        new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding);
    vlmItemLayout->addItem( spacer );

    QPushButton *importButton = new QPushButton( qtr( "I&mport" ) );
    ui.buttonBox->addButton( importButton, QDialogButtonBox::ActionRole );

    QPushButton *exportButton = new QPushButton( qtr( "E&xport" ) );
    ui.buttonBox->addButton( exportButton, QDialogButtonBox::ActionRole );

    QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
    ui.buttonBox->addButton( closeButton, QDialogButtonBox::RejectRole );


    showScheduleWidget( QVLM_Broadcast );

    /* Connect the comboBox to show the right Widgets */
    CONNECT( ui.mediaType, currentIndexChanged( int ),
             this, showScheduleWidget( int ) );

    /* Connect the leftList to show the good VLMItem */
    CONNECT( ui.vlmListItem, currentRowChanged( int ),
             this, selectVLMItem( int ) );

    BUTTONACT( closeButton, close() );
    BUTTONACT( exportButton, exportVLMConf() );
    BUTTONACT( importButton, importVLMConf() );
    BUTTONACT( ui.addButton, addVLMItem() );
    BUTTONACT( ui.clearButton, clearWidgets() );
    BUTTONACT( ui.saveButton, saveModifications() );
    BUTTONACT( ui.inputButton, selectInput() );
    BUTTONACT( ui.outputButton, selectOutput() );

    if( !restoreGeometry( getSettings()->value("VLM/geometry").toByteArray() ) )
    {
        resize( QSize( 700, 500 ) );
    }
}
예제 #21
0
void SequenceDisplayer::handleHelpLevelChanged(int lvl)
{
    midasHelpLevel = helpLevel(lvl);
    clearWidgets();
    updateSequences();
}
예제 #22
0
void VLMDialog::addVLMItem()
{
    int vlmItemCount = vlmItems.count();

    /* Take the name and Check it */
    QString name = ui.nameLedit->text();
    if( name.isEmpty() || !isNameGenuine( name ) )
    {
        msg_Err( p_intf, "VLM Name is empty or already exists, I can't do it" );
        return;
    }

    int type = ui.mediaType->itemData( ui.mediaType->currentIndex() ).toInt();

    QString typeShortName;
    QString inputText = ui.inputLedit->text();
    QString outputText = ui.outputLedit->text();
    bool b_checked = ui.enableCheck->isChecked();
    bool b_looped = ui.loopBCast->isChecked();
    QDateTime schetime = time->dateTime();
    QDateTime schedate = date->dateTime();
    int repeatnum = scherepeatnumber->value();
    int repeatdays = repeatDays->value();
    VLMAWidget * vlmAwidget;
    outputText.remove( ":sout=" );

    switch( type )
    {
    case QVLM_Broadcast:
        typeShortName = "Bcast";
        vlmAwidget = new VLMBroadcast( name, inputText, inputOptions, outputText,
                                       b_checked, b_looped, this );
        VLMWrapper::AddBroadcast( name, inputText, inputOptions, outputText, b_checked,
                                  b_looped );
    break;
    case QVLM_VOD:
        typeShortName = "VOD";
        vlmAwidget = new VLMVod( name, inputText, inputOptions, outputText,
                                 b_checked, ui.muxLedit->text(), this );
        VLMWrapper::AddVod( name, inputText, inputOptions, outputText, b_checked );
        break;
    case QVLM_Schedule:
        typeShortName = "Sched";
        vlmAwidget = new VLMSchedule( name, inputText, inputOptions, outputText,
                                      schetime, schedate, repeatnum,
                                      repeatdays, b_checked, this );
        VLMWrapper::AddSchedule( name, inputText, inputOptions, outputText, schetime,
                                 schedate, repeatnum, repeatdays, b_checked);
        break;
    default:
        msg_Warn( p_intf, "Something bad happened" );
        return;
    }

    /* Add an Item of the Side List */
    ui.vlmListItem->addItem( typeShortName + " : " + name );
    ui.vlmListItem->setCurrentRow( vlmItemCount - 1 );

    /* Add a new VLMAWidget on the main List */

    vlmItemLayout->insertWidget( vlmItemCount, vlmAwidget );
    vlmItems.append( vlmAwidget );
    clearWidgets();
}
예제 #23
0
void KstEditViewObjectDialogI::updateWidgets() {
  // clear all the current widgets from the grid
  clearWidgets();

  // get the qt properties of the viewobject
  if (_viewObject) {
    _customWidget = _viewObject->configWidget();
    if (_customWidget) {
      _grid = new QGridLayout(_propertiesFrame, 1, 1);
      _customWidget->reparent(_propertiesFrame, QPoint(0, 0));
      _grid->addWidget(_customWidget, 0, 0);
      _viewObject->fillConfigWidget(_customWidget, _isNew);
      resize(minimumSizeHint());
      return;
    }
    
    //---------------------------------------------------------------
    // NOTE: due to Early return, nothing after this line is executed
    // if the view object provides a custom widget.

    int numProperties = _viewObject->metaObject()->numProperties(true);

    // create a new grid
    _grid = new QGridLayout(_propertiesFrame, numProperties, 2, 0, 8);
    _grid->setColStretch(0,0);
    _grid->setColStretch(1,1);
    
    // get the property names and types
    for (int i = 0; i < numProperties; i++) {
      const QMetaProperty* property = _viewObject->metaObject()->property(i, true);
      QString propertyType(property->type());
      QString propertyName(property->name());
     
      // for this property, get the meta-data map
      QMap<QString, QVariant> metaData = _viewObject->widgetHints(propertyName);
      
      if (!metaData.empty()) {
        QString friendlyName = metaData["_kst_label"].toString();
        QString widgetType = metaData["_kst_widgetType"].toString();
        metaData.erase("_kst_label");
        metaData.erase("_kst_widgetType");
        
        // use friendly name for label
        QLabel* propertyLabel = new QLabel(_propertiesFrame, "label-"+i);
        propertyLabel->setText(friendlyName);
        _grid->addWidget(propertyLabel,i,0);
        _widgets.append(propertyLabel);
        propertyLabel->show();
        
        // display different types of widgets depending on what dialogData specifies
        QWidget* propertyWidget = 0L;
        if (widgetType == "QSpinBox") {
          // insert a spinbox
          propertyWidget = new QSpinBox(_propertiesFrame, (propertyName+","+"value").latin1()); 
          propertyWidget->setProperty("value", _viewObject->property(property->name()));
        } else if (widgetType == "KColorButton") {
          // insert a colorbutton
          propertyWidget = new KColorButton(_propertiesFrame, (propertyName+","+"color").latin1());
          propertyWidget->setProperty("color", _viewObject->property(property->name()));
        } else if (widgetType == "QLineEdit") {
          // insert a text field
          propertyWidget = new QLineEdit(_propertiesFrame, (propertyName+","+"text").latin1());
          propertyWidget->setProperty("text", _viewObject->property(property->name()));
        } else if (widgetType == "KURLRequester") {
          // insert a url requester
          propertyWidget = new KURLRequester(_propertiesFrame, (propertyName+","+"url").latin1());
          propertyWidget->setProperty("url", _viewObject->property(property->name()));
        } else if (widgetType == "PenStyleWidget") {
          // insert a combobox with QT pen styles
          QComboBox* combo = new QComboBox(_propertiesFrame, (propertyName+","+"currentItem").latin1());
          fillPenStyleWidget(combo);
          propertyWidget = combo;
          propertyWidget->setProperty("currentItem", _viewObject->property(property->name()));
        } else if (widgetType == "QCheckBox") {
          // insert a checkbox
          propertyWidget = new QCheckBox(_propertiesFrame, (propertyName+","+"checked").latin1());
          propertyWidget->setProperty("checked", _viewObject->property(property->name()));
        } else if (widgetType == "KDoubleSpinBox") {
          // insert a double num spinbox
          KDoubleSpinBox* input = new KDoubleSpinBox(_propertiesFrame, (propertyName+","+"value").latin1());
          // need this so that setValue later works
          input->setMinValue(metaData["minValue"].toDouble());
          input->setMaxValue(metaData["maxValue"].toDouble());
          input->setLineStep(metaData["lineStep"].toDouble());
          metaData.erase("minValue");
          metaData.erase("maxValue");
          metaData.erase("lineStep");
          propertyWidget = input; 
          propertyWidget->setProperty("value", _viewObject->property(property->name())); 
        } else if (widgetType == "KFontCombo") {
          // insert a font combo box
          propertyWidget = new KFontCombo(_propertiesFrame, (propertyName+","+"currentText").latin1());
          propertyWidget->setProperty("currentText", _viewObject->property(property->name()));  
        } else if (widgetType == "HJustifyCombo") {
          // insert a combo box filled with horizontal justifications
          QComboBox* combo = new QComboBox(_propertiesFrame, (propertyName+","+"currentItem").latin1());
          fillHJustifyWidget(combo);
          propertyWidget = combo;
          propertyWidget->setProperty("currentItem", _viewObject->property(property->name()));
        } else if (widgetType == "VJustifyCombo") {
          // insert a combo box filled with vertical justifications
          QComboBox* combo = new QComboBox(_propertiesFrame, (propertyName+","+"currentItem").latin1());
          fillVJustifyWidget(combo);
          propertyWidget = combo;
          propertyWidget->setProperty("currentItem", _viewObject->property(property->name()));
        }
        
        // also set any additional properties specified by metaData
        for (QMap<QString, QVariant>::ConstIterator it = metaData.begin(); it != metaData.end(); ++it) {
          propertyWidget->setProperty(it.key().latin1(), it.data());
        }
        
        _grid->addWidget(propertyWidget, i, 1);
        _inputWidgets.append(propertyWidget);
        propertyWidget->show();
      }   
    }
    
    // geometry cleanup
    resize(minimumSizeHint());
    //setFixedHeight(height());
  }
}
예제 #24
0
void TitleWidget::setTitleType( TitleType titleType,
                                bool validDepartureData, bool validJourneyData )
{
    // Remove old additional widgets
    clearWidgets();

    // New type
    m_type = titleType;
    switch ( titleType ) {
        case ShowDepartureArrivalListTitle:
            // Default state, a departure/arrival board is shown
            setIcon( validDepartureData ? DepartureListOkIcon : DepartureListErrorIcon );
            m_icon->setToolTip( i18nc("@info:tooltip", "Show available actions in the applet") );
            setTitle( titleText() );

            // Show a title (with the stop name) and the filter and quick journey search widgets
            addWidget( m_title, WidgetTitle );
            if ( m_journeysSupported ) {
                addWidget( m_journeysWidget, WidgetQuickJourneySearch );
            }
            addWidget( m_filterWidget, WidgetFilter );
            break;

        case ShowIntermediateDepartureListTitle:
            // An intermediate deparure list is shown
            setIcon( GoBackIcon );
            m_icon->setToolTip( i18nc("@info:tooltip", "Go back to original stop") );
            setTitle( titleText() );

            // Same as for normal departure/arrival boards
            addWidget( m_title, WidgetTitle );
            if ( m_journeysSupported ) {
                addWidget( m_journeysWidget, WidgetQuickJourneySearch );
            }
            addWidget( m_filterWidget, WidgetFilter );
            break;

        case ShowSearchJourneyLineEdit: {
            // The journey search UI is shown
            setIcon( AbortJourneySearchIcon );
            m_icon->setToolTip( i18nc("@info:tooltip", "Abort search for journeys "
                                                       "to or from the home stop" ) );

            // Add widgets
            addJourneySearchWidgets();
            Plasma::LineEdit *journeySearchLine =
                    castedWidget<Plasma::LineEdit>(WidgetJourneySearchLine);
            journeySearchLine->setEnabled( true );
            journeySearchLine->setFocus();
            journeySearchLine->nativeWidget()->selectAll();
            break;
        }
        case ShowSearchJourneyLineEditDisabled:
            // The journey search UI is shown,
            // but the currently used service provider does not support journeys
            setIcon( AbortJourneySearchIcon );
            m_icon->setToolTip( i18nc("@info:tooltip", "Abort search for journeys "
                                                       "to or from the home stop") );

            // Add widgets
            addJourneySearchWidgets();

            // Disable all widgets, because journeys are not supported by the currently used
            // service provider
            castedWidget<Plasma::LineEdit>(WidgetJourneySearchLine)->setEnabled( false );
            castedWidget<Plasma::LineEdit>(WidgetFillJourneySearchLineButton)->setEnabled( false );
            castedWidget<Plasma::LineEdit>(WidgetStartJourneySearchButton)->setEnabled( false );
            break;

        case ShowJourneyListTitle: {
            // A list of journeys is shown
            setIcon( validJourneyData ? JourneyListOkIcon : JourneyListErrorIcon );
            m_icon->setToolTip( i18nc("@info:tooltip", "Show available actions in the applet") );

            // Add a close icon to close the journey view
            int iconExtend = 26 * m_settings->sizeFactor();
            Plasma::IconWidget *closeIcon = new Plasma::IconWidget;
            closeIcon->setIcon( "window-close" );
            closeIcon->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
            closeIcon->setMinimumSize( iconExtend, iconExtend );
            closeIcon->setMaximumSize( iconExtend, iconExtend );
            closeIcon->setToolTip( i18nc("@info:tooltip", "Show departures / arrivals") );
            connect( closeIcon, SIGNAL(clicked()), this, SIGNAL(closeIconClicked()) );
            addWidget( closeIcon, WidgetCloseIcon );

            // Add a title label
            addWidget( m_title, WidgetTitle );
            break;
        }
    }
}
예제 #25
0
void QPhotorec::qphotorec_search_setupUI()
{
  clearWidgets();
  delete this->layout();
  QVBoxLayout *mainLayout = new QVBoxLayout();
  QWidget *t_copy = copyright(this);

  QSizePolicy c_sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);

  QLabel *disk_img=new QLabel();
  QPixmap disk_pixmap = QPixmap(":res/gnome/drive-harddisk.png");
  disk_img->setPixmap(disk_pixmap);
  disk_img->setSizePolicy(c_sizePolicy);

  QLabel *disk_txt=new QLabel();
  disk_txt->setText(selected_disk->description_short(selected_disk));

  QWidget *diskWidget = new QWidget();
  QHBoxLayout *diskWidgetLayout = new QHBoxLayout(diskWidget);
  diskWidgetLayout->addWidget(disk_img);
  diskWidgetLayout->addWidget(disk_txt);
  diskWidget->setLayout(diskWidgetLayout);

  QLabel *folder_img=new QLabel();
  QPixmap *folder_pixmap = new QPixmap(":res/gnome/folder.png");
  folder_img->setPixmap(*folder_pixmap);
  folder_img->setSizePolicy(c_sizePolicy);

  folder_txt=new QLabel();
  folder_txt->setTextFormat(Qt::RichText);
  folder_txt->setTextInteractionFlags(Qt::TextBrowserInteraction);
  folder_txt->setOpenExternalLinks(true);

  QWidget *folderWidget = new QWidget();
  QHBoxLayout *folderWidgetLayout = new QHBoxLayout(folderWidget);
  folderWidgetLayout->addWidget(folder_img);
  folderWidgetLayout->addWidget(folder_txt);
  folderWidget->setLayout(folderWidgetLayout);


  progress_info=new QLabel();
  progress_filefound=new QLabel();
  progress_bar=new QProgressBar();

  QWidget *progressWidget = new QWidget();
  QHBoxLayout *progressWidgetLayout = new QHBoxLayout(progressWidget);
  progressWidgetLayout->addWidget(progress_info);
  progressWidgetLayout->addWidget(progress_bar);
  progressWidgetLayout->addWidget(progress_filefound);
  progressWidget->setLayout(progressWidgetLayout);

  QWidget *progressWidget2 = new QWidget();
  QHBoxLayout *progressWidgetLayout2 = new QHBoxLayout(progressWidget2);
// TODO
//  progressWidgetLayout2->addWidget(progress_elapsed);
//  progressWidgetLayout2->addWidget(progress_eta);
  progressWidget2->setLayout(progressWidgetLayout2);

  QStringList oLabel;
  oLabel.append("File familly");
  oLabel.append("Number of files recovered");

  filestatsWidget=new QTableWidget();
  filestatsWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
  filestatsWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
  filestatsWidget->setSelectionMode(QAbstractItemView::SingleSelection);
  filestatsWidget->verticalHeader()->hide();
  filestatsWidget->setColumnCount( 2 );
  filestatsWidget->setHorizontalHeaderLabels( oLabel );
  filestatsWidget->resizeColumnsToContents();

  QPushButton *button_quit= new QPushButton(QIcon::fromTheme("application-exit", QIcon(":res/gnome/application-exit.png")), tr("&Quit"));
  mainLayout->addWidget(t_copy);
  mainLayout->addWidget(diskWidget);
  mainLayout->addWidget(folderWidget);
  mainLayout->addWidget(progressWidget);
  mainLayout->addWidget(progressWidget2);
  mainLayout->addWidget(filestatsWidget);
  mainLayout->addWidget(button_quit);
  this->setLayout(mainLayout);

  connect( button_quit, SIGNAL(clicked()), this, SLOT(stop_and_quit()) );
  connect(this, SIGNAL(finished()), qApp, SLOT(quit()));

  timer = new QTimer(this);
  timer->setInterval(500);
  connect(timer, SIGNAL(timeout()), this, SLOT(qphotorec_search_updateUI()));
}
예제 #26
0
void QPhotorec::setupUI()
{
  QWidget *t_copy = copyright(this);
  QLabel *t_free_soft = new QLabel(tr("PhotoRec is free software, and comes with ABSOLUTELY NO WARRANTY."));
  QLabel *t_select = new QLabel(tr("Please select a media to recover from"));

  HDDlistWidget = new QComboBox();
  HDDlistWidget->setToolTip(tr("Disk capacity must be correctly detected for a successful recovery.\n"
      "If a disk listed above has an incorrect size, check HD jumper settings and BIOS\n"
      "detection, and install the latest OS patches and disk drivers.")
  );

  QStringList oLabel;
  oLabel.append("");
  oLabel.append(tr("Flags"));
  oLabel.append(tr("Type"));
  oLabel.append(tr("File System"));
  oLabel.append(tr("Size"));
  oLabel.append(tr("Label"));

  PartListWidget= new QTableWidget();
  PartListWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
  PartListWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
  PartListWidget->setSelectionMode(QAbstractItemView::SingleSelection);
  PartListWidget->verticalHeader()->hide();
  PartListWidget->setShowGrid(false);
  PartListWidget->setColumnCount( 6 );
  PartListWidget->setHorizontalHeaderLabels( oLabel );
  PartListWidget_updateUI();

  QGroupBox *groupBox1;
  QGroupBox *groupBox2;

  groupBox1 = new QGroupBox(tr("File System type"));
  qextRadioButton = new QRadioButton(tr("ext2/ext3/ext4 filesystem"));
  qfatRadioButton = new QRadioButton(tr("FAT/NTFS/HFS+/ReiserFS/..."));
  qfatRadioButton->setChecked(true);

  groupBox2 = new QGroupBox();
  qfreeRadioButton = new QRadioButton(tr("Free: Scan for file from unallocated space only"));
  qwholeRadioButton = new QRadioButton(tr("Whole: Extract files from whole partition"));
  qfreeRadioButton->setEnabled(false);
  qwholeRadioButton->setChecked(true);


  QVBoxLayout *groupBox1Layout = new QVBoxLayout;
  QVBoxLayout *groupBox2Layout = new QVBoxLayout;

  groupBox1Layout->addWidget(qextRadioButton);
  groupBox1Layout->addWidget(qfatRadioButton);
  groupBox1->setLayout(groupBox1Layout);

  groupBox2Layout->addWidget(qfreeRadioButton);
  groupBox2Layout->addWidget(qwholeRadioButton);
  groupBox2->setLayout(groupBox2Layout);

  QWidget *groupBox= new QWidget();
  QHBoxLayout *groupBoxLayout = new QHBoxLayout;
  groupBoxLayout->addWidget(groupBox1);
  groupBoxLayout->addWidget(groupBox2);
  groupBox->setLayout(groupBoxLayout);


  QLabel *dstWidget= new QLabel(tr("Please select a destination to save the recovered files to."));
  directoryLabel=new QLineEdit("");
  QPushButton *dst_button = new QPushButton(
      QIcon::fromTheme("folder", QIcon(":res/gnome/folder.png")),
      tr("&Browse"));

  QWidget *dst_widget= new QWidget(this);
  QWidget *dst_widget2= new QWidget(this);

  QHBoxLayout *dst_widgetLayout2 = new QHBoxLayout;
  dst_widgetLayout2->addWidget(directoryLabel);
  dst_widgetLayout2->addWidget(dst_button);
  dst_widget2->setLayout(dst_widgetLayout2);

  QVBoxLayout *dst_widgetLayout = new QVBoxLayout;
  dst_widgetLayout->addWidget(dstWidget);
  dst_widgetLayout->addWidget(dst_widget2);
  dst_widget->setLayout(dst_widgetLayout);
  

  button_search = new QPushButton(QIcon::fromTheme("go-next", QIcon(":res/gnome/go-next.png")), "&Search");
  button_search->setEnabled(false);
  QPushButton *button_quit= new QPushButton(QIcon::fromTheme("application-exit", QIcon(":res/gnome/application-exit.png")), "&Quit");
  QPushButton *button_about= new QPushButton(QIcon::fromTheme("help-about", QIcon(":res/gnome/help-about.png")), "&About");
  QPushButton *button_formats= new QPushButton(QIcon::fromTheme("image-x-generic.png", QIcon(":res/gnome/image-x-generic.png")),tr("&File Formats"));

  QWidget *B_widget = new QWidget(this);
  QHBoxLayout *B_layout = new QHBoxLayout(B_widget);
  B_layout->addWidget(button_about);
  B_layout->addWidget(button_formats);
  B_layout->addWidget(button_search);
  B_layout->addWidget(button_quit);
  B_widget->setLayout(B_layout);

  clearWidgets();
//  QLayout *mainLayout = this->layout();
  delete this->layout();
  QVBoxLayout *mainLayout = new QVBoxLayout();
  mainLayout->addWidget(t_copy);
  mainLayout->addWidget(t_free_soft);
  mainLayout->addWidget(t_select);
  mainLayout->addWidget(HDDlistWidget);
  mainLayout->addWidget(PartListWidget);
  mainLayout->addWidget(groupBox);
  mainLayout->addWidget(dst_widget);
  mainLayout->addWidget(B_widget);
  this->setLayout(mainLayout);

  HDDlistWidget_updateUI();
  buttons_updateUI();

  connect(button_about, SIGNAL(clicked()), this, SLOT(qphotorec_about()) );
  connect(button_formats, SIGNAL(clicked()), this, SLOT(qphotorec_formats()) );
  connect(button_search, SIGNAL(clicked()), this, SLOT(qphotorec_search()) );
  connect(button_quit, SIGNAL(clicked()), qApp, SLOT(quit()) );
  connect(HDDlistWidget, SIGNAL(activated(int)),this,SLOT(disk_changed(int)));
  connect(PartListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(partition_selected()));
  connect(dst_button, SIGNAL(clicked()), this, SLOT(setExistingDirectory()));
  connect(directoryLabel, SIGNAL(editingFinished()), this, SLOT(buttons_updateUI()));
}
예제 #27
0
        void kMediaScrollView::addMedia( vector<shared_ptr<MediaHolder> > _media ){

            clearWidgets();
            string type;

            for (int i=0; i<_media.size(); i++)
            {

                type = _media[i]->getType();

                if(type == "clip") {
                    shared_ptr<kClipShow> btn = make_shared<kClipShow>();
                    btn->setSize(widgetSize);

                    shared_ptr< Clip > clip = dynamic_pointer_cast< Clip >( _media[i] );

                    btn->setClip( clip );

                    btn->value = i;
                    addWidget( btn );

                    ofAddListener( *btn->events.lookup("press"),this,&kMediaScrollView::btnClicked);
                    ofAddListener( *btn->events.lookup("drag"),this,&kMediaScrollView::btnDragged);

                }
                else if(type == "sample") {

//                    shared<kSampleShow> btn = make_shared<kSampleShow>();
//                    btn->setSize(widgetSize);
//                    btn->setSample( _samples[i] );
//
//                    btn->value = i;
//                    addWidget( btn );
//
//                    ofAddListener( *btn->events.lookup("press"),this,&kButtonView::btnClicked);
//                    ofAddListener( *btn->events.lookup("drag"),this,&kButtonView::btnDragged);

                }
                else if(type == "text") {

//                    shared<kTextShow> btn = make_shared<kTextShow>();
//                    btn->setSize(widgetSize);
//                    btn->setText( _texts[i] );
//
//                    btn->value = i;
//                    addWidget( btn );
//
//                    ofAddListener( *btn->events.lookup("press"),this,&kButtonView::btnClicked);
//                    ofAddListener( *btn->events.lookup("drag"),this,&kButtonView::btnDragged);

                }



            }



            arrangeWidgets();


        }
예제 #28
0
void KstEditViewObjectDialogI::updateWidgets() {
  // clear all the current widgets from the grid
  clearWidgets();

  // get the qt properties of the viewobject
  if (_viewObject) {
    _customWidget = _viewObject->configWidget();
    if (_customWidget) {
      _grid = new QGridLayout(_propertiesFrame, 1, 1);
      _customWidget->reparent(_propertiesFrame, QPoint(0, 0));
      _grid->addWidget(_customWidget, 0, 0);
      _viewObject->fillConfigWidget(_customWidget, _isNew);
      if (!_isNew) {
        _viewObject->connectConfigWidget(this, _customWidget);
      }
      resize(minimumSizeHint());
      return;
    }
    
    //---------------------------------------------------------------
    // NOTE: due to Early return, nothing after this line is executed
    // if the view object provides a custom widget.

    int numProperties = _viewObject->metaObject()->numProperties(true);

    // create a new grid
    _grid = new QGridLayout(_propertiesFrame, numProperties, 2, 0, 8);
    _grid->setColStretch(0,0);
    _grid->setColStretch(1,1);
    
    // get the property names and types
    for (int i = 0; i < numProperties; i++) {
      const QMetaProperty* property = _viewObject->metaObject()->property(i, true);
      QString propertyType(property->type());
      QString propertyName(property->name());
     
      // for this property, get the meta-data map
      QMap<QString, QVariant> metaData = _viewObject->widgetHints(propertyName);
      
      if (!metaData.empty()) {
        QString friendlyName = metaData["_kst_label"].toString();
        QString widgetType = metaData["_kst_widgetType"].toString();
        metaData.erase("_kst_label");
        metaData.erase("_kst_widgetType");
        
        // use friendly name for label
        QLabel* propertyLabel = new QLabel(_propertiesFrame, "label-"+i);
        propertyLabel->setText(friendlyName);
        _grid->addWidget(propertyLabel,i,0);
        _widgets.append(propertyLabel);
        propertyLabel->show();
        
        // display different types of widgets depending on what dialogData specifies
        QWidget* propertyWidget = 0L;
        if (widgetType == "QSpinBox") {
          // insert a spinbox
          propertyWidget = new QSpinBox(_propertiesFrame, (propertyName+","+"value").latin1()); 
          propertyWidget->setProperty("value", _viewObject->property(property->name()));
          if (!_isNew) {
            connect(propertyWidget, SIGNAL(valueChanged(const QString&)), this, SLOT(modified()));
            connect(propertyWidget->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(modified()));
          }
        } else if (widgetType == "KColorButton") {