Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nedit-import: Convert shortcuts to valid QT equivalents #339

Open
GrAndAG opened this issue Feb 14, 2023 · 2 comments
Open

nedit-import: Convert shortcuts to valid QT equivalents #339

GrAndAG opened this issue Feb 14, 2023 · 2 comments

Comments

@GrAndAG
Copy link

GrAndAG commented Feb 14, 2023

Original nedit shortcuts can contain names of keys (such as Period, Comma, Prior, Slash, etc.) which are not supported by nedit-ng.
I had to add several replace() calls into import.cpp to handle some cases that I found in my macros. Like this:

accStr.replace(QLatin1String("Period"), QLatin1String("."), Qt::CaseInsensitive);
accStr.replace(QLatin1String("Comma"), QLatin1String(","), Qt::CaseInsensitive);
accStr.replace(QLatin1String("Bracketright"), QLatin1String("]"), Qt::CaseInsensitive);
accStr.replace(QLatin1String("Bracketleft"), QLatin1String("["), Qt::CaseInsensitive);
accStr.replace(QLatin1String("Backslash"), QLatin1String("\\"), Qt::CaseInsensitive);
accStr.replace(QLatin1String("Slash"), QLatin1String("/"), Qt::CaseInsensitive);
accStr.replace(QLatin1String("Apostrophe"), QLatin1String("'"), Qt::CaseInsensitive);
accStr.replace(QLatin1String("Grave"), QLatin1String("`"), Qt::CaseInsensitive);
accStr.replace(QLatin1String("Prior"), QLatin1String("PgUp"), Qt::CaseInsensitive);
accStr.replace(QLatin1String("Next"), QLatin1String("PgDown"), Qt::CaseInsensitive);

I'm pretty sure that it does not cover all cases.

@eteran
Copy link
Owner

eteran commented Feb 15, 2023

Oh, interesting, I'll have to take a look at this. Thanks!

I've also been planning to revamp how the shortcuts are handled in NG so they are more configurable too.

@eteran
Copy link
Owner

eteran commented Mar 13, 2023

So I can definitely do this sort of fixup... but I'd love to find a place which lists the translations so I can just get them all correct once. Looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants