Page 1 of 1

Open Close Workspace Menu weirdness

Posted: Sat Dec 13, 2014 3:06 am
by Gibbon1
I'm running one of the later version of codelite 7.0 built from sources on 11/28 so take this with a grain of salt.

Something seems a bit odd with the workspace drop down.

Used to be if I had a project open, I could just open another project and codelite would close the current project then open the new one.

When I have a workspace open, 'Open Workspace' is greyed out. I have to 'Close Workspace' then open a workspace, this is a bit annoying but maybe there is a reason for this.
However sometimes after closing a workspace I still can't open a new workspace. I have to close codelite and then open a new workspace. This seems like a bug.

Re: Open Close Workspace Menu weirdness

Posted: Sat Dec 13, 2014 9:53 am
by eranif
Gibbon1 wrote:Used to be if I had a project open, I could just open another project and codelite would close the current project then open the new one.
You mean: workspace
Gibbon1 wrote:When I have a workspace open, 'Open Workspace' is greyed out. I have to 'Close Workspace' then open a workspace, this is a bit annoying but maybe there is a reason for this.
Yes there is: a rare crash ... the only solution I found was to disallow to open a workspace while another is opened
Gibbon1 wrote:However sometimes after closing a workspace I still can't open a new workspace
I havn't seen this, however, I don't switch workspaces too often, will give this a try

Eran

Re: Open Close Workspace Menu weirdness

Posted: Sat Dec 13, 2014 10:49 am
by Gibbon1
I think I'm a bit usual. I switch workspaces constantly, and have am building several different flavors of the same code base. I like codelite because it doesn't bitch about that.

An aside, I reorganized a project recently and renamed a few header files using codelite, worked great.

Re: Open Close Workspace Menu weirdness

Posted: Sat Dec 13, 2014 11:46 am
by DavidGH
Hi,
I think I'm a bit usual. I switch workspaces constantly
So do I.

However I'd not even noticed the change, as I use File > Recent Workspaces. Fortunately this still works :) .

Regards,

David

Re: Open Close Workspace Menu weirdness

Posted: Sat Dec 13, 2014 12:01 pm
by eranif
I just tried that, and I could not make it happen here... it works as expected.
Can you try this without any of the plugins loaded?

You will need to run codelite like this:

Code: Select all

codelite --no-plugins
Eran

Re: Open Close Workspace Menu weirdness

Posted: Sat Dec 20, 2014 3:12 am
by eranif
Gibbon1 wrote:However sometimes after closing a workspace I still can't open a new workspace. I have to close codelite and then open a new workspace. This seems like a bug.
This one was a b**ch to debug !
But I managed to reproduce it (and fix it...)
It seems that it all started from the time I changed the "File" menu to also include "Open workspace" menu entry

In our case, since "Open workspace" exists in 2 places (File->Open->Open workspace and Workspace->Open workspace) it caused a situation where one menu entry was disabled (the one in File->Open->Open workspace) while the second one was enabled.
This is because of the nature of how wxWidgets' "update UI" events are working: they are sent just before a menu is shown, so when you used "Open workspace" from the "Workspace" menu, codelite enabled the "Open workspace" menu entry (which is the right thing to do).
However, when you clicked that entry wxWidgets used the menu entry from File->Open->Open workspace, which is still disabled...hence, event is ignored and nothing happened

Hope I was clear, if not, it does not really matter :)
Bug fixed

Eran

Re: Open Close Workspace Menu weirdness

Posted: Sat Dec 20, 2014 10:01 pm
by petah
eranif wrote: In our case, since "Open workspace" exists in 2 places (File->Open->Open workspace and Workspace->Open workspace) it caused a situation where one menu entry was disabled (the one in File->Open->Open workspace) while the second one was enabled.
Eran
I wrote a (very ugly) hack that does something like that on purpose so I that I can map more than one keyboard shortcut to the same operation. F.ex. I have both CTRL-C and ALT-C mapped to "copy" for historical reasons and old habits.

I reused some CL logical op I don't use, then hardcoded a hash map<key, op> that redirects (merges) different keys to the same op. CL used to allow such many-to-one keyboard shortcut prefs but I see you rewrote that logic.

Still, is there a simpler way to achieve this than my ugly hack?

thx & cheers!

-- p