void PicasawebWindow::slotButtonClicked(int button)
{
    switch (button)
    {
        case Close:
            if (m_widget->progressBar()->isHidden())
            {
                writeSettings();
                m_widget->imagesList()->listView()->clear();
                m_widget->progressBar()->progressCompleted();
                done(Close);
            }
            else // cancel login/transfer
            {
                m_widget->progressBar()->progressCompleted();
                cancelProcessing();
            }
            break;
        case User1:
            slotStartTransfer();
            break;
        default:
             KDialog::slotButtonClicked(button);
             break;
    }
}
Example #2
0
processMultireads::processMultireads(QWidget *parent) :
    QWidget(parent),
    progressView(new analysisProgressView(this)),
    multireadsView(new processMultireadsView(this))
{
    // set a window title
    setWindowTitle(tr("Rcount-multireads"));

    // initialize all the other widgets
    // get and set the minimal sizes
    int minWidth = multireadsView->sizeHint().width();
    int minHeight = multireadsView->sizeHint().height()+progressView->sizeHint().height()*1.5;
    this->setMinimumHeight(minHeight);
    this->setMinimumWidth(minWidth);

    // layout
    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(multireadsView);
    layout->addWidget(progressView);
    setLayout(layout);

    // hide the progressView
    //! progressView->hide();

    // connections
    connect(&processor, SIGNAL(processStatus(QString)), progressView, SLOT(updateStatus(QString)));
    connect(&processor, SIGNAL(processProgress(int)), progressView, SLOT(updateProgress(int)));
    connect(&processor, SIGNAL(errorMessage(QString)), progressView, SLOT(updateStatus(QString)));
    //! connect(&processor, SIGNAL(idleAgain()), this, SLOT(hideProgress()));
    connect(&processor, SIGNAL(workFinished(QString)), multireadsView, SLOT(removeFromQueue(QString)));
    connect(progressView, SIGNAL(analysisCanceled()), &processor, SLOT(cancelProcessing()));
    connect(multireadsView, SIGNAL(closeAll()), &processor, SLOT(cancelProcessing()));
    connect(multireadsView, SIGNAL(closeAll()), this, SLOT(close()));
    connect(multireadsView, SIGNAL(processReads(QString)), this, SLOT(runProcessor(QString)));

}