mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
added Ctrl-Enter hotkey which opens current translation in a new tab
This commit is contained in:
parent
35ee5f6ab5
commit
dcdb645c10
|
@ -137,8 +137,6 @@ QVariant DictListModel::data( QModelIndex const & index, int role ) const
|
||||||
|
|
||||||
case Qt::DisplayRole :
|
case Qt::DisplayRole :
|
||||||
return QString::fromUtf8( item->getName().c_str() );
|
return QString::fromUtf8( item->getName().c_str() );
|
||||||
// + QString(" lang: %1 %2").arg( langCoder.decode(item->getLangFrom()),
|
|
||||||
// langCoder.decode(item->getLangTo()) );
|
|
||||||
|
|
||||||
case Qt::EditRole :
|
case Qt::EditRole :
|
||||||
return QString::fromUtf8( item->getId().c_str() );
|
return QString::fromUtf8( item->getId().c_str() );
|
||||||
|
|
|
@ -684,7 +684,13 @@ void MainWindow::translateInputFinished()
|
||||||
QString word = ui.translateLine->text();
|
QString word = ui.translateLine->text();
|
||||||
|
|
||||||
if ( word.size() )
|
if ( word.size() )
|
||||||
|
{
|
||||||
|
Qt::KeyboardModifiers mods = QApplication::keyboardModifiers();
|
||||||
|
if ( mods & Qt::ControlModifier )
|
||||||
|
addNewTab();
|
||||||
|
|
||||||
showTranslationFor( word );
|
showTranslationFor( word );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::focusTranslateLine()
|
void MainWindow::focusTranslateLine()
|
||||||
|
|
Loading…
Reference in a new issue