From dcdb645c107faa0296e26e21a0b3a57f6967b0c7 Mon Sep 17 00:00:00 2001 From: ars_goldendict Date: Tue, 5 May 2009 20:12:20 +0000 Subject: [PATCH] added Ctrl-Enter hotkey which opens current translation in a new tab --- src/groups_widgets.cc | 2 -- src/mainwindow.cc | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/groups_widgets.cc b/src/groups_widgets.cc index 482f2689..eca0bacd 100644 --- a/src/groups_widgets.cc +++ b/src/groups_widgets.cc @@ -137,8 +137,6 @@ QVariant DictListModel::data( QModelIndex const & index, int role ) const case Qt::DisplayRole : return QString::fromUtf8( item->getName().c_str() ); -// + QString(" lang: %1 %2").arg( langCoder.decode(item->getLangFrom()), -// langCoder.decode(item->getLangTo()) ); case Qt::EditRole : return QString::fromUtf8( item->getId().c_str() ); diff --git a/src/mainwindow.cc b/src/mainwindow.cc index 3185ef3c..ec5a91ce 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -684,7 +684,13 @@ void MainWindow::translateInputFinished() QString word = ui.translateLine->text(); if ( word.size() ) + { + Qt::KeyboardModifiers mods = QApplication::keyboardModifiers(); + if ( mods & Qt::ControlModifier ) + addNewTab(); + showTranslationFor( word ); + } } void MainWindow::focusTranslateLine()