Commit 62d7d384 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: better hotkeys change management.

Close #2245
parent 9c95e933
...@@ -1326,6 +1326,10 @@ KeyInputDialog::KeyInputDialog( QTreeWidget *_table, ...@@ -1326,6 +1326,10 @@ KeyInputDialog::KeyInputDialog( QTreeWidget *_table,
selected = new QLabel( qtr( "Press the new keys for " ) + keyToChange ); selected = new QLabel( qtr( "Press the new keys for " ) + keyToChange );
vLayout->addWidget( selected , Qt::AlignCenter ); vLayout->addWidget( selected , Qt::AlignCenter );
warning = new QLabel;
warning->hide();
vLayout->insertWidget( 1, warning );
buttonBox = new QDialogButtonBox; buttonBox = new QDialogButtonBox;
QPushButton *ok = new QPushButton( qtr("OK") ); QPushButton *ok = new QPushButton( qtr("OK") );
QPushButton *cancel = new QPushButton( qtr("Cancel") ); QPushButton *cancel = new QPushButton( qtr("Cancel") );
...@@ -1347,12 +1351,11 @@ void KeyInputDialog::checkForConflicts( int i_vlckey ) ...@@ -1347,12 +1351,11 @@ void KeyInputDialog::checkForConflicts( int i_vlckey )
if( conflictList.size() && if( conflictList.size() &&
conflictList[0]->data( 1, Qt::UserRole ).toInt() > 1 ) conflictList[0]->data( 1, Qt::UserRole ).toInt() > 1 )
/* Avoid 0 or -1 that are the "Unset" states*/ /* Avoid 0 or -1 that are the "Unset" states */
{ {
QLabel *warning = new QLabel( warning->setText( qtr("Warning: the key is already assigned to \"") +
qtr("Warning: the key is already assigned to \"") +
conflictList[0]->text( 0 ) + "\"" ); conflictList[0]->text( 0 ) + "\"" );
vLayout->insertWidget( 1, warning ); warning->show();
buttonBox->show(); buttonBox->show();
conflicts = true; conflicts = true;
......
...@@ -468,7 +468,7 @@ private: ...@@ -468,7 +468,7 @@ private:
void checkForConflicts( int i_vlckey ); void checkForConflicts( int i_vlckey );
void keyPressEvent( QKeyEvent *); void keyPressEvent( QKeyEvent *);
void wheelEvent( QWheelEvent *); void wheelEvent( QWheelEvent *);
QLabel *selected; QLabel *selected, *warning;
QVBoxLayout *vLayout; QVBoxLayout *vLayout;
QDialogButtonBox *buttonBox; QDialogButtonBox *buttonBox;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment