diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp index 1bf57c25ff5d79f65a334b344233e709778fe33a..8af40afab65cda6d5a66c0e03c4adfc286b855c6 100644 --- a/modules/gui/qt4/components/preferences_widgets.cpp +++ b/modules/gui/qt4/components/preferences_widgets.cpp @@ -1228,11 +1228,11 @@ void KeySelectorControl::finish() treeItem->setData( ACTION_COL, Qt::UserRole, QVariant( qfu( p_config_item->psz_name ) ) ); - QString keys = qfu( p_config_item->value.psz ); + QString keys = qfu(p_config_item->value.psz ? _(p_config_item->value.psz) : ""); treeItem->setText( HOTKEY_COL, keys ); treeItem->setToolTip( HOTKEY_COL, qtr("Double click to change.\nDelete key to remove.") ); treeItem->setToolTip( GLOBAL_HOTKEY_COL, qtr("Double click to change.\nDelete key to remove.") ); - treeItem->setData( HOTKEY_COL, Qt::UserRole, QVariant( keys ) ); + treeItem->setData( HOTKEY_COL, Qt::UserRole, QVariant( p_config_item->value.psz ) ); table->addTopLevelItem( treeItem ); continue; } @@ -1313,7 +1313,7 @@ void KeySelectorControl::selectKey( QTreeWidgetItem *keyItem, int column ) if( d->result() == QDialog::Accepted ) { - QString newKey = VLCKeyToString( d->keyValue ); + QString newKey = VLCKeyToString( d->keyValue, false ); /* In case of conflict, reset other keys*/ if( d->conflicts ) @@ -1331,7 +1331,7 @@ void KeySelectorControl::selectKey( QTreeWidgetItem *keyItem, int column ) } } - keyItem->setText( column, newKey ); + keyItem->setText( column, VLCKeyToString( d->keyValue, true ) ); keyItem->setData( column, Qt::UserRole, newKey ); } else if( d->result() == 2 ) @@ -1448,7 +1448,7 @@ void KeyInputDialog::setExistingkeysSet( const QSet<QString> *keyset ) void KeyInputDialog::checkForConflicts( int i_vlckey, const QString &sequence ) { QList<QTreeWidgetItem *> conflictList = - table->findItems( VLCKeyToString( i_vlckey ), Qt::MatchExactly, + table->findItems( VLCKeyToString( i_vlckey, true ), Qt::MatchExactly, b_global ? 2 : 1 ); if( conflictList.count() && @@ -1491,7 +1491,7 @@ void KeyInputDialog::keyPressEvent( QKeyEvent *e ) int i_vlck = qtEventToVLCKey( e ); QKeySequence sequence( e->key() | e->modifiers() ); selected->setText( qtr( "Key or combination: " ) - + QString("<b>%1</b>").arg( VLCKeyToString( i_vlck ) ) ); + + QString("<b>%1</b>").arg( VLCKeyToString( i_vlck, true ) ) ); checkForConflicts( i_vlck, sequence.toString() ); keyValue = i_vlck; } @@ -1499,7 +1499,7 @@ void KeyInputDialog::keyPressEvent( QKeyEvent *e ) void KeyInputDialog::wheelEvent( QWheelEvent *e ) { int i_vlck = qtWheelEventToVLCKey( e ); - selected->setText( qtr( "Key: " ) + VLCKeyToString( i_vlck ) ); + selected->setText( qtr( "Key: " ) + VLCKeyToString( i_vlck, true ) ); checkForConflicts( i_vlck, QString() ); keyValue = i_vlck; } diff --git a/modules/gui/qt4/util/customwidgets.cpp b/modules/gui/qt4/util/customwidgets.cpp index 23a6150cb2c0b547de593a60cf25280bdf59166c..b9d5bfb261be106a1727a77405e32d58db7b9508 100644 --- a/modules/gui/qt4/util/customwidgets.cpp +++ b/modules/gui/qt4/util/customwidgets.cpp @@ -306,9 +306,9 @@ int qtWheelEventToVLCKey( QWheelEvent *e ) return i_vlck; } -QString VLCKeyToString( unsigned val ) +QString VLCKeyToString( unsigned val, bool locale ) { - char *base = vlc_keycode2str (val, true); + char *base = vlc_keycode2str (val, locale); if (base == NULL) return qtr( "Unset" ); diff --git a/modules/gui/qt4/util/customwidgets.hpp b/modules/gui/qt4/util/customwidgets.hpp index 9a15553e89417729109614e40803b56f2ea452ad..fd2cd937f8e18132b77fef19a5eb9779747571b2 100644 --- a/modules/gui/qt4/util/customwidgets.hpp +++ b/modules/gui/qt4/util/customwidgets.hpp @@ -177,6 +177,6 @@ class QInputEvent; int qtKeyModifiersToVLC( QInputEvent* e ); int qtEventToVLCKey( QKeyEvent *e ); int qtWheelEventToVLCKey( QWheelEvent *e ); -QString VLCKeyToString( unsigned val ); +QString VLCKeyToString( unsigned val, bool ); #endif