ShowFuelDeliveriesDialog::ShowFuelDeliveriesDialog(QWidget *parent) : QDialog(parent), ui(new Ui::ShowFuelDeliveriesDialog) { ui->setupUi(this); connect(this, SIGNAL(settingsChanged()), this, SLOT(updateSums())); /* * Configure table 'Fuels' columns */ //A few columns shouldn't be shown ui->tableFuels->hideColumn(Column_Date); ui->tableFuels->hideColumn(Column_UUID); //Fuel ComboBoxDelegate *delegateFuel = new ComboBoxDelegate(this); QVector<QString> fuels; fuels.push_back("Bois déchiqueté"); fuels.push_back("Granulés"); fuels.push_back("Fioul"); fuels.push_back("Propane"); delegateFuel->setItems(fuels); ui->tableFuels->setItemDelegateForColumn(Column_Fuel, delegateFuel); ui->tableFuels->setColumnWidth(Column_Fuel, 150); //Qauntity ui->tableFuels->setColumnWidth(Column_Quantity, 110); //Unit ComboBoxDelegate *delegateUnit = new ComboBoxDelegate(this); QVector<QString> units; units.push_back("kg"); units.push_back("tonnes"); units.push_back("litres"); units.push_back("m³"); units.push_back("MAP"); units.push_back("kWh"); units.push_back("MWh"); delegateUnit->setItems(units); ui->tableFuels->setItemDelegateForColumn(Column_Unit, delegateUnit); ui->tableFuels->setColumnWidth(Column_Unit, 80); //LHV DoubleSpinBoxDelegate *delegateLHV = new DoubleSpinBoxDelegate(this); delegateLHV->setSuffix(" kWh / unité"); delegateLHV->setPrecision(4); ui->tableFuels->setItemDelegateForColumn(Column_LHV, delegateLHV); ui->tableFuels->setColumnWidth(Column_LHV, 140); //Moisture DoubleSpinBoxDelegate *delegateMoisture = new DoubleSpinBoxDelegate(this); delegateMoisture->setSuffix(" %"); delegateMoisture->setMaximum(100); ui->tableFuels->setItemDelegateForColumn(Column_Moisture, delegateMoisture); ui->tableFuels->setColumnWidth(Column_Moisture, 80); //Energy DoubleSpinBoxDelegate *delegateEnergy = new DoubleSpinBoxDelegate(this); delegateEnergy->setSuffix(" MWh"); delegateEnergy->setPrecision(4); ui->tableFuels->setItemDelegateForColumn(Column_Energy, delegateEnergy); ui->tableFuels->setColumnWidth(Column_Energy, 100); //Bill DoubleSpinBoxDelegate *delegateBill = new DoubleSpinBoxDelegate(this); delegateBill->setSuffix(" €"); delegateBill->setPrecision(6); ui->tableFuels->setItemDelegateForColumn(Column_Bill, delegateBill); ui->tableFuels->setColumnWidth(Column_Bill, 110); //Energy Price DoubleSpinBoxDelegate *delegateEnergyPrice = new DoubleSpinBoxDelegate(this); delegateEnergyPrice->setSuffix(" € / MWh"); delegateEnergyPrice->setPrecision(4); ui->tableFuels->setItemDelegateForColumn(Column_EnergyPrice, delegateEnergyPrice); ui->tableFuels->setColumnWidth(Column_EnergyPrice, 110); //Last column allows user to delete records ui->tableFuels->setColumnWidth(Column_Delete, 34); /* * Configure table 'Natural gas' columns */ //Date shouldn't be shown ui->tableWidget_NaturalGas->hideRow(0); //Gas index will be edited by a DoubleSpinBox with extra parameters DoubleSpinBoxDelegate *delegateIndex_NaturalGas = new DoubleSpinBoxDelegate(this); delegateIndex_NaturalGas->setSuffix(" m³"); delegateIndex_NaturalGas->setPrecision(5); ui->tableWidget_NaturalGas->setItemDelegateForRow(1, delegateIndex_NaturalGas); /* * Configure table 'Electricity' columns */ //Date shouldn't be shown ui->tableWidget_Electricity->hideRow(0); //Gas index will be edited by a DoubleSpinBox with extra parameters DoubleSpinBoxDelegate *delegateIndex_Electricity = new DoubleSpinBoxDelegate(this); delegateIndex_Electricity->setSuffix(" kWh"); delegateIndex_Electricity->setPrecision(5); ui->tableWidget_Electricity->setItemDelegateForRow(1, delegateIndex_Electricity); }
/** Constructor */ GxsChannelPostsWidget::GxsChannelPostsWidget(const RsGxsGroupId &channelId, QWidget *parent) : GxsMessageFramePostWidget(rsGxsChannels, parent), ui(new Ui::GxsChannelPostsWidget) { /* Invoke the Qt Designer generated object setup routine */ ui->setupUi(this); /* Setup UI helper */ mStateHelper->addWidget(mTokenTypeAllPosts, ui->progressBar, UISTATE_LOADING_VISIBLE); mStateHelper->addWidget(mTokenTypeAllPosts, ui->loadingLabel, UISTATE_LOADING_VISIBLE); mStateHelper->addWidget(mTokenTypeAllPosts, ui->filterLineEdit); mStateHelper->addWidget(mTokenTypePosts, ui->loadingLabel, UISTATE_LOADING_VISIBLE); mStateHelper->addLoadPlaceholder(mTokenTypeGroupData, ui->nameLabel); mStateHelper->addWidget(mTokenTypeGroupData, ui->postButton); mStateHelper->addWidget(mTokenTypeGroupData, ui->logoLabel); mStateHelper->addWidget(mTokenTypeGroupData, ui->subscribeToolButton); /* Connect signals */ connect(ui->postButton, SIGNAL(clicked()), this, SLOT(createMsg())); connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool))); connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); /* add filter actions */ ui->filterLineEdit->addFilter(QIcon(), tr("Title"), FILTER_TITLE, tr("Search Title")); ui->filterLineEdit->addFilter(QIcon(), tr("Message"), FILTER_MSG, tr("Search Message")); ui->filterLineEdit->addFilter(QIcon(), tr("Filename"), FILTER_FILE_NAME, tr("Search Filename")); connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), ui->feedWidget, SLOT(setFilterText(QString))); connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), ui->fileWidget, SLOT(setFilterText(QString))); connect(ui->filterLineEdit, SIGNAL(filterChanged(int)), this, SLOT(filterChanged(int))); /* Initialize view button */ //setViewMode(VIEW_MODE_FEEDS); see processSettings ui->infoWidget->hide(); QSignalMapper *signalMapper = new QSignalMapper(this); connect(ui->feedToolButton, SIGNAL(clicked()), signalMapper, SLOT(map())); connect(ui->fileToolButton, SIGNAL(clicked()), signalMapper, SLOT(map())); signalMapper->setMapping(ui->feedToolButton, VIEW_MODE_FEEDS); signalMapper->setMapping(ui->fileToolButton, VIEW_MODE_FILES); connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(setViewMode(int))); /*************** Setup Left Hand Side (List of Channels) ****************/ ui->loadingLabel->hide(); ui->progressBar->hide(); ui->nameLabel->setMinimumWidth(20); /* Initialize feed widget */ ui->feedWidget->setSortRole(ROLE_PUBLISH, Qt::DescendingOrder); ui->feedWidget->setFilterCallback(filterItem); /* load settings */ processSettings(true); /* Initialize subscribe button */ QIcon icon; icon.addPixmap(QPixmap(":/images/redled.png"), QIcon::Normal, QIcon::On); icon.addPixmap(QPixmap(":/images/start.png"), QIcon::Normal, QIcon::Off); mAutoDownloadAction = new QAction(icon, "", this); mAutoDownloadAction->setCheckable(true); connect(mAutoDownloadAction, SIGNAL(triggered()), this, SLOT(toggleAutoDownload())); ui->subscribeToolButton->addSubscribedAction(mAutoDownloadAction); /* Initialize GUI */ setAutoDownload(false); settingsChanged(); setGroupId(channelId); }
void VideoSettings::slotResolutionChanged(int idx) { Q_UNUSED(idx) emit settingsChanged(); }
void DiveProfileItem::settingsToggled(bool toggled) { Q_UNUSED(toggled); settingsChanged(); }
void CWizPreferenceWindow::on_checkBoxManuallySort_toggled(bool checked) { m_app.userSettings().setManualSortingEnable(checked); emit settingsChanged(wizoptionsFolders); }
void SettingsPanel::dirtifySettings() { if (!m_isLoading) { setIsDirty(true); emit settingsChanged(); } }
void TodoPlugin::scanningScopeChanged(ScanningScope scanningScope) { Settings newSettings = m_settings; newSettings.scanningScope = scanningScope; settingsChanged(newSettings); }
ImageCache::ImageCache() { cachedImages = new QList<CacheObject*>(); applySettings(); connect(globalSettings, SIGNAL(settingsChanged()), this, SLOT(applySettings())); }
void KstSettingsDlg::save() { if (!_dirty) { return; } KstSettings s; s.plotUpdateTimer = _timer->value(); s.plotFontSize = _fontSize->value(); s.plotFontMinSize = _fontMinSize->value(); s.backgroundColor = _colors->background(); s.foregroundColor = _colors->foreground(); s.promptPlotDelete = _promptPlotDelete->isChecked(); s.promptWindowClose = _promptWindowClose->isChecked(); s.showQuickStart = _showQuickStart->isChecked(); s.tiedZoomGlobal = _tiedZoomGlobal->isChecked(); s.curveColorSequencePalette = _colorPalette->selectedPalette(); s.xMajor = _xMajorGrid->isChecked(); s.yMajor = _yMajorGrid->isChecked(); s.xMinor = _xMinorGrid->isChecked(); s.yMinor = _yMinorGrid->isChecked(); s.majorColor = _majorGridColor->color(); s.minorColor = _minorGridColor->color(); s.majorGridColorDefault = _checkBoxDefaultMajorGridColor->isChecked(); s.minorGridColorDefault = _checkBoxDefaultMinorGridColor->isChecked(); s.xAxisInterpret = _checkBoxXInterpret->isChecked(); s.xAxisInterpretation = (KstAxisInterpretation)(_comboBoxXInterpret->currentIndex()); s.xAxisDisplay = (KstAxisDisplay)(_comboBoxXDisplay->currentIndex()); s.defaultLineWeight = _spinBoxLineWidth->value(); s.emailSender = _lineEditSender->text(); s.emailSMTPServer = _lineEditHost->text(); s.emailUsername = _lineEditLogin->text(); s.emailPassword = _lineEditPassword->text(); s.emailSMTPPort = _kIntSpinBoxEMailPort->value(); s.emailRequiresAuthentication = _checkBoxAuthentication->isChecked(); QString tzName = _tz->tzName(); bool emitTZChanged = tzName != KstSettings::globalSettings()->timezone; s.timezone = tzName; s.offsetSeconds = utcOffset(tzName); /* xxx int value = _buttonGroupEncryption->id(_buttonGroupEncryption->selected()); if (value >= 0 && value < EMailEncryptionMAXIMUM) { s.emailEncryption = (EMailEncryption)value; } else { s.emailEncryption = EMailEncryptionNone; } value = _buttonGroupAuthentication->id(_buttonGroupAuthentication->selected()); if (value >= 0 && value < EMailAuthenticationMAXIMUM) { s.emailAuthentication = (EMailAuthentication)value; } else { s.emailAuthentication = EMailAuthenticationPLAIN; } */ KstSettings::setGlobalSettings(&s); KstSettings::globalSettings()->save(); emit settingsChanged(); if (emitTZChanged) { KstApp::inst()->emitTimezoneChanged(tzName, s.offsetSeconds); } }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), kwp(this), appSettings(new QSettings("vagblocks.ini", QSettings::IniFormat, this)), serialConfigured(false), storedRow(-1), storedCol(-1), currentlyLogging(false) { /* QFile roboto(":/resources/Roboto-Regular.ttf"); roboto.open(QIODevice::ReadOnly); if (QFontDatabase::addApplicationFontFromData(roboto.readAll()) < 0) { // error } roboto.close(); */ ui->setupUi(this); QString svnRev = APP_SVN_REV; int colonAt = svnRev.indexOf(":"); if (colonAt > 0) { svnRev = svnRev.mid(colonAt+1); } QString appVer = APP_VERSION; aboutDialog = new about(appVer, svnRev, this); serSettings = new serialSettingsDialog(this); settingsDialog = new settings(appSettings, this); connect(ui->action_About, SIGNAL(triggered()), aboutDialog, SLOT(show())); connect(ui->actionApplication_settings, SIGNAL(triggered()), settingsDialog, SLOT(show())); setupBlockArray(ui->blocksLayout); connect(&kwp, SIGNAL(log(QString, int)), this, SLOT(log(QString, int))); connect(&kwp, SIGNAL(newBlockData(int)), this, SLOT(newBlockData(int))); connect(&kwp, SIGNAL(blockOpen(int)), this, SLOT(blockOpen(int))); connect(&kwp, SIGNAL(blockClosed(int)), this, SLOT(blockClosed(int))); connect(&kwp, SIGNAL(channelOpen(bool)), this, SLOT(channelOpen(bool))); connect(&kwp, SIGNAL(elmInitialised(bool)), this, SLOT(elmInitialised(bool))); connect(&kwp, SIGNAL(portOpened(bool)), this, SLOT(portOpened(bool))); connect(&kwp, SIGNAL(portClosed()), this, SLOT(portClosed())); connect(&kwp, SIGNAL(newModuleInfo(QStringList)), this, SLOT(moduleInfoReceived(QStringList))); connect(&kwp, SIGNAL(newEcuInfo(QStringList)), this, SLOT(ecuInfoReceived(QStringList))); connect(ui->pushButton_log, SIGNAL(clicked(bool)), this, SLOT(startLogging(bool))); connect(&kwp, SIGNAL(labelsLoaded(bool)), this, SLOT(labelsLoaded(bool))); connect(ui->lineEdit_moduleNum, SIGNAL(textChanged(QString)), this, SLOT(clearUI())); connect(ui->comboBox_modules, SIGNAL(activated(int)), this, SLOT(selectNewModule(int))); connect(&kwp, SIGNAL(moduleListRefreshed()), this, SLOT(refreshModules())); connect(ui->pushButton_refresh, SIGNAL(clicked()), &kwp, SLOT(openGW_refresh())); connect(&kwp, SIGNAL(sampleFormatChanged()), this, SLOT(sampleFormatChanged())); connect(&kwp, SIGNAL(loggingStarted()), this, SLOT(loggingStarted())); connect(settingsDialog, SIGNAL(settingsChanged()), this, SLOT(updateSettings())); for (int i = 0; i < 16; i++) { // setup running average for sample rate avgList.append(0); } restoreSettings(); if (serialConfigured) { kwp.setSerialParams(serSettings->getSettings()); QMetaObject::invokeMethod(&kwp, "openPort", Qt::QueuedConnection); } connect(serSettings, SIGNAL(settingsApplied()), this, SLOT(connectToSerial())); refreshModules(true); }
Dialog::Dialog(QWidget *parent) : QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint), ui(new Ui::Dialog), mSettings(new LxQt::Settings("lxqt-runner", this)), mGlobalShortcut(0), mLockCascadeChanges(false), mConfigureDialog(0) { ui->setupUi(this); setWindowTitle("LXDE-Qt Runner"); connect(LxQt::Settings::globalSettings(), SIGNAL(iconThemeChanged()), this, SLOT(update())); connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(hide())); connect(mSettings, SIGNAL(settingsChanged()), this, SLOT(applySettings())); ui->commandEd->installEventFilter(this); connect(ui->commandEd, SIGNAL(textChanged(QString)), this, SLOT(setFilter(QString))); connect(ui->commandEd, SIGNAL(returnPressed()), this, SLOT(runCommand())); mCommandItemModel = new CommandItemModel(this); ui->commandList->installEventFilter(this); ui->commandList->setModel(mCommandItemModel); ui->commandList->setEditTriggers(QAbstractItemView::NoEditTriggers); connect(ui->commandList, SIGNAL(clicked(QModelIndex)), this, SLOT(runCommand())); setFilter(""); dataChanged(); ui->commandList->setItemDelegate(new HtmlDelegate(QSize(32, 32), ui->commandList)); // Popup menu ............................... QAction *a = new QAction(XdgIcon::fromTheme("configure"), tr("Configure lxqt-runner"), this); connect(a, SIGNAL(triggered()), this, SLOT(showConfigDialog())); addAction(a); // a = new QAction(XdgIcon::fromTheme("edit-clear-history"), tr("Clear lxqt-runner History"), this); // connect(a, SIGNAL(triggered()), mCommandItemModel, SLOT(clearHistory())); // addAction(a); mPowerManager = new LxQt::PowerManager(this); addActions(mPowerManager->availableActions()); mScreenSaver = new LxQt::ScreenSaver(this); addActions(mScreenSaver->availableActions()); setContextMenuPolicy(Qt::ActionsContextMenu); QMenu *menu = new QMenu(this); menu->addActions(actions()); ui->actionButton->setMenu(menu); ui->actionButton->setIcon(XdgIcon::fromTheme("configure")); // End of popup menu ........................ applySettings(); connect(mGlobalShortcut, SIGNAL(activated()), this, SLOT(showHide())); connect(mGlobalShortcut, SIGNAL(shortcutChanged(QString, QString)), this, SLOT(shortcutChanged(QString, QString))); resize(mSettings->value("dialog/width", 400).toInt(), size().height()); connect(mCommandItemModel, SIGNAL(layoutChanged()), this, SLOT(dataChanged())); }
PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f) { ui.setupUi(this); QSettings s; QStringList rebreater_modes; s.beginGroup("Planner"); prefs.last_stop = s.value("last_stop", prefs.last_stop).toBool(); prefs.verbatim_plan = s.value("verbatim_plan", prefs.verbatim_plan).toBool(); prefs.display_duration = s.value("display_duration", prefs.display_duration).toBool(); prefs.display_runtime = s.value("display_runtime", prefs.display_runtime).toBool(); prefs.display_transitions = s.value("display_transitions", prefs.display_transitions).toBool(); prefs.deco_mode = deco_mode(s.value("deco_mode", prefs.deco_mode).toInt()); prefs.safetystop = s.value("safetystop", prefs.safetystop).toBool(); prefs.reserve_gas = s.value("reserve_gas", prefs.reserve_gas).toInt(); prefs.ascrate75 = s.value("ascrate75", prefs.ascrate75).toInt(); prefs.ascrate50 = s.value("ascrate50", prefs.ascrate50).toInt(); prefs.ascratestops = s.value("ascratestops", prefs.ascratestops).toInt(); prefs.ascratelast6m = s.value("ascratelast6m", prefs.ascratelast6m).toInt(); prefs.descrate = s.value("descrate", prefs.descrate).toInt(); prefs.bottompo2 = s.value("bottompo2", prefs.bottompo2).toInt(); prefs.decopo2 = s.value("decopo2", prefs.decopo2).toInt(); prefs.doo2breaks = s.value("doo2breaks", prefs.doo2breaks).toBool(); prefs.switch_at_req_stop = s.value("switch_at_req_stop", prefs.switch_at_req_stop).toBool(); prefs.min_switch_duration = s.value("min_switch_duration", prefs.min_switch_duration).toInt(); prefs.drop_stone_mode = s.value("drop_stone_mode", prefs.drop_stone_mode).toBool(); prefs.bottomsac = s.value("bottomsac", prefs.bottomsac).toInt(); prefs.decosac = s.value("decosac", prefs.decosac).toInt(); plannerModel->getDiveplan().bottomsac = prefs.bottomsac; plannerModel->getDiveplan().decosac = prefs.decosac; s.endGroup(); updateUnitsUI(); ui.lastStop->setChecked(prefs.last_stop); ui.verbatim_plan->setChecked(prefs.verbatim_plan); ui.display_duration->setChecked(prefs.display_duration); ui.display_runtime->setChecked(prefs.display_runtime); ui.display_transitions->setChecked(prefs.display_transitions); ui.safetystop->setChecked(prefs.safetystop); ui.reserve_gas->setValue(prefs.reserve_gas / 1000); ui.bottompo2->setValue(prefs.bottompo2 / 1000.0); ui.decopo2->setValue(prefs.decopo2 / 1000.0); ui.backgasBreaks->setChecked(prefs.doo2breaks); ui.drop_stone_mode->setChecked(prefs.drop_stone_mode); ui.switch_at_req_stop->setChecked(prefs.switch_at_req_stop); ui.min_switch_duration->setValue(prefs.min_switch_duration / 60); ui.recreational_deco->setChecked(prefs.deco_mode == RECREATIONAL); ui.buehlmann_deco->setChecked(prefs.deco_mode == BUEHLMANN); ui.vpmb_deco->setChecked(prefs.deco_mode == VPMB); // should be the same order as in dive_comp_type! rebreater_modes << tr("Open circuit") << tr("CCR") << tr("pSCR"); ui.rebreathermode->insertItems(0, rebreater_modes); modeMapper = new QSignalMapper(this); connect(modeMapper, SIGNAL(mapped(int)) , plannerModel, SLOT(setDecoMode(int))); modeMapper->setMapping(ui.recreational_deco, int(RECREATIONAL)); modeMapper->setMapping(ui.buehlmann_deco, int(BUEHLMANN)); modeMapper->setMapping(ui.vpmb_deco, int(VPMB)); connect(ui.recreational_deco, SIGNAL(clicked()), modeMapper, SLOT(map())); connect(ui.buehlmann_deco, SIGNAL(clicked()), modeMapper, SLOT(map())); connect(ui.vpmb_deco, SIGNAL(clicked()), modeMapper, SLOT(map())); connect(ui.lastStop, SIGNAL(toggled(bool)), plannerModel, SLOT(setLastStop6m(bool))); connect(ui.verbatim_plan, SIGNAL(toggled(bool)), plannerModel, SLOT(setVerbatim(bool))); connect(ui.display_duration, SIGNAL(toggled(bool)), plannerModel, SLOT(setDisplayDuration(bool))); connect(ui.display_runtime, SIGNAL(toggled(bool)), plannerModel, SLOT(setDisplayRuntime(bool))); connect(ui.display_transitions, SIGNAL(toggled(bool)), plannerModel, SLOT(setDisplayTransitions(bool))); connect(ui.safetystop, SIGNAL(toggled(bool)), plannerModel, SLOT(setSafetyStop(bool))); connect(ui.reserve_gas, SIGNAL(valueChanged(int)), plannerModel, SLOT(setReserveGas(int))); connect(ui.ascRate75, SIGNAL(valueChanged(int)), this, SLOT(setAscRate75(int))); connect(ui.ascRate75, SIGNAL(valueChanged(int)), plannerModel, SLOT(emitDataChanged())); connect(ui.ascRate50, SIGNAL(valueChanged(int)), this, SLOT(setAscRate50(int))); connect(ui.ascRate50, SIGNAL(valueChanged(int)), plannerModel, SLOT(emitDataChanged())); connect(ui.ascRateStops, SIGNAL(valueChanged(int)), this, SLOT(setAscRateStops(int))); connect(ui.ascRateStops, SIGNAL(valueChanged(int)), plannerModel, SLOT(emitDataChanged())); connect(ui.ascRateLast6m, SIGNAL(valueChanged(int)), this, SLOT(setAscRateLast6m(int))); connect(ui.ascRateLast6m, SIGNAL(valueChanged(int)), plannerModel, SLOT(emitDataChanged())); connect(ui.descRate, SIGNAL(valueChanged(int)), this, SLOT(setDescRate(int))); connect(ui.descRate, SIGNAL(valueChanged(int)), plannerModel, SLOT(emitDataChanged())); connect(ui.bottompo2, SIGNAL(valueChanged(double)), this, SLOT(setBottomPo2(double))); connect(ui.decopo2, SIGNAL(valueChanged(double)), this, SLOT(setDecoPo2(double))); connect(ui.drop_stone_mode, SIGNAL(toggled(bool)), plannerModel, SLOT(setDropStoneMode(bool))); connect(ui.bottomSAC, SIGNAL(valueChanged(double)), this, SLOT(bottomSacChanged(double))); connect(ui.decoStopSAC, SIGNAL(valueChanged(double)), this, SLOT(decoSacChanged(double))); connect(ui.gfhigh, SIGNAL(valueChanged(int)), plannerModel, SLOT(setGFHigh(int))); connect(ui.gflow, SIGNAL(valueChanged(int)), plannerModel, SLOT(setGFLow(int))); connect(ui.gfhigh, SIGNAL(editingFinished()), plannerModel, SLOT(triggerGFHigh())); connect(ui.gflow, SIGNAL(editingFinished()), plannerModel, SLOT(triggerGFLow())); connect(ui.backgasBreaks, SIGNAL(toggled(bool)), this, SLOT(setBackgasBreaks(bool))); connect(ui.switch_at_req_stop, SIGNAL(toggled(bool)), plannerModel, SLOT(setSwitchAtReqStop(bool))); connect(ui.min_switch_duration, SIGNAL(valueChanged(int)), plannerModel, SLOT(setMinSwitchDuration(int))); connect(ui.rebreathermode, SIGNAL(currentIndexChanged(int)), plannerModel, SLOT(setRebreatherMode(int))); connect(plannerModel, SIGNAL(recreationChanged(bool)), this, SLOT(disableDecoElements(bool))); settingsChanged(); ui.gflow->setValue(prefs.gflow); ui.gfhigh->setValue(prefs.gfhigh); setMinimumWidth(0); setMinimumHeight(0); }
void SettingsWidget::apply() { Settings &QMPSettings = QMPlay2Core.getSettings(); bool page3Restart = false; const int page = tabW->currentIndex() + 1; switch (page) { case 1: { if (QMPlay2Core.getLanguage() != page1->langBox->itemData(page1->langBox->currentIndex()).toString()) { QMPSettings.set("Language", page1->langBox->itemData(page1->langBox->currentIndex()).toString()); QMPlay2Core.setLanguage(); QMessageBox::information(this, tr("New language"), tr("To set up a new language, the program will start again!")); restartApp(); } #ifdef ICONS_FROM_THEME if (page1->iconsFromTheme->isChecked() != QMPSettings.getBool("IconsFromTheme")) { QMPSettings.set("IconsFromTheme", page1->iconsFromTheme->isChecked()); if (!QMPlay2GUI.restartApp) { QMessageBox::information(this, tr("Changing icons"), tr("To apply the icons change program will start again!")); restartApp(); } } #endif QMPSettings.set("FallbackSubtitlesEncoding", page1->encodingB->currentText().toUtf8()); QMPSettings.set("AudioLanguage", page1->audioLangB->currentIndex() > 0 ? page1->audioLangB->currentText() : QString()); QMPSettings.set("SubtitlesLanguage", page1->subsLangB->currentIndex() > 0 ? page1->subsLangB->currentText() : QString()); QMPSettings.set("screenshotPth", page1->screenshotE->text()); QMPSettings.set("screenshotFormat", page1->screenshotFormatB->currentText()); QMPSettings.set("ShowCovers", page1->showCoversGB->isChecked()); QMPSettings.set("BlurCovers", page1->blurCoversB->isChecked()); QMPSettings.set("ShowDirCovers", page1->showDirCoversB->isChecked()); QMPSettings.set("AutoOpenVideoWindow", page1->autoOpenVideoWindowB->isChecked()); QMPSettings.set("AutoRestoreMainWindowOnVideo", page1->autoRestoreMainWindowOnVideoB->isChecked()); QMPSettings.set("AutoUpdates", page1->autoUpdatesB->isChecked()); QMPSettings.set("MainWidget/TabPositionNorth", page1->tabsNorths->isChecked()); #ifdef QMPLAY2_ALLOW_ONLY_ONE_INSTANCE QMPSettings.set("AllowOnlyOneInstance", page1->allowOnlyOneInstance->isChecked()); #endif QMPSettings.set("HideArtistMetadata", page1->hideArtistMetadata->isChecked()); QMPSettings.set("DisplayOnlyFileName", page1->displayOnlyFileName->isChecked()); QMPSettings.set("RestoreRepeatMode", page1->restoreRepeatMode->isChecked()); QMPSettings.set("StillImages", page1->stillImages->isChecked()); if (page1->trayNotifiesDefault) QMPSettings.set("TrayNotifiesDefault", page1->trayNotifiesDefault->isChecked()); QMPSettings.set("AutoDelNonGroupEntries", page1->autoDelNonGroupEntries->isChecked()); QMPSettings.set("Proxy/Use", page1->proxyB->isChecked() && !page1->proxyHostE->text().isEmpty()); QMPSettings.set("Proxy/Host", page1->proxyHostE->text()); QMPSettings.set("Proxy/Port", page1->proxyPortB->value()); QMPSettings.set("Proxy/Login", page1->proxyLoginB->isChecked() && !page1->proxyUserE->text().isEmpty()); QMPSettings.set("Proxy/User", page1->proxyUserE->text()); QMPSettings.set("Proxy/Password", page1->proxyPasswordE->text().toUtf8().toBase64()); page1->proxyB->setChecked(QMPSettings.getBool("Proxy/Use")); page1->proxyLoginB->setChecked(QMPSettings.getBool("Proxy/Login")); qobject_cast<QMainWindow *>(QMPlay2GUI.mainW)->setTabPosition(Qt::AllDockWidgetAreas, page1->tabsNorths->isChecked() ? QTabWidget::North : QTabWidget::South); applyProxy(); if (page1->trayNotifiesDefault) Notifies::setNativeFirst(!page1->trayNotifiesDefault->isChecked()); QSettings profileSettings(QMPlay2Core.getSettingsDir() + "Profile.ini", QSettings::IniFormat); const QString selectedProfile = getSelectedProfile(); if (selectedProfile != profileSettings.value("Profile", "/").toString()) { profileSettings.setValue("Profile", selectedProfile); restartApp(); } } break; case 2: { QMPSettings.set("ShortSeek", page2->shortSeekB->value()); QMPSettings.set("LongSeek", page2->longSeekB->value()); QMPSettings.set("AVBufferLocal", page2->bufferLocalB->value()); QMPSettings.set("AVBufferNetwork", page2->bufferNetworkB->value()); QMPSettings.set("BackwardBuffer", page2->backwardBufferNetworkB->currentIndex()); QMPSettings.set("PlayIfBuffered", page2->playIfBufferedB->value()); QMPSettings.set("ForceSamplerate", page2->forceSamplerate->isChecked()); QMPSettings.set("Samplerate", page2->samplerateB->value()); QMPSettings.set("MaxVol", page2->maxVolB->value()); QMPSettings.set("ForceChannels", page2->forceChannels->isChecked()); QMPSettings.set("Channels", page2->channelsB->value()); QMPSettings.set("ReplayGain/Enabled", page2->replayGain->isChecked()); QMPSettings.set("ReplayGain/Album", page2->replayGainAlbum->isChecked()); QMPSettings.set("ReplayGain/PreventClipping", page2->replayGainPreventClipping->isChecked()); QMPSettings.set("ReplayGain/Preamp", page2->replayGainPreamp->value()); QMPSettings.set("WheelAction", page2->wheelActionB->isChecked()); QMPSettings.set("WheelSeek", page2->wheelSeekB->isChecked()); QMPSettings.set("WheelVolume", page2->wheelVolumeB->isChecked()); QMPSettings.set("ShowBufferedTimeOnSlider", page2->showBufferedTimeOnSlider->isChecked()); QMPSettings.set("SavePos", page2->savePos->isChecked()); QMPSettings.set("KeepZoom", page2->keepZoom->isChecked()); QMPSettings.set("KeepARatio", page2->keepARatio->isChecked()); QMPSettings.set("KeepSubtitlesDelay", page2->keepSubtitlesDelay->isChecked()); QMPSettings.set("KeepSubtitlesScale", page2->keepSubtitlesScale->isChecked()); QMPSettings.set("KeepVideoDelay", page2->keepVideoDelay->isChecked()); QMPSettings.set("KeepSpeed", page2->keepSpeed->isChecked()); QMPSettings.set("SyncVtoA", page2->syncVtoA->isChecked()); QMPSettings.set("Silence", page2->silence->isChecked()); QMPSettings.set("RestoreVideoEqualizer", page2->restoreVideoEq->isChecked()); QMPSettings.set("IgnorePlaybackError", page2->ignorePlaybackError->isChecked()); QMPSettings.set("LeftMouseTogglePlay", page2->leftMouseTogglePlay->checkState()); QMPSettings.set("AccurateSeek", page2->accurateSeekB->checkState()); QMPSettings.set("UnpauseWhenSeeking", page2->unpauseWhenSeekingB->isChecked()); QMPSettings.set("StoreARatioAndZoom", page2->storeARatioAndZoomB->isChecked()); QStringList videoWriters, audioWriters, decoders; for (QListWidgetItem *wI : page2ModulesList[0]->list->findItems(QString(), Qt::MatchContains)) videoWriters += wI->text(); for (QListWidgetItem *wI : page2ModulesList[1]->list->findItems(QString(), Qt::MatchContains)) audioWriters += wI->text(); for (QListWidgetItem *wI : page2ModulesList[2]->list->findItems(QString(), Qt::MatchContains)) decoders += wI->text(); QMPSettings.set("videoWriters", videoWriters); QMPSettings.set("audioWriters", audioWriters); QMPSettings.set("decoders", decoders); tabCh(2); tabCh(1); emit setWheelStep(page2->shortSeekB->value()); emit setVolMax(page2->maxVolB->value()); SetAudioChannelsMenu(); } break; case 3: if (page3->module && page3->scrollA->widget()) { Module::SettingsWidget *settingsWidget = (Module::SettingsWidget *)page3->scrollA->widget(); settingsWidget->saveSettings(); settingsWidget->flushSettings(); page3->module->setInstances(page3Restart); chModule(page3->listW->currentItem()); } break; case 4: page4->writeSettings(); QMPSettings.set("ApplyToASS/ColorsAndBorders", page4->colorsAndBordersB->isChecked()); QMPSettings.set("ApplyToASS/MarginsAndAlignment", page4->marginsAndAlignmentB->isChecked()); QMPSettings.set("ApplyToASS/FontsAndSpacing", page4->fontsB->isChecked()); QMPSettings.set("ApplyToASS/OverridePlayRes", page4->overridePlayResB->isChecked()); QMPSettings.set("ApplyToASS/ApplyToASS", page4->toAssGB->isChecked()); break; case 5: QMPSettings.set("OSD/Enabled", page5->enabledB->isChecked()); page5->writeSettings(); break; case 6: page6->deintSettingsW->writeSettings(); if (page6->otherVFiltersW) page6->otherVFiltersW->writeSettings(); break; } if (page != 3) QMPSettings.flush(); emit settingsChanged(page, page3Restart); }
AbstractProfilePolygonItem::AbstractProfilePolygonItem() : QObject(), QGraphicsPolygonItem(), hAxis(NULL), vAxis(NULL), dataModel(NULL), hDataColumn(-1), vDataColumn(-1) { setCacheMode(DeviceCoordinateCache); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); preferencesDialog = new PreferencesDialog(); fontDialog = new FontDialog(); errorMessage = new QErrorMessage(); sheetNumberLabel = new QLabel("<h2>1</h2>"); sheetNumberLabel->setToolTip(tr("Number of Current Sheet")); sheetNumberLabel->setFrameShape(QFrame::Panel); sheetNumberLabel->setFrameShadow(QFrame::Sunken); sheetNumberLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); sheetNumberLabel->setMinimumWidth(ui->toolBar->height()); errorMessage->setMinimumSize(200, 150); //----File---- connect(ui->actionConvert_to_Handwritten, SIGNAL(triggered()), this, SLOT(renderFirstSheet())); connect(ui->actionLoad_Text_from_File, SIGNAL(triggered()), this, SLOT(loadTextFromFile())); connect(ui->actionLoad_Font, SIGNAL(triggered()), this, SLOT(loadFont())); connect(ui->actionFont_Editor, SIGNAL(triggered()), fontDialog, SLOT(exec())); connect(ui->actionSave_Current_Sheet_as, SIGNAL(triggered()), this, SLOT(saveSheet())); connect(ui->actionSave_All_Sheets, SIGNAL(triggered()), this, SLOT(saveAllSheets())); connect(ui->actionPrint_Current_Sheet, SIGNAL(triggered()), this, SLOT(printSheet())); connect(ui->actionPrint_All, SIGNAL(triggered()), this, SLOT(printAllSheets())); //----Edit---- //connect menu action "Show Toolbar" connect(ui->actionShow_ToolBar, SIGNAL(triggered(bool)), ui->toolBar, SLOT(setVisible(bool))); connect(ui->toolBar, SIGNAL(visibilityChanged(bool)), ui->actionShow_ToolBar, SLOT(setChecked(bool))); //preferencesDialog connections connect(ui->actionPreferences, SIGNAL(triggered()), preferencesDialog, SLOT(exec())); connect(preferencesDialog, SIGNAL(settingsChanged()), this, SLOT(loadSettings())); //----Help---- connect(ui->actionAbout_Scribbler, SIGNAL(triggered()), this, SLOT(showAboutBox())); connect(ui->actionLicenses_and_Credits, SIGNAL(triggered()), this, SLOT(showLicensesBox())); connect(ui->actionHowTo, SIGNAL(triggered()), this, SLOT(showHowToBox())); //----ToolBar---- //add actions to tool bar and connect them to slots connect(ui->toolBar->addAction(QPixmap("://render.png"), tr("Convert to Handwritten")), SIGNAL(triggered(bool)), this, SLOT(renderFirstSheet())); connect(ui->toolBar->addAction(QPixmap("://printer.png"), tr("Print Sheets")), SIGNAL(triggered(bool)), this, SLOT(printAllSheets())); connect(ui->toolBar->addAction(QPixmap("://save.png"), tr("Save Sheets")), SIGNAL(triggered(bool)), this, SLOT(saveAllSheets())); ui->toolBar->addSeparator(); connect(ui->toolBar->addAction(QPixmap("://left.png"), tr("Previous Sheet")), SIGNAL(triggered(bool)), this, SLOT(renderPreviousSheet())); ui->toolBar->addWidget(sheetNumberLabel); connect(ui->toolBar->addAction(QPixmap("://right.png"), tr("Next Sheet")), SIGNAL(triggered(bool)), this, SLOT(renderNextSheet())); connect(fontDialog, SIGNAL(fontReady()), this, SLOT(updateCurrentSheet())); errorMessage->setModal(true); ui->toolBar->actions()[ToolButton::Render]->setShortcut(Qt::ControlModifier + Qt::Key_R); ui->toolBar->actions()[ToolButton::Print]->setShortcut(Qt::ControlModifier + Qt::Key_P); ui->toolBar->actions()[ToolButton::Save]->setShortcut(Qt::ControlModifier + Qt::Key_S); ui->toolBar->actions()[ToolButton::Next]->setShortcut(Qt::ControlModifier + Qt::Key_Right); ui->toolBar->actions()[ToolButton::Previous]->setShortcut(Qt::ControlModifier + Qt::Key_Left); ui->textEdit->installEventFilter(this); ui->toolBar->actions()[ToolButton::Next]->setDisabled(true); ui->toolBar->actions()[ToolButton::Previous]->setDisabled(true); //initialize some class members sheetPointers.push_back(0); currentSheetNumber = 0; preferencesDialog->loadSettingsFromFile(); preferencesDialog->loadSettingsToFile(); }
void MLocale::connectSettings() { d_ptr->pLocale->connectSettings(); connect( d_ptr->pLocale, SIGNAL( settingsChanged() ), this, SIGNAL( settingsChanged() ) ); }
int CNetworkSetup::showNetworkSetup() { struct dirent **namelist; //if select int ifcount = scandir("/sys/class/net", &namelist, my_filter, alphasort); CMenuOptionStringChooser * ifSelect = new CMenuOptionStringChooser(LOCALE_NETWORKMENU_SELECT_IF, &g_settings.ifname, ifcount > 1, this, CRCInput::RC_nokey, "", true); ifSelect->setHint("", LOCALE_MENU_HINT_NET_IF); bool found = false; for(int i = 0; i < ifcount; i++) { ifSelect->addOption(namelist[i]->d_name); if(strcmp(g_settings.ifname.c_str(), namelist[i]->d_name) == 0) found = true; free(namelist[i]); } if (ifcount >= 0) free(namelist); if(!found) g_settings.ifname = "eth0"; networkConfig->readConfig(g_settings.ifname); readNetworkSettings(); backupNetworkSettings(); //menue init CMenuWidget* networkSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_NETWORKSETUP); networkSettings->setWizardMode(is_wizard); //apply button CMenuForwarder *m0 = new CMenuForwarder(LOCALE_NETWORKMENU_SETUPNOW, true, NULL, this, "networkapply", CRCInput::RC_red); m0->setHint("", LOCALE_MENU_HINT_NET_SETUPNOW); //eth id CMenuForwarder *mac = new CMenuForwarder("MAC", false, mac_addr); //prepare input entries CIPInput networkSettings_NetworkIP(LOCALE_NETWORKMENU_IPADDRESS , &network_address , LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2, this); CIPInput networkSettings_NetMask (LOCALE_NETWORKMENU_NETMASK , &network_netmask , LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2, this); CIPInput networkSettings_Gateway (LOCALE_NETWORKMENU_GATEWAY , &network_gateway , LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2); CIPInput networkSettings_NameServer(LOCALE_NETWORKMENU_NAMESERVER, &network_nameserver, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2); //hostname CKeyboardInput networkSettings_Hostname(LOCALE_NETWORKMENU_HOSTNAME, &network_hostname, 0, NULL, NULL, LOCALE_NETWORKMENU_HOSTNAME_HINT1, LOCALE_NETWORKMENU_HOSTNAME_HINT2); //auto start CMenuOptionChooser* o1 = new CMenuOptionChooser(LOCALE_NETWORKMENU_SETUPONSTARTUP, &network_automatic_start, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); o1->setHint("", LOCALE_MENU_HINT_NET_SETUPONSTARTUP); //dhcp network_dhcp = networkConfig->inet_static ? NETWORK_DHCP_OFF : NETWORK_DHCP_ON; CMenuForwarder *m1 = new CMenuForwarder(LOCALE_NETWORKMENU_IPADDRESS , networkConfig->inet_static, network_address , &networkSettings_NetworkIP ); CMenuForwarder *m2 = new CMenuForwarder(LOCALE_NETWORKMENU_NETMASK , networkConfig->inet_static, network_netmask , &networkSettings_NetMask ); setBroadcast(); CMenuForwarder *m3 = new CMenuForwarder(LOCALE_NETWORKMENU_BROADCAST , false, network_broadcast); CMenuForwarder *m4 = new CMenuForwarder(LOCALE_NETWORKMENU_GATEWAY , networkConfig->inet_static, network_gateway , &networkSettings_Gateway ); CMenuForwarder *m5 = new CMenuForwarder(LOCALE_NETWORKMENU_NAMESERVER, networkConfig->inet_static, network_nameserver, &networkSettings_NameServer); CMenuForwarder *m8 = new CMenuForwarder(LOCALE_NETWORKMENU_HOSTNAME , true , network_hostname , &networkSettings_Hostname ); m1->setHint("", LOCALE_MENU_HINT_NET_IPADDRESS); m2->setHint("", LOCALE_MENU_HINT_NET_NETMASK); m3->setHint("", LOCALE_MENU_HINT_NET_BROADCAST); m4->setHint("", LOCALE_MENU_HINT_NET_GATEWAY); m5->setHint("", LOCALE_MENU_HINT_NET_NAMESERVER); m8->setHint("", LOCALE_MENU_HINT_NET_HOSTNAME); dhcpDisable.Add(m1); dhcpDisable.Add(m2); dhcpDisable.Add(m3); dhcpDisable.Add(m4); dhcpDisable.Add(m5); CMenuOptionChooser* o2 = new CMenuOptionChooser(LOCALE_NETWORKMENU_DHCP, &network_dhcp, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); o2->setHint("", LOCALE_MENU_HINT_NET_DHCP); //paint menu items networkSettings->addIntroItems(LOCALE_MAINSETTINGS_NETWORK); //intros //------------------------------------------------- networkSettings->addItem( m0 ); //apply CMenuForwarder * mf = new CMenuForwarder(LOCALE_NETWORKMENU_TEST, true, NULL, this, "networktest", CRCInput::RC_green); mf->setHint("", LOCALE_MENU_HINT_NET_TEST); networkSettings->addItem(mf); //test mf = new CMenuForwarder(LOCALE_NETWORKMENU_SHOW, true, NULL, this, "networkshow", CRCInput::RC_info); mf->setHint("", LOCALE_MENU_HINT_NET_SHOW); networkSettings->addItem(mf); //show settings networkSettings->addItem(GenericMenuSeparatorLine); //------------------------------------------------ if(ifcount) networkSettings->addItem(ifSelect); //if select else delete ifSelect; networkSettings->addItem(o1); //set on start networkSettings->addItem(GenericMenuSeparatorLine); //------------------------------------------------ if(ifcount > 1) // if there is only one, its probably wired { //ssid CKeyboardInput * networkSettings_ssid = new CKeyboardInput(LOCALE_NETWORKMENU_SSID, &network_ssid); //key CKeyboardInput * networkSettings_key = new CKeyboardInput(LOCALE_NETWORKMENU_PASSWORD, &network_key); CMenuForwarder *m9 = new CMenuDForwarder(LOCALE_NETWORKMENU_SSID , networkConfig->wireless, network_ssid , networkSettings_ssid ); CMenuForwarder *m10 = new CMenuDForwarder(LOCALE_NETWORKMENU_PASSWORD , networkConfig->wireless, network_key , networkSettings_key ); CMenuForwarder *m11 = new CMenuForwarder(LOCALE_NETWORKMENU_SSID_SCAN , networkConfig->wireless, NULL, this, "scanssid"); m9->setHint("", LOCALE_MENU_HINT_NET_SSID); m10->setHint("", LOCALE_MENU_HINT_NET_PASS); m11->setHint("", LOCALE_MENU_HINT_NET_SSID_SCAN); wlanEnable.Add(m9); wlanEnable.Add(m10); wlanEnable.Add(m11); networkSettings->addItem( m11); //ssid scan networkSettings->addItem( m9); //ssid networkSettings->addItem( m10); //key networkSettings->addItem(GenericMenuSeparatorLine); } //------------------------------------------------ networkSettings->addItem(mac); //eth id networkSettings->addItem(GenericMenuSeparatorLine); //------------------------------------------------- networkSettings->addItem(o2); //dhcp on/off networkSettings->addItem( m8); //hostname networkSettings->addItem(GenericMenuSeparatorLine); //------------------------------------------------- networkSettings->addItem( m1); //adress networkSettings->addItem( m2); //mask networkSettings->addItem( m3); //broadcast networkSettings->addItem(GenericMenuSeparatorLine); //------------------------------------------------ networkSettings->addItem( m4); //gateway networkSettings->addItem( m5); //nameserver //------------------------------------------------ sectionsdConfigNotifier = NULL; CMenuWidget ntp(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_NETWORKSETUP_NTP); #ifdef ENABLE_GUI_MOUNT CMenuWidget networkmounts(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_NETWORKSETUP_MOUNTS); #endif CProxySetup proxy(LOCALE_MAINSETTINGS_NETWORK); CNetworkServiceSetup services; //ntp submenu sectionsdConfigNotifier = new CSectionsdConfigNotifier; mf = new CMenuForwarder(LOCALE_NETWORKMENU_NTPTITLE, true, NULL, &ntp, NULL, CRCInput::RC_yellow); mf->setHint("", LOCALE_MENU_HINT_NET_NTP); networkSettings->addItem(mf); showNetworkNTPSetup(&ntp); #ifdef ENABLE_GUI_MOUNT //nfs mount submenu mf = new CMenuForwarder(LOCALE_NETWORKMENU_MOUNT, true, NULL, &networkmounts, NULL, CRCInput::RC_blue); mf->setHint("", LOCALE_MENU_HINT_NET_MOUNT); networkSettings->addItem(mf); showNetworkNFSMounts(&networkmounts); #endif //proxyserver submenu mf = new CMenuForwarder(LOCALE_FLASHUPDATE_PROXYSERVER_SEP, true, NULL, &proxy, NULL, CRCInput::RC_0); mf->setHint("", LOCALE_MENU_HINT_NET_PROXY); networkSettings->addItem(mf); //services mf = new CMenuForwarder(LOCALE_NETWORKMENU_SERVICES, true, NULL, &services, NULL, CRCInput::RC_1); mf->setHint("", LOCALE_MENU_HINT_NET_SERVICES); networkSettings->addItem(mf); int ret = 0; while(true) { int res = menu_return::RETURN_EXIT; ret = networkSettings->exec(NULL, ""); if (settingsChanged()) res = saveChangesDialog(); if(res == menu_return::RETURN_EXIT) break; } dhcpDisable.Clear(); wlanEnable.Clear(); delete networkSettings; delete sectionsdConfigNotifier; return ret; }
void QgsSingleSymbolDialog::symbolChanged( const QModelIndex ¤t, const QModelIndex &previous ) { emit settingsChanged(); }
AmarokConfigDialog::AmarokConfigDialog( QWidget *parent, const char* name, KConfigSkeleton *config ) : KConfigDialog( parent, name, config ) , m_engineConfig( 0 ) , m_opt4( 0 ) { setWFlags( WDestructiveClose ); // IMPORTANT Don't simply change the page names, they are used as identifiers in other parts of the app. m_opt1 = new Options1( 0, "General" ); m_opt2 = new Options2( 0, "Appearance" ); m_opt4 = new Options4( 0, "Playback" ); Options5 *opt5 = new Options5( 0, "OSD" ); QVBox *opt6 = new QVBox; m_opt7 = new Options7( 0, "Collection" ); Options8 *opt8 = new Options8( 0, "Scrobbler" ); // Sound System opt6->setName( "Engine" ); opt6->setSpacing( 12 ); opt6->setMargin( 11 ); QWidget *groupBox, *aboutEngineButton; groupBox = new QGroupBox( 2, Qt::Horizontal, i18n("Sound System"), opt6 ); m_engineConfigFrame = new QGroupBox( 1, Qt::Horizontal, opt6 ); m_soundSystem = new QComboBox( false, groupBox ); aboutEngineButton = new QPushButton( i18n("About"), groupBox ); QToolTip::add( m_soundSystem, i18n("Click to select the sound system to use for playback.") ); QToolTip::add( aboutEngineButton, i18n("Click to get the plugin information.") ); KTrader::OfferList offers = PluginManager::query( "[X-KDE-amaroK-plugintype] == 'engine'" ); KTrader::OfferList::ConstIterator end( offers.end() ); for( KTrader::OfferList::ConstIterator it = offers.begin(); it != end; ++it ) { m_soundSystem->insertItem( (*it)->name() ); // Save name properties in QMap for lookup m_pluginName[(*it)->name()] = (*it)->property( "X-KDE-amaroK-name" ).toString(); m_pluginAmarokName[(*it)->property( "X-KDE-amaroK-name" ).toString()] = (*it)->name(); } // KConfigXT doesn't like Comboboxes, still, 2 versions after // it was created. How shit. Hence we can't make recodeEncoding // a string (which we need to because by index is not consistent) QTextCodec *codec; m_opt1->kcfg_RecodeEncoding->insertItem( i18n("Locale Encoding") ); for( int i = 1; (codec = QTextCodec::codecForIndex( i )); i++ ) m_opt1->kcfg_RecodeEncoding->insertItem( codec->name() ); // Collection #if !defined(USE_MYSQL) && !defined(USE_POSTGRESQL) m_opt7->databaseBox->hide(); #endif #ifndef USE_MYSQL //FIXME we do this because this widget breaks the Apply button (always enabled). //It breaks because it is set to type="password" in the .kcfg file. Setting to //type="string" also fixes this bug, but means the password is stored in plain //text. This is a temporary fix so that the majority of users get a fixed Apply //button. delete m_opt7->dbSetupFrame->kcfg_MySqlPassword; #endif m_opt7->collectionFoldersBox->setColumns( 1 ); new CollectionSetup( m_opt7->collectionFoldersBox ); //TODO this widget doesn't update the apply/ok buttons // add pages addPage( m_opt1, i18n( "General" ), "misc", i18n( "Configure General Options" ) ); addPage( m_opt2, i18n( "Appearance" ), "colors", i18n( "Configure amaroK's Appearance" ) ); addPage( m_opt4, i18n( "Playback" ), "kmix", i18n( "Configure Playback" ) ); addPage( opt5, i18n( "OSD" ), "tv", i18n( "Configure On-Screen-Display" ) ); addPage( opt6, i18n( "Engine" ), "amarok", i18n( "Configure Engine" ) ); addPage( m_opt7, i18n( "Collection" ), "collection", i18n( "Configure Collection" ) ); addPage( opt8, i18n( "last.fm" ), "audioscrobbler", i18n( "Configure last.fm Support" ) ); // Show information labels (must be done after insertions) QObjectList *list = queryList( "QLabel", "infoPixmap" ); for( QObject *label = list->first(); label; label = list->next() ) static_cast<QLabel*>(label)->setPixmap( QMessageBox::standardIcon( QMessageBox::Information ) ); delete list; //stop KFont Requesters getting stupidly large list = queryList( "QLabel", "m_sampleLabel" ); for( QObject *label = list->first(); label; label = list->next() ) static_cast<QLabel*>(label)->setMaximumWidth( 250 ); delete list; connect( m_soundSystem, SIGNAL(activated( int )), SLOT(updateButtons()) ); connect( aboutEngineButton, SIGNAL(clicked()), SLOT(aboutEngine()) ); connect( opt5, SIGNAL(settingsChanged()), SLOT(updateButtons()) ); //see options5.ui.h connect( m_opt2->styleComboBox, SIGNAL( activated( int ) ), SLOT( updateButtons() ) ); connect( m_opt7->dbSetupFrame->databaseEngine, SIGNAL( activated( int ) ), SLOT( updateButtons() ) ); }
void CameraBinImageEncoder::setImageSettings(const QImageEncoderSettings &settings) { m_settings = settings; emit settingsChanged(); }
void KonqHistorySettings::slotSettingsChanged() { readSettings(true /*reparse*/); emit settingsChanged(); }
void testQOfonoConnectionManagerContext () { QSignalSpy conadd(m, SIGNAL(contextAdded(QString))); QSignalSpy conrem(m, SIGNAL(contextRemoved(QString))); m->addContext("internet"); QTRY_COMPARE(conadd.count(), 1); QString contextid = conadd.takeFirst().at(0).toString(); QVERIFY(m->contexts().contains(contextid)); QOfonoConnectionContext* context = new QOfonoConnectionContext(this); context->setContextPath(contextid); QSignalSpy active(context, SIGNAL(activeChanged(bool))); QSignalSpy apn(context,SIGNAL(accessPointNameChanged(QString))); QSignalSpy name(context, SIGNAL(nameChanged(QString))); QSignalSpy type (context, SIGNAL(typeChanged(QString))); QSignalSpy uname (context, SIGNAL(usernameChanged(QString))); QSignalSpy pw (context, SIGNAL(passwordChanged(QString))); QSignalSpy proto (context, SIGNAL(protocolChanged(QString))); QSignalSpy sett (context, SIGNAL(settingsChanged(QVariantMap))); QSignalSpy sett6 (context, SIGNAL(IPv6SettingsChanged(QVariantMap))); context->setAccessPointName("hyva"); QTRY_COMPARE(apn.count(), 1); QCOMPARE(apn.takeFirst().at(0).toString(), QString("hyva")); context->setUsername("huomenta"); QTRY_COMPARE(uname.count(), 1); QCOMPARE(uname.takeFirst().at(0).toString(), QString("huomenta")); context->setPassword("HYVA"); QTRY_COMPARE(pw.count(), 1); QCOMPARE(pw.takeFirst().at(0).toString(), QString("HYVA")); context->setName("yota"); QTRY_COMPARE(name.count(), 1); QCOMPARE(name.takeFirst().at(0).toString(), QString("yota")); context->setType("mms"); QTRY_COMPARE(type.count(), 1); QCOMPARE(type.takeFirst().at(0).toString(), QString("mms")); context->setProtocol("ipv6"); QTRY_COMPARE(proto.count(), 1); QCOMPARE(proto.takeFirst().at(0).toString(), QString("ipv6")); context->setActive(true); QTRY_COMPARE(active.count(), 1); QCOMPARE(active.takeFirst().at(0).toBool(), true); QTRY_COMPARE(sett6.count(), 1); QCOMPARE(sett6.takeFirst().at(0).toMap()["Interface"].value<QString>().left(5), QString("dummy")); // "dummy" plus number QVariantMap settings = context->IPv6Settings(); QCOMPARE(settings["Interface"].value<QString>().left(5),QString("dummy")); // "dummy" plus number QTest::qWait(REASONABLE_TIMEOUT); QCOMPARE(apn.count(), 0); QCOMPARE(uname.count(), 0); QCOMPARE(pw.count(), 0); QCOMPARE(name.count(), 0); QCOMPARE(type.count(), 0); QCOMPARE(sett.count(), 0); QCOMPARE(proto.count(), 0); QCOMPARE(active.count(), 0); context->setActive(false); QTRY_COMPARE(active.count(), 1); QCOMPARE(active.takeFirst().at(0).toBool(), false); delete context; m->removeContext(contextid); QTRY_COMPARE(conrem.count(), 1); QCOMPARE(conrem.takeFirst().at(0).toString(), contextid); }
DivePercentageItem::DivePercentageItem(int i) { connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::percentageGraphChanged, this, &DivePercentageItem::setVisible); tissueIndex = i; settingsChanged(); }
void QgsSingleSymbolDialog::resendSettingsChanged() { emit settingsChanged(); }
PreviewWidget::PreviewWidget(QWidget* parent) : QGraphicsView(parent), d(new PreviewWidgetPriv) { QString whatsThis = i18n("<p>This widget will display a correction " "preview for the currently selected image</p>" "<p><ul>" "<li>Move the mouse <b>over</b> the preview to display the original image</li>" "<li>Move the mouse <b>out of</b> the preview to display the corrected image</li>" "<li><b>Click on</b> the preview to display the correction mask</li>" "</ul></p>" "<p>The zoom buttons and panning widget allow you to view certain parts of the image " "more closely.</p>"); setWhatsThis(whatsThis); // -------------------------------------------------------- setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); setCacheMode(QGraphicsView::CacheBackground); // -------------------------------------------------------- d->locked = true; d->busyLabel = new QLabel; d->correctedLabel = new QLabel; d->maskLabel = new QLabel; d->noSelectionLabel = new QLabel; d->originalLabel = new QLabel; d->correctedLabel->setScaledContents(true); d->maskLabel->setScaledContents(true); d->originalLabel->setScaledContents(true); d->noSelectionLabel->clear(); d->busyLabel->setText(i18n("<h2>generating preview...</h2>")); d->busyLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); // -------------------------------------------------------- d->stack = new QStackedWidget; d->stack->insertWidget(BusyMode, d->busyLabel); d->stack->insertWidget(LockedMode, d->noSelectionLabel); d->stack->insertWidget(OriginalMode, d->originalLabel); d->stack->insertWidget(CorrectedMode, d->correctedLabel); d->stack->insertWidget(MaskMode, d->maskLabel); // -------------------------------------------------------- QGraphicsScene* scene = new QGraphicsScene; scene->addWidget(d->stack); setScene(scene); // -------------------------------------------------------- // floating widgets d->modeInfo = new InfoMessageWidget(this); d->controller = new ControlWidget(this); // -------------------------------------------------------- connect(this, SIGNAL(settingsChanged()), this, SLOT(updateSettings())); connect(d->controller, SIGNAL(zoomInClicked()), this, SLOT(zoomInClicked())); connect(d->controller, SIGNAL(zoomOutClicked()), this, SLOT(zoomOutClicked())); connect(d->controller, SIGNAL(originalClicked()), this, SLOT(originalClicked())); connect(d->controller, SIGNAL(correctedClicked()), this, SLOT(correctedClicked())); connect(d->controller, SIGNAL(maskClicked()), this, SLOT(maskClicked())); // -------------------------------------------------------- reset(); }
void QgsSingleSymbolDialog::symbolChanged( const QModelIndex ¤t, const QModelIndex &previous ) { Q_UNUSED( current ); Q_UNUSED( previous ); emit settingsChanged(); }
void VideoSettings::slotChannelChanged(int idx) { Q_UNUSED(idx) emit settingsChanged(); }
void ZynAddSubFxInstrument::loadSettings( const QDomElement & _this ) { if( !_this.hasChildNodes() ) { return; } m_portamentoModel.loadSettings( _this, "portamento" ); m_filterFreqModel.loadSettings( _this, "filterfreq" ); m_filterQModel.loadSettings( _this, "filterq" ); m_bandwidthModel.loadSettings( _this, "bandwidth" ); m_fmGainModel.loadSettings( _this, "fmgain" ); m_resCenterFreqModel.loadSettings( _this, "rescenterfreq" ); m_resBandwidthModel.loadSettings( _this, "resbandwidth" ); m_forwardMidiCcModel.loadSettings( _this, "forwardmidicc" ); QDomDocument doc; QDomElement data = _this.firstChildElement( "ZynAddSubFX-data" ); if( data.isNull() ) { data = _this.firstChildElement(); } doc.appendChild( doc.importNode( data, true ) ); QTemporaryFile tf; tf.setAutoRemove( false ); if( tf.open() ) { QByteArray a = doc.toString( 0 ).toUtf8(); tf.write( a ); tf.flush(); const std::string fn = QSTR_TO_STDSTR( QDir::toNativeSeparators( tf.fileName() ) ); m_pluginMutex.lock(); if( m_remotePlugin ) { m_remotePlugin->lock(); m_remotePlugin->sendMessage( RemotePlugin::message( IdLoadSettingsFromFile ).addString( fn ) ); m_remotePlugin->waitForMessage( IdLoadSettingsFromFile ); m_remotePlugin->unlock(); } else { m_plugin->loadXML( fn ); } m_pluginMutex.unlock(); m_modifiedControllers.clear(); for( const QString & c : _this.attribute( "modifiedcontrollers" ).split( ',' ) ) { if( !c.isEmpty() ) { switch( c.toInt() ) { case C_portamento: updatePortamento(); break; case C_filtercutoff: updateFilterFreq(); break; case C_filterq: updateFilterQ(); break; case C_bandwidth: updateBandwidth(); break; case C_fmamp: updateFmGain(); break; case C_resonance_center: updateResCenterFreq(); break; case C_resonance_bandwidth: updateResBandwidth(); break; default: break; } } } emit settingsChanged(); } }
void VideoSettings::slotDeviceChanged(int idx) { Q_UNUSED(idx) emit settingsChanged(); }
ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent), currentState(INVALID), dataModel(new DivePlotDataModel(this)), zoomLevel(0), zoomFactor(1.15), background(new DivePixmapItem()), backgroundFile(":poster"), toolTipItem(new ToolTipItem()), isPlotZoomed(prefs.zoomed_plot), forceReplot(false), profileYAxis(new DepthAxis()), gasYAxis(new PartialGasPressureAxis()), temperatureAxis(new TemperatureAxis()), timeAxis(new TimeAxis()), diveProfileItem(new DiveProfileItem()), temperatureItem(new DiveTemperatureItem()), cylinderPressureAxis(new DiveCartesianAxis()), gasPressureItem(new DiveGasPressureItem()), meanDepth(new MeanDepthLine()), diveComputerText(new DiveTextItem()), diveCeiling(new DiveCalculatedCeiling()), reportedCeiling(new DiveReportedCeiling()), pn2GasItem(new PartialPressureGasItem()), pheGasItem(new PartialPressureGasItem()), po2GasItem(new PartialPressureGasItem()), heartBeatAxis(new DiveCartesianAxis()), heartBeatItem(new DiveHeartrateItem()), rulerItem(new RulerItem2()), isGrayscale(false), printMode(false), shouldCalculateMaxTime(true) { memset(&plotInfo, 0, sizeof(plotInfo)); setupSceneAndFlags(); setupItemSizes(); setupItemOnScene(); addItemsToScene(); scene()->installEventFilter(this); setEmptyState(); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); QAction *action = NULL; #define ADD_ACTION(SHORTCUT, Slot) \ action = new QAction(this); \ action->setShortcut(SHORTCUT); \ action->setShortcutContext(Qt::WindowShortcut); \ addAction(action); \ connect(action, SIGNAL(triggered(bool)), this, SLOT(Slot)); \ actionsForKeys[SHORTCUT] = action; ADD_ACTION(Qt::Key_Escape, keyEscAction()); ADD_ACTION(Qt::Key_Delete, keyDeleteAction()); ADD_ACTION(Qt::Key_Up, keyUpAction()); ADD_ACTION(Qt::Key_Down, keyDownAction()); ADD_ACTION(Qt::Key_Left, keyLeftAction()); ADD_ACTION(Qt::Key_Right, keyRightAction()); #undef ADD_ACTION #ifndef QT_NO_DEBUG QTableView *diveDepthTableView = new QTableView(); diveDepthTableView->setModel(dataModel); diveDepthTableView->show(); #endif }