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


C++ ConfigManager::Write方法代码示例

本文整理汇总了C++中ConfigManager::Write方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigManager::Write方法的具体用法?C++ ConfigManager::Write怎么用?C++ ConfigManager::Write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConfigManager的用法示例。


在下文中一共展示了ConfigManager::Write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnRelease

void IncrementalSearch::OnRelease(bool /*appShutDown*/)
{
    // do de-initialization for your plugin
    // if appShutDown is true, the plugin is unloaded because Em::Blocks is being shut down,
    // which means you must not use any of the SDK Managers
    // NOTE: after this function, the inherited member variable
    // m_IsAttached will be FALSE...
    ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("editor"));
    if (cfg->ReadInt(_T("/incremental_search/highlight_default_state"),0) == 2)
    {
        cfg->Write(_T("/incremental_search/highlight_all_occurrences"),m_Highlight);
    }
    if (cfg->ReadInt(_T("/incremental_search/selected_default_state"),0) == 2)
    {
        cfg->Write(_T("/incremental_search/search_selected_only"),m_SelectedOnly);
    }
    if (cfg->ReadInt(_T("/incremental_search/match_case_default_state"),0) == 2)
    {
        cfg->Write(_T("/incremental_search/match_case"),m_flags & wxSCI_FIND_MATCHCASE);
    }
    if (cfg->ReadInt(_T("/incremental_search/regex_default_state"),0) == 2)
    {
        cfg->Write(_T("/incremental_search/regex"),m_flags & wxSCI_FIND_REGEXP);
    }
    m_pTextCtrl->Disconnect(wxEVT_KEY_DOWN);
    m_pTextCtrl->Disconnect(wxEVT_KILL_FOCUS);

    // TODO : KILLERBOT : menu entries should be removed, right ?????
    // TODO : JENS : no, the menubar gets recreated after a plugin changes (install, uninstall or unload), see MainFrame::PluginsUpdated(plugin, status)
}
开发者ID:stahta01,项目名称:EmBlocks_old,代码行数:30,代码来源:IncrementalSearch.cpp

示例2: SaveTools

void ToolsManager::SaveTools()
{
    ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("tools"));
    wxArrayString list = cfg->EnumerateSubPaths(_("/"));
    for (unsigned int i = 0; i < list.GetCount(); ++i)
    {
        cfg->DeleteSubPath(list[i]);
    }

    int count = 0;
    for (ToolsList::Node* node = m_Tools.GetFirst(); node; node = node->GetNext())
    {
        cbTool* tool = node->GetData();
        wxString elem;

        // prepend a 0-padded 2-digit number to keep ordering
        wxString tmp;
        tmp.Printf(_T("tool%2.2d"), count++);

        elem << _T("/") << tmp  << _T("/");
        cfg->Write(elem + _T("name"), tool->GetName());
        cfg->Write(elem + _T("command"), tool->GetCommand());
        cfg->Write(elem + _T("params"), tool->GetParams());
        cfg->Write(elem + _T("workingDir"), tool->GetWorkingDir());
        cfg->Write(elem + _T("launchOption"), static_cast<int>(tool->GetLaunchOption()));
    }
}
开发者ID:stahta01,项目名称:EmBlocks_old,代码行数:27,代码来源:toolsmanager.cpp

示例3: OnRelease

