diff options
author | Marc Bartholomaeus <marc.bartholomaeus@carmeq.com> | 2013-04-17 22:53:12 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2013-04-24 19:32:42 (GMT) |
commit | 4ce65e82f5865469f392b0d021da588366bc14c3 (patch) | |
tree | b6501faa85d75ffd045943e983b36b6bc7d69aeb /Source/QtDialog | |
parent | df3663bfabc9de99a7338ea0a19a1101a8dbc703 (diff) | |
download | CMake-4ce65e82f5865469f392b0d021da588366bc14c3.zip CMake-4ce65e82f5865469f392b0d021da588366bc14c3.tar.gz CMake-4ce65e82f5865469f392b0d021da588366bc14c3.tar.bz2 |
cmake-gui: Add search functions to the context menu of the Output widget
Signed-off-by: Alex Neundorf <neundorf@kde.org>
Diffstat (limited to 'Source/QtDialog')
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.cxx | 20 | ||||
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 3cf799f..0be45c6 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -183,6 +183,10 @@ CMakeSetupDialog::CMakeSetupDialog() this->Output->setFont(outputFont); this->ErrorFormat.setForeground(QBrush(Qt::red)); + this->Output->setContextMenuPolicy(Qt::CustomContextMenu); + connect(this->Output, SIGNAL(customContextMenuRequested(const QPoint&)), + this, SLOT(doOutputContextMenu(const QPoint &))); + // start the cmake worker thread this->CMakeThread = new QCMakeThread(this); QObject::connect(this->CMakeThread, SIGNAL(cmakeInitialized()), @@ -1160,6 +1164,22 @@ void CMakeSetupDialog::setSearchFilter(const QString& str) this->CacheValues->setSearchFilter(str); } +void CMakeSetupDialog::doOutputContextMenu(const QPoint &pt) +{ + QMenu *menu = this->Output->createStandardContextMenu(); + + menu->addSeparator(); + menu->addAction(tr("Find..."), + this, SLOT(doOutputFindDialog())); + menu->addAction(tr("Find Next"), + this, SLOT(doOutputFindNext()), QKeySequence::FindNext); + menu->addAction(tr("Find Previous"), + this, SLOT(doOutputFindPrev()), QKeySequence::FindPrevious); + + menu->exec(this->Output->mapToGlobal(pt)); + delete menu; +} + void CMakeSetupDialog::doOutputFindDialog() { QStringList strings(this->FindHistory); diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h index 88fefcc..100834d 100644 --- a/Source/QtDialog/CMakeSetupDialog.h +++ b/Source/QtDialog/CMakeSetupDialog.h @@ -77,6 +77,7 @@ protected slots: bool doConfigureInternal(); bool doGenerateInternal(); void exitLoop(int); + void doOutputContextMenu(const QPoint &); void doOutputFindDialog(); void doOutputFindNext(bool directionForward = true); void doOutputFindPrev(); |