Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: oBFusCATed on June 27, 2019, 07:23:34 pm

Title: Keybinder v2 notes/problems
Post by: oBFusCATed on June 27, 2019, 07:23:34 pm
I've updated my main install of the codeblocks to the latest rev and the keybinder seems to be broken for me.
Here is the list of things I've spotted as problems:

1. Memory leak from "m_pAccelEntries = new wxAcceleratorEntry[m_AccelCount];" use unique_ptr?
2. ctrl-shift-. and ctrl-shift-t doesn't work as accelerators
3. The new keybinder failed to parse the old config and lost all my bindings
4. The old menu name is not visible on windows7 with wx-master + 4k 27inch display in the settings on windows (this is with the latest night build)
5. I have ctrl-f4 instead of ctrl-w for file->close file?
6. The json file is not sorted, so it is hard to compare with another version. It would be really good if this is sorted
7. The json file contains all the keybindings. I think it would be better if it stores only the user specified bindings and leave everything else as default.
8. Can we really make a introspecting keybinder work reliably? Wouldn't it be better if we specify commands using code? VStudio has such an approach. And this would make it possible to have the sublime/vscode command windows.

I'm on gentoo linux, wx3.0.4+patch and wx-master+asan. Both wx versions behave the same sort of.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on June 28, 2019, 07:22:10 pm
I've updated my main install of the codeblocks to the latest rev and the keybinder seems to be broken for me.
Here is the list of things I've spotted as problems:

1. Memory leak from "m_pAccelEntries = new wxAcceleratorEntry[m_AccelCount];" use unique_ptr?
At the point it needs to be deleted, the whole address space is about to be destroyed. But since it seems to offend, I'll add a delete.

2. ctrl-shift-. and ctrl-shift-t doesn't work as accelerators
I'm using both shortcuts every day. Please describe your environment and how you're setting them. Further data would help me recreate the problem.
Would you attach the cbKeybinder.ini file that Keybinder tried to convert.
 
3. The new keybinder failed to parse the old config and lost all my bindings
Would you attach your old cbKeybinder.ini file so I can try and duplicate the problem. Windows or Linux? This happens on Linux for the nightly build (June 10 and prior). But I fixed this in head.

4. The old menu name is not visible on windows7 with wx-master + 4k 27inch display in the settings on windows (this is with the latest night build)
I'll try this on a VMWare Windows 7, but I don't have access to such a nice monitor. What do you mean by "wx-master" on "lastest night build" I thought the nightly builds were using 3.1 on windows. And I've I made major fixes since the latest nightly build (june 10).

5. I have ctrl-f4 instead of ctrl-w for file->close file?
Both probably work. Keybinder now preserves the global accelerators set in main.cpp . Somehow the global shortcut got set as the first accelerator. Please attach your cbKeybinder.ini file so I can try to recreate the problem.
 
6. The json file is not sorted, so it is hard to compare with another version. It would be really good if this is sorted
I agree. I'll put it on the todo list.

7. The json file contains all the keybindings. I think it would be better if it stores only the user specified bindings and leave everything else as default.
I'll put this on the todo list to see what happens.

8. Can we really make a introspecting keybinder work reliably? Wouldn't it be better if we specify commands using code? VStudio has such an approach. And this would make it possible to have the sublime/vscode command windows.
I don't know yet what any of this means. I'll do some googling.
 
