Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

a Qt plugin : QtPregenForCB => AddOnForQt

<< < (3/14) > >>

oBFusCATed:
I can believe you. There is no chance for this to work.
This is the code that registers the context menu items. Obviously the items don't reuse the ids from the main menu.
And I couldn't see any code that takes these ids.

--- Code: ---        menu->Append(idMenuCompileFromProjectManager, _("Build"));
        menu->Append(idMenuRebuildFromProjectManager, _("Rebuild"));
        menu->Append(idMenuCleanFromProjectManager,   _("Clean"));

--- End code ---

The dependence on the plugin load order is another nail in the coffin of this change!  8)

oBFusCATed:
If you need to make a robust solution.
Take a look at the CompilerGCC::BuildStateManagement function. There is a switch for every build action.
You can invent an event that fires in this specific moment so it will always be correct.
You can add events that fire at the end of the action. So you will know when clean has started and also you'll know when it has finished. Also you'll know the same things about the other phases of the build.

Also there are the cbEVT_CLEAN_PROJECT_STARTED and cbEVT_CLEAN_WORKSPACE_STARTED events.

LETARTARE:
I ask that you check, you'll see!

For

--- Code: --- menu->Append(idMenuCompileFromProjectManager, _("Build"));
menu->Append(idMenuRebuildFromProjectManager, _("Rebuild"));
menu->Append(idMenuCleanFromProjectManager,   _("Clean"));
--- End code ---

A little higher in the Dispatcher:


--- Code: ---void CompilerGCC::Dispatcher(wxCommandEvent& event)
{
    m_EventId = event.GetId();
//    Manager::Get()->GetMessageManager()->Log(wxT("Dispatcher")));
    if (m_EventId == idMenuRun)
        OnRun(event);
    else if (m_EventId == idMenuCompileAndRun)
        OnCompileAndRun(event);
    else if (m_EventId == idMenuCompile)
        OnCompile(event);
    else if (m_EventId == idMenuCompileFromProjectManager)
        OnCompile(event);
    else if (m_EventId == idMenuCompileFile)
        OnCompileFile(event);
    else if (m_EventId == idMenuCompileFileFromProjectManager)
        OnCompileFile(event);
    else if (m_EventId == idMenuCleanFileFromProjectManager)
        OnCleanFile(event);
    else if (m_EventId == idMenuRebuild)
        OnRebuild(event);
    else if (m_EventId == idMenuRebuildFromProjectManager)
        OnRebuild(event);
....

--- End code ---

we recover the same id's

--- Quote ---idMenuCompileFromProjectManager
idMenuCleanFileFromProjectManager
idMenuRebuildFromProjectManager
--- End quote ---
triggers

--- Quote ---OnCompile(event);
OnRebuild(event);
--- End quote ---


--- Quote ---Take a look at the CompilerGCC::BuildStateManagement function.
--- End quote ---
I will try to understand how it works to use.

oBFusCATed:
I don't understand what you mean with the last post.
Do you agree that there is no chance for your plugin to work correctly when someone is using the context menu or are you seeing something in the code that I'm missing?


--- Quote from: LETARTARE on February 12, 2015, 11:13:34 pm ---I ask that you check, you'll see!

--- End quote ---
I don't understand the meaning of this sentence.

LETARTARE:
I ask you to try the plugin 'QtPregenForCB' to verify that the context menu works correctly.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version