void EditorTweaks::OnRelease(bool /*appShutDown*/)
{
    m_tweakmenu = 0;

//    EditorHooks::UnregisterHook(m_EditorHookId, true);
    EditorManager* em = Manager::Get()->GetEditorManager();
    for (int i=0;i<em->GetEditorsCount();i++)
    {
        cbEditor* ed=em->GetBuiltinEditor(i);
        if (ed && ed->GetControl())
        {
            ed->GetControl()->Disconnect(wxEVT_NULL,(wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction)&EditorTweaks::OnKeyPress);
            ed->GetControl()->Disconnect(wxEVT_NULL,(wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction)&EditorTweaks::OnChar);
        }
    }

    AlignerMenuEntry e;

    ConfigManager *cfg = Manager::Get()->GetConfigManager(_T("EditorTweaks"));
    std::sort (AlignerMenuEntries.begin(), AlignerMenuEntries.end(),CompareAlignerMenuEntryObject);
    std::reverse( AlignerMenuEntries.begin(), AlignerMenuEntries.end());
    int i = 0;
    for (; i < cfg->ReadInt(_T("/aligner/max_saved_entries"),defaultStoredAlignerEntries) && i < static_cast<int>(AlignerMenuEntries.size()) ; ++i)
    {
        cfg->Write(wxString::Format(_T("/aligner/first_name_%d"),i),AlignerMenuEntries[i].MenuName);
        cfg->Write(wxString::Format(_T("/aligner/first_argument_string_%d"),i) ,AlignerMenuEntries[i].ArgumentString);

        Disconnect(AlignerMenuEntries[i].id, wxEVT_COMMAND_MENU_SELECTED,  wxCommandEventHandler(EditorTweaks::OnAlign) );
    }
    cfg->Write(_T("/aligner/saved_entries"),i);
    for (; i < static_cast<int>(AlignerMenuEntries.size()) ; ++i)
        Disconnect(AlignerMenuEntries[i].id, wxEVT_COMMAND_MENU_SELECTED,  wxCommandEventHandler(EditorTweaks::OnAlign) );
    cfg->Write(wxT("/suppress_insert_key"), m_suppress_insert);
    cfg->Write(wxT("/convert_braces"),      m_convert_braces);
}
开发者ID:Three-DS,项目名称:codeblocks-13.12,代码行数:35,代码来源:EditorTweaks.cpp

示例4: OnApply

void cbmakefilecfg::OnApply()
{
    ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("cbMakefileGen"));
    cfg->Write(_T("/filename"),(const wxString &)m_pTCFilename->GetValue());
    cfg->Write(_T("/overwrite"),(bool)m_pCBOverwrite->GetValue());
    cfg->Write(_T("/silence"),(bool)m_pCBSilence->GetValue());
}
开发者ID:BackupTheBerlios,项目名称:cbmakegen-svn,代码行数:7,代码来源:cbmakefilecfg.cpp

示例5: SaveSettings

void AutosaveConfigDlg::SaveSettings()
{
    ConfigManager *cfg = Manager::Get()->GetConfigManager(_T("autosave"));

    cfg->Write(_T("do_project"), (bool) XRCCTRL(*this, "do_project", wxCheckBox)->GetValue());
    cfg->Write(_T("do_sources"), (bool) XRCCTRL(*this, "do_sources", wxCheckBox)->GetValue());
    cfg->Write(_T("do_workspace"), (bool) XRCCTRL(*this, "do_workspace", wxCheckBox)->GetValue());
    cfg->Write(_T("all_projects"), (bool) XRCCTRL(*this, "all_projects", wxCheckBox)->GetValue());

    long pm, sm;

    XRCCTRL(*this, "project_mins", wxTextCtrl)->GetValue().ToLong(&pm);
    XRCCTRL(*this, "source_mins", wxTextCtrl)->GetValue().ToLong(&sm);

    if (pm < 1)
        pm = 1;
    if (sm < 1)
        sm = 1;

    cfg->Write(_T("project_mins"), (int) pm);
    cfg->Write(_T("source_mins"), (int) sm);

    cfg->Write(_T("method"), XRCCTRL(*this, "method", wxChoice)->GetSelection());

    plugin->Start();
}
开发者ID:Distrotech,项目名称:codeblocks,代码行数:26,代码来源:autosave.cpp

示例6: EndModal

void PluginsConfigurationDlg::EndModal(int retCode)
{
    ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("plugins"));

    cfg->Write(_T("/install_globally"), XRCCTRL(*this, "chkInstallGlobally", wxCheckBox)->GetValue());
    cfg->Write(_T("/install_confirmation"), XRCCTRL(*this, "chkInstallConfirmation", wxCheckBox)->GetValue());

    wxScrollingDialog::EndModal(retCode);
}
开发者ID:stahta01,项目名称:codeblocks_r7456,代码行数:9,代码来源:pluginsconfigurationdlg.cpp

