void PlotSettingsDialog::accept() { std::vector<QwtPlot*> plots_to_modify; if( all_plots_button_->isChecked() ) plots_to_modify = plots_; else { for( unsigned int i=0; i < plots_list_->count() ; i++ ) { if( plots_list_->item(i)->isSelected( ) ) plots_to_modify.push_back( plots_[i] ); } } if( !x_leave_unchanged_->isChecked() ) { if( x_autoscale_->isChecked() ) { setAutoScale( plots_to_modify, QwtPlot::xBottom ); } else { setScale( plots_to_modify, QwtPlot::xBottom, xmin_->text(), xmax_->text() ); } } if( !y_leave_unchanged_->isChecked() ) { if( y_autoscale_->isChecked() ) { setAutoScale( plots_to_modify, QwtPlot::yLeft ); } else { setScale( plots_to_modify, QwtPlot::yLeft, ymin_->text(), ymax_->text() ); } } QDialog::accept(); }
bool Image::setProperty(P_ID propertyId, const QVariant& v) { bool rv = true; score()->addRefresh(canvasBoundingRect()); switch(propertyId) { case P_AUTOSCALE: setAutoScale(v.toBool()); break; case P_SIZE: setSize(v.toSizeF()); break; case P_SCALE: setScale(v.toSizeF()); break; case P_LOCK_ASPECT_RATIO: setLockAspectRatio(v.toBool()); break; case P_SIZE_IS_SPATIUM: setSizeIsSpatium(v.toBool()); break; default: rv = Element::setProperty(propertyId, v); break; } setGenerated(false); score()->setLayoutAll(true); return rv; }
bool Image::setProperty(Pid propertyId, const QVariant& v) { bool rv = true; score()->addRefresh(canvasBoundingRect()); switch(propertyId) { case Pid::AUTOSCALE: setAutoScale(v.toBool()); break; case Pid::SIZE: setSize(v.toSizeF()); break; case Pid::LOCK_ASPECT_RATIO: setLockAspectRatio(v.toBool()); break; case Pid::SIZE_IS_SPATIUM: { QSizeF s = size2pixel(_size); setSizeIsSpatium(v.toBool()); _size = pixel2size(s); } break; default: rv = Element::setProperty(propertyId, v); break; } setGenerated(false); _dirty = true; triggerLayout(); return rv; }
void MainWindow::loadSettings(){ setFullScreen(false); setHideMenu(false); QSettings settingsNative; resize(settingsNative.value("size", QSize(320, 480 + ui.menuBar->height())).toSize()); move(settingsNative.value("pos", QPoint(0, 0)).toPoint()); int red = settingsNative.value("backgroundRed", 240).toInt(); int green = settingsNative.value("backgroundGreen", 240).toInt(); int blue = settingsNative.value("backgroundBlue", 240).toInt(); QColor backgroundColor = QColor(red, green, blue); red = settingsNative.value("canvasRed", 255).toInt(); green = settingsNative.value("canvasGreen", 255).toInt(); blue = settingsNative.value("canvasBlue", 255).toInt(); QColor canvasColor = QColor(red, green, blue); red = settingsNative.value("infoRed", 0).toInt(); green = settingsNative.value("infoGreen", 0).toInt(); blue = settingsNative.value("infoBlue", 0).toInt(); QColor infoColor = QColor(red, green, blue); setBackgroundColor(backgroundColor); setCanvasColor(canvasColor); setInfoColor(infoColor); updateBackgroundColor(); updateCanvasColor(); updateInfoColor(); QSettings settings(Constants::SETTINGS_FOLDER + "/" + Constants::PLAYER_SETTINGS_FILE, QSettings::IniFormat); setWidth(settings.value("width", 320).toInt()); setHeight(settings.value("height", 480).toInt()); setScale(settings.value("scale", 100).toInt()); setFps(settings.value("fps", 60).toInt()); setOrientation(static_cast<Orientation>(settings.value("orientation", ePortrait).toInt())); setDrawInfos(settings.value("drawInfos", false).toBool()); setAutoScale(settings.value("autoScale", false).toBool()); setAlwaysOnTop(settings.value("alwaysOnTop", false).toBool()); checkLoadedSettings(); updateFps(); updateDrawInfos(); updateAlwaysOnTop(); updateAutoScale(); updateOrientation(); updateResolution(); }
// *NOTE: returns true if NO failures to set occurred, false otherwise. // However, be aware that if a failure to set does occur, it does // not stop setting fields from the LLSD! bool LLMediaEntry::fromLLSDInternal(const LLSD& sd, bool overwrite) { // *HACK: we sort of cheat here and assume that status is a // bit field. We "or" into status and instead of returning // it, we return whether it finishes off as LSL_STATUS_OK or not. U32 status = LSL_STATUS_OK; // "general" fields if ( overwrite || sd.has(ALT_IMAGE_ENABLE_KEY) ) { status |= setAltImageEnable( sd[ALT_IMAGE_ENABLE_KEY] ); } if ( overwrite || sd.has(CONTROLS_KEY) ) { status |= setControls( (MediaControls)(LLSD::Integer)sd[CONTROLS_KEY] ); } if ( overwrite || sd.has(CURRENT_URL_KEY) ) { // Don't check whitelist status |= setCurrentURLInternal( sd[CURRENT_URL_KEY], false ); } if ( overwrite || sd.has(HOME_URL_KEY) ) { status |= setHomeURL( sd[HOME_URL_KEY] ); } if ( overwrite || sd.has(AUTO_LOOP_KEY) ) { status |= setAutoLoop( sd[AUTO_LOOP_KEY] ); } if ( overwrite || sd.has(AUTO_PLAY_KEY) ) { status |= setAutoPlay( sd[AUTO_PLAY_KEY] ); } if ( overwrite || sd.has(AUTO_SCALE_KEY) ) { status |= setAutoScale( sd[AUTO_SCALE_KEY] ); } if ( overwrite || sd.has(AUTO_ZOOM_KEY) ) { status |= setAutoZoom( sd[AUTO_ZOOM_KEY] ); } if ( overwrite || sd.has(FIRST_CLICK_INTERACT_KEY) ) { status |= setFirstClickInteract( sd[FIRST_CLICK_INTERACT_KEY] ); } if ( overwrite || sd.has(WIDTH_PIXELS_KEY) ) { status |= setWidthPixels( (LLSD::Integer)sd[WIDTH_PIXELS_KEY] ); } if ( overwrite || sd.has(HEIGHT_PIXELS_KEY) ) { status |= setHeightPixels( (LLSD::Integer)sd[HEIGHT_PIXELS_KEY] ); } // "security" fields if ( overwrite || sd.has(WHITELIST_ENABLE_KEY) ) { status |= setWhiteListEnable( sd[WHITELIST_ENABLE_KEY] ); } if ( overwrite || sd.has(WHITELIST_KEY) ) { status |= setWhiteList( sd[WHITELIST_KEY] ); } // "permissions" fields if ( overwrite || sd.has(PERMS_INTERACT_KEY) ) { status |= setPermsInteract( 0xff & (LLSD::Integer)sd[PERMS_INTERACT_KEY] ); } if ( overwrite || sd.has(PERMS_CONTROL_KEY) ) { status |= setPermsControl( 0xff & (LLSD::Integer)sd[PERMS_CONTROL_KEY] ); } return LSL_STATUS_OK == status; }
void MainWindow::fullScreenWindow(bool _fullScreen){ setAutoScale(_fullScreen); setFullScreen(_fullScreen); actionFull_Screen(fullScreen()); updateAutoScale(); }
void MainWindow::actionAuto_Scale(bool checked){ setAutoScale(checked); updateAutoScale(); }