void QvisPostableWindowSimpleObserver::makeDefaultHelper() { if(makeDefaultConfirm) { QString msg(tr("Do you really want to make these the default attributes?")); // Ask the user if he really wants to set the defaults int button = QMessageBox::warning(0, "VisIt", msg, tr("Ok"), tr("Cancel"), tr("Yes, Do not prompt again"), 0, 1); if(button == 0) { // The user actually chose to set the defaults. makeDefault(); } else if(button == 2) { // Make it so no confirmation is needed. makeDefaultConfirm = false; GlobalAttributes *globalAtts = GetViewerState()->GetGlobalAttributes(); globalAtts->SetMakeDefaultConfirm(false); globalAtts->Notify(); makeDefault(); } } else makeDefault(); }
OrthogonalCamera* CameraManager::createOrthogonalCam(const std::string& name, const glm::dvec3& pos, const glm::dvec3& center, const double left, const double right, const double bottom, const double top, const double zNear, const double zFar) { if (m_cameras.size() == MAX_CAMERAS) { LOG_ERROR("Maximum number of cameras reached!"); abort(); } if (m_camera_names.find(name) != m_camera_names.end()) { LOG_ERROR("Camera already exists: ", name); abort(); } const auto offset = m_camera_buffer.alloc(); auto* const ptr = m_camera_buffer.offsetToPointer(offset); m_cameras.emplace_back(new OrthogonalCamera(pos, center, left, right, bottom, top, zNear, zFar, ptr)); m_camera_names.emplace(name, m_cameras.size()); if (m_cameras.size() == 1) { makeDefault(m_cameras.back().get()); } return reinterpret_cast<OrthogonalCamera*>(m_cameras.back().get()); }
PerspectiveCamera* CameraManager::createPerspectiveCam(const std::string& name, const glm::dvec3& pos, const glm::dvec3& center, const double fovy, const double aspect_ratio, const double near, const double far) { if (m_cameras.size() == MAX_CAMERAS) { LOG_ERROR("Maximum number of cameras reached!"); abort(); } if (m_camera_names.find(name) != m_camera_names.end()) { LOG_ERROR("Camera already exists: ", name); abort(); } const auto offset = m_camera_buffer.alloc(); auto* const ptr = m_camera_buffer.offsetToPointer(offset); m_cameras.emplace_back(new PerspectiveCamera(pos, center, fovy, aspect_ratio, near, far, ptr)); m_camera_names.emplace(name, m_cameras.size()); if (m_cameras.size() == 1) { makeDefault(m_cameras.back().get()); } return reinterpret_cast<PerspectiveCamera*>(m_cameras.back().get()); }
void TButton::setState( ushort aState, Boolean enable ) { TView::setState(aState, enable); if( aState & (sfSelected | sfActive) ) drawView(); if( (aState & sfFocused) != 0 ) makeDefault( enable ); }
void Settings::load () { QSettings settings; makeDefault (); _regionID = settings.value ("region", _regionID).toString (); _checks[C_ShowLight] = settings.value ("checks/light", _checks[C_ShowLight]).toBool (); _checks[C_ShowRank] = settings.value ("checks/rank", _checks[C_ShowRank]).toBool (); _checks[C_ShowTime] = settings.value ("checks/time", _checks[C_ShowTime]).toBool (); _checks[C_ShowHint] = settings.value ("checks/hint", _checks[C_ShowHint]).toBool (); _checks[C_UpdateOnWiFi] = settings.value ("checks/updateOnWifi", _checks[C_UpdateOnWiFi]).toBool (); _checks[C_UpdateOnGSM] = settings.value ("checks/updateOnGSM", _checks[C_UpdateOnGSM]).toBool (); _checks[C_UpdateWhenLocked] = settings.value ("checks/updateWhenLocked", _checks[C_UpdateWhenLocked]).toBool (); _updateIntervalIndex = minutes2IntervalIndex (settings.value ("updateInterval", intervalIndex2Minutes (_updateIntervalIndex)).toInt ()); setLanguageIndex (settings.value ("langIndex", _langIndex).toInt ()); }
void Config::createOrLoad() { QFile f(filename.c_str()); if(not QDir("download").exists()) QDir().mkdir("download"); if(not QDir("logs").exists()) QDir().mkdir("logs"); if(!f.exists()) { makeDefault(); makeFile(); } else { loadFile(f); } }