本文整理汇总了C++中KConfigGroup::writeEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfigGroup::writeEntry方法的具体用法?C++ KConfigGroup::writeEntry怎么用?C++ KConfigGroup::writeEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfigGroup
的用法示例。
在下文中一共展示了KConfigGroup::writeEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fi
bool K3b::MiscOptionTab::saveSettings()
{
KConfigGroup c = KGlobal::config()->group( "General Options" );
c.writeEntry( "ask_for_saving_changes_on_exit", m_checkSaveOnExit->isChecked() );
c.writeEntry( "Show splash", m_checkShowSplash->isChecked() );
c.writeEntry( "Show progress OSD", m_checkShowProgressOSD->isChecked() );
c.writeEntry( "hide main window while writing", m_checkHideMainWindowWhileWriting->isChecked() );
c.writeEntry( "keep action dialogs open", m_checkKeepDialogsOpen->isChecked() );
c.writeEntry( "check system config", m_checkSystemConfig->isChecked() );
c.writeEntry( "action dialog startup settings", m_comboActionDialogSettings->selectedValue() );
QString tempDir = m_editTempDir->url().toLocalFile();
QFileInfo fi( tempDir );
if( fi.isRelative() ) {
fi.setFile( fi.absoluteFilePath() );
}
if( !fi.exists() ) {
if( KMessageBox::questionYesNo( this,
i18n("Folder (%1) does not exist. Create?",tempDir),
i18n("Create Folder"),
KGuiItem( i18n("Create") ),
KStandardGuiItem::cancel() ) == KMessageBox::Yes ) {
if( !KStandardDirs::makeDir( fi.absoluteFilePath() ) ) {
KMessageBox::error( this, i18n("Unable to create folder %1",tempDir) );
return false;
}
}
else {
// the dir does not exist and the user doesn't want to create it
return false;
}
}
if( fi.isFile() ) {
KMessageBox::information( this, i18n("You specified a file for the temporary folder. "
"K3b will use its base path as the temporary folder."),
i18n("Warning"),
"temp file only using base path" );
fi.setFile( fi.path() );
}
// check for writing permission
if( !fi.isWritable() ) {
KMessageBox::error( this, i18n("You do not have permission to write to %1.",fi.absoluteFilePath()) );
return false;
}
m_editTempDir->setUrl( fi.absoluteFilePath() );
k3bcore->globalSettings()->setDefaultTempPath( m_editTempDir->url().toLocalFile() );
// if( m_radioMultipleInstancesSmart->isChecked() )
// c.writeEntry( "Multiple Instances", "smart" );
// else
// c.writeEntry( "Multiple Instances", "always_new" );
return true;
}
示例2: setProxyConfigScript
void KSaveIOConfig::setProxyConfigScript( const QString& _url )
{
KConfigGroup cfg (config(), "Proxy Settings");
cfg.writeEntry("Proxy Config Script", _url);
cfg.sync();
}
示例3: setConnectTimeout
void KSaveIOConfig::setConnectTimeout( int _timeout )
{
KConfigGroup cfg (config(), QString());
cfg.writeEntry("ConnectTimeout", qMax(MIN_TIMEOUT_VALUE,_timeout));
cfg.sync();
}
示例4: setMaxCacheAge
void KSaveIOConfig::setMaxCacheAge( int cache_age )
{
KConfigGroup cfg (http_config(), QString());
cfg.writeEntry( "MaxCacheAge", cache_age );
cfg.sync();
}
示例5: setProxyType
void KSaveIOConfig::setProxyType(KProtocolManager::ProxyType type)
{
KConfigGroup cfg (config(), "Proxy Settings");
cfg.writeEntry("ProxyType", static_cast<int>(type));
cfg.sync();
}
示例6: setMarkPartial
void KSaveIOConfig::setMarkPartial( bool _mode )
{
KConfigGroup cfg (config(), QString());
cfg.writeEntry( "MarkPartial", _mode );
cfg.sync();
}
示例7: setAutoResume
void KSaveIOConfig::setAutoResume( bool _mode )
{
KConfigGroup cfg (config(), QString());
cfg.writeEntry( "AutoResume", _mode );
cfg.sync();
}
示例8: writeConfig
void Autocorrect::writeConfig()
{
KConfigGroup interface = KoGlobal::kofficeConfig()->group("Autocorrect");
interface.writeEntry("enabled", m_enabled->isChecked());
interface.writeEntry("UppercaseFirstCharOfSentence", m_uppercaseFirstCharOfSentence);
interface.writeEntry("FixTwoUppercaseChars", m_fixTwoUppercaseChars);
interface.writeEntry("AutoFormatURLs", m_autoFormatURLs);
interface.writeEntry("SingleSpaces", m_singleSpaces);
interface.writeEntry("TrimParagraphs", m_trimParagraphs);
interface.writeEntry("AutoBoldUnderline", m_autoBoldUnderline);
interface.writeEntry("AutoFractions", m_autoFractions);
interface.writeEntry("AutoNumbering", m_autoNumbering);
interface.writeEntry("SuperscriptAppendix", m_superscriptAppendix);
interface.writeEntry("CapitalizeWeekDays", m_capitalizeWeekDays);
interface.writeEntry("AutoFormatBulletList", m_autoFormatBulletList);
interface.writeEntry("AdvancedAutocorrect", m_advancedAutocorrect);
interface.writeEntry("ReplaceDoubleQuotes", m_replaceDoubleQuotes);
interface.writeEntry("ReplaceSingleQuotes", m_replaceSingleQuotes);
interface.writeEntry("formatLanguage", m_autocorrectLang);
}
示例9: contextMenuRequested
void IdealDockWidget::contextMenuRequested(const QPoint &point)
{
QWidget* senderWidget = qobject_cast<QWidget*>(sender());
Q_ASSERT(senderWidget);
QMenu menu;
menu.addSection(windowIcon(), windowTitle());
QList< QAction* > viewActions = m_view->contextMenuActions();
if(!viewActions.isEmpty()) {
menu.addActions(viewActions);
menu.addSeparator();
}
///TODO: can this be cleaned up?
if(QToolBar* toolBar = widget()->findChild<QToolBar*>()) {
menu.addAction(toolBar->toggleViewAction());
menu.addSeparator();
}
/// start position menu
QMenu* positionMenu = menu.addMenu(i18n("Toolview Position"));
QActionGroup *g = new QActionGroup(this);
QAction *left = new QAction(i18nc("toolview position", "Left"), g);
QAction *bottom = new QAction(i18nc("toolview position", "Bottom"), g);
QAction *right = new QAction(i18nc("toolview position", "Right"), g);
QAction *detach = new QAction(i18nc("toolview position", "Detached"), g);
for (auto action : {left, bottom, right, detach}) {
positionMenu->addAction(action);
action->setCheckable(true);
}
if (isFloating()) {
detach->setChecked(true);
} else if (m_docking_area == Qt::BottomDockWidgetArea)
bottom->setChecked(true);
else if (m_docking_area == Qt::LeftDockWidgetArea)
left->setChecked(true);
else if (m_docking_area == Qt::RightDockWidgetArea)
right->setChecked(true);
/// end position menu
menu.addSeparator();
QAction *setShortcut = menu.addAction(QIcon::fromTheme(QStringLiteral("configure-shortcuts")), i18n("Assign Shortcut..."));
setShortcut->setToolTip(i18n("Use this shortcut to trigger visibility of the toolview."));
menu.addSeparator();
QAction* remove = menu.addAction(QIcon::fromTheme(QStringLiteral("dialog-close")), i18n("Remove Toolview"));
QAction* triggered = menu.exec(senderWidget->mapToGlobal(point));
if (triggered)
{
if ( triggered == remove ) {
slotRemove();
return;
} else if ( triggered == setShortcut ) {
QDialog* dialog(new QDialog(this));
dialog->setWindowTitle(i18n("Assign Shortcut For '%1' Tool View", m_view->document()->title()));
KShortcutWidget *w = new KShortcutWidget(dialog);
w->setShortcut(m_controller->actionForView(m_view)->shortcuts());
QVBoxLayout* dialogLayout = new QVBoxLayout(dialog);
dialogLayout->addWidget(w);
QDialogButtonBox* buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
dialogLayout->addWidget(buttonBox);
connect(buttonBox, &QDialogButtonBox::accepted, dialog, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, dialog, &QDialog::reject);
if (dialog->exec() == QDialog::Accepted) {
m_controller->actionForView(m_view)->setShortcuts(w->shortcut());
//save shortcut config
KConfigGroup config = KSharedConfig::openConfig()->group("UI");
QStringList shortcuts;
shortcuts << w->shortcut().value(0).toString();
shortcuts << w->shortcut().value(1).toString();
config.writeEntry(QStringLiteral("Shortcut for %1").arg(m_view->document()->title()), shortcuts);
config.sync();
}
delete dialog;
return;
} else if ( triggered == detach ) {
setFloating(true);
m_area->raiseToolView(m_view);
return;
}
if (isFloating()) {
setFloating(false);
}
Sublime::Position pos;
if (triggered == left)
pos = Sublime::Left;
else if (triggered == bottom)
pos = Sublime::Bottom;
//.........这里部分代码省略.........
示例10: saveState
void ChunkDownloadView::saveState(KSharedConfigPtr cfg)
{
KConfigGroup g = cfg->group("ChunkDownloadView");
QByteArray s = m_chunk_view->header()->saveState();
g.writeEntry("state", s.toBase64());
}
示例11: writeConfig
void WPEditAccount::writeConfig()
{
KConfigGroup group = KGlobal::config()->group("WinPopup");
group.writeEntry("SmbcPath", mSmbcPath->url().toLocalFile());
group.writeEntry("HostCheckFreq", mHostCheckFreq->text());
}
示例12: saveState
void WebSeedsTab::saveState(KSharedConfigPtr cfg)
{
KConfigGroup g = cfg->group("WebSeedsTab");
QByteArray s = m_webseed_list->header()->saveState();
g.writeEntry("state", s.toBase64());
}
示例13: writeSettings
void RestorationTool::writeSettings()
{
GreycstorationContainer prm = d->settingsWidget->settings();
KSharedConfig::Ptr config = KGlobal::config();
KConfigGroup group = config->group(d->configGroupName);
group.writeEntry(d->configPresetEntry, d->restorationTypeCB->currentIndex());
group.writeEntry(d->configFastApproxEntry, prm.fastApprox);
group.writeEntry(d->configInterpolationEntry, prm.interp);
group.writeEntry(d->configAmplitudeEntry, (double)prm.amplitude);
group.writeEntry(d->configSharpnessEntry, (double)prm.sharpness);
group.writeEntry(d->configAnisotropyEntry, (double)prm.anisotropy);
group.writeEntry(d->configAlphaEntry, (double)prm.alpha);
group.writeEntry(d->configSigmaEntry, (double)prm.sigma);
group.writeEntry(d->configGaussPrecEntry, (double)prm.gaussPrec);
group.writeEntry(d->configDlEntry, (double)prm.dl);
group.writeEntry(d->configDaEntry, (double)prm.da);
group.writeEntry(d->configIterationEntry, prm.nbIter);
group.writeEntry(d->configTileEntry, prm.tile);
group.writeEntry(d->configBTileEntry, prm.btile);
group.sync();
}
示例14: saveSettings
void ScriptingSettings::saveSettings(KConfigGroup& group)
{
group.writeEntry("Script", d->script->text());
}
示例15: writeToConfig
void ICCSettingsContainer::writeToConfig(KConfigGroup& group) const
{
group.writeEntry("EnableCM", enableCM);
if (!enableCM)
{
return; // No need to write settings in this case.
}
group.writeEntry("DefaultMismatchBehavior", (int)defaultMismatchBehavior);
group.writeEntry("DefaultMissingProfileBehavior", (int)defaultMissingProfileBehavior);
group.writeEntry("DefaultUncalibratedBehavior", (int)defaultUncalibratedBehavior);
group.writeEntry("LastMismatchBehavior", (int)lastMismatchBehavior);
group.writeEntry("LastMissingProfileBehavior", (int)lastMissingProfileBehavior);
group.writeEntry("LastUncalibratedBehavior", (int)lastUncalibratedBehavior);
group.writeEntry("LastSpecifiedAssignProfile", lastSpecifiedAssignProfile);
group.writeEntry("LastSpecifiedInputProfile", lastSpecifiedInputProfile);
group.writeEntry("BPCAlgorithm", useBPC);
group.writeEntry("ManagedView", useManagedView);
group.writeEntry("ManagedPreviews", useManagedPreviews);
group.writeEntry("RenderingIntent", renderingIntent);
group.writePathEntry("WorkProfileFile", workspaceProfile);
group.writePathEntry("MonitorProfileFile", monitorProfile);
group.writePathEntry("InProfileFile", defaultInputProfile);
group.writePathEntry("ProofProfileFile", defaultProofProfile);
group.writeEntry("ProofingRenderingIntent", proofingRenderingIntent);
group.writeEntry("DoGamutCheck", doGamutCheck);
group.writeEntry("GamutCheckMaskColor", gamutCheckMaskColor);
group.writeEntry("DefaultPath", iccFolder);
}