File: HelpPluginSettingsDlg.cpp

package info (click to toggle)
codelite 12.0+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 95,112 kB
  • sloc: cpp: 424,040; ansic: 18,284; php: 9,569; lex: 4,186; yacc: 2,820; python: 2,294; sh: 312; makefile: 51; xml: 13
file content (41 lines) | stat: -rw-r--r-- 1,558 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "HelpPluginSettingsDlg.h"
#include "windowattrmanager.h"
#include "HelpPluginSettings.h"

HelpPluginSettingsDlg::HelpPluginSettingsDlg(wxWindow* parent)
    : HelpPluginSettingsDlgBase(parent)
    , m_modified(false)
{
    HelpPluginSettings settings;
    settings.Load();

    m_pgPropCMake->SetValue(settings.GetCmakeDocset());
    m_pgPropCSS->SetValue(settings.GetCssDocset());
    m_pgPropCxx->SetValue(settings.GetCxxDocset());
    m_pgPropHtml->SetValue(settings.GetHtmlDocset());
    m_pgPropJS->SetValue(settings.GetJsDocset());
    m_pgPropJava->SetValue(settings.GetJavaDocset());
    m_pgPropPHP->SetValue(settings.GetPhpDocset());
    WindowAttrManager::Load(this);
}

HelpPluginSettingsDlg::~HelpPluginSettingsDlg() {}

void HelpPluginSettingsDlg::OnOKUI(wxUpdateUIEvent& event) { event.Enable(m_modified); }

void HelpPluginSettingsDlg::OnDocsetChanged(wxPropertyGridEvent& event) { m_modified = true; }
void HelpPluginSettingsDlg::OnOK(wxCommandEvent& event)
{
    event.Skip();
    HelpPluginSettings settings;
    settings.Load();
    settings.SetCmakeDocset(m_pgPropCMake->GetValue().GetString());
    settings.SetCssDocset(m_pgPropCSS->GetValue().GetString());
    settings.SetCxxDocset(m_pgPropCxx->GetValue().GetString());
    settings.SetHtmlDocset(m_pgPropHtml->GetValue().GetString());
    settings.SetJsDocset(m_pgPropJS->GetValue().GetString());
    settings.SetJavaDocset(m_pgPropJava->GetValue().GetString());
    settings.SetPhpDocset(m_pgPropPHP->GetValue().GetString());
    settings.Save();
    EndModal(wxID_OK);
}