void RbUtilQt::configDialog() { Config *cw = new Config(this); connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings())); connect(cw, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo())); cw->show(); }
PlayerControls::PlayerControls(QMenu *appMenu, QWidget *parent) : QWidget(parent) { m_iShuffleMode = 1; m_iRepeatMode = 1; m_currentTrack = 0; m_mainLayout = new QGridLayout(this); m_localsMenu = new QMenu(tr("Add to list")); connect(PlistsGroup::instance(), SIGNAL(localsChanged(QStringList)), SLOT(onLocalsChanged(QStringList))); PlistsGroup::instance()->updateLocalLists(); setupCover(); setupTrackbar(); setupSliders(); setupButtons(appMenu); layout()->setMargin(0); connect(Settings::instance(), SIGNAL(changed()), SLOT(settingsUpdated())); }
void Settings::toggleVerticalDepth(bool value) { verticalDepth=value; QSettings info; info.setValue("verticaldepth",value); emit settingsUpdated(); }
void Settings::toggleAutoUpdate(bool up) { autoUpdate=up; QSettings info; info.setValue("autoupdate",up); emit settingsUpdated(); }
void InstallTalkWindow::updateSettings(void) { QString ttsName = RbSettings::value(RbSettings::Tts).toString(); TTSBase* tts = TTSBase::getTTS(this,ttsName); if(tts->configOk()) ui.labelTtsProfile->setText(tr("Selected TTS engine: <b>%1</b>") .arg(TTSBase::getTTSName(ttsName))); else ui.labelTtsProfile->setText(tr("Selected TTS engine: <b>%1</b>") .arg("Invalid TTS configuration!")); QString encoder = SystemInfo::value(SystemInfo::CurEncoder).toString(); EncBase* enc = EncBase::getEncoder(this,encoder); if(enc != NULL) { if(enc->configOk()) ui.labelEncProfile->setText(tr("Selected encoder: <b>%1</b>") .arg(EncBase::getEncoderName(encoder))); else ui.labelEncProfile->setText(tr("Selected encoder: <b>%1</b>") .arg("Invalid encoder configuration!")); } else ui.labelEncProfile->setText(tr("Selected encoder: <b>%1</b>") .arg("Invalid encoder configuration!")); setTalkFolder(RbSettings::value(RbSettings::LastTalkedFolder).toString()); emit settingsUpdated(); }
void Settings::pathChanged(const QString &path) { mcpath = path; QSettings info; info.setValue("mcdir", path); // save settings emit settingsUpdated(); }
/** * Initialise the module, called on startup * \returns 0 on success or -1 if initialisation failed */ int32_t GeofenceInitialize(void) { bool module_enabled = false; #ifdef MODULE_Geofence_BUILTIN module_enabled = true; #else uint8_t module_state[MODULESETTINGS_ADMINSTATE_NUMELEM]; ModuleSettingsAdminStateGet(module_state); if (module_state[MODULESETTINGS_ADMINSTATE_GEOFENCE] == MODULESETTINGS_ADMINSTATE_ENABLED) { module_enabled = true; } else { module_enabled = false; } #endif if (module_enabled) { GeoFenceSettingsInitialize(); // allocate and initialize the static data storage only if module is enabled geofenceSettings = (GeoFenceSettingsData *) PIOS_malloc(sizeof(GeoFenceSettingsData)); if (geofenceSettings == NULL) { module_enabled = false; return -1; } GeoFenceSettingsConnectCallback(settingsUpdated); settingsUpdated(NULL, NULL, NULL, 0); return 0; } return -1; }
KisColorSelectorNgDockerWidget::KisColorSelectorNgDockerWidget(QWidget *parent) : QWidget(parent), m_colorHistoryAction(0), m_commonColorsAction(0), m_verticalColorPatchesLayout(0), m_horizontalColorPatchesLayout(0), m_canvas(0) { setAutoFillBackground(true); m_colorSelectorContainer = new KisColorSelectorContainer(this); m_colorHistoryWidget = new KisColorHistory(this); m_commonColorsWidget = new KisCommonColors(this); //default settings //remember to also change the default in the ui file //shade selector //layout m_verticalColorPatchesLayout = new QHBoxLayout(); m_verticalColorPatchesLayout->setSpacing(0); m_verticalColorPatchesLayout->setMargin(0); m_verticalColorPatchesLayout->addWidget(m_colorSelectorContainer); m_horizontalColorPatchesLayout = new QVBoxLayout(this); m_horizontalColorPatchesLayout->setSpacing(0); m_horizontalColorPatchesLayout->setMargin(0); m_horizontalColorPatchesLayout->addLayout(m_verticalColorPatchesLayout); updateLayout(); connect(m_colorSelectorContainer, SIGNAL(openSettings()), this, SLOT(openSettings())); //emit settingsChanged() if the settings are changed in krita preferences KisPreferenceSetRegistry *preferenceSetRegistry = KisPreferenceSetRegistry::instance(); KisColorSelectorSettingsFactory* factory = dynamic_cast<KisColorSelectorSettingsFactory*>(preferenceSetRegistry->get("KisColorSelectorSettingsFactory")); Q_ASSERT(factory); connect(&(factory->repeater), SIGNAL(settingsUpdated()), this, SIGNAL(settingsChanged()), Qt::UniqueConnection); connect(this, SIGNAL(settingsChanged()), this, SLOT(updateLayout()), Qt::UniqueConnection); connect(this, SIGNAL(settingsChanged()), m_commonColorsWidget, SLOT(updateSettings()), Qt::UniqueConnection); connect(this, SIGNAL(settingsChanged()), m_colorHistoryWidget, SLOT(updateSettings()), Qt::UniqueConnection); connect(this, SIGNAL(settingsChanged()), m_colorSelectorContainer, SIGNAL(settingsChanged()), Qt::UniqueConnection); connect(this, SIGNAL(settingsChanged()), this, SLOT(update()), Qt::UniqueConnection); emit settingsChanged(); m_colorHistoryAction = new QAction("Show color history", this); m_colorHistoryAction->setShortcut(QKeySequence(tr("H"))); connect(m_colorHistoryAction, SIGNAL(triggered()), m_colorHistoryWidget, SLOT(showPopup()), Qt::UniqueConnection); m_commonColorsAction = new QAction("Show common colors", this); m_commonColorsAction->setShortcut(QKeySequence(tr("U"))); connect(m_commonColorsAction, SIGNAL(triggered()), m_commonColorsWidget, SLOT(showPopup()), Qt::UniqueConnection); }
void CreateVoiceWindow::change() { // save window settings saveSettings(); // call configuration dialog Config *cw = new Config(this,4); connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings())); cw->show(); }
void VariableEditorBase::updateVar() { if(_checkBox->isChecked()) { setValue(); } else { emit varDisable(_variableName); } emit settingsUpdated(); }
void Settings::okButtonClicked(){ int idVersion = getVersionIdByName(versionList->itemText(versionList->currentIndex())); int idServer = getServerIdByName(serverList->itemText(serverList->currentIndex())); int idEngine = getEngineIdByName(engineList->itemText(engineList->currentIndex())); int idUpdate = updateBehaviorList->currentIndex(); if(idVersion == -1 || idServer == -1 || idEngine == -1 || idUpdate == -1){ return; } emit settingsUpdated(idVersion, idEngine, idServer, idUpdate); close(); }
void KbPerf::update(QFile& cmd, bool force, bool saveCustomDpi){ if(!force && !_needsUpdate) return; emit settingsUpdated(); _needsUpdate = false; // Save DPI stage 0 (sniper) cmd.write(QString("dpi 0:%1,%2").arg(dpiX[0]).arg(dpiY[0]).toLatin1()); // If the mouse is set to a custom DPI, save it in stage 1 int stage = dpiCurIdx; if(stage < 0 && saveCustomDpi){ stage = 1; cmd.write(QString(" 1:%1,%2").arg(dpiCurX).arg(dpiCurY).toLatin1()); } else { // Otherwise, save stage 1 normally if(!dpiOn[1] && stage != 1) cmd.write(" 1:off"); else cmd.write(QString(" 1:%1,%2").arg(dpiX[1]).arg(dpiY[1]).toLatin1()); } // Save stages 1 - 5 for(int i = 2; i < DPI_COUNT; i++){ if(!dpiOn[i] && stage != i) cmd.write(QString(" %1:off").arg(i).toLatin1()); else cmd.write(QString(" %1:%2,%3").arg(i).arg(dpiX[i]).arg(dpiY[i]).toLatin1()); } // Save stage selection, lift height, and angle snap cmd.write(QString(" dpisel %1 lift %2 snap %3").arg(stage).arg(_liftHeight).arg(_angleSnap ? "on" : "off").toLatin1()); // Save DPI colors cmd.write(" rgb"); for(int i = 0; i < DPI_COUNT; i++){ QColor color = dpiColor(i); cmd.write(" dpi"); char output[9]; snprintf(output, sizeof(output), "%1d:%02x%02x%02x", i, color.red(), color.green(), color.blue()); cmd.write(output); } // Enable indicator notifications cmd.write(" inotify all"); // Set indicator state const char* iNames[HW_I_COUNT] = { "num", "caps", "scroll" }; for(int i = 0; i < HW_I_COUNT; i++){ if(hwIType[i] == ON) cmd.write(" ion "); else if(hwIType[i] == OFF) cmd.write(" ioff "); else cmd.write(" iauto "); cmd.write(iNames[i]); } }
/** @brief update displayed settings */ void CreateVoiceWindow::updateSettings(void) { // fill in language combobox QMap<QString, QString> languages = SystemInfo::languages(); for(int i = 0; i < languages.keys().size(); i++) { QString key = languages.keys().at(i); ui.comboLanguage->addItem(languages.value(key), key); } // set saved lang int sel = ui.comboLanguage->findText( RbSettings::value(RbSettings::VoiceLanguage).toString()); // if no saved language is found try to figure the language from the UI lang if(sel == -1) { QString f = RbSettings::value(RbSettings::Language).toString(); // if no language is set default to english. Make sure not to check an empty string. if(f.isEmpty()) f = "english"; sel = ui.comboLanguage->findData(f); qDebug() << "sel =" << sel; // still nothing found? if(sel == -1) sel = ui.comboLanguage->findText("english", Qt::MatchStartsWith); } ui.comboLanguage->setCurrentIndex(sel); QString ttsName = RbSettings::value(RbSettings::Tts).toString(); TTSBase* tts = TTSBase::getTTS(this,ttsName); if(tts->configOk()) ui.labelTtsProfile->setText(tr("Selected TTS engine: <b>%1</b>") .arg(TTSBase::getTTSName(ttsName))); else ui.labelTtsProfile->setText(tr("Selected TTS engine: <b>%1</b>") .arg("Invalid TTS configuration!")); QString encoder = SystemInfo::value(SystemInfo::CurEncoder).toString(); // only proceed if encoder setting is set EncBase* enc = EncBase::getEncoder(this,encoder); if(enc != NULL) { if(enc->configOk()) ui.labelEncProfile->setText(tr("Selected encoder: <b>%1</b>") .arg(EncBase::getEncoderName(encoder))); else ui.labelEncProfile->setText(tr("Selected encoder: <b>%1</b>") .arg("Invalid encoder configuration!")); } else ui.labelEncProfile->setText(tr("Selected encoder: <b>%1</b>") .arg("Invalid encoder configuration!")); ui.wavtrimthreshold->setValue(RbSettings::value(RbSettings::WavtrimThreshold).toInt()); emit settingsUpdated(); }
void InstallTalkWindow::change() { Config *cw = new Config(this,4); // make sure the current selected folder doesn't get lost on settings // changes. If the current selection is invalid don't accept it so // it gets reset to the old value after closing the settings dialog. QString folderToTalk = ui.lineTalkFolder->text(); if(QFileInfo(folderToTalk).isDir()) RbSettings::setValue(RbSettings::LastTalkedFolder, folderToTalk); connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings())); cw->show(); }
void AudioSettingsController::valuesUpdated(const QVariantMap& values) { bool advanced = SettingsComponent::Get().value(SETTINGS_SECTION_AUDIO, "advanced").toBool(); SettingsSection* audioSection = SettingsComponent::Get().getSection(SETTINGS_SECTION_AUDIO); if (values.contains("devicetype")) { QString type = values.value("devicetype").toString(); if (type == AUDIO_DEVICE_TYPE_BASIC) { setHiddenPassthrough(PlayerComponent::AudioCodecsAll(), true); } else if (type == AUDIO_DEVICE_TYPE_HDMI) { setHiddenPassthrough(PlayerComponent::AudioCodecsAll(), !advanced); } else if (type == AUDIO_DEVICE_TYPE_SPDIF) { setHiddenPassthrough(PlayerComponent::AudioCodecsAll(), true); setHiddenPassthrough(PlayerComponent::AudioCodecsSPDIF(), false); } emit settingsUpdated(SETTINGS_SECTION_AUDIO, audioSection->descriptions()); } if (values.contains("advanced")) { advanced = values.value("advanced").toBool(); if (audioSection->value("devicetype") == AUDIO_DEVICE_TYPE_HDMI) setHiddenPassthrough(PlayerComponent::AudioCodecsAll(), !advanced); audioSection->setValueHidden("exclusive", !advanced); emit settingsUpdated(SETTINGS_SECTION_AUDIO, audioSection->descriptions()); } }
void MainWindow::addTab(TabbedWidget* tab) { if(!tab->beginSetup()) return; addLookup(tab); setUpdatesEnabled(false); int tabNum = ui_tabWidget->addTab(tab->widget(), QString::fromAscii("")); ui_tabWidget->setCurrentIndex(tabNum); setUpdatesEnabled(true); tab->completeSetup(); moveToTab(tab); QObject::connect(this, SIGNAL(settingsUpdated()), tab->widget(), SLOT(refreshSettings())); emit updateActivatable(); }
/** @brief update displayed settings */ void CreateVoiceWindow::updateSettings(void) { // fill in language combobox QMap<QString, QStringList> languages = SystemInfo::languages(); for(int i = 0; i < languages.keys().size(); i++) { QString key = languages.keys().at(i); ui.comboLanguage->addItem(languages.value(key).at(1), languages.value(key).at(0)); } // set saved lang int sel = ui.comboLanguage->findData( RbSettings::value(RbSettings::VoiceLanguage).toString()); // if no saved language is found try to figure the language from the UI lang if(sel == -1) { QString uilang = RbSettings::value(RbSettings::Language).toString(); // if no language is set default to english. Make sure not to check an empty string. QString f = "english"; if(!uilang.isEmpty() && languages.contains(uilang)) { f = languages.value(uilang).at(0); } sel = ui.comboLanguage->findData(f); qDebug() << "[CreateVoiceWindow] Selected language index:" << sel; } ui.comboLanguage->setCurrentIndex(sel); QString ttsName = RbSettings::value(RbSettings::Tts).toString(); TTSBase* tts = TTSBase::getTTS(this,ttsName); if(!tts) { QMessageBox::critical(this, tr("TTS error"), tr("The selected TTS failed to initialize. You can't use this TTS.")); return; } if(tts->configOk()) ui.labelTtsProfile->setText(tr("Engine: <b>%1</b>") .arg(TTSBase::getTTSName(ttsName))); else ui.labelTtsProfile->setText(tr("Engine: <b>%1</b>") .arg("Invalid TTS configuration!")); ui.wavtrimthreshold->setValue(RbSettings::value(RbSettings::WavtrimThreshold).toInt()); emit settingsUpdated(); }
void MainWindow::settings() { if(m_editorSettingsDialog.exec()) emit settingsUpdated(); }
/** * Module task */ static void pathPlannerTask(void *parameters) { // If the PathStatus isn't available no follower is running and we should abort while (PathStatusHandle() == NULL || !TaskMonitorQueryRunning(TASKINFO_RUNNING_PATHFOLLOWER)) { AlarmsSet(SYSTEMALARMS_ALARM_PATHPLANNER, SYSTEMALARMS_ALARM_CRITICAL); PIOS_Thread_Sleep(1000); } AlarmsClear(SYSTEMALARMS_ALARM_PATHPLANNER); PathPlannerSettingsConnectCallback(settingsUpdated); settingsUpdated(PathPlannerSettingsHandle()); WaypointConnectCallback(waypointsUpdated); WaypointActiveConnectCallback(waypointsUpdated); PathStatusConnectCallback(pathStatusUpdated); FlightStatusData flightStatus; // Main thread loop bool pathplanner_active = false; path_status_updated = false; while (1) { PIOS_Thread_Sleep(UPDATE_RATE_MS); // When not running the path planner short circuit and wait FlightStatusGet(&flightStatus); if (flightStatus.FlightMode != FLIGHTSTATUS_FLIGHTMODE_PATHPLANNER) { pathplanner_active = false; continue; } if(pathplanner_active == false) { // Reset the state. Active waypoint should be set to an invalid // value to force waypoint 0 to become activated when starting // Note: this needs to be done before the callback is triggered! active_waypoint = -1; previous_waypoint = -1; // This triggers callback to update variable WaypointActiveGet(&waypointActive); waypointActive.Index = 0; WaypointActiveSet(&waypointActive); pathplanner_active = true; continue; } /* This method determines if we have achieved the goal of the active */ /* waypoint */ if (path_status_updated) checkTerminationCondition(); /* If advance waypoint takes a long time to calculate then it should */ /* be called from here when the active_waypoints does not equal the */ /* WaypointActive.Index */ /* if (active_waypoint != WaypointActive.Index) */ /* advanceWaypoint(WaypointActive.Index) */ } }
void Config::accept() { qDebug() << "[Config] checking configuration"; QString errormsg = tr("The following errors occurred:") + "<ul>"; bool error = false; // proxy: save entered proxy values, not displayed. if(ui.radioManualProxy->isChecked()) { proxy.setScheme("http"); proxy.setUserName(ui.proxyUser->text()); proxy.setPassword(ui.proxyPass->text()); proxy.setHost(ui.proxyHost->text()); proxy.setPort(ui.proxyPort->text().toInt()); } // QUrl::toEncoded() doesn't encode a colon in the password correctly, // which will result in errors during parsing the string. // QUrl::toPercentEncoding() does work as expected, so build the string to // store in the configuration file manually. QString proxystring = "http://" + QString(QUrl::toPercentEncoding(proxy.userName())) + ":" + QString(QUrl::toPercentEncoding(proxy.password())) + "@" + proxy.host() + ":" + QString::number(proxy.port()); RbSettings::setValue(RbSettings::Proxy, proxystring); qDebug() << "[Config] setting proxy to:" << proxy; // proxy type QString proxyType; if(ui.radioNoProxy->isChecked()) proxyType = "none"; else if(ui.radioSystemProxy->isChecked()) proxyType = "system"; else proxyType = "manual"; RbSettings::setValue(RbSettings::ProxyType, proxyType); RbSettings::setValue(RbSettings::Language, language); // mountpoint if(mountpoint.isEmpty()) { errormsg += "<li>" + tr("No mountpoint given") + "</li>"; error = true; } else if(!QFileInfo(mountpoint).exists()) { errormsg += "<li>" + tr("Mountpoint does not exist") + "</li>"; error = true; } else if(!QFileInfo(mountpoint).isDir()) { errormsg += "<li>" + tr("Mountpoint is not a directory.") + "</li>"; error = true; } else if(!QFileInfo(mountpoint).isWritable()) { errormsg += "<li>" + tr("Mountpoint is not writeable") + "</li>"; error = true; } else { RbSettings::setValue(RbSettings::Mountpoint, QDir::fromNativeSeparators(mountpoint)); } // platform QString nplat; if(ui.treeDevices->selectedItems().size() != 0) { nplat = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString(); RbSettings::setValue(RbSettings::Platform, nplat); } else { errormsg += "<li>" + tr("No player selected") + "</li>"; error = true; } // cache settings if(QFileInfo(ui.cachePath->text()).isDir()) { if(!QFileInfo(ui.cachePath->text()).isWritable()) { errormsg += "<li>" + tr("Cache path not writeable. Leave path empty " "to default to systems temporary path.") + "</li>"; error = true; } else RbSettings::setValue(RbSettings::CachePath, ui.cachePath->text()); } else // default to system temp path RbSettings::setValue(RbSettings::CachePath, QDir::tempPath()); RbSettings::setValue(RbSettings::CacheDisabled, ui.cacheDisable->isChecked()); RbSettings::setValue(RbSettings::CacheOffline, ui.cacheOfflineMode->isChecked()); // tts settings RbSettings::setValue(RbSettings::UseTtsCorrections, ui.ttsCorrections->isChecked()); int i = ui.comboTts->currentIndex(); RbSettings::setValue(RbSettings::Tts, ui.comboTts->itemData(i).toString()); RbSettings::setValue(RbSettings::RbutilVersion, PUREVERSION); errormsg += "</ul>"; errormsg += tr("You need to fix the above errors before you can continue."); if(error) { QMessageBox::critical(this, tr("Configuration error"), errormsg); } else { // sync settings RbSettings::sync(); this->close(); emit settingsUpdated(); } }
void setValues(std::pair<T,U> uiElement) { emit(settingsUpdated()); mSettings.setValue(uiElement.first, uiElement.second); }
Minutor::Minutor(): maxentitydistance(0) { mapview = new MapView; connect(mapview, SIGNAL(hoverTextChanged(QString)), statusBar(), SLOT(showMessage(QString))); connect(mapview, SIGNAL(showProperties(QVariant)), this, SLOT(showProperties(QVariant))); connect(mapview, SIGNAL(addOverlayItemType(QString, QColor)), this, SLOT(addOverlayItemType(QString, QColor))); dm = new DefinitionManager(this); mapview->attach(dm); connect(dm, SIGNAL(packsChanged()), this, SLOT(updateDimensions())); dimensions = dm->dimensionIdentifer(); connect(dimensions, SIGNAL(dimensionChanged(const DimensionInfo &)), this, SLOT(viewDimension(const DimensionInfo &))); settings = new Settings(this); connect(settings, SIGNAL(settingsUpdated()), this, SLOT(rescanWorlds())); jumpTo = new JumpTo(this); if (settings->autoUpdate) { // get time of last update QSettings settings; QDateTime lastUpdateTime = settings.value("packupdate").toDateTime(); // auto-update only once a week if (lastUpdateTime.addDays(7) < QDateTime::currentDateTime()) dm->autoUpdate(); } createActions(); createMenus(); createStatusBar(); QBoxLayout *mainLayout; if (settings->verticalDepth) { mainLayout = new QHBoxLayout; depth = new LabelledSlider(Qt::Vertical); mainLayout->addWidget(mapview, 1); mainLayout->addWidget(depth); } else { mainLayout = new QVBoxLayout; depth = new LabelledSlider(Qt::Horizontal); mainLayout->addWidget(depth); mainLayout->addWidget(mapview, 1); } depth->setValue(255); mainLayout->setSpacing(0); mainLayout->setContentsMargins(0, 0, 0, 0); connect(depth, SIGNAL(valueChanged(int)), mapview, SLOT(setDepth(int))); connect(mapview, SIGNAL(demandDepthChange(int)), depth, SLOT(changeValue(int))); connect(mapview, SIGNAL(demandDepthValue(int)), depth, SLOT(setValue(int))); connect(this, SIGNAL(worldLoaded(bool)), mapview, SLOT(setEnabled(bool))); connect(this, SIGNAL(worldLoaded(bool)), depth, SLOT(setEnabled(bool))); QWidget *central = new QWidget; central->setLayout(mainLayout); setCentralWidget(central); layout()->setContentsMargins(0, 0, 0, 0); setWindowTitle(qApp->applicationName()); propView = new Properties(this); emit worldLoaded(false); }
UavTalkRelayOptionsPage::UavTalkRelayOptionsPage(QObject *parent) : IOptionsPage(parent) { m_config=qobject_cast<UavTalkRelayPlugin *>(parent); connect(this,SIGNAL(settingsUpdated()),m_config,SLOT(updateSettings())); }
void MainWindow::updateSettings() { readUpdateableSettings(); emit settingsUpdated(); }
void SessionAgent::update(const QVariantMap &settings) { Q_EMIT settingsUpdated(settings); }
void scigraphics::qt4settingsGroupBox::updateWidgets() { emit settingsUpdated(); }