示例7: SaveSettings

void EnvVarsConfigDlg::SaveSettings()
{
#if defined(TRACE_ENVVARS)
  if (Manager::Get() && Manager::Get()->GetLogManager());
    Manager::Get()->GetLogManager()->DebugLog(F(_T("SaveSettings")));
#endif

  wxChoice* choSet = XRCCTRL(*this, "choSet", wxChoice);
  if (!choSet)
    return;

  wxCheckListBox* lstEnvVars = XRCCTRL(*this, "lstEnvVars", wxCheckListBox);
  if (!lstEnvVars)
    return;

  wxCheckBox* chkDebugLog = XRCCTRL(*this, "chkDebugLog", wxCheckBox);
  if (!chkDebugLog)
    return;

  ConfigManager *cfg = Manager::Get()->GetConfigManager(_T("envvars"));
  if (!cfg)
    return;

  wxString active_set = choSet->GetString(choSet->GetCurrentSelection());
  if (active_set.IsEmpty())
    active_set = nsEnvVars::EnvVarsDefault;

  SaveSettingsActiveSet(active_set);

  wxString active_set_path = nsEnvVars::GetSetPathByName(active_set, false);
  EV_DBGLOG(_T("EnvVars: Removing (old) envvar set '%s' at path '%s' from config."),
    active_set.wx_str(), active_set_path.wx_str());
  cfg->DeleteSubPath(active_set_path);

  EV_DBGLOG(_T("EnvVars: Saving (new) envvar set '%s'."), active_set.wx_str());
  cfg->SetPath(active_set_path);

  for (int i=0; i<(int)lstEnvVars->GetCount(); ++i)
  {
    // Format: [checked?]|[key]|[value]
    wxString check = (lstEnvVars->IsChecked(i))?_T("1"):_T("0");
    wxString key   = lstEnvVars->GetString(i).BeforeFirst(_T('=')).Trim(true).Trim(false);
    wxString value = lstEnvVars->GetString(i).AfterFirst(_T('=')).Trim(true).Trim(false);

    wxString txt;
    txt << check << nsEnvVars::EnvVarsSep << key
                 << nsEnvVars::EnvVarsSep << value;

    wxString cfg_key;
    cfg_key.Printf(_T("EnvVar%d"), i);
    cfg->Write(cfg_key, txt);
  }// for

  cfg->Write(_T("/debug_log"), chkDebugLog->GetValue());
}// SaveSettings
开发者ID:Three-DS,项目名称:codeblocks-13.12,代码行数:55,代码来源:envvars_cfgdlg.cpp

示例8: DoOnFileOpen

// ----------------------------------------------------------------------------
// DoOnFileOpen:
// in case we are opening a project (bProject == true) we do not want to interfere
// with 'last type of files' (probably the call was open (existing) project on the
// start here page --> so we know it's a project --> set the filter accordingly
// but as said don't force the 'last used type of files' to change, that should
// only change when an open file is carried out (so (source) file <---> project (file) )
// TODO : when regular file open and user manually sets filter to project files --> will change
//      the last type : is that expected behaviour ???
// ----------------------------------------------------------------------------
void ThreadSearchFrame::DoOnFileOpen(bool bProject)
// ----------------------------------------------------------------------------
{
    wxString Filters = FileFilters::GetFilterString();
    // the value returned by GetIndexForFilterAll() is updated by GetFilterString()
    int StoredIndex = FileFilters::GetIndexForFilterAll();
    wxString Path;
    ConfigManager* mgr = Manager::Get()->GetConfigManager(_T("app"));
    if(mgr)
    {
        if(!bProject)
        {
            wxString Filter = mgr->Read(_T("/file_dialogs/file_new_open/filter"));
            if(!Filter.IsEmpty())
            {
                FileFilters::GetFilterIndexFromName(Filters, Filter, StoredIndex);
            }
            Path = mgr->Read(_T("/file_dialogs/file_new_open/directory"), Path);
        }
        else
        {
            FileFilters::GetFilterIndexFromName(Filters, _("Code::Blocks project files"), StoredIndex);
        }
    }
    wxFileDialog* dlg = new wxFileDialog(this,
                            _("Open file"),
                            Path,
                            wxEmptyString,
                            Filters,
                            wxFD_OPEN | wxFD_MULTIPLE | compatibility::wxHideReadonly);
    dlg->SetFilterIndex(StoredIndex);

    PlaceWindow(dlg);
    if (dlg->ShowModal() == wxID_OK)
    {
        // store the last used filter and directory
        // as said : don't do this in case of an 'open project'
        if(mgr && !bProject)
        {
            int Index = dlg->GetFilterIndex();
            wxString Filter;
            if(FileFilters::GetFilterNameFromIndex(Filters, Index, Filter))
            {
                mgr->Write(_T("/file_dialogs/file_new_open/filter"), Filter);
            }
            wxString Test = dlg->GetDirectory();
            mgr->Write(_T("/file_dialogs/file_new_open/directory"), dlg->GetDirectory());
        }
        wxArrayString files;
        dlg->GetPaths(files);
        OnDropFiles(0,0,files);
    }

    dlg->Destroy();
} // end of DoOnFileOpen
开发者ID:469306621,项目名称:Languages,代码行数:65,代码来源:ThreadSearchFrame.cpp

