Author Topic: New event - cbEVT_EDITOR_SAVE_ALL  (Read 4965 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
New event - cbEVT_EDITOR_SAVE_ALL
« on: February 16, 2010, 10:33:56 pm »
Hello,

Is it a good idea the addition of cbEVT_EDITOR_SAVE_ALL?
For example, this event will be fired when the compiler starts to build the project (currently it calls project->SaveAllFiles() :( )  every other plugin/core needs to save all files.
I want this event in order to make the wxSmith plugin save the *.wxs file, when the user compiles the project.
At the moment when you hit compile in a wxSmith project the *.wxs is not saved, which is a bit disturbing and not very user friendly.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: New event - cbEVT_EDITOR_SAVE_ALL
« Reply #1 on: February 17, 2010, 06:40:36 am »
Is it a good idea the addition of cbEVT_EDITOR_SAVE_ALL?
Why don't you simply use cbEVT_COMPILER_STARTED?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: New event - cbEVT_EDITOR_SAVE_ALL
« Reply #2 on: February 17, 2010, 08:14:19 am »
That was my first idea, but adding the event SAVE_ALL sounds more logical and robust (can save all files on other events, not sure which :) ).

Maybe the event name should be other, because cbEVT_EDITOR_* is for the editors... probably cbEVT_PROJECT_SAVE_FILES is better one.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: New event - cbEVT_EDITOR_SAVE_ALL
« Reply #3 on: February 17, 2010, 09:21:02 am »
That was my first idea, but adding the event SAVE_ALL sounds more logical and robust (can save all files on other events, not sure which :) ).
Make it cbEVT_PROJECT_SAVE_ALL_FILES then to comply with the method's name.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: New event - cbEVT_EDITOR_SAVE_ALL
« Reply #4 on: February 17, 2010, 12:26:12 pm »
OK, One more thing - should I fire it from the inside of project->SaveAllFiles() or I need to modify all places that call SaveAllFiles() to fire the event?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: New event - cbEVT_EDITOR_SAVE_ALL
« Reply #5 on: February 17, 2010, 01:26:14 pm »
inside of project->SaveAllFiles()
This one. :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: New event - cbEVT_EDITOR_SAVE_ALL
« Reply #6 on: February 18, 2010, 12:17:18 am »
OK, I've done it.
And now I need to know how to save all wxs files in a project.
I've written this:

Code
bool wxsProject::SaveResources()
{
    for (size_t ii = 0; ii < m_Resources.GetCount(); ++ii)
    {
        wxsResource* Resource = m_Resources[ii];
        Resource->
    }
    return false;
}

And I don't know what to type after "->". I've found that the wxs' data is stored in wxsItemResData objects, but I don't see a way to get to such an object for a given wxsResource object.
Does anyone know how could I do that?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]