Open Close Workspace Menu weirdness

Discussion about CodeLite development process and patches
Gibbon1
CodeLite Expert
Posts: 167
Joined: Fri Jul 22, 2011 5:32 am
Genuine User: Yes
IDE Question: C++
Contact:

Open Close Workspace Menu weirdness

Post by Gibbon1 » Sat Dec 13, 2014 3:06 am

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.

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Open Close Workspace Menu weirdness

Post by eranif » Sat Dec 13, 2014 9:53 am

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
Make sure you have read the HOW TO POST thread

Gibbon1
CodeLite Expert
Posts: 167
Joined: Fri Jul 22, 2011 5:32 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Open Close Workspace Menu weirdness

Post by Gibbon1 » Sat Dec 13, 2014 10:49 am

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.

DavidGH
CodeLite Plugin
Posts: 677
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Open Close Workspace Menu weirdness

Post by DavidGH » Sat Dec 13, 2014 11:46 am

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

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Open Close Workspace Menu weirdness

Post by eranif » Sat Dec 13, 2014 12:01 pm

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
Make sure you have read the HOW TO POST thread

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Open Close Workspace Menu weirdness

Post by eranif » Sat Dec 20, 2014 3:12 am

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
Make sure you have read the HOW TO POST thread

petah
CodeLite Expert
Posts: 231
Joined: Sat Nov 24, 2012 8:04 pm
Genuine User: Yes
IDE Question: c++
Location: Los Angeles
Contact:

Re: Open Close Workspace Menu weirdness

Post by petah » Sat Dec 20, 2014 10:01 pm

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
main: Debian Jessie x64 + custom wxTrunk

Post Reply