MCPcopy Create free account
hub / github.com/WinMerge/winmerge / OnSaveCurrentScheme

Method OnSaveCurrentScheme

Src/PropColorSchemes.cpp:142–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void PropColorSchemes::OnSaveCurrentScheme()
143{
144 const String dir = ColorSchemes::GetPrivateColorSchemesFolder(GetOptionsMgr()->GetInt(OPT_USERDATA_LOCATION) != 0);
145 paths::CreateIfNeeded(dir);
146 String path;
147 if (!SelectFile(GetSafeHwnd(), path, false,
148 dir.c_str(), _("Select file for export"),
149 _("Options files (*.ini)|*.ini|All Files (*.*)|*.*||"), _T("ini")))
150 return;
151 CIniOptionsMgr optionsMgr(path);
152 COLORSETTINGS diffColors;
153 DIRCOLORSETTINGS dirColors;
154 COLORREF customColors[16];
155 SyntaxColors syntaxColors;
156 Options::CustomColors::Init(&optionsMgr);
157 Options::CustomColors::Load(GetOptionsMgr(), customColors);
158 Options::CustomColors::Save(&optionsMgr, customColors);
159 Options::DiffColors::Init(&optionsMgr);
160 Options::DiffColors::Load(GetOptionsMgr(), diffColors);
161 Options::DiffColors::Save(&optionsMgr, diffColors);
162 Options::DirColors::Init(&optionsMgr);
163 Options::DirColors::Load(GetOptionsMgr(), dirColors);
164 Options::DirColors::Save(&optionsMgr, dirColors);
165 Options::SyntaxColors::Init(&optionsMgr, &syntaxColors);
166 Options::SyntaxColors::Load(GetOptionsMgr(), &syntaxColors);
167 Options::SyntaxColors::Save(&optionsMgr, &syntaxColors);
168 optionsMgr.InitOption(OPT_SYSCOLOR_HOOK_ENABLED, false);
169 optionsMgr.SaveOption(OPT_SYSCOLOR_HOOK_ENABLED, GetOptionsMgr()->GetBool(OPT_SYSCOLOR_HOOK_ENABLED));
170 optionsMgr.InitOption(OPT_SYSCOLOR_HOOK_COLORS, _T(""));
171 optionsMgr.SaveOption(OPT_SYSCOLOR_HOOK_COLORS, GetOptionsMgr()->GetString(OPT_SYSCOLOR_HOOK_COLORS));
172
173 ReloadColorSchemes();
174 UpdateData(FALSE);
175}
176
177void PropColorSchemes::OnDeleteCurrentScheme()
178{

Callers

nothing calls this directly

Calls 12

CreateIfNeededFunction · 0.85
SelectFileFunction · 0.85
GetOptionsMgrFunction · 0.70
InitFunction · 0.70
LoadFunction · 0.70
SaveFunction · 0.70
GetIntMethod · 0.45
InitOptionMethod · 0.45
SaveOptionMethod · 0.45
GetBoolMethod · 0.45
GetStringMethod · 0.45

Tested by

no test coverage detected