void MyProcess::setupSignals() { connect(git, SIGNAL(cancelAllProcesses()), this, SLOT(on_cancel())); connect(this, SIGNAL(readyReadStandardOutput()), this, SLOT(on_readyReadStandardOutput())); connect(this, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(on_finished(int, QProcess::ExitStatus))); if (receiver) { connect(this, SIGNAL(readyReadStandardError ()), this, SLOT(on_readyReadStandardError())); connect(this, SIGNAL(procDataReady(const QByteArray&)), receiver, SLOT(procReadyRead(const QByteArray&))); connect(this, SIGNAL(eof()), receiver, SLOT(procFinished())); } Domain* d = git->curContext(); if (d) connect(d, SIGNAL(cancelDomainProcesses()), this, SLOT(on_cancel())); }
void stop() { if(localSM().isRunning()) { on_cancel(); localSM().stop(); } }
DataLoader::DataLoader(Git* g, FileHistory* f) : QProcess(g), git(g), fh(f) { canceling = parsing = false; isProcExited = true; halfChunk = NULL; dataFile = NULL; loadedBytes = 0; guiUpdateTimer.setSingleShot(true); connect(git, SIGNAL(cancelAllProcesses()), this, SLOT(on_cancel())); connect(&guiUpdateTimer, SIGNAL(timeout()), this, SLOT(on_timeout())); }
void Task::stop() { boost::mutex::scoped_lock lock(m_mutex); lock.unlock(); cancel(); lock.lock(); if (!is_done()) { m_end = time(NULL); m_cond.notify_all(); } m_status = CANCELED; //m_status should always be CANCELED once stop() has been called lock.unlock(); on_cancel(); }
void DynamicBox::show(vpz::Dynamic* dyn) { mDyn = dyn; mDialog->set_title((fmt(_("Dynamics: %1%")) % dyn->name()).str()); makeComboPackage(); makeComboLibrary(); if (mDialog->run() == Gtk::RESPONSE_OK) { mDialog->hide(); on_apply(); } else { mDialog->hide(); on_cancel(); } }
void DataLoader::on_cancel(const FileHistory* f) { if (f == fh) on_cancel(); }
ProviderDialog::ProviderDialog(MainObject *mOb, QDialog *parent) : QDialog(parent) { mainObject = mOb; //provider = prov; //setFixedWidth(300); setWindowIcon(QIcon(":/icons/provider")); setWindowTitle("Provider"); QVBoxLayout *mainOuterLayout = new QVBoxLayout(); this->setLayout(mainOuterLayout); mainOuterLayout->setContentsMargins(0,0,0,0); mainOuterLayout->setSpacing(0); //** Header Label headerLabel = new QLabel(); headerLabel->setText("-- provider --"); headerLabel->setStyleSheet("font-size: 20pt; background-color: white; color: green;"); mainOuterLayout->addWidget(headerLabel); QVBoxLayout *mainLayout = new QVBoxLayout(); mainOuterLayout->addLayout(mainLayout); mainLayout->setContentsMargins(20,20,20,20); mainLayout->setSpacing(10); //QString styleGrp = QString("QGroupBox{ border:2px solid gray;border-radius:5px; margin-top: 1ex;} QGroupBox::title{subcontrol-origin: margin;subcontrol-position:top left;padding:0px 3px;}"); QString styleGrp = QString("QGroupBox{ border:1px solid gray; margin-top: 2ex;} QGroupBox::title{subcontrol-origin: margin;subcontrol-position:top left;padding:0px 3px;}"); //*************************************************** //** Browse Button Group QGroupBox *grpBrowse = new QGroupBox(); grpBrowse->setTitle("Open in web browser.."); grpBrowse->setStyleSheet(styleGrp); mainLayout->addWidget(grpBrowse); QHBoxLayout *grpBrowseLayout = new QHBoxLayout(); grpBrowseLayout->setContentsMargins(10,10,10,10); grpBrowse->setLayout(grpBrowseLayout); //** Browser Buttons QButtonGroup *buttonGroupBrowse = new QButtonGroup(this); connect(buttonGroupBrowse, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(on_browse_button(QAbstractButton*)) ); buttHomePage = new QPushButton(); buttHomePage->setText("Home page"); grpBrowseLayout->addWidget(buttHomePage); buttonGroupBrowse->addButton(buttHomePage); buttPrices = new QPushButton(); buttPrices->setText("Prices"); grpBrowseLayout->addWidget(buttPrices); buttonGroupBrowse->addButton(buttPrices); buttSignUp = new QPushButton(); buttSignUp->setText("Sign Up"); grpBrowseLayout->addWidget(buttSignUp); buttonGroupBrowse->addButton(buttSignUp); buttLogin = new QPushButton(); buttLogin->setText("Login"); grpBrowseLayout->addWidget(buttLogin); buttonGroupBrowse->addButton(buttLogin); mainLayout->addSpacing(20); //************************************************************* //** Credentials grpCredentials = new QGroupBox(); grpCredentials->setTitle("Account Details"); grpCredentials->setCheckable(true); grpCredentials->setStyleSheet(styleGrp); mainLayout->addWidget(grpCredentials); connect(grpCredentials, SIGNAL(clicked(bool)), this, SLOT(on_credentials_checkbox(bool))); QGridLayout *credLayout = new QGridLayout(); credLayout->setContentsMargins(10,20,10,10); grpCredentials->setLayout(credLayout); int row =0; QLabel *lblUsername = new QLabel("Username"); credLayout->addWidget( lblUsername, row, 0 ); txtUsername = new QLineEdit(); credLayout->addWidget(txtUsername, ++row, 0, 1, 1); QLabel *lblPassword = new QLabel("Password"); credLayout->addWidget( lblPassword, ++row, 0, 1, 1 ); txtPass = new QLineEdit(); credLayout->addWidget(txtPass, ++row, 0, 1, 1); //credLayout->addSpacing(10); QLabel *lblEmail = new QLabel("Email"); credLayout->addWidget( lblEmail, ++row, 0 ); txtEmail = new QLineEdit(); credLayout->addWidget(txtEmail, ++row, 0, 1, 2); credLayout->setColumnStretch(0,1); credLayout->setColumnStretch(1,1); mainLayout->addSpacing(20); //************************************************** //** Buttons QHBoxLayout *buttonBox = new QHBoxLayout(); mainLayout->addLayout(buttonBox); buttonBox->addStretch(10); QPushButton *cancelButton = new QPushButton(); cancelButton->setText("Cancel"); cancelButton->setIcon(QIcon(":/icons/black")); buttonBox->addWidget(cancelButton); connect(cancelButton, SIGNAL(clicked()), this, SLOT(on_cancel())); QPushButton *saveButton = new QPushButton(); saveButton->setText("Save"); saveButton->setIcon(QIcon(":/icons/ok")); buttonBox->addWidget(saveButton); connect(saveButton, SIGNAL(clicked()), this, SLOT(on_save())); statusBar = new XStatusBar(); mainOuterLayout->addWidget(statusBar); statusBar->showMessage("Loaded", 2000); }