2
* This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
3
* http://www.gnu.org/licenses/gpl-3.0.html
10
#include <wx/window.h>
13
#include <cbproject.h>
16
#include <projectmanager.h>
18
#include "headerfixup.h"
19
#include "configuration.h"
20
#include "execution.h"
22
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
26
PluginRegistrant<HeaderFixup> reg(_T("HeaderFixup"));
29
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
31
HeaderFixup::HeaderFixup()
33
if ( !Manager::LoadResource(_T("headerfixup.zip")) )
35
NotifyMissingFile(_T("headerfixup.zip"));
39
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
41
HeaderFixup::~HeaderFixup()
45
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
47
void HeaderFixup::OnAttach()
51
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
53
void HeaderFixup::OnRelease(bool appShutDown)
57
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
59
int HeaderFixup::Configure()
61
cbConfigurationDialog dlg(Manager::Get()->GetAppWindow(), wxID_ANY, _("Header Fixup Config"));
62
cbConfigurationPanel* panel = GetConfigurationPanel(&dlg);
65
dlg.AttachConfigurationPanel(panel);
67
return dlg.ShowModal() == wxID_OK ? 0 : -1;
72
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
74
int HeaderFixup::Execute()
76
// if not attached, exit
80
// if no project is opened -> inform the user and do not operate
81
const cbProject* prj = Manager::Get()->GetProjectManager()->GetActiveProject();
84
cbMessageBox(_("You need to open a project/workspace before using this plugin!"),
85
_T("Header Fixup"), wxICON_ERROR | wxOK);
94
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
96
cbConfigurationPanel* HeaderFixup::GetConfigurationPanel(wxWindow* parent)
98
return new Configuration(parent);
99
}// GetConfigurationPanel