@MortenMacFly
Thank you for taking the time to test this plugin.
Is it possible to use the 'Build log' to display messages generated by the pre-generate ?
This would be more consistent than display them in 'Code::Blocks log'.
@oBFusCATed
when it has never requested them
See 2-
1- It retrieves the ids menus created by the plugin 'CompilerGcc' by :
void QtPregen::BuildMenu(wxMenuBar* menuBar)
{
if (!IsAttached())
return;
int pos = menuBar->FindMenu(_("Build"));
if (pos !=-1) {
wxMenu * builder = menuBar->GetMenu(pos);
m_IdBuild = builder->FindItem(_("Build"));
m_IdCompile = builder->FindItem(_("Compile current file"));
m_IdRun = builder->FindItem(_("Run"));
m_IdBuildRun = builder->FindItem(_("Build and run"));
m_IdRebuild = builder->FindItem(_("Rebuild"));
m_IdClean = builder->FindItem(_("Clean"));
}
}
2- It retrieves the ids context menus created by the plugin 'CompilerGcc' by :
void QtPregen::BuildModuleMenu(const ModuleType type, wxMenu* menu, const FileTreeData* data)
{
if (!IsAttached())
return;
// we 're only interested in m_project manager's menus
if (!menu || type != mtProjectManager)
return;
// right click on item menu ...else -> 0
if (data) {
FileTreeData::FileTreeDataKind typedata = data->GetKind();
// ... click project
bool preproject = typedata == FileTreeData::ftdkProject ;
// ... click file
bool prefile = typedata == FileTreeData::ftdkFile ;
if (preproject) {
// popup menu on a project
m_IdpClean = menu->FindItem(_("Clean"));
m_IdpBuild = menu->FindItem(_("Build"));
m_IdpRebuild = menu->FindItem(_("Rebuild"));
}
else
if (prefile) {
// popup menu on a file
m_IdfBuild = menu->FindItem(_("Build file"));
m_IdfClean = menu->FindItem(_("Clean file"));
}
}
}
3- Id are used to select the treatment in :
void QtPregen::OnPrebuild(CodeBlocksEvent& event)
{
int eventId = event.GetId();
....
}
Note that from one session to another, id's remain the same!
While compiling a new version of svn 'Code::Block'.
Obviously we need to implement this feature as a new event that is fired at the correct time and it doesn't depend on a state variable.
Well, how so ?