当前位置: 首页>>代码示例>>C++>>正文


C++ GeneralSettings类代码示例

本文整理汇总了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);
}
开发者ID:fluxer,项目名称:kde-baseapps,代码行数:7,代码来源:startupsettingspage.cpp

示例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);
}
开发者ID:vishesh,项目名称:kde-baseapps,代码行数:9,代码来源:behaviorsettingspage.cpp

示例3: restoreDefaults

void ConfirmationsSettingsPage::restoreDefaults()
{
    GeneralSettings* settings = GeneralSettings::self();
    settings->useDefaults(true);
    loadSettings();
    settings->useDefaults(false);

    m_confirmMoveToTrash->setChecked(ConfirmTrash);
    m_confirmDelete->setChecked(ConfirmDelete);
}
开发者ID:theunbelievablerepo,项目名称:dolphin2.1,代码行数:10,代码来源:confirmationssettingspage.cpp

示例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;
        }
    }
}
开发者ID:vishesh,项目名称:kde-baseapps,代码行数:55,代码来源:viewproperties.cpp

示例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();
}
开发者ID:theunbelievablerepo,项目名称:dolphin2.1,代码行数:12,代码来源:confirmationssettingspage.cpp

示例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);
}
开发者ID:fluxer,项目名称:kde-baseapps,代码行数:12,代码来源:navigationsettingspage.cpp

示例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();
}
开发者ID:fluxer,项目名称:kde-baseapps,代码行数:14,代码来源:navigationsettingspage.cpp

示例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();
}
开发者ID:vishesh,项目名称:kde-baseapps,代码行数:15,代码来源:dolphinviewcontainer.cpp

示例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();
}
开发者ID:KDE,项目名称:dolphin,代码行数:18,代码来源:confirmationssettingspage.cpp

示例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);
    }
}
开发者ID:vishesh,项目名称:kde-baseapps,代码行数:44,代码来源:dolphinstatusbar.cpp

示例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);
}
开发者ID:ixc-software,项目名称:lucksi,代码行数:11,代码来源:ClientSrvTestBase.cpp

示例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);
    }
  }
}
开发者ID:badzz,项目名称:opentx,代码行数:13,代码来源:eeprominterface.cpp

示例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();
}
开发者ID:DocOnDev,项目名称:mythtv,代码行数:26,代码来源:main.cpp

示例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();
}
开发者ID:fluxer,项目名称:kde-baseapps,代码行数:19,代码来源:startupsettingspage.cpp

示例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();
}
开发者ID:emmanuel099,项目名称:dolphin,代码行数:19,代码来源:startupsettingspage.cpp


注:本文中的GeneralSettings类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。