I'm on gentoo linux, wx3.0.4+patch and wx-master+asan. Both wx versions behave the same sort of.
I'll try to create a VMWare gentoo. But it looks really complicated. It will take some time. I can't find an ISO image like Ubuntu or Mint that VMware Player can just load and run without all that configuration voodoo.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on June 29, 2019, 10:04:44 am
1. The memory leak makes using asan harder. I can learn to ignore some leaks, but it will be best if there are as few known leaks as possible. This would make it easy for me to spot new leaks and problem.
2. ctrl-shift-. and ctrl-shift-t doesn't work on a fresh config. So I do
Code
rm ~/.config/codeblocks/debug* -v
and then start codeblocks from codeblocks. For this test I use wx-master (wxwidgets built from recent master and also I'm using asan for everything, but I doubt this last fact matters). But I see a single cbKeyBinder10.ini. Does this mean that it is common for all personalities?

3. See the attached cbKeyBinder10.ini; Linux rev 11750. wx3.0.4.
5. I've found this problem because ctrl-w didn't work.
8. This means that all commands are generated with code, so there would be explicit calls like commandManager.AddCommand(...). Current code relies on properly inspecting (introspecting) the contents of menus to find all the commands. This is less work in the beginning, but it seems unreliable to me.

It will be cool if someday we get something like this https://code.visualstudio.com/assets/docs/getstarted/tips-and-tricks/OpenCommandPalatte.gif (it can also be done with introspection the menus).
It makes it really easy to discover/use obscure features.

Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on June 29, 2019, 04:39:57 pm
Also:
9. alt-pgup/alt-pgdown doesn't work for me. They should be set to prev/next bookmark, but they don't work. :(
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on June 30, 2019, 06:44:23 pm
@ oBFusCATed

Would you try svn rev 11764 on your gentoo.
Please delete all <personality>.cbKeybinder20.conf files before testing.
(you might not have any because of a bug before rev:11741.)

I re-created the menu accelerator bug, fixed it, and tested on other Linux versions. User config'ed menu accelerators now work correctly on Mint and Ubuntu.
I will fix the memory leak after confirming that you have been successful on gentoo.

2. ctrl-shift-. and ctrl-shift-t doesn't work on a fresh config. [snip] ...
5. I've found this problem because ctrl-w didn't work.
9. alt-pgup/alt-pgdown doesn't work for me. They should be set to prev/next bookmark, but they don't work. :(
But I see a single cbKeyBinder10.ini. Does this mean that it is common for all personalities?
Accelerators are now fixed. svn rev:11764 .
I believe that cbKeyBinder10.ini appeared without a personality prefix because you might have been using a cbKeyBinder prior to rev:11741 which corrected obtaining the location of .config/.codeblocks config directory.

Thanks for finding these bugs.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on July 01, 2019, 08:48:20 pm
2 and 5 are fixed it seems. Thanks. This works without deleting the config.

3. Is still broken.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on July 02, 2019, 10:51:24 pm
@ oBFusCATed

3. Is still broken.
Quote from: oBFusCATed on June 27, 2019, 10:23:34 am
3. The new keybinder failed to parse the old config and lost all my bindings

Please test rev:11766.

To test, backup your ~/.config/codeblocks/<personality>.cbKeybinder20.conf, then remove it. Else Keybinder won't process cbKeyBinder10.ini since it thinks it's already processed it once.

Also, backup and remove any <personality>.cbKeyBinder10.ini file that may not contain the keys you want from the standalone(non-personality) cbKeyBinder10.ini.

This will cause KeyBinder to use the standalone cbKeyBinder10.ini file because it cannot find a personalized one.

I forgot that there could be non-personalized cbKeyBinder10.ini files still sitting around. They don't happen anymore unless a pre-personalized version of CB is run or the file is inherited from a pre-personalized version of CB.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on July 04, 2019, 07:29:40 pm
@ oBFusCATed

4. The old menu name is not visible on windows7 with wx-master + 4k 27inch display in the settings on windows (this is with the latest night build)

wx-master fails to compile on my windows 10 or my VM windows 7.
And, I am unable to re-create the described problem with wx-3.1.1 .

Code
if exist ..\..\lib\gcc_dll\libwxregexu.a del ..\..\lib\gcc_dll\libwxregexu.a
ar rcu ..\..\lib\gcc_dll\libwxregexu.a gcc_mswudll\wxregex_regcomp.o gcc_mswudll\wxregex_regexec.o gcc_mswudll\wxregex_regerror.o gcc_mswudll\wxregex_regfree.o
ranlib ..\..\lib\gcc_dll\libwxregexu.a
mingw32-make: *** No rule to make target '../../src/zlib/adler32.c', needed by 'gcc_mswudll\wxzlib_adler32.o'.  Stop.
Title: Re: Keybinder v2 notes/problems
Post by: sodev on July 04, 2019, 07:42:39 pm
Did you forget to update the submodules or did you fetch them at all?
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on July 05, 2019, 10:18:11 pm
Did you forget to update the submodules or did you fetch them at all?

That was the problem, thanks.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on July 05, 2019, 10:21:39 pm
@ oBFusCATed

4. The old menu name is not visible on windows7 with wx-master + 4k 27inch display in the settings on windows (this is with the latest night build)

I am unable to re-create this problem with wx-master, mingw-810seh(64bit), on windows VM 7sp1 (HP laptop 17" dispaly @ res:1920x1080) .

I also cannot cause the problem on the last cbNightly ref:11712 .

Could you give me some more clues as to how to make this happen?

Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on July 14, 2019, 06:38:27 pm
3) is now fixed thank you.

For the display issue just open the settings for the keybinder. Next time I'm on windows, I'll try to remember to provide a screenshot.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on December 14, 2019, 03:11:50 pm
Another problem I've discovered is that a v2 file saved with wx28 build doesn't work on wx313 build on linux. I've tried relatively recent build. Please let me know if you need more details.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on December 17, 2019, 07:43:20 pm
Another problem I've discovered is that a v2 file saved with wx28 build doesn't work on wx313 build on linux. I've tried relatively recent build. Please let me know if you need more details.
Are there any instructions anywhere to install wx313 on linux. Mint19 only has 3.0
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on December 17, 2019, 08:13:35 pm
I build it manually and install in some home folder then I use --with-wx-config to point codeblocks' build to it.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on December 18, 2019, 09:08:49 pm
Another problem I've discovered is that a v2 file saved with wx28 build doesn't work on wx313 build on linux. I've tried relatively recent build. Please let me know if you need more details.

I cannot duplicate this error on Windows; nor on Linux Mint19 using wxWidgets 3.1.3 .

I suspect your .config/codeblocks directory already contains a [personality].cbKeybinder20.conf file.
In which case neither [personality].cbKeybinder10.ini nor ancient cbKeybinder10.ini will be scanned for key definitions.
 
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on December 19, 2019, 09:43:06 am
Yes, I'm migrating from v2 to v2, but for some reason the file generated by v2.wx28 doesn't work correctly with v2.wx31.
I've custom keybindings - ctrl-shift-f for view -> focus thread search is an example.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on December 19, 2019, 07:06:43 pm
Yes, I'm migrating from v2 to v2, but for some reason the file generated by v2.wx28 doesn't work correctly with v2.wx31.
I've custom keybindings - ctrl-shift-f for view -> focus thread search is an example.

I cannot test this since ThreadSearch will not run with head.
I get asserts when CB loads ThreadSearch.

Why would anybody be building head with wx28. I thought we were dropping wx28.

Do you mean that you are attempting to use  (copy)[profile].cbKeyBinder20.conf build by wx28 on CodeBlocks built by wx31?
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on December 19, 2019, 08:33:56 pm
I have a centos7 build which is wx28. This is my regular build I use every day. It is not the latest version, but it is pretty new.
I want to migrate to wx3.x and I'm experimenting with a centos7 build which is using wx3.1.3.
This means that I was using wx28 for some time, then I've installed the new build which is now wx3.1.3 and I've discovered this breakage.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on December 21, 2019, 10:04:17 pm
I have a centos7 build which is wx28. This is my regular build I use every day. It is not the latest version, but it is pretty new.
I want to migrate to wx3.x and I'm experimenting with a centos7 build which is using wx3.1.3.
This means that I was using wx28 for some time, then I've installed the new build which is now wx3.1.3 and I've discovered this breakage.

@oBFusCATed

I'm having trouble creating this situation. I must be mis-understanding.

Could you give me the exact steps to cause this problem, starting with:
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on December 22, 2019, 12:51:19 am
1. no idea
2. 11925 probably
3. not possible before next year :)
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on February 23, 2020, 02:08:13 pm
Today I've had the ctrl-w stop working and tried to rectify the situation, but then I've got this message "KeyBinding file corrupted. Please delete". What should I delete?

See the attached config file.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on February 25, 2020, 09:05:21 pm
Today I've had the ctrl-w stop working and tried to rectify the situation, but then I've got this message "KeyBinding file corrupted. Please delete". What should I delete?

See the attached config file.

You must be using an old version of keybinder. That event was fixed a few revision ago.
That message does not exist anymore.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on February 26, 2020, 08:24:13 pm
I don't remember, there is a chance I might have used a build from the release-20.xx branch.
Could you do some test with such a build and tell me if I've picked all required commits?
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on February 27, 2020, 05:30:06 pm
Today I've had the ctrl-w stop working and tried to rectify the situation, but then I've got this message "KeyBinding file corrupted. Please delete". What should I delete?

See the attached config file.

You must be using an old version of keybinder. That event was fixed a few revision ago.
That message does not exist anymore.

I've been able to re-create this problem. Am now working on it.
It's caused by using a <personality>.cbKeyBinder20.conf file from one build on a different build. The menu id's don't match.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on March 02, 2020, 07:51:23 pm
Today I've had the ctrl-w stop working and tried to rectify the situation, but then I've got this message "KeyBinding file corrupted. Please delete". What should I delete?

See the attached config file.

You must be using an old version of keybinder. That event was fixed a few revision ago.
That message does not exist anymore.

I've been able to re-create this problem. Am now working on it.
It's caused by using a <personality>.cbKeyBinder20.conf file from one build on a different build. The menu id's don't match.

Fixed SVN 11974
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on March 07, 2020, 08:29:32 pm
Is there any reason you're storing random numerical ids?
Isn't it possible to use the menu item label (before translation) as an identifier instead?
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on March 09, 2020, 06:09:44 pm
Is there any reason you're storing random numerical ids?
Isn't it possible to use the menu item label (before translation) as an identifier instead?

Numerical id's are used by tradition from the original KeyBinder code suggested to me in 2005. And they're also used by the code from CodeLite.

I'll look into the possiblity of using only the Menu tree paths instead.

But that, I think, will take a lot of time. Duplicate menu labels and translated menu labels will cause many problems to solve.

To use menu labels will require a rewrite.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on March 09, 2020, 11:25:32 pm
For the record, today I've upgraded to this version and I've seen zero problems. I'll wait a day or two and the last un-picked keybinder commits are going to the release branch. 8)
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on March 22, 2020, 11:38:29 am
I've lost all my shortcuts again. I'm on 11979.
See the config file attached.

Does the plugin logs when it fails to set a shortcut? I don't see any error/warning messages.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on March 23, 2020, 06:06:45 am
I've lost all my shortcuts again. I'm on 11979.
See the config file attached.

Does the plugin logs when it fails to set a shortcut? I don't see any error/warning messages.


rev 11979 is before the keybinder fixes. Update your keybinder plugin.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on March 23, 2020, 09:10:38 am
If I see correctly
Code
    * Keybinder 2.0.11 2020/03/02 fix missing/conflicting shortcuts when using older .conf on newer build
      - Check for mismatched menu id's to global accelerators id's
        Cf.,This will allow a global to override an old menu item.This happends when a new build does not match the current .conf file
        The non-matching .conf menu item has an incorrect id anyway.
      - When a .conf menu id matches a default( current structure) menu id, also make sure the menu path (parentMenu) also matches.
        It can mismatch when using a keybinder .conf configured from a previously built version of CodeBlocks on a newer build.
      - Set the global accelerators table before calling Initilaize::Update() else globals are missed on the first invocation of KeyBinder/Configure.
   
   
    git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@11974 2a5c6006-c6dd-42ca-98ab-0921f2732cef

is the last commit for the keybinder and its revision is 11974... I'm talking about commits in trunk/master.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on March 24, 2020, 08:26:36 pm
I've lost all my shortcuts again. I'm on 11979.
See the config file attached.

Does the plugin logs when it fails to set a shortcut? I don't see any error/warning messages.

Fixed At revision: 11993
KeyBinder 2.0.12 2020/03/23 Match .conf to menu structure (by menu titles) to replace old menu ids with newer.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on March 24, 2020, 09:31:16 pm
Should I pick this for 20.xx?
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on March 24, 2020, 09:54:00 pm
Should I pick this for 20.xx?

Yes, please do. It compares by menu title as you had suggested.
It can now find the new menu id when the menu structure changes.
Thus preserving user defined accelerators even when the menu structure is radically changed by a new build.

 
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on March 25, 2020, 01:37:16 am
What happens if there are duplicate menu items? How does it handle it?

I'll test it myself a day or two and then it will go to 20.xx...
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on March 25, 2020, 02:17:59 am
What happens if there are duplicate menu items? How does it handle it?

I'll test it myself a day or two and then it will go to 20.xx...

There wont be duplicates. Keybinder compares with the full menu path not just the item title.
Eg., "&Build::Run" can't match "&MyPlugin::Run" (if there was such an item title);

Thanks for testing.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on March 26, 2020, 08:44:45 pm
BTW: Is this a regression relative to 17.12. I've never been able to preserve my keybinder settings for years. If this is not a regression, I'd rather prefer not to delay the release even further...
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on March 27, 2020, 05:47:34 am
BTW: Is this a regression relative to 17.12. I've never been able to preserve my keybinder settings for years. If this is not a regression, I'd rather prefer not to delay the release even further...

Sorry, I don't know what you mean by "Is this a regression..."

But this new KeyBinder version is the first time KeyBinder has attempted to save all the users bindings between re-builds that altered the menu tree ids.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on March 27, 2020, 09:59:29 am
If the problem existed in 17.12 then not fixing it in 20.xx is not a regression. If problem wasn't there and it exists now then it is a regression. The idea of this is if the software got worse and not better.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on March 27, 2020, 06:39:05 pm
If the problem existed in 17.12 then not fixing it in 20.xx is not a regression. If problem wasn't there and it exists now then it is a regression. The idea of this is if the software got worse and not better.

In my view, the software has gotten better. It saves all the users' defined key bindings, even when CB gets re-built and/or wxWidgets changes the way it assigns menu ids.

Version 17.12 bailed out when there were more than three bindings that had no matching menu ids.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on March 27, 2020, 07:19:46 pm
I don't deny this. I don't know if it is worth it to do rebuilds.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on March 27, 2020, 07:27:26 pm
I don't deny this. I don't know if it is worth it to do rebuilds.

Since it was you that was annoyed about losing your bindings, it might suggest that others are as interested in saving them as you are.
I know I'd appreciate it, I'm tired of losing bindings everytime I have to do a major build.
But I understand that we all have limited contribution time.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on March 30, 2020, 12:50:25 am
Hm, now I've lost the keybindings for prev/next bookmark (alt-pgup/pgdown).
Any idea why this might have happened?
Currently using rev 12002. No idea how this has happened. I don't remember removing them manually. :(

Looking in the config the keys for these menu entries are empty.
Would it be possible to store only bindings different from the default? Or somehow manually set by the user?
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on April 05, 2020, 06:50:25 pm
I've lost my local bindings once more. Rev 12012 at the moment.

Would it be possible to implement storing only non-default bindings (the ones I've actually set (only 3 at the moment))?
It will make debugging this a bit easier.
When are keybindings applied? Can the plugin change bindings in the middle of the execution?
Would it be possible to print an error when reading the bindings fails?
My C::B is crashing a lot, so it might be corrupting the files, but I'm finding about this corrupting late.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on April 06, 2020, 06:44:12 pm
I think I've already found the problem. Still testing...
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on April 07, 2020, 01:42:06 am
I've lost my local bindings once more. Rev 12012 at the moment.

Would it be possible to implement storing only non-default bindings (the ones I've actually set (only 3 at the moment))?
It will make debugging this a bit easier.
When are keybindings applied? Can the plugin change bindings in the middle of the execution?
Would it be possible to print an error when reading the bindings fails?
My C::B is crashing a lot, so it might be corrupting the files, but I'm finding about this corrupting late.

Fixed Rev 12034
KeyBinder - More comparisons to sync. .conf to restructured menu tree, eg., when switching between CB builds using the same personality.

The debugger log will contain the changes or errors found by KeyBinder.

KeyBinder makes no changes during execution. Changes are made only at CB startup and from the users configuration UI.

I found a couple more bugs where KeyBinder did not convert the users key bindings when when the menu structure changed.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on April 07, 2020, 07:36:13 pm
Code
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/cbkeybinder.o: in function `cbKeyBinder::cbKeyBinder()':
/var/tmp/portage/dev-util/codeblocks-9999-r24/work/codeblocks-9999/src/plugins/contrib/keybinder/cbkeybinder.cpp:75: undefined reference to `vtable for cbKeyBinder'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/cbkeybinder.o: in function `cbKeyBinder::~cbKeyBinder()':
/var/tmp/portage/dev-util/codeblocks-9999-r24/work/codeblocks-9999/src/plugins/contrib/keybinder/cbkeybinder.cpp:87: undefined reference to `vtable for cbKeyBinder'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/cbkeybinder.o: in function `cbKeyBinder::CreateKeyBindDefaultFile(bool)':
/var/tmp/portage/dev-util/codeblocks-9999-r24/work/codeblocks-9999/src/plugins/contrib/keybinder/cbkeybinder.cpp:478: undefined reference to `cbKeyBinder::GetTempOldFmtMnuScanFilename()'

My build failed with this. Also the build on travis has failed too https://travis-ci.org/github/obfuscated/codeblocks_sf/builds/671985456
Title: Re: Keybinder v2 notes/problems
Post by: blauzahn on April 07, 2020, 09:35:19 pm
oBFusCATed wrote:
Quote
My build failed with this.

Mine failed too with the same error messages.

wxwidgets trunk, Linux x86_64, tried on arch as well as on ubuntu. Same result.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on April 07, 2020, 11:57:51 pm
Code
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/cbkeybinder.o: in function `cbKeyBinder::cbKeyBinder()':
/var/tmp/portage/dev-util/codeblocks-9999-r24/work/codeblocks-9999/src/plugins/contrib/keybinder/cbkeybinder.cpp:75: undefined reference to `vtable for cbKeyBinder'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/cbkeybinder.o: in function `cbKeyBinder::~cbKeyBinder()':
/var/tmp/portage/dev-util/codeblocks-9999-r24/work/codeblocks-9999/src/plugins/contrib/keybinder/cbkeybinder.cpp:87: undefined reference to `vtable for cbKeyBinder'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/cbkeybinder.o: in function `cbKeyBinder::CreateKeyBindDefaultFile(bool)':
/var/tmp/portage/dev-util/codeblocks-9999-r24/work/codeblocks-9999/src/plugins/contrib/keybinder/cbkeybinder.cpp:478: undefined reference to `cbKeyBinder::GetTempOldFmtMnuScanFilename()'

My build failed with this. Also the build on travis has failed too https://travis-ci.org/github/obfuscated/codeblocks_sf/builds/671985456

I'm working on it.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on April 08, 2020, 01:32:17 am
I don't know what you've done, but the last commit broke the eol characters in git. They are now the windows style on linux. This is something which must not happen. Can you try to fix it? I suppose the same problem is happening with svn.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on April 08, 2020, 08:34:42 am
I don't know what you've done, but the last commit broke the eol characters in git. They are now the windows style on linux. This is something which must not happen. Can you try to fix it? I suppose the same problem is happening with svn.

How do I fix it? I commit from windows. Is windows suppose to have only a linefeed?
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on April 08, 2020, 09:13:38 am
I don't know what you've done, but the last commit broke the eol characters in git. They are now the windows style on linux. This is something which must not happen. Can you try to fix it? I suppose the same problem is happening with svn.

How do I fix it? I commit from windows. Is windows suppose to have only a linefeed?

On linux, I've run all .h and .cpp thru Dos2Unix.
Should I now just commit those changes from linux?
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on April 08, 2020, 10:16:03 am
Not sure. There is property for eol in svn. Probably you should set it first. Read svn docs.
Title: Re: Keybinder v2 notes/problems
Post by: blauzahn on April 08, 2020, 11:00:09 am
Having accidentially changed eol happened to us as well. This was in our project with mercurial which is not to blame.

Rather it was my fault. Running Linux, I mounted the Windows partition and committed the changes in the tree lying on the Windows partition I had made before when running Windows. Having experienced that, we avoid now committing when running Linux a source tree which is on an NTFS partition or mounted via Samba.

Now, we have set the appropriate property in the mercurial repo. Maybe, this is enough. Nevertheless, we now always commit on Windows when we have made changes on Windows and on Linux when we have made changes on Linux. Merging back and forth is fine then. This workflow is definitely not elegant but is KISS and works quite reliably.

Dos2Unix does work if the files are on some Linux partition. Of course, you can change files on a windows partition as well with it. But then the OS might interfere when committing and it is probably more error prone, especially if done manually.

Title: Re: Keybinder v2 notes/problems
Post by: sodev on April 08, 2020, 05:49:04 pm
Not sure if i understand your workflow correct, but you checkout a working copy on windows with windows tools, mount that on linux and modify that with linux tools? Now if thats not asking for trouble :o

Anyway, to prevent such eol issues with svn, either make sure you configured the autoprops in your svn client properly or use that server side autoprops feature of newer svn versions (this is specifying autoprops properties in the repository itself). Both will only work with new files beeing added though, for already present files you have to check if for them the eol-style is properly set. If not, adding that property should fix your eol next time you update and will prevent a commit if the files contain mixed eol already.
Title: Re: Keybinder v2 notes/problems
Post by: blauzahn on April 08, 2020, 06:44:38 pm
sodev wrote:
Quote
Now if thats not asking for trouble

Yes, and that is how we learned not to do it anymore :)
We use Windows tools on Windows and LInux tools on Linux. Period.

The cross-border commit looked tempting at the beginning. When I had forgotten to commit a change on Windows I wondered whether I can avoid to reboot into Windows and reboot back to Linux when working without network on a single machine. The only tool used cross-border was the vcs (tortoisehg/mercurial on both sides) for the commit.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on April 08, 2020, 10:18:30 pm
Linux will not let me commit.
I modified the offending files on windows and verified they were not mixed eol.
I committed them, but then updating them on linux still shows windows eols.

Code
pecan@LinuxMint19:~/proj/cbBeta30/trunk/src/plugins/contrib/keybinder$ svn commit -m "- Keybinder - Convert windows CRLF to Linux LF"
svn: E170001: Commit failed (details follow):
svn: E170001: Authorization failed

Would someone who can commit from linux please do the following:

Code
svn update
cd [to the keybinder plugin dir]
dos2unix *.h
dos2unix *.cpp
svn status -u #Just to see the changed filenames
svn commit -m "- KeyBinder - Convert CRLF to LF"

Thanks

dos2unix works well. I installed it with:
sudo apt install dos2unix
It will show what it will do without modifying the files with the command "dos2unix -ih *.h" etc.
To modify the eols leave out the "-ih"

Title: Re: Keybinder v2 notes/problems
Post by: sodev on April 08, 2020, 10:28:50 pm
It says Authorization failed, if you didn't enter any credentials delete your stored authentication data (somewhere in .svn in your home directory, don't know exact location).

But you don't have to run these linux tools, simply set the svn:eol-style property to native on all source files and you get the conversion for free. Unless you have already mixed eol, that you can fix with e.g. Notepad++ easily on the windows side.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on April 08, 2020, 11:10:46 pm
It says Authorization failed, if you didn't enter any credentials delete your stored authentication data (somewhere in .svn in your home directory, don't know exact location).

But you don't have to run these linux tools, simply set the svn:eol-style property to native on all source files and you get the conversion for free. Unless you have already mixed eol, that you can fix with e.g. Notepad++ easily on the windows side.

On Linux Mint19, there's a .subversion/auth/ folder. I deleted it, but commit still failed with "Authorization failed".
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on April 09, 2020, 12:05:06 am
You most probably have to change the eol property. I'll do it for you in a minute.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on April 09, 2020, 12:13:32 am
Code
         {
+            // FIXME (ph#):This call crashes KeyBinder, I'll fix soon.
+            if (lb->GetPageText(selection) == wxT("Keyboard shortcuts")) break;

What is this? If you don't have this method implemented it should not crash! But you have to rebuild properly!!!
This doesn't probably work on translated C::Bs...
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on April 09, 2020, 12:52:36 am
Code
         {
+            // FIXME (ph#):This call crashes KeyBinder, I'll fix soon.
+            if (lb->GetPageText(selection) == wxT("Keyboard shortcuts")) break;

What is this? If you don't have this method implemented it should not crash! But you have to rebuild properly!!!
This doesn't probably work on translated C::Bs...

What's a translated C::B ?
KeyBinder does not implement the call.

Are you actually able to configure your keys with KeyBinder after the addition of the OnPageChanging() call?

For me, Setting/Editor/KeyboardShortcuts crashes consistenly .
Even after a full rebuild of CB and it's plugins (on windows).

I've spent approximately 12 hours trying to find its' cause.
GDB only shows one frame with no meaningful information.

I'll eventually find the problem, but for now this is a temporary fix to allow users to set their key bindings.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on April 09, 2020, 10:20:52 am
This happens because you have a duplicate configurationpanel.h file which doesn't have this method. I don't know why you do this but I doubt it is a good idea.
Next time when you have a problem with a change I've made, you can tell me. :)
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on April 09, 2020, 06:29:51 pm
This happens because you have a duplicate configurationpanel.h file which doesn't have this method. I don't know why you do this but I doubt it is a good idea.
Next time when you have a problem with a change I've made, you can tell me. :)

I had no problem with your change. In fact I like it.
I only made that temporary fix to give me time to find the source of the crash. And I had all intentions of removing it.
Please don't feel offended.

Thanks for your work.
Title: Re: Keybinder v2 notes/problems
Post by: oBFusCATed on April 09, 2020, 07:16:26 pm
I don't like it because there is not need to put workarounds in the code. It is fine if trunk/master is broken for some time. If someone is affected he/she can revert the commit that is causing the problem.

BTW: Connecting events to the parent is not a good idea in my opinion. It is too fragile if someday we decide to change the UI of the config dialogs.
I'm talking about the page-changed and destroyed events. For the latter - why do you needed? Can't you use the cancel/apply methods implementations?

If there is something missing from the API it is better to add it. Applying workarounds leads to more work in the future.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on April 09, 2020, 07:55:21 pm
I don't like it because there is not need to put workarounds in the code. It is fine if trunk/master is broken for some time. If someone is affected he/she can revert the commit that is causing the problem.

BTW: Connecting events to the parent is not a good idea in my opinion. It is too fragile if someday we decide to change the UI of the config dialogs.
I'm talking about the page-changed and destroyed events. For the latter - why do you needed? Can't you use the cancel/apply methods implementations?

If there is something missing from the API it is better to add it. Applying workarounds leads to more work in the future.

I will no longer need the events now that OnPageChanging() is provided.

I used the events to avoid the large overhead caused by scanning the menu structure and building the voluminously stacked arrays used by the original keybinder code from 2005.

The overhead occurred when the user chose Settinging/Editor. There was no need for that overhead until the user actually chose "Keyboard shortcuts."  Using the events cut that overhead in half.

The event method served the same purpose that is now provided by OnPageChanging(). I had already planned to remove the events and use that UI instead.

The duplicate configurationpanel.h was a fix for disappearing wxMessageBoxes on linux from years and years ago. It also will be removed as it's no longer needed.
 
Title: Re: Keybinder v2 notes/problems
Post by: gd_on on April 21, 2020, 10:58:40 am
A new problem, mix of languages :
Usually, I use a translated version of C::B, in french. Sometimes, I need to switch the interface to English, at least to verify the exact word used in the original interface.
After my last switch, I have seen this dialog (see attachment). The sentence, describing the conflict in English and french are the same, as if there where a mix of languages.
(svn 12069, but may be appeared before).
And in Settings/Environmement/Keyboard Shortcuts Ctrl-W and Ctrl-Shift-W appears twice.
I tried to delete one of them in the right part, but it's not sufficient. I have to delete All to avoid this warning.
gd_on

Title: Re: Keybinder v2 notes/problems
Post by: Pecan on April 22, 2020, 11:35:01 pm
A new problem, mix of languages :
Usually, I use a translated version of C::B, in french. Sometimes, I need to switch the interface to English, at least to verify the exact word used in the original interface.
After my last switch, I have seen this dialog (see attachment). The sentence, describing the conflict in English and french are the same, as if there where a mix of languages.
(svn 12069, but may be appeared before).
And in Settings/Environmement/Keyboard Shortcuts Ctrl-W and Ctrl-Shift-W appears twice.
I tried to delete one of them in the right part, but it's not sufficient. I have to delete All to avoid this warning.
gd_on

Until I can re-create and find a fix for this, using separate personalities for differenct languages will solve the problem.

See the CB /p parameter.
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on June 08, 2020, 08:24:45 pm
A new problem, mix of languages :
Usually, I use a translated version of C::B, in french. Sometimes, I need to switch the interface to English, at least to verify the exact word used in the original interface.
After my last switch, I have seen this dialog (see attachment). The sentence, describing the conflict in English and french are the same, as if there where a mix of languages.
(svn 12069, but may be appeared before).
And in Settings/Environmement/Keyboard Shortcuts Ctrl-W and Ctrl-Shift-W appears twice.
I tried to delete one of them in the right part, but it's not sufficient. I have to delete All to avoid this warning.
gd_on

I am unable to find a translation to download and test with.
Launchpad gives me an "Invalid OpenID transaction" error and https://translations.launchpad.net/codeblocks-gd wants a UbuntuOne login.

Does anyone have a translation I can download.
Also, I once found instruction for using translations but now can't find it. Does anyone know where there are instructions for using translations.

TIA
Title: Re: Keybinder v2 notes/problems
Post by: Pecan on July 15, 2020, 09:28:12 pm
A new problem, mix of languages :
Usually, I use a translated version of C::B, in french. Sometimes, I need to switch the interface to English, at least to verify the exact word used in the original interface.
After my last switch, I have seen this dialog (see attachment). The sentence, describing the conflict in English and french are the same, as if there where a mix of languages.
(svn 12069, but may be appeared before).
And in Settings/Environmement/Keyboard Shortcuts Ctrl-W and Ctrl-Shift-W appears twice.
I tried to delete one of them in the right part, but it's not sufficient. I have to delete All to avoid this warning.
gd_on

Fixed: rev 12189
Title: Re: Keybinder v2 notes/problems
Post by: gd_on on July 16, 2020, 10:15:14 am
Thanks for the fix.
I'll try this as soon as possible.

gd_on