cmake-gui: Add search functions to the context menu of the Output widget
Signed-off-by: Alex Neundorf <neundorf@kde.org>
This commit is contained in:
parent
df3663bfab
commit
4ce65e82f5
|
@ -183,6 +183,10 @@ CMakeSetupDialog::CMakeSetupDialog()
|
||||||
this->Output->setFont(outputFont);
|
this->Output->setFont(outputFont);
|
||||||
this->ErrorFormat.setForeground(QBrush(Qt::red));
|
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
|
// start the cmake worker thread
|
||||||
this->CMakeThread = new QCMakeThread(this);
|
this->CMakeThread = new QCMakeThread(this);
|
||||||
QObject::connect(this->CMakeThread, SIGNAL(cmakeInitialized()),
|
QObject::connect(this->CMakeThread, SIGNAL(cmakeInitialized()),
|
||||||
|
@ -1160,6 +1164,22 @@ void CMakeSetupDialog::setSearchFilter(const QString& str)
|
||||||
this->CacheValues->setSearchFilter(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()
|
void CMakeSetupDialog::doOutputFindDialog()
|
||||||
{
|
{
|
||||||
QStringList strings(this->FindHistory);
|
QStringList strings(this->FindHistory);
|
||||||
|
|
|
@ -77,6 +77,7 @@ protected slots:
|
||||||
bool doConfigureInternal();
|
bool doConfigureInternal();
|
||||||
bool doGenerateInternal();
|
bool doGenerateInternal();
|
||||||
void exitLoop(int);
|
void exitLoop(int);
|
||||||
|
void doOutputContextMenu(const QPoint &);
|
||||||
void doOutputFindDialog();
|
void doOutputFindDialog();
|
||||||
void doOutputFindNext(bool directionForward = true);
|
void doOutputFindNext(bool directionForward = true);
|
||||||
void doOutputFindPrev();
|
void doOutputFindPrev();
|
||||||
|
|
Loading…
Reference in New Issue