User forums > Using Code::Blocks
Opening project with undefined global variables
Seronis:
If I open a project that attempts to use a variable that is undefined, C::B convienently pops up the display asking to enter information on it. This is nice and convienent but in instances where the information doesnt yet exist i dont want to have to enter anything. Id like to be able to click cancel and have it, well, CANCEL. Not just pop the dialog back up. One time per instance of loading the project is enough. If it refuses to allow me to compile or even if it sends garbage options to gcc i'll accept that. But dont ask me to enter the variable information again and let me get back to work without having to task kill C::B. If you must, refuse to load the project if a user refuses to enter info, but locking up the interface is extremely annoying.
oBFusCATed:
You can enter some garbage settings to make it go away.
But I also think this is quite annoying, so +1 from me :lol:
thomas:
Agreed, it is annoying, but unluckily, this issue that has been existing for a long time is not easy to fix.
The global user variable manager works by returning a value if you ask for a variable, and by prompting the user if a variable doesn't exist yet. So far so good.
Now, the problem is, during the loading of a project and while code completion is running, it may be called a dozen times. If you hit "cancel", it's still being called again. That's the reason why the dialog keeps popping up.
To avoid this happening, one would need to add failure reporting to the user variable manager, and some kind of caching into the project loader and into code completion. However, that would very likely break something, since if the information wasn't necessary, the respective components wouldn't be asking for it in the first place (at least, I hope so!).
Or, one could add a flag into the global user variable manager which marks a certain variable as "undefined, don't ask again", but then it won't do its work for compilation any more :(
oBFusCATed:
After reading your explanation, I think there is an easy solution: remove the cancel button and don't allow the user to close the dialog without entering something (proper message should be supplied)
Seronis:
My issue is I dont want to enter garbage data once because I want it to come back up NEXT time if need be. It either needs to be able to 'go away' peacefully or canceling it should unload the offending project.
And a point of curiosity, since we can -change- variables at any time and we can change them to 'wrong' info, why cant it just flag a variable as defaulted and any further requests return a garbage string, or an empty string? A garbage string would be far more useful than locking the interface and as long as the 'defaulted' flag isnt saved to disk it will properly ask next time the project is opened, right? And if the user changes their mind, and decides to manually enter something useful for that variable during the session we can just clear the defaulted flag. Then again I've admited to merely being a hobbyist coder before, and you're more experienced, so I could be mistaken about how easy it should be. =-)
BTW not doing its job for compilation involving a 'dirty' variable is acceptible. Stopping a user from opening a project that they might merely want to READ using their preferred IDE is not acceptible.
Navigation
[0] Message Index
[#] Next page
Go to full version