本文整理汇总了C++中GeneralSettings类的典型用法代码示例。如果您正苦于以下问题:C++ GeneralSettings类的具体用法?C++ GeneralSettings怎么用?C++ GeneralSettings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GeneralSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: restoreDefaults
void StartupSettingsPage::restoreDefaults()
{
GeneralSettings* settings = GeneralSettings::self();
settings->useDefaults(true);
loadSettings();
settings->useDefaults(false);
}
示例2: restoreDefaults
void BehaviorSettingsPage::restoreDefaults()
{
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
settings->useDefaults(true);
loadSettings();
settings->useDefaults(false);
m_confirmMoveToTrash->setChecked(CONFIRM_TRASH);
m_confirmDelete->setChecked(CONFIRM_DELETE);
}
示例3: restoreDefaults
void ConfirmationsSettingsPage::restoreDefaults()
{
GeneralSettings* settings = GeneralSettings::self();
settings->useDefaults(true);
loadSettings();
settings->useDefaults(false);
m_confirmMoveToTrash->setChecked(ConfirmTrash);
m_confirmDelete->setChecked(ConfirmDelete);
}
示例4: m_changedProps
ViewProperties::ViewProperties(const KUrl& url) :
m_changedProps(false),
m_autoSave(true),
m_node(0)
{
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
const bool useGlobalViewProps = settings->globalViewProps();
bool useDetailsViewWithPath = false;
// We try and save it to the file .directory in the directory being viewed.
// If the directory is not writable by the user or the directory is not local,
// we store the properties information in a local file.
if (useGlobalViewProps) {
m_filePath = destinationDir("global");
} else if (url.protocol().contains("search")) {
m_filePath = destinationDir("search");
useDetailsViewWithPath = true;
} else if (url.protocol() == QLatin1String("trash")) {
m_filePath = destinationDir("trash");
useDetailsViewWithPath = true;
} else if (url.isLocalFile()) {
m_filePath = url.toLocalFile();
const QFileInfo info(m_filePath);
if (!info.isWritable() || !isPartOfHome(m_filePath)) {
m_filePath = destinationDir("local") + m_filePath;
}
} else {
m_filePath = destinationDir("remote") + m_filePath;
}
const QString file = m_filePath + QDir::separator() + QLatin1String(".directory");
m_node = new ViewPropertySettings(KSharedConfig::openConfig(file));
// If the .directory file does not exist or the timestamp is too old,
// use default values instead.
const bool useDefaultProps = (!useGlobalViewProps || useDetailsViewWithPath) &&
(!QFileInfo(file).exists() ||
(m_node->timestamp() < settings->viewPropsTimestamp()));
if (useDefaultProps) {
if (useDetailsViewWithPath) {
setViewMode(DolphinView::DetailsView);
setAdditionalInfo(KFileItemDelegate::InformationList() << KFileItemDelegate::LocalPathOrUrl);
} else {
// The global view-properties act as default for directories without
// any view-property configuration
settings->setGlobalViewProps(true);
ViewProperties defaultProps(url);
setDirProperties(defaultProps);
settings->setGlobalViewProps(false);
m_changedProps = false;
}
}
}
示例5: confirmationGroup
void ConfirmationsSettingsPage::applySettings()
{
KSharedConfig::Ptr kioConfig = KSharedConfig::openConfig("kiorc", KConfig::NoGlobals);
KConfigGroup confirmationGroup(kioConfig, "Confirmations");
confirmationGroup.writeEntry("ConfirmTrash", m_confirmMoveToTrash->isChecked());
confirmationGroup.writeEntry("ConfirmDelete", m_confirmDelete->isChecked());
confirmationGroup.sync();
GeneralSettings* settings = GeneralSettings::self();
settings->setConfirmClosingMultipleTabs(m_confirmClosingMultipleTabs->isChecked());
settings->writeConfig();
}
示例6: restoreDefaults
void NavigationSettingsPage::restoreDefaults()
{
GeneralSettings* settings = GeneralSettings::self();
settings->useDefaults(true);
loadSettings();
settings->useDefaults(false);
// The mouse settings stored in KGlobalSettings must be reset to
// the default values (= single click) manually.
m_singleClick->setChecked(true);
m_doubleClick->setChecked(false);
}
示例7: config
void NavigationSettingsPage::applySettings()
{
KConfig config("kcminputrc");
KConfigGroup group = config.group("KDE");
group.writeEntry("SingleClick", m_singleClick->isChecked(), KConfig::Persistent|KConfig::Global);
config.sync();
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_MOUSE);
GeneralSettings* settings = GeneralSettings::self();
settings->setBrowseThroughArchives(m_openArchivesAsFolder->isChecked());
settings->setAutoExpandFolders(m_autoExpandFolders->isChecked());
settings->writeConfig();
}
示例8: refresh
void DolphinViewContainer::refresh()
{
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
if (settings->modifiedStartupSettings()) {
// The startup settings should only get applied if they have been
// modified by the user. Otherwise keep the (possibly) different current
// settings of the URL navigator and the filterbar.
m_urlNavigator->setUrlEditable(settings->editableUrl());
m_urlNavigator->setShowFullPath(settings->showFullPath());
setFilterBarVisible(settings->filterBar());
}
m_view->refresh();
m_statusBar->refresh();
}
示例9: confirmationGroup
void ConfirmationsSettingsPage::applySettings()
{
KSharedConfig::Ptr kioConfig = KSharedConfig::openConfig(QStringLiteral("kiorc"), KConfig::NoGlobals);
KConfigGroup confirmationGroup(kioConfig, "Confirmations");
confirmationGroup.writeEntry("ConfirmTrash", m_confirmMoveToTrash->isChecked());
confirmationGroup.writeEntry("ConfirmDelete", m_confirmDelete->isChecked());
confirmationGroup.sync();
if (m_confirmScriptExecution->isChecked()) {
KConfigGroup scriptExecutionGroup(kioConfig, "Executable scripts");
scriptExecutionGroup.writeEntry("behaviourOnLaunch", "alwaysAsk");
scriptExecutionGroup.sync();
}
GeneralSettings* settings = GeneralSettings::self();
settings->setConfirmClosingMultipleTabs(m_confirmClosingMultipleTabs->isChecked());
settings->save();
}
示例10: Q_UNUSED
void DolphinStatusBar::contextMenuEvent(QContextMenuEvent* event)
{
Q_UNUSED(event);
KMenu menu(this);
QAction* copyAction = 0;
switch (type()) {
case Default:
case OperationCompleted:
case Information:
copyAction = menu.addAction(i18nc("@action:inmenu", "Copy Information Message"));
break;
case Error:
copyAction = menu.addAction(i18nc("@action:inmenu", "Copy Error Message"));
break;
default: break;
}
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
QAction* showZoomSliderAction = menu.addAction(i18nc("@action:inmenu", "Show Zoom Slider"));
showZoomSliderAction->setCheckable(true);
showZoomSliderAction->setChecked(settings->showZoomSlider());
QAction* showSpaceInfoAction = menu.addAction(i18nc("@action:inmenu", "Show Space Information"));
showSpaceInfoAction->setCheckable(true);
showSpaceInfoAction->setChecked(settings->showSpaceInfo());
const QAction* action = menu.exec(QCursor::pos());
if (action == copyAction) {
QMimeData* mimeData = new QMimeData();
mimeData->setText(message());
QApplication::clipboard()->setMimeData(mimeData);
} else if (action == showZoomSliderAction) {
const bool visible = showZoomSliderAction->isChecked();
settings->setShowZoomSlider(visible);
m_zoomWidget->setVisible(visible);
} else if (action == showSpaceInfoAction) {
const bool visible = showSpaceInfoAction->isChecked();
settings->setShowSpaceInfo(visible);
m_spaceInfo->setVisible(visible);
}
}
示例11: PutMsg
ClientSrvTestBase::ClientSrvTestBase( Domain::DomainClass& domain, const GeneralSettings& prof )
: iCore::MsgObject(domain.getMsgThread()),
m_dummy(prof.IsValid()),
m_domain(domain),
m_prof(prof),
m_log(getLogCreator().CreateLogSesion("ClientSrvTestBase", prof.TraceTest, prof.EmulName.toStdString())),// todo resolve test name
m_tagTaskEvent(m_log->RegisterRecordKind(L"TaskEvent"))
{
*m_log << "ClientSrvTestBase created." << EndRecord;
PutMsg(this, &ClientSrvTestBase::OnRun);
}
示例12: setDefaultInputs
void ModelData::setDefaultInputs(const GeneralSettings & settings)
{
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
for (int i=0; i<NUM_STICKS; i++) {
ExpoData * expo = &expoData[i];
expo->chn = i;
expo->mode = INPUT_MODE_BOTH;
expo->srcRaw = settings.getDefaultSource(i);
expo->weight = 100;
strncpy(inputNames[i], expo->srcRaw.toString(*this).toLatin1().constData(), sizeof(inputNames[i])-1);
}
}
}
示例13: WriteDefaults
// If any settings are missing from the database, this will write
// the default values
static void WriteDefaults()
{
PlaybackSettings ps;
ps.Load();
ps.Save();
OSDSettings os;
os.Load();
os.Save();
GeneralSettings gs;
gs.Load();
gs.Save();
EPGSettings es;
es.Load();
es.Save();
AppearanceSettings as;
as.Load();
as.Save();
MainGeneralSettings mgs;
mgs.Load();
mgs.Save();
GeneralRecPrioritiesSettings grs;
grs.Load();
grs.Save();
}
示例14: applySettings
void StartupSettingsPage::applySettings()
{
GeneralSettings* settings = GeneralSettings::self();
const KUrl url(m_homeUrl->text());
KFileItem fileItem(KFileItem::Unknown, KFileItem::Unknown, url);
if ((url.isValid() && fileItem.isDir()) || (url.protocol() == QLatin1String("timeline"))) {
settings->setHomeUrl(url.prettyUrl());
} else {
KMessageBox::error(this, i18nc("@info", "The location for the home folder is invalid or does not exist, it will not be applied."));
}
settings->setSplitView(m_splitView->isChecked());
settings->setEditableUrl(m_editableUrl->isChecked());
settings->setShowFullPath(m_showFullPath->isChecked());
settings->setFilterBar(m_filterBar->isChecked());
settings->writeConfig();
}
示例15: applySettings
void StartupSettingsPage::applySettings()
{
GeneralSettings* settings = GeneralSettings::self();
const QUrl url(QUrl::fromUserInput(m_homeUrl->text(), QString(), QUrl::AssumeLocalFile));
KFileItem fileItem(url);
if ((url.isValid() && fileItem.isDir()) || (url.scheme() == QLatin1String("timeline"))) {
settings->setHomeUrl(url.toDisplayString(QUrl::PreferLocalFile));
} else {
KMessageBox::error(this, i18nc("@info", "The location for the home folder is invalid or does not exist, it will not be applied."));
}
settings->setSplitView(m_splitView->isChecked());
settings->setEditableUrl(m_editableUrl->isChecked());
settings->setShowFullPath(m_showFullPath->isChecked());
settings->setFilterBar(m_filterBar->isChecked());
settings->save();
}