void LYGithubProductBacklogCentralWidget::onSanityCheckReturned(LYProductBacklogModel::ProductBacklogSanityChecks sanityCheck){ QStringList missingIssues; QStringList orderedIssuesWithoutChildren; QStringList orderedIssuesWithChildren; if(sanityCheck.testFlag(LYProductBacklogModel::SanityCheckFailedMissingIssue)) missingIssues = productBacklog_->missingIssues(); if(sanityCheck.testFlag(LYProductBacklogModel::SanityCheckFailedFalseOrderedIssueNoChildren)) orderedIssuesWithoutChildren = productBacklog_->orderedIssuesWithoutChildren(); if(sanityCheck.testFlag(LYProductBacklogModel::SanityCheckFailedFalseOrderedIssueWithChildren)) orderedIssuesWithChildren = productBacklog_->orderedIssuesWithChildren(); if(!sanityCheck.testFlag(LYProductBacklogModel::SanityCheckPassed)){ LYGithubProductBacklogSanityCheckView *sanityCheckView = new LYGithubProductBacklogSanityCheckView(sanityCheck, productBacklog_->missingIssues(), productBacklog_->orderedIssuesWithoutChildren(), productBacklog_->orderedIssuesWithChildren()); int retVal = sanityCheckView->exec(); switch(retVal){ case QDialog::Accepted: productBacklog_->fixStartupIssues(); break; case QDialog::Rejected: emit requestQuit(); break; } } }
bool EventsManager::parseEventQuit(const Event &event) { if ((event.type == kEventQuit) || ((event.type == kEventKeyDown) && (event.key.keysym.mod & (KMOD_CTRL | KMOD_GUI)) && (event.key.keysym.sym == SDLK_q))) { requestQuit(); return true; } #ifdef WIN32 if ((event.type == kEventKeyDown) && (event.key.keysym.mod & KMOD_ALT) && (event.key.keysym.sym == SDLK_F4)) { requestQuit(); return true; } #endif return false; }
bool EventsManager::parseEventQuit(const Event &event) { if ((event.type == kEventQuit) || ((event.type == kEventKeyDown) && (event.key.keysym.mod & (KMOD_CTRL | KMOD_META)) && (event.key.keysym.sym == SDLK_q))) { requestQuit(); return true; } return false; }
ContextMenu::ContextMenu(QWidget *parent) : QDialog(parent) { setWindowFlags(Qt::FramelessWindowHint | Qt::Widget); setAutoFillBackground(true); calendar = new QPushButton(); network = new QPushButton(); settings = new QPushButton(); quit = new QPushButton(); calendar->setIcon(QIcon(":calendar.png")); calendar->setToolTip(tr("Calendar")); network->setIcon(QIcon(":network.png")); network->setToolTip(tr("Network")); settings->setIcon(QIcon(":settings.png")); settings->setToolTip(tr("Settings")); quit->setIcon(QIcon(":quit.png")); quit->setToolTip(tr("Quit")); connect(calendar, SIGNAL(clicked()), this, SIGNAL(requestCalendar())); connect(network, SIGNAL(clicked()), this, SIGNAL(requestNetwork())); connect(settings, SIGNAL(clicked()), this, SIGNAL(requestSettings())); connect(quit, SIGNAL(clicked()), this, SIGNAL(requestQuit())); connect(calendar, SIGNAL(clicked()), this, SLOT(hide())); connect(network, SIGNAL(clicked()), this, SLOT(hide())); connect(settings, SIGNAL(clicked()), this, SLOT(hide())); QHBoxLayout *layout = new QHBoxLayout(); layout->addWidget(calendar); layout->addWidget(network); layout->addWidget(settings); layout->addWidget(quit); setModal(true); setBackgroundRole(QPalette::Window); setLayout(layout); }
void Engine::runGameEngine(long dt) { View* topView = views.top(); topView->update(dt); if (newView != NULL) { views.push(newView); newView = NULL; } if (topView == views.top()) while (closingView) { delete views.pop(); closingView = false; } if (views.size() == 0) requestQuit(); }
void Engine::handleEvent(SDL_Event& event) { MouseButton button; int key; switch (event.type) { case SDL_QUIT: requestQuit(); break; case SDL_MOUSEMOTION: mouse.setPosition(event); break; case SDL_MOUSEBUTTONDOWN: button = static_cast<MouseButton>(event.button.button); views.top()->doMouseDown(button); break; case SDL_MOUSEBUTTONUP: button = static_cast<MouseButton>(event.button.button); views.top()->doMouseUp(button); break; case SDL_KEYDOWN: key = event.key.keysym.sym; views.top()->doKeyDown(key); break; case SDL_KEYUP: key = event.key.keysym.sym; views.top()->doKeyUp(key); break; default: break; } }
void HdrApp::update(float dt) { // Quit application if (isKeyDown(SDLK_ESCAPE)) requestQuit(); // Camera zoom in and out if (isButtonDown(2)) cam->zoom(getMouseRelY() * dt * 10.0f); // Camera rotate if (isButtonDown(0)) { cam->rotateX(getMouseRelX()*dt*10.0f); cam->rotateY(getMouseRelY()*dt*10.0f); } // Change mid point if (isKeyDown(SDLK_LEFT)) cam->setMid(mid = Math::clamp(mid-0.01f, 0.0f, 1.0f)); if (isKeyDown(SDLK_RIGHT)) cam->setMid(mid = Math::clamp(mid+0.01f, 0.0f, 1.0f)); // Reset effect parameters if (isKeyJustDown(SDLK_SPACE)) resetEffect(); // Exposure control keyIncControlDec(SDLK_e, exposureControl, 0.01f, 0.1f, 3.0f); exposure = Math::exp(exposureControl*exposureControl) - 1.0f; // Bloom factor keyIncControlDec(SDLK_o, bloomFactor, 0.01f, 0.0f, 1.0f); // Brightness threshold keyIncControlDec(SDLK_t, brightThreshold, 0.05f); // Reflection factor keyIncControlDec(SDLK_r, reflectionFactor, 0.01f, 0.0f, 1.0f); // Change mesh if (keyIncControlDecLoop(SDLK_m, currentMesh, (int)fileMesh.size())) { // If textured effect : block change to textured mesh if (currentEffect == 1 && currentMesh != 1) currentMesh = 1; mesh = TriMeshManager::get()->getTriMesh(fileMesh[currentMesh]); } // Change cube map if (keyIncControlDecLoop(SDLK_c, currentCubeMap, (int)fileCubeMap.size())) { cubeMapHdr.release(); cubeMapHdr.load(fileCubeMap.at(currentCubeMap), GL_RGBA16F_ARB); cubeMapRgb.release(); cubeMapRgb.load(fileCubeMap.at(currentCubeMap), GL_RGBA); } // Change shader effect if (keyIncControlDecLoop(SDLK_h, currentEffect, (int)shaderEffect.size())) { // If textured effect : block change to textured mesh (1 & 2) if (currentEffect == 1 && currentMesh != 1) { currentMesh = 1; mesh = TriMeshManager::get()->getTriMesh(fileMesh[currentMesh]); } } // Change fresnel parameters keyIncControlDec(SDLK_b, fresnelBias, 0.05f); keyIncControlDec(SDLK_s, fresnelScale, 0.05f); keyIncControlDec(SDLK_p, fresnelPower, 0.05f); // Change eta ratio keyIncControlDec(SDLK_5, etaRatio.x, 0.01f); keyIncControlDec(SDLK_6, etaRatio.y, 0.01f); keyIncControlDec(SDLK_7, etaRatio.z, 0.01f); keyIncControlDec(SDLK_a, etaRatio.x, 0.01f); keyIncControlDec(SDLK_a, etaRatio.y, 0.01f); keyIncControlDec(SDLK_a, etaRatio.z, 0.01f); // Change material color keyIncControlDec(SDLK_1, matColor.r, 0.01f); keyIncControlDec(SDLK_2, matColor.g, 0.01f); keyIncControlDec(SDLK_3, matColor.b, 0.01f); }