News:

--

Main Menu

Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]

Started by Jan Gruuthuse, July 23, 2016, 06:19:48 AM

Previous topic - Next topic

eumagga0x2a

#15
Quote from: mean on July 26, 2016, 07:48:17 PM
The [] are a pain depending on the keyboard

Oh, I see. Usually pressing a modifier key switches the layout temporarily back to English(?), so usual keybindings work regardless of the currect keyboard layout, but AltGr seems to be ignored by Qt, isn't it? Anyway, I should have tested with a non-latin layout...

So,

diff --git a/avidemux/common/ADM_commonUI/myOwnMenu.h b/avidemux/common/ADM_commonUI/myOwnMenu.h
index d8e68ce..5f2b4ba 100644
--- a/avidemux/common/ADM_commonUI/myOwnMenu.h
+++ b/avidemux/common/ADM_commonUI/myOwnMenu.h
@@ -58,8 +58,8 @@ static const MenuEntry _myMenuEdit[] = {
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Paste"),       NULL,ACT_Paste      ,NULL,"Ctrl+V"},
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Delete"),      NULL,ACT_Delete     ,NULL,"Delete"},
             {MENU_SEPARATOR,"-",NULL,ACT_DUMMY             ,NULL,NULL},
-            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker A"),NULL,ACT_MarkA      ,NULL,"["},
-            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker B"),NULL,ACT_MarkB      ,NULL,"]"},
+            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker A"),NULL,ACT_MarkA      ,NULL,"Ctrl+PgUp"},
+            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker B"),NULL,ACT_MarkB      ,NULL,"Ctrl+PgDown"},
             {MENU_SEPARATOR,"-",NULL,ACT_DUMMY             ,NULL,NULL},
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Preferences"), NULL,ACT_PREFERENCES,NULL,NULL},
             {MENU_SEPARATOR,"-",NULL,ACT_DUMMY             ,NULL,NULL},
diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp
index 4780b20..f3d3ac0 100644
--- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp
+++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp
@@ -688,14 +688,14 @@ bool MainWindow::eventFilter(QObject* watched, QEvent* event)
shiftKeyHeld = 1;
break;

- case Qt::Key_BracketLeft:
+ case Qt::Key_PageUp:
                                                 if (keyEvent->modifiers() == Qt::ControlModifier)
-                                                        sendAction(ACT_GotoMarkA);
+                                                        sendAction(ACT_MarkA);
                                                 return true;

- case Qt::Key_BracketRight:
+ case Qt::Key_PageDown:
if (keyEvent->modifiers() == Qt::ControlModifier)
- sendAction(ACT_GotoMarkB);
+ sendAction(ACT_MarkB);
return true;
}
}


would have done it <-- Sorry, I've missed that labels stem from avidemux/common/ADM_commonUI/myOwnMenu.h:61 Then probably all translations have to be modified ("PgUp" and "PgDown" are displayed not localized in German).

Thanks!

eumagga0x2a

#16
Fixed by https://github.com/mean00/avidemux2/commit/98cdf41601c26cbae1b932106acd73f3b57a9c73, thanks! Just a minor leftover:

grep -nRI "Set Marker A" . | grep -v i18n
./avidemux/common/ADM_commonUI/myOwnMenu.h:61:            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker A"),NULL,ACT_MarkA      ,NULL,"["},
./avidemux/qt4/common/ADM_commonUI/myOwnMenu.h:61:            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker A"),NULL,ACT_MarkA      ,NULL,"["},


(the "Edit" menu still shows "[" and "]" as shortcuts).

eumagga0x2a

I'm sorry, but I need

diff --git a/avidemux/common/ADM_commonUI/myOwnMenu.h b/avidemux/common/ADM_commonUI/myOwnMenu.h
index 4a49ae8..5f2b4ba 100644
--- a/avidemux/common/ADM_commonUI/myOwnMenu.h
+++ b/avidemux/common/ADM_commonUI/myOwnMenu.h
@@ -59,7 +59,7 @@ static const MenuEntry _myMenuEdit[] = {
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Delete"),      NULL,ACT_Delete     ,NULL,"Delete"},
             {MENU_SEPARATOR,"-",NULL,ACT_DUMMY             ,NULL,NULL},
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker A"),NULL,ACT_MarkA      ,NULL,"Ctrl+PgUp"},
-            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker B"),NULL,ACT_MarkB      ,NULL,"Ctrl+PgDw"},
+            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker B"),NULL,ACT_MarkB      ,NULL,"Ctrl+PgDown"},
             {MENU_SEPARATOR,"-",NULL,ACT_DUMMY             ,NULL,NULL},
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Preferences"), NULL,ACT_PREFERENCES,NULL,NULL},
             {MENU_SEPARATOR,"-",NULL,ACT_DUMMY             ,NULL,NULL},


to make the keyboard shortcut for "Set Marker B" show in the "Edit" menu in the German locale (the shortcut worked anyway). It may be related to avidemux/qt4/i18n/qt_de.ts:3272 (other qt_*.ts files reference "PgDown" too), but I really don't know.