Core::IUAVGadget* UploaderGadgetFactory::createGadget(QWidget *parent) { UploaderGadgetWidget* gadgetWidget = new UploaderGadgetWidget(parent); isautocapable=gadgetWidget->autoUpdateCapable(); connect(this,SIGNAL(autoUpdate()),gadgetWidget,SLOT(autoUpdate())); connect(gadgetWidget,SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep,QVariant)),this,SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep,QVariant))); return new UploaderGadget(QString("Uploader"), gadgetWidget, parent); }
void DefinitionManager::checkForUpdates() { // show update dialog if (!isUpdating) autoUpdate(); if (!isUpdating) { // nothing needs updating // hide update dialog // show completion } }
AutoUpdatePage::AutoUpdatePage(SetupWizard *wizard, QWidget *parent) : AbstractWizardPage(wizard, parent), ui(new Ui::AutoUpdatePage) { ui->setupUi(this); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); Q_ASSERT(pm); UploaderGadgetFactory *uploader = pm->getObject<UploaderGadgetFactory>(); Q_ASSERT(uploader); connect(ui->startUpdate, SIGNAL(clicked()), this, SLOT(disableButtons())); connect(ui->startUpdate, SIGNAL(clicked()), uploader, SIGNAL(autoUpdate())); connect(uploader, SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep, QVariant)), this, SLOT(updateStatus(uploader::AutoUpdateStep, QVariant))); }
OnlineServices::OnlineServices(QNetworkAccessManager * nam, QObject * parent) : QObject(parent) , m_nam(nam) , m_haveTutorial(false) { // set the global reference App::onlineServices = this; #if !defined(NO_UPDATE_CHECK) // start-up operations autoUpdate(); #endif }
int PrevWndApiHelper::AutoUpdate(u32 id, BOOL enable) { if (autoUpdate) { #pragma pack(push, 1) struct { u32 id; BOOL enable; } inPars = {id, enable}; #pragma pack(pop) return autoUpdate(autoUpdatePar, (byte *) &inPars, 0); } return -1; }
void Debugger::event() { char t[256]; switch(SNES::debugger.break_event) { case SNES::Debugger::BreakEvent::BreakpointHit: { unsigned n = SNES::debugger.breakpoint_hit; echo(string() << "Breakpoint " << n << " hit (" << SNES::debugger.breakpoint[n].counter << ").<br>"); if(SNES::debugger.breakpoint[n].source == SNES::Debugger::Breakpoint::Source::CPUBus) { SNES::debugger.step_cpu = true; SNES::cpu.disassemble_opcode(t, SNES::cpu.opcode_pc); string s = t; s.replace(" ", " "); echo(string() << "<font color='#a00000'>" << s << "</font><br>"); disassembler->refresh(Disassembler::CPU, SNES::cpu.opcode_pc); } if(SNES::debugger.breakpoint[n].source == SNES::Debugger::Breakpoint::Source::APURAM) { SNES::debugger.step_smp = true; SNES::smp.disassemble_opcode(t, SNES::smp.opcode_pc); string s = t; s.replace(" ", " "); echo(string() << "<font color='#a00000'>" << t << "</font><br>"); disassembler->refresh(Disassembler::SMP, SNES::smp.opcode_pc); } } break; case SNES::Debugger::BreakEvent::CPUStep: { SNES::cpu.disassemble_opcode(t, SNES::cpu.regs.pc); string s = t; s.replace(" ", " "); echo(string() << "<font color='#0000a0'>" << s << "</font><br>"); disassembler->refresh(Disassembler::CPU, SNES::cpu.regs.pc); } break; case SNES::Debugger::BreakEvent::SMPStep: { SNES::smp.disassemble_opcode(t, SNES::smp.regs.pc); string s = t; s.replace(" ", " "); echo(string() << "<font color='#a00000'>" << s << "</font><br>"); disassembler->refresh(Disassembler::SMP, SNES::smp.regs.pc); } break; } autoUpdate(); }
nsresult nsDOMCSSDeclaration::RemoveProperty(const nsCSSProperty aPropID) { css::Declaration* decl = GetCSSDeclaration(PR_FALSE); if (!decl) { return NS_OK; // no decl, so nothing to remove } // For nsDOMCSSAttributeDeclaration, SetCSSDeclaration will lead to // Attribute setting code, which leads in turn to BeginUpdate. We // need to start the update now so that the old rule doesn't get used // between when we mutate the declaration and when we set the new // rule (see stack in bug 209575). mozAutoDocConditionalContentUpdateBatch autoUpdate(DocToUpdate(), PR_TRUE); decl = decl->EnsureMutable(); decl->RemoveProperty(aPropID); return SetCSSDeclaration(decl); }
void KUserTable::insertItem(KUser *aku) { KUserRow *tmpUser = new KUserRow(aku, pmUser); if (sort != -1) { bool isinserted = FALSE; for (int i=0;i<numRows();i++) { KUserRow *krow; krow = (KUserRow *)getRow(i); if (krow == NULL) break; if (isinserted) break; switch (sort) { case 0: if (krow->getData()->getName() > (const char *)aku->getName()) { insertRow(tmpUser, i); isinserted = TRUE; } break; case 1: if (krow->getData()->getFullName() > (const char *)aku->getFullName()) { insertRow(tmpUser, i); isinserted = TRUE; } break; } } if (!isinserted) { appendRow(tmpUser); } } else appendRow(tmpUser); if (autoUpdate()) repaint(); }
nsresult nsDOMCSSDeclaration::ParsePropertyValue(const nsCSSProperty aPropID, const nsAString& aPropValue, bool aIsImportant) { css::Declaration* olddecl = GetCSSDeclaration(PR_TRUE); if (!olddecl) { return NS_ERROR_FAILURE; } CSSParsingEnvironment env; GetCSSParsingEnvironment(env); if (!env.mPrincipal) { return NS_ERROR_NOT_AVAILABLE; } // For nsDOMCSSAttributeDeclaration, SetCSSDeclaration will lead to // Attribute setting code, which leads in turn to BeginUpdate. We // need to start the update now so that the old rule doesn't get used // between when we mutate the declaration and when we set the new // rule (see stack in bug 209575). mozAutoDocConditionalContentUpdateBatch autoUpdate(DocToUpdate(), PR_TRUE); css::Declaration* decl = olddecl->EnsureMutable(); nsCSSParser cssParser(env.mCSSLoader); bool changed; nsresult result = cssParser.ParseProperty(aPropID, aPropValue, env.mSheetURI, env.mBaseURI, env.mPrincipal, decl, &changed, aIsImportant); if (NS_FAILED(result) || !changed) { if (decl != olddecl) { delete decl; } return result; } return SetCSSDeclaration(decl); }
NS_IMETHODIMP nsDOMCSSDeclaration::SetCssText(const nsAString& aCssText) { // We don't need to *do* anything with the old declaration, but we need // to ensure that it exists, or else SetCSSDeclaration may crash. css::Declaration* olddecl = GetCSSDeclaration(PR_TRUE); if (!olddecl) { return NS_ERROR_FAILURE; } CSSParsingEnvironment env; GetCSSParsingEnvironment(env); if (!env.mPrincipal) { return NS_ERROR_NOT_AVAILABLE; } // For nsDOMCSSAttributeDeclaration, SetCSSDeclaration will lead to // Attribute setting code, which leads in turn to BeginUpdate. We // need to start the update now so that the old rule doesn't get used // between when we mutate the declaration and when we set the new // rule (see stack in bug 209575). mozAutoDocConditionalContentUpdateBatch autoUpdate(DocToUpdate(), PR_TRUE); nsAutoPtr<css::Declaration> decl(new css::Declaration()); decl->InitializeEmpty(); nsCSSParser cssParser(env.mCSSLoader); bool changed; nsresult result = cssParser.ParseDeclarations(aCssText, env.mSheetURI, env.mBaseURI, env.mPrincipal, decl, &changed); if (NS_FAILED(result) || !changed) { return result; } return SetCSSDeclaration(decl.forget()); }
void SyncState::sync() { m_timer.restart(); // Set up directory structure, if necessary std::string tmpPath = cpp3ds::FileSystem::getFilePath("sdmc:/3ds/BrewMan/tmp"); std::string cachePath = cpp3ds::FileSystem::getFilePath("sdmc:/3ds/BrewMan/cache"); std::string installedPath = cpp3ds::FileSystem::getFilePath("sdmc:/3ds/BrewMan/installed"); if (pathExists(tmpPath.c_str(), false)) removeDirectory(tmpPath.c_str()); mkdir(tmpPath.c_str(), 0777); if (!pathExists(cachePath.c_str(), false)) mkdir(cachePath.c_str(), 0777); if (!pathExists(installedPath.c_str(), false)) mkdir(installedPath.c_str(), 0777); // If auto-dated, boot into newest BrewMan if (autoUpdate()) { char buf[256]; size_t len; FILE *src = fopen("sdmc:/3ds/BrewMan/tmp/update.3dsx", "rb"); FILE *dst = fopen("sdmc:/3ds/BrewMan/tmp/update-copy.3dsx", "wb"); while ((len = fread(buf, 1, sizeof(buf), src)) > 0) fwrite(buf, 1, sizeof(buf), dst); fclose(src); fclose(dst); bootApp("/3ds/BrewMan/tmp/update.3dsx", ""); requestStackClear(); return; } git_repository *repo = NULL; const char *repoUrl = "git://github.com/Repo3DS/ideal-enigma.git"; const std::string path = cpp3ds::FileSystem::getFilePath(REPO_DIR); git_clone_options opts = GIT_CLONE_OPTIONS_INIT; setStatus("Fetching git repo..."); int error = git_clone(&repo, repoUrl, path.c_str(), NULL); if (error < 0) { if (error == GIT_EEXISTS) { error = git_repository_open(&repo, path.c_str()); if (error == 0) { git_remote *remote; error = git_remote_lookup(&remote, repo, "origin"); if (error == 0) { error = git_remote_fetch(remote, NULL, NULL, "pull"); if (error == 0) { git_annotated_commit *our_head, *their_heads[1]; if (git_repository_fetchhead_foreach(repo, find_master, NULL) == 0) { git_annotated_commit_from_fetchhead(&their_heads[0], repo, "master", repoUrl, &m_git_oid); git_merge_analysis_t analysis; git_merge_preference_t prefs; git_merge_analysis(&analysis, &prefs, repo, (const git_annotated_commit**)their_heads, 1); if (analysis & GIT_MERGE_ANALYSIS_UP_TO_DATE) printf("up to date\n"); else if (analysis & GIT_MERGE_ANALYSIS_FASTFORWARD) { printf("fast-forwarding\n"); // if (git_merge(repo, (const git_annotated_commit **)their_heads, 1, NULL, NULL) == 0) { git_reference *ref; git_reference *newref; if (git_reference_lookup(&ref, repo, "refs/heads/master") == 0) git_reference_set_target(&newref, ref, &m_git_oid, "BrewMan pull: Fast-forward"); git_reset_from_annotated(repo, their_heads[0], GIT_RESET_HARD, NULL); git_reference_free(ref); git_repository_state_cleanup(repo); } git_annotated_commit_free(their_heads[0]); } } } } git_repository_free(repo); const git_error *e = giterr_last(); if (e) { setStatus(_("Error %d/%d\n%s\nCloning repo again...", error, e->klass, e->message)); if (!removeDirectory(path.c_str())) { cpp3ds::sleep(cpp3ds::seconds(2.f)); sync(); } else { setStatus("Repo failure. Please report this error.\nAnd delete /3ds/BrewMan/repo/ and try again."); } return; } } const git_error *e = giterr_last(); if (e) { setStatus(_("Error %d/%d: %s", error, e->klass, e->message)); return; } } setStatus("Everything up-to-date!"); // Give the Title animation time to finish if necessary while (m_timer.getElapsedTime() < cpp3ds::seconds(5.f)) cpp3ds::sleep(cpp3ds::milliseconds(50)); requestStackClear(); requestStackPush(States::Browse); }
//called once every time a video frame is rendered, used to update "auto refresh" tool windows void Debugger::frameTick() { if(++frameCounter >= (SNES::system.region() == SNES::System::Region::NTSC ? 60 : 50)) { frameCounter = 0; autoUpdate(); } }
void Logic::setMoveDirection(MoveDirection aDirection) { if(aDirection != Move_Nothing) autoUpdate(aDirection); }
//connects gui buttons with Slots in this class void MainWindow::connectSignalSlots() { //connect signals/slots //load/save/open export folder connect(ui->pushButton_load, SIGNAL(clicked()), this, SLOT(loadUserFilePath())); connect(ui->pushButton_save, SIGNAL(clicked()), this, SLOT(saveUserFilePath())); connect(ui->pushButton_openExportFolder, SIGNAL(clicked()), this, SLOT(openExportFolder())); //zoom connect(ui->pushButton_zoomIn, SIGNAL(clicked()), this, SLOT(zoomIn())); connect(ui->pushButton_zoomOut, SIGNAL(clicked()), this, SLOT(zoomOut())); connect(ui->pushButton_resetZoom, SIGNAL(clicked()), this, SLOT(resetZoom())); connect(ui->pushButton_fitInView, SIGNAL(clicked()), this, SLOT(fitInView())); //calculate connect(ui->pushButton_calcNormal, SIGNAL(clicked()), this, SLOT(calcNormalAndPreview())); connect(ui->pushButton_calcSpec, SIGNAL(clicked()), this, SLOT(calcSpecAndPreview())); connect(ui->pushButton_calcDisplace, SIGNAL(clicked()), this, SLOT(calcDisplaceAndPreview())); connect(ui->pushButton_calcSsao, SIGNAL(clicked()), this, SLOT(calcSsaoAndPreview())); //switch between tabs connect(ui->tabWidget, SIGNAL(tabBarClicked(int)), this, SLOT(preview(int))); //display channel intensity connect(ui->checkBox_displayChannelIntensity, SIGNAL(clicked(bool)), this, SLOT(preview())); connect(ui->checkBox_displayChannelIntensity, SIGNAL(clicked(bool)), ui->radioButton_displayRed, SLOT(setEnabled(bool))); connect(ui->checkBox_displayChannelIntensity, SIGNAL(clicked(bool)), ui->radioButton_displayGreen, SLOT(setEnabled(bool))); connect(ui->checkBox_displayChannelIntensity, SIGNAL(clicked(bool)), ui->radioButton_displayBlue, SLOT(setEnabled(bool))); connect(ui->checkBox_displayChannelIntensity, SIGNAL(clicked(bool)), ui->radioButton_displayAlpha, SLOT(setEnabled(bool))); connect(ui->radioButton_displayRed, SIGNAL(clicked()), this, SLOT(displayChannelIntensity())); connect(ui->radioButton_displayGreen, SIGNAL(clicked()), this, SLOT(displayChannelIntensity())); connect(ui->radioButton_displayBlue, SIGNAL(clicked()), this, SLOT(displayChannelIntensity())); connect(ui->radioButton_displayAlpha, SIGNAL(clicked()), this, SLOT(displayChannelIntensity())); connect(ui->checkBox_displayChannelIntensity, SIGNAL(clicked()), this, SLOT(displayChannelIntensity())); //autoupdate after changed values // spec autoupdate connect(ui->doubleSpinBox_spec_redMul, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate())); connect(ui->doubleSpinBox_spec_greenMul, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate())); connect(ui->doubleSpinBox_spec_blueMul, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate())); connect(ui->doubleSpinBox_spec_alphaMul, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate())); connect(ui->doubleSpinBox_spec_scale, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate())); connect(ui->comboBox_mode_spec, SIGNAL(currentIndexChanged(int)), this, SLOT(autoUpdate())); connect(ui->doubleSpinBox_spec_contrast, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate())); // normal autoupdate connect(ui->checkBox_useRed_normal, SIGNAL(clicked()), this, SLOT(autoUpdate())); connect(ui->checkBox_useGreen_normal, SIGNAL(clicked()), this, SLOT(autoUpdate())); connect(ui->checkBox_useBlue_normal, SIGNAL(clicked()), this, SLOT(autoUpdate())); connect(ui->checkBox_useAlpha_normal, SIGNAL(clicked()), this, SLOT(autoUpdate())); connect(ui->comboBox_mode_normal, SIGNAL(currentIndexChanged(int)), this, SLOT(autoUpdate())); connect(ui->comboBox_method, SIGNAL(currentIndexChanged(int)), this, SLOT(autoUpdate())); connect(ui->doubleSpinBox_strength, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate())); connect(ui->checkBox_tileable, SIGNAL(clicked()), this, SLOT(autoUpdate())); connect(ui->checkBox_invertHeight, SIGNAL(clicked()), this, SLOT(autoUpdate())); connect(ui->spinBox_normalmapSize, SIGNAL(valueChanged(int)), this, SLOT(autoUpdate())); connect(ui->checkBox_keepLargeDetail, SIGNAL(clicked()), this, SLOT(autoUpdate())); connect(ui->spinBox_largeDetailScale, SIGNAL(valueChanged(int)), this, SLOT(autoUpdate())); connect(ui->doubleSpinBox_largeDetailHeight, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate())); // displcacement autoupdate connect(ui->doubleSpinBox_displace_redMul, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate())); connect(ui->doubleSpinBox_displace_greenMul, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate())); connect(ui->doubleSpinBox_displace_blueMul, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate())); connect(ui->doubleSpinBox_displace_scale, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate())); connect(ui->comboBox_mode_displace, SIGNAL(currentIndexChanged(int)), this, SLOT(autoUpdate())); connect(ui->doubleSpinBox_displace_contrast, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate())); // ssao autoupdate connect(ui->doubleSpinBox_ssao_size, SIGNAL(valueChanged(double)), this, SLOT(autoUpdate())); //graphicsview drag and drop connect(ui->graphicsView, SIGNAL(singleImageDropped(QUrl)), this, SLOT(loadSingleDropped(QUrl))); connect(ui->graphicsView, SIGNAL(multipleImagesDropped(QList<QUrl>)), this, SLOT(loadMultipleDropped(QList<QUrl>))); //graphicsview rightclick/middleclick/zoom connect(ui->graphicsView, SIGNAL(rightClick()), this, SLOT(resetZoom())); connect(ui->graphicsView, SIGNAL(middleClick()), this, SLOT(fitInView())); connect(ui->graphicsView, SIGNAL(zoomIn()), this, SLOT(zoomIn())); connect(ui->graphicsView, SIGNAL(zoomOut()), this, SLOT(zoomOut())); //queue (item widget) connect(ui->pushButton_removeImagesFromQueue, SIGNAL(clicked()), this, SLOT(removeImagesFromQueue())); connect(ui->pushButton_processQueue, SIGNAL(clicked()), this, SLOT(processQueue())); connect(ui->pushButton_stopProcessingQueue, SIGNAL(clicked()), this, SLOT(stopProcessingQueue())); connect(ui->pushButton_changeOutputPath_Queue, SIGNAL(clicked()), this, SLOT(changeOutputPathQueueDialog())); connect(ui->lineEdit_outputPath, SIGNAL(editingFinished()), this, SLOT(editOutputPathQueue())); connect(ui->listWidget_queue, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(queueItemDoubleClicked(QListWidgetItem*))); //queue drag and drop connect(ui->listWidget_queue, SIGNAL(singleImageDropped(QUrl)), this, SLOT(loadSingleDropped(QUrl))); connect(ui->listWidget_queue, SIGNAL(multipleImagesDropped(QList<QUrl>)), this, SLOT(loadMultipleDropped(QList<QUrl>))); //normalmap size preview text connect(ui->spinBox_normalmapSize, SIGNAL(valueChanged(int)), this, SLOT(normalmapSizeChanged())); //"About" button connect(ui->pushButton_about, SIGNAL(clicked()), this, SLOT(showAboutDialog())); }