virtual void next() { if ( !c_->ok() ) { setComplete(); return; } if ( bc_ ) { if ( firstMatch_.isEmpty() ) { firstMatch_ = bc_->currKeyNode().key; // if not match if ( query_.woCompare( firstMatch_, BSONObj(), false ) ) { setComplete(); return; } _gotOne(); } else { if ( !firstMatch_.woEqual( bc_->currKeyNode().key ) ) { setComplete(); return; } _gotOne(); } } else { if ( !matcher_->matches(c_->currKey(), c_->currLoc() ) ) { } else if( !c_->getsetdup(c_->currLoc()) ) { _gotOne(); } } c_->advance(); }
virtual void next() { if ( !c_->ok() ) { setComplete(); return; } if ( matcher_->matches( c_->currKey(), c_->currLoc() ) ) { one_ = c_->current(); setComplete(); } else { c_->advance(); } }
void Order::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) { utility::string_t namePrefix = prefix; if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) { namePrefix += utility::conversions::to_string_t("."); } if(multipart->hasContent(utility::conversions::to_string_t("id"))) { setId(ModelBase::int64_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("id")))); } if(multipart->hasContent(utility::conversions::to_string_t("petId"))) { setPetId(ModelBase::int64_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("petId")))); } if(multipart->hasContent(utility::conversions::to_string_t("quantity"))) { setQuantity(ModelBase::int32_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("quantity")))); } if(multipart->hasContent(utility::conversions::to_string_t("shipDate"))) { setShipDate(ModelBase::dateFromHttpContent(multipart->getContent(utility::conversions::to_string_t("shipDate")))); } if(multipart->hasContent(utility::conversions::to_string_t("status"))) { setStatus(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("status")))); } if(multipart->hasContent(utility::conversions::to_string_t("complete"))) { setComplete(ModelBase::boolFromHttpContent(multipart->getContent(utility::conversions::to_string_t("complete")))); } }
void PanoOptimizePage::initializePage() { d->title->setText(i18n("<qt>" "<p>The optimization step according to your settings is ready to be performed.</p>" "<p>This step can include an automatic leveling of the horizon, and also " "an automatic projection selection and size</p>" "<p>To perform this operation, the <command>%1</command> program from the " "<a href='%2'>%3</a> project will be used.</p>" "<p>Press the \"Next\" button to run the optimization.</p>" "</qt>", QDir::toNativeSeparators(d->mngr->autoOptimiserBinary().path()), d->mngr->autoOptimiserBinary().url().url(), d->mngr->autoOptimiserBinary().projectName())); // QPair<double, int> result = d->mngr->cpFindUrlData().standardDeviation(); // d->preprocessResults->setText(i18n("Alignment error: %1px", result.first / ((double) result.second))); d->detailsText->hide(); d->horizonCheckbox->show(); // d->projectionAndSizeCheckbox->show(); d->canceled = false; d->optimisationDone = false; setComplete(true); emit completeChanged(); }
void Order::fromJson(web::json::value& val) { if(val.has_field(utility::conversions::to_string_t("id"))) { setId(ModelBase::int64_tFromJson(val[utility::conversions::to_string_t("id")])); } if(val.has_field(utility::conversions::to_string_t("petId"))) { setPetId(ModelBase::int64_tFromJson(val[utility::conversions::to_string_t("petId")])); } if(val.has_field(utility::conversions::to_string_t("quantity"))) { setQuantity(ModelBase::int32_tFromJson(val[utility::conversions::to_string_t("quantity")])); } if(val.has_field(utility::conversions::to_string_t("shipDate"))) { setShipDate(ModelBase::dateFromJson(val[utility::conversions::to_string_t("shipDate")])); } if(val.has_field(utility::conversions::to_string_t("status"))) { setStatus(ModelBase::stringFromJson(val[utility::conversions::to_string_t("status")])); } if(val.has_field(utility::conversions::to_string_t("complete"))) { setComplete(ModelBase::boolFromJson(val[utility::conversions::to_string_t("complete")])); } }
void PanoLastPage::checkFiles() { QString dir = d->mngr->preProcessedMap().begin().key().toString(QUrl::RemoveFilename); QUrl panoUrl(dir + panoFileName(d->fileTemplateQLineEdit->text())); QUrl ptoUrl(dir + d->fileTemplateQLineEdit->text() + QLatin1String(".pto")); QFile panoFile(panoUrl.toString(QUrl::PreferLocalFile)); QFile ptoFile(ptoUrl.toString(QUrl::PreferLocalFile)); bool rawsOk = true; if (d->savePtoCheckBox->isChecked()) { for (auto& input : d->mngr->preProcessedMap().keys()) { if (input != d->mngr->preProcessedMap()[input].preprocessedUrl) { QString dir = input.toString(QUrl::RemoveFilename); QUrl derawUrl(dir + d->mngr->preProcessedMap()[input].preprocessedUrl.fileName()); QFile derawFile(derawUrl.toString(QUrl::PreferLocalFile)); rawsOk &= !derawFile.exists(); } } } if (panoFile.exists() || (d->savePtoCheckBox->isChecked() && ptoFile.exists())) { setComplete(false); emit completeChanged(); d->warningLabel->setText(i18n("<qt><p><font color=\"red\"><b>Warning:</b> " "This file already exists.</font></p></qt>")); d->warningLabel->show(); } else if (!rawsOk) { setComplete(true); emit completeChanged(); d->warningLabel->setText(i18n("<qt><p><font color=\"orange\"><b>Warning:</b> " "One or more converted raw files already exists (they will be skipped during the copying process).</font></p></qt>")); d->warningLabel->show(); } else { setComplete(true); emit completeChanged(); d->warningLabel->hide(); } }
virtual void _init() { if ( requireIndex_ && strcmp( qp().indexKey().firstElement().fieldName(), "$natural" ) == 0 ) throw MsgAssertionException( 9011 , "Not an index cursor" ); c_ = qp().newCursor(); if ( !c_->ok() ) { setComplete(); } }
bool MethodResponseParser::testStartElement(const XML_Char* name, const XML_Char** /*atts*/) { ULXR_TRACE("MethodResponseParser::testStartElement(const XML_Char*, const char**)" << "\n name: " << name ); switch(states.top()->getParserState() ) { case eNone: if(strcmp(name, "methodResponse") == 0) { setComplete (false); states.push(new ValueState(eMethodResponse)); } else return false; break; case eMethodResponse: if(strcmp(name, "fault") == 0) states.push(new ValueState(eFault)); else if(strcmp(name, "params") == 0) states.push(new ValueState(eParams)); else return false; break; case eFault: if(strcmp(name, "value") == 0) states.push(new ValueState(eValue)); else return false; break; case eParams: if(strcmp(name, "param") == 0) states.push(new ValueState(eParam)); else return false; break; case eParam: if(strcmp(name, "value") == 0) states.push(new ValueState(eValue)); else return false; break; default: return false; } return true; }
virtual void init() { if ( requireIndex_ && strcmp( qp().indexKey().firstElement().fieldName(), "$natural" ) == 0 ) throw MsgAssertionException( 9011 , "Not an index cursor" ); c_ = qp().newCursor(); if ( !c_->ok() ) setComplete(); else matcher_.reset( new CoveredIndexMatcher( qp().query(), qp().indexKey() ) ); }
bool PanoLastPage::validatePage() { if (d->copyDone) return true; setComplete(false); copyFiles(); return false; }
bool MyWork::process() { logMsg(boost::format("Processing work %d") % m_id); if (++m_count > 5) { setComplete(); getEventTable().postEvent(shared_from_this(), 0); return true; } else { return false; } }
bool PanoOptimizePage::validatePage() { if (d->optimisationDone) return true; setComplete(false); process(); return false; }
bool PanoPreviewPage::validatePage() { if (d->stitchingDone) return true; setComplete(false); startStitching(); return false; }
FadeStateTransition::FadeStateTransition(FadeDirection direction, sf::Color color, float duration) : StateTransition() , direction(direction) , overlay(sf::Vector2f(256.0f, 240.0f)) , fadeTask(direction == FADE_OUT ? FadeColorTask::FADE_OUT : FadeColorTask::FADE_IN, overlay, duration) { setComplete(false); color.a = direction == FADE_OUT ? 0 : 255; overlay.setFillColor(color); }
void PanoPreviewPage::preInitializePage() { d->title->setText(QString()); d->previewWidget->show(); d->progressBar->progressCompleted(); d->progressBar->hide(); d->postProcessing->hide(); setComplete(true); emit completeChanged(); }
/** * \brief Constructor - creates the GUI * \author Peter Grasch * @param parent * Parent of the widget */ ImportTrainingDirectoryWorkingPage::ImportTrainingDirectoryWorkingPage(QWidget* parent) : QWizardPage(parent), importer(new ImportTrainingData(this)), completed(false) { ui.setupUi(this); setTitle(i18n("Processing folder...")); connect(importer, SIGNAL(done()), this, SLOT(setComplete())); connect(importer, SIGNAL(progress(int,int)), this, SLOT(displayProgress(int,int))); connect(importer, SIGNAL(status(QString)), this, SLOT(displayStatus(QString))); connect(importer, SIGNAL(error(QString)), this, SLOT(displayError(QString))); }
void _gotOne(){ if ( skip_ ){ skip_--; return; } if ( limit_ > 0 && count_ >= limit_ ){ setComplete(); return; } count_++; }
void wpPartMan::clearPage() { setComplete(false); delete terminal; delete gridLayout; delete label; setupUi(this); connect(terminal, SIGNAL(finished()), this, SLOT(terminalFinished())); QStringList args; args << "/bin/bash" << BACKEND_PATH << "-e" << "run_partmgr" << backend->cfg("partman_program") << backend->cfg("partman_disk"); terminal->setArgs(args); terminal->startShellProgram(); terminal->setFocus(Qt::OtherFocusReason); }
void finish() { if ( explain_ ) { n_ = ordering_ ? so_->size() : n_; } else if ( ordering_ ) { so_->fill(b_, filter_, n_); } if ( mayCreateCursor2() ) { c_->setTailable(); } // If the tailing request succeeded. if ( c_->tailable() ) { saveClientCursor_ = true; } setComplete(); }
void MaintenanceTool::slotDone() { QTime t = QTime::fromMSecsSinceStartOfDay(d->duration.elapsed()); if (d->notification) { // Pop-up a message to bring user when all is done. DNotificationWrapper(id(), i18n("Process is done.\nDuration: %1", t.toString()), qApp->activeWindow(), label()); } emit signalComplete(); setComplete(); }
virtual void next() { mayAdvance(); if ( _matchCount >= 101 ) { // This is equivalent to the default condition for switching from // a query to a getMore. setStop(); return; } if ( !_c || !_c->ok() ) { setComplete(); return; } if ( matcher( _c )->matchesCurrent( _c.get() ) && !_c->getsetdup( _c->currLoc() ) ) { ++_matchCount; } _mustAdvance = true; }
bool MethodResponseParser::testEndElement(const XML_Char *name) { ULXR_TRACE("MethodResponseParser::testEndElement(const XML_Char*)"); if (states.size() <= 1) throw RuntimeException(ApplicationError, "abnormal program behaviour: MethodResponseParser::testEndElement() had no states left"); std::auto_ptr<ValueState> curr(getTopValueState()); states.pop(); ValueState *on_top = getTopValueState(); switch(curr->getParserState() ) { case eMethodResponse: setComplete(true); assertEndElement(name, "methodResponse"); on_top->takeValue (curr->getValue()); if (on_top->getValue() != 0) method_value = *on_top->getValue(); break; case eFault: assertEndElement(name, "fault"); on_top->takeValue (curr->getValue()); break; case eParams: assertEndElement(name, "params"); on_top->takeValue (curr->getValue()); break; case eParam: assertEndElement(name, "param"); on_top->takeValue (curr->getValue()); break; default: states.push(curr.release()); // put back, someone else will process return false; } return true; }
bool MethodCallParser::testEndElement(const XML_Char *name) { ULXR_TRACE("MethodCallParser::testEndElement(const XML_Char*)"); if (states.size() <= 1) throw RuntimeException(ApplicationError, "abnormal program behaviour: MethodCallParser::testEndElement() had no states left"); std::auto_ptr<ValueState> curr(getTopValueState()); states.pop(); // ULXR_TRACE("\n current data: <" // << curr->getCharData() << ">"); switch(curr->getParserState() ) { case eMethodName: assertEndElement(name, "methodName"); methodcall.setMethodName(curr->getCharData()); break; case eMethodCall: assertEndElement(name, "methodCall"); setComplete(true); break; case eParams: assertEndElement(name, "params"); break; case eParam: assertEndElement(name, "param"); if (curr->getValue() != 0) methodcall.addParam(*curr->getValue()); delete curr->getValue(); break; default: states.push(curr.release()); // put back, someone else will process return false; } return true; }
// link this page to SimpleViewer to gain access to settings container. FirstRunPage::FirstRunPage(KPWizardDialog* const dlg) : KPWizardPage(dlg, i18n("First Run")), d(new Private) { KPVBox* const vbox = new KPVBox(this); QLabel* const info1 = new QLabel(vbox); info1->setWordWrap(true); info1->setText( i18n("<p>SimpleViewer's plugins are Flash components which are free to use, " "but use a license which comes into conflict with several distributions. " "Due to the license it is not possible to ship it with this tool.</p>" "<p>You can now download plugin from its homepage and point this tool " "to the downloaded archive. The archive will be stored with the plugin configuration, " "so it is available for further use.</p>" "<p><b>Note: Please download the plugin that you selected on the first page.</b></p>")); QLabel* const info2 = new QLabel(vbox); info2->setText(i18n("<p>1.) Download plugin from the following url:</p>")); QLabel* const link = new QLabel(vbox); link->setAlignment(Qt::AlignLeft); link->setOpenExternalLinks(true); link->setTextFormat(Qt::RichText); link->setTextInteractionFlags(Qt::LinksAccessibleByMouse); link->setText(QString::fromLatin1("<a href=\"%1\">%2</a>") .arg(QLatin1String("http://www.simpleviewer.net")) .arg(QLatin1String("http://www.simpleviewer.net"))); QLabel* const info3 = new QLabel(vbox); info3->setText(i18n("<p>2.) Point this tool to the downloaded archive</p>")); d->urlRequester = new KPFileSelector(vbox); d->urlRequester->lineEdit()->setText(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)); d->urlRequester->setFileDlgTitle(i18n("Select downloaded archive")); d->urlRequester->setFileDlgMode(QFileDialog::ExistingFile); connect(d->urlRequester, SIGNAL(signalUrlSelected(QUrl)), this, SLOT(slotUrlSelected(QUrl))); setPageWidget(vbox); setLeftBottomPix(QIcon::fromTheme(QStringLiteral("kipi-flash")).pixmap(128)); setComplete(false); }
bool HostInfo::process() { struct hostent *ret = gethostbyname(m_name.c_str()); if (!ret) { m_error = static_cast<ErrorState>(h_errno); } else { int i = 0; while (char *c = ret->h_addr_list[i++]) { IPV4Address addr(*reinterpret_cast<uint32_t*>(c)); m_addrList.push_back(addr); } i = 0; while (char *c = ret->h_aliases[i++]) { m_aliasList.push_back(c); } } m_errorMsg = DNS::ResolverThread::instance().error(m_error); Utils::timedCallback(boost::bind(m_handler, *this), 1); setComplete(); return true; }
void PanoIntroPage::initializePage() { setComplete(d->binariesWidget->allBinariesFound()); emit completeChanged(); }
void PanoIntroPage::slotBinariesChanged(bool found) { setComplete(found); emit completeChanged(); }
void FadeStateTransition::update(float dt) { fadeTask.update(dt); setComplete(fadeTask.isComplete()); }
void FileEvent::chainedComplete(FileEvent *event) { setComplete(event->successful(), event->message()); }
void Token::setFloat(float val){ float_val = val; token_string = boost::lexical_cast<std::string>(float_val); float_val_set = true; setComplete(); }