示例9: SaveSettings

void CFortranIndentConfigDlg::SaveSettings()
{
    ConfigManager *cfg = Manager::Get()->GetConfigManager(_T("fortran_indent"));

    cfg->Write(_T("is_SameAsEditor"), (bool) XRCCTRL(*this, "cb_SameAsEditor", wxCheckBox)->GetValue());
    cfg->Write(_T("is_UseTab"), (bool) XRCCTRL(*this, "cb_UseTab", wxCheckBox)->GetValue());
	cfg->Write(_T("i_TabWidth"), (int) XRCCTRL(*this, "sp_TabWidth", wxSpinCtrl)->GetValue());
	cfg->Write(_T("is_KeepBlankLineOnly"), (bool) XRCCTRL(*this, "cb_KeepBlankLineOnly", wxCheckBox)->GetValue());
    cfg->Write(_T("is_TrimLineFromRight"), (bool) XRCCTRL(*this, "cb_TrimLineFromRight", wxCheckBox)->GetValue());
    cfg->Write(_T("i_PreprocessorType"), (int) XRCCTRL(*this, "rb_PreprocessorType", wxRadioBox)->GetSelection());
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例10: XRCCTRL

ClassWizardDlg::~ClassWizardDlg()
{
    // NOTE (Morten#3#): Not nice to have it here (should be in OnApply of the plugin)
    ConfigManager *cfg = Manager::Get()->GetConfigManager(_T("classwizard"));
    if (cfg)
    {
        cfg->Write(_T("documentation"), (bool) XRCCTRL(*this, "chkDocumentation", wxCheckBox)->GetValue());
        cfg->Write(_T("common_dir"),    (bool) XRCCTRL(*this, "chkCommonDir",     wxCheckBox)->GetValue());
        cfg->Write(_T("lower_case"),    (bool) XRCCTRL(*this, "chkLowerCase",     wxCheckBox)->GetValue());
    }
}
开发者ID:stahta01,项目名称:codeblocks_custom_build,代码行数:11,代码来源:classwizarddlg.cpp

示例11: OnApply

void ConfigPanel::OnApply()
{
    ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("cppcheck"));
    if (cfg)
    {
        wxString app = txtCppCheckApp->GetValue();
        if (!app.IsEmpty())
            cfg->Write(_T("cppcheck_app"), app);
        if (!txtCppCheckArgs->GetValue().IsEmpty())
            cfg->Write(_T("cppcheck_args"), txtCppCheckArgs->GetValue());
    }
}
开发者ID:DowerChest,项目名称:codeblocks,代码行数:12,代码来源:ConfigPanel.cpp

示例12: OnOk

void LibSelectDlg::OnOk(wxCommandEvent& event)
{
	ConfigManager* Cfg = Manager::Get()->GetConfigManager(_T("lib_finder"));

	if ( !m_DontClear )
	{
        if ( m_DontClear->GetValue()     ) Cfg->Write(_T("libselect/previous"),0);
        if ( m_ClearSelected->GetValue() ) Cfg->Write(_T("libselect/previous"),1);
        if ( m_ClearAll->GetValue()      ) Cfg->Write(_T("libselect/previous"),2);
	}
	Cfg->Write(_T("libselect/setup_global_vars"),m_SetupGlobalVars->GetValue());
    event.Skip();
}
开发者ID:DowerChest,项目名称:codeblocks,代码行数:13,代码来源:libselectdlg.cpp

示例13: OnPageChanging

//------------------------------------------------------------------------------
void WizCompilerPanel::OnPageChanging(wxWizardEvent& event)
{
    if (event.GetDirection() != 0) // !=0 forward, ==0 backward
    {
        if (GetCompilerID().IsEmpty())
        {
            cbMessageBox(_("You must select a compiler for your project..."), _("Error"), wxICON_ERROR, GetParent());
            event.Veto();
            return;
        }
        if (m_AllowConfigChange && !GetWantDebug() && !GetWantRelease())
        {
            cbMessageBox(_("You must select at least one configuration..."), _("Error"), wxICON_ERROR, GetParent());
            event.Veto();
            return;
        }

        if (m_AllowConfigChange)
        {
            ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("scripts"));

            cfg->Write(_T("/generic_wizard/want_debug"), (bool)GetWantDebug());
            cfg->Write(_T("/generic_wizard/debug_name"), GetDebugName());
            cfg->Write(_T("/generic_wizard/debug_output"), GetDebugOutputDir());
            cfg->Write(_T("/generic_wizard/debug_objects_output"), GetDebugObjectOutputDir());

            cfg->Write(_T("/generic_wizard/want_release"), (bool)GetWantRelease());
            cfg->Write(_T("/generic_wizard/release_name"), GetReleaseName());
            cfg->Write(_T("/generic_wizard/release_output"), GetReleaseOutputDir());
            cfg->Write(_T("/generic_wizard/release_objects_output"), GetReleaseObjectOutputDir());
        }
    }
    WizPageBase::OnPageChanging(event); // let the base class handle it too
}
开发者ID:stahta01,项目名称:codeblocks_r7456,代码行数:35,代码来源:wizpage.cpp

示例14: SaveSettings

void EditorTweaksConfDlg::SaveSettings()
{
    ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("EditorTweaks"));
    int oldSavedAlignerEntries = cfg->ReadInt(_T("/aligner/max_saved_entries"), 4);
    int newSavedAlignerEntries = SpinCtrl1->GetValue();

    if(oldSavedAlignerEntries != newSavedAlignerEntries )
        cfg->Write(_T("aligner/max_saved_entries"),newSavedAlignerEntries);

    const int oldBuffer = cfg->ReadInt(wxT("/buffer_caret"), 1);
    const int newBuffer = Choice1->GetSelection();
    if (oldBuffer != newBuffer)
        cfg->Write(wxT("/buffer_caret"), newBuffer);
}
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:14,代码来源:EditorTweaksConfDlg.cpp

示例15: Save

void FilesGroupsAndMasks::Save()
{
    ConfigManager* conf = Manager::Get()->GetConfigManager(_T("project_manager"));
    conf->DeleteSubPath(_T("/file_groups"));
    for (unsigned int i = 0; i < m_Groups.GetCount(); ++i)
    {
        FileGroups* fg = m_Groups[i];
        wxString key;
        key << _T("/file_groups/group") << wxString::Format(_T("%d"), i) << _T("/") << _T("name");
        conf->Write(key, fg->groupName);
        key.Clear();
        key << _T("/file_groups/group") << wxString::Format(_T("%d"), i) << _T("/") << _T("mask");
        conf->Write(key, GetStringFromArray(fg->fileMasks, _T(";")));
    }
}
开发者ID:yjdwbj,项目名称:cb10-05-ide,代码行数:15,代码来源:filegroupsandmasks.cpp


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