void qvortaro::slot_ansichtSpeichern() { ConfigViewDgl dlg; dlg.setCurrentView(getView()); dlg.adjustSize(); if (dlg.exec() == QDialog::Accepted) { QString name = dlg.name(); if (!name.isEmpty() && !Config::instance()->storedViews().keys().contains(name)) { Config::instance()->setStoredView(name, dlg.getConfig()); createActionsForViews(); restoreView(Config::instance()->storedViews().value(name)); } else { QMessageBox::warning( this, "qVortaro", trUtf8("Ansicht konnte nicht gespeichert werden.\n Mögliche Ursachen:\n - Der angegebene Name wird bereits verwendet\n - Der angegebene Namen war leer"), QMessageBox::Ok); } } }
/** * Shows previous view. */ void RS_GraphicView::zoomPrevious() { RS_DEBUG->print("RS_GraphicView::zoomPrevious"); if (container) { restoreView(); } }
void GameOverScreen::render(double edt) { setupOrthoView(); glDisable(GL_TEXTURE_2D); glColor4f(0.25f, 0.0f, 0.0f, 1.0); glBegin(GL_TRIANGLE_STRIP); glVertex3f(1.0f, -0.5f, 0.0f); glVertex3f(1.0f, 0.5f, 0.0f); glVertex3f(-1.0f, -0.5f, 0.0f); glVertex3f(-1.0f, 0.5f, 0.0f); glEnd(); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); glEnable(GL_TEXTURE_2D); textRenderer->setFontSize(1.0 / 24.0); textRenderer->renderText(ALIGN_CENTER, Vector(0.0, 0.0), "|f00|Game Over|fff|"); Engine::VideoSystem *videoSystem = Engine::Core::getInstance()->getVideoSystem(); videoSystem->bindTexture("Interface"); cursor->render(edt); glDisable(GL_TEXTURE_2D); glColor4f(fadeColor.x, fadeColor.y, fadeColor.z, iplFadeOpacity.getValue(edt)); glBegin(GL_TRIANGLE_STRIP); glVertex3f(1.0f, -0.5f, 0.0f); glVertex3f(1.0f, 0.5f, 0.0f); glVertex3f(-1.0f, -0.5f, 0.0f); glVertex3f(-1.0f, 0.5f, 0.0f); glEnd(); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); glEnable(GL_TEXTURE_2D); restoreView(); }
bool RearMirrorTools::mousePressEvent(int x, int y) { if (_windowed) { if (_closeIconRect.contains(x, y)) { _windowed = false; emit closeView(); return true; } /* Disabled for now https://worklist.net/19548 if (_resetIconRect.contains(x, y)) { emit resetView(); return true; } */ if (_headZoomIconRect.contains(x, y)) { _zoomLevel = HEAD; Application::getInstance()->bumpSettings(); return true; } if (_bodyZoomIconRect.contains(x, y)) { _zoomLevel = BODY; Application::getInstance()->bumpSettings(); return true; } if (_bounds.contains(x, y)) { _windowed = false; emit restoreView(); return true; } } if (_fullScreen) { if (_shrinkIconRect.contains(x, y)) { _fullScreen = false; emit shrinkView(); return true; } } return false; }
bool RearMirrorTools::mousePressEvent(int x, int y) { if (_windowed) { if (_closeIconRect.contains(x, y)) { _windowed = false; emit closeView(); return true; } if (_resetIconRect.contains(x, y)) { emit resetView(); return true; } if (_headZoomIconRect.contains(x, y)) { _zoomLevel = HEAD; return true; } if (_bodyZoomIconRect.contains(x, y)) { _zoomLevel = BODY; return true; } if (_bounds.contains(x, y)) { _windowed = false; emit restoreView(); return true; } } if (_fullScreen) { if (_shrinkIconRect.contains(x, y)) { _fullScreen = false; emit shrinkView(); return true; } } return false; }
void qvortaro::slot_ansichtLaden(QAction *_act) { if (Config::instance()->storedViews().contains(_act->text())) restoreView(Config::instance()->storedViews().value(_act->text())); }
qvortaro::qvortaro(QWidget *parent) : QMainWindow(parent) { Config::instance()->read(); ui.setupUi(this); statusBar()->hide(); createMenuAndActions(); QObject::connect(m_aBeenden, SIGNAL(triggered()), this, SLOT(slot_quit())); QObject::connect(m_agAnordnungLexika, SIGNAL(triggered(QAction*)), this, SLOT(slot_changeAnordnungLexika(QAction*))); QObject::connect(m_agGestaltungLexikaAnordnung, SIGNAL(triggered(QAction*)), this, SLOT(slot_changeGestaltungLexika(QAction*))); QObject::connect(m_agGestaltungLexikaGestaltung, SIGNAL(triggered(QAction*)), this, SLOT(slot_changeGestaltungLexika(QAction*))); QObject::connect(m_agLexika1, SIGNAL(triggered(QAction*)), this, SLOT(slot_changeLexika1(QAction*))); QObject::connect(m_agLexika2, SIGNAL(triggered(QAction*)), this, SLOT(slot_changeLexika2(QAction*))); QObject::connect(m_agCaption, SIGNAL(triggered(QAction*)), this, SLOT(slot_changeCaption(QAction*))); QObject::connect(m_aProgrammEinrichten, SIGNAL(triggered()), this, SLOT(slot_configDgl())); QObject::connect(m_aAnsichtSpeichern, SIGNAL(triggered()), this, SLOT(slot_ansichtSpeichern())); QObject::connect(m_aAnsichtZeigeLanguage2, SIGNAL(triggered(bool)), this, SLOT(slot_zeigeLanguage2())); QObject::connect(m_aAnsichtZeigeLanguage2, SIGNAL(toggled(bool)), this, SLOT(slot_zeigeLanguage2())); QObject::connect(m_agAnsichtLaden, SIGNAL(triggered(QAction*)), this, SLOT(slot_ansichtLaden(QAction*))); QObject::connect(m_aUeber, SIGNAL(triggered()), this, SLOT(slot_showUeber())); QObject::connect(m_aStayOnTop, SIGNAL(triggered(bool)), this, SLOT(slot_stayOnTop())); mySearchLayout1 = new SearchLayout1(); ui.sw->insertWidget(0, mySearchLayout1); ui.sw->setCurrentIndex(0); // Zwischenablage m_cb = QApplication::clipboard(); m_cbStringLast = getCbString(); m_cbTimer = new QTimer(this); m_cbTimer->setSingleShot(true); QObject::connect(m_cbTimer, SIGNAL(timeout()), this, SLOT(slot_checkCb())); slot_checkCb(); // Keine Wörterbücher gefunden if (Config::instance()->languages().isEmpty()) { if (!Config::instance()->containsPathLexika(QApplication::applicationDirPath()+QDir::separator()+"dict") && !Config::instance()->containsPathLexika(QApplication::applicationDirPath())) QMessageBox::warning( this, "qVortaro - "+trUtf8("Keine Wörterbücher gefunden"), trUtf8("Es konnten keine Wörterbucher gefunden werden!\n\n" "Bitte überprüfen Sie unter »Einstellungen->aVortaro einrichten«,\n" "ob der richtige Pfad zum Ordner mit den Wörterbüchern\n" "angegeben wurde."), QMessageBox::Ok); } if (Config::instance()->restoreOnStartup() && !Config::instance()->currentView().isEmpty() && Config::instance()->currentView().contains("zeigeLanguage2")) { restoreView(Config::instance()->currentView()); m_aStayOnTop->setChecked(Config::instance()->stayOnTop()); slot_stayOnTop(); } else { m_aStayOnTop->setChecked(false); slot_stayOnTop(); Config::instance()->setCurrentView(getDefaultView()); restoreView(getDefaultView()); adjustSize(); } }