[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2819-g4cf05ba
Brad King
brad.king at kitware.com
Wed Apr 24 15:33:53 EDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 4cf05ba7c48f69beff60ee682d0cd52008e65e32 (commit)
via f92d7e7f9541f74357d55ccc6781a8fe6c3bb8e9 (commit)
via 6e57724fc3f95f954666fbe9c33ea14e22c858a3 (commit)
via 7be2d8acc64e371748b8758f16b7aa6bdaf3fd0f (commit)
via 4ce65e82f5865469f392b0d021da588366bc14c3 (commit)
via df3663bfabc9de99a7338ea0a19a1101a8dbc703 (commit)
from 8ca149896566119be4d324fd56cbe66d755b8d9e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4cf05ba7c48f69beff60ee682d0cd52008e65e32
commit 4cf05ba7c48f69beff60ee682d0cd52008e65e32
Merge: 8ca1498 f92d7e7
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Apr 24 15:33:49 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Apr 24 15:33:49 2013 -0400
Merge topic 'QtDialogSearchText2' into next
f92d7e7 cmake-gui: use shortcut F only for "Find in Output"
6e57724 cmake-gui: Add function for going to next error message in Output window
7be2d8a cmake-gui: Change shortcut of the search field from Ctrl-F to Alt-E
4ce65e8 cmake-gui: Add search functions to the context menu of the Output widget
df3663b cmake-gui: Add search functions for Output window (#9733)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f92d7e7f9541f74357d55ccc6781a8fe6c3bb8e9
commit f92d7e7f9541f74357d55ccc6781a8fe6c3bb8e9
Author: Alex Neundorf <neundorf at kde.org>
AuthorDate: Thu Apr 18 19:59:11 2013 +0200
Commit: Alex Neundorf <neundorf at kde.org>
CommitDate: Wed Apr 24 15:32:43 2013 -0400
cmake-gui: use shortcut F only for "Find in Output"
Before it was used also for "Find Next" and "Find Previous"
Alex
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 91279fd..4d62f72 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -127,10 +127,10 @@ CMakeSetupDialog::CMakeSetupDialog()
ToolsMenu->addAction(tr("&Find in Output..."),
this, SLOT(doOutputFindDialog()),
QKeySequence::Find);
- ToolsMenu->addAction(tr("&Find Next"),
+ ToolsMenu->addAction(tr("Find Next"),
this, SLOT(doOutputFindNext()),
QKeySequence::FindNext);
- ToolsMenu->addAction(tr("&Find Previous"),
+ ToolsMenu->addAction(tr("Find Previous"),
this, SLOT(doOutputFindPrev()),
QKeySequence::FindPrevious);
ToolsMenu->addAction(tr("Goto Next Error"),
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e57724fc3f95f954666fbe9c33ea14e22c858a3
commit 6e57724fc3f95f954666fbe9c33ea14e22c858a3
Author: Marc Bartholomaeus <marc.bartholomaeus at carmeq.com>
AuthorDate: Thu Apr 18 01:06:00 2013 +0200
Commit: Alex Neundorf <neundorf at kde.org>
CommitDate: Wed Apr 24 15:32:42 2013 -0400
cmake-gui: Add function for going to next error message in Output window
Using new shortcuts: F8 (Visual Studio) and Ctrl-. (Eclipse)
Signed-off-by: Alex Neundorf <neundorf at kde.org>
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index fb74aaf..91279fd 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -133,6 +133,11 @@ CMakeSetupDialog::CMakeSetupDialog()
ToolsMenu->addAction(tr("&Find Previous"),
this, SLOT(doOutputFindPrev()),
QKeySequence::FindPrevious);
+ ToolsMenu->addAction(tr("Goto Next Error"),
+ this, SLOT(doOutputErrorNext()),
+ QKeySequence(Qt::Key_F8)); // in Visual Studio
+ new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Period),
+ this, SLOT(doOutputErrorNext())); // in Eclipse
QMenu* OptionsMenu = this->menuBar()->addMenu(tr("&Options"));
this->SuppressDevWarningsAction =
@@ -649,7 +654,13 @@ void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent)
void CMakeSetupDialog::error(const QString& msg)
{
this->Output->setCurrentCharFormat(this->ErrorFormat);
- this->Output->append(msg);
+ //QTextEdit will terminate the msg with a ParagraphSeparator, but it also replaces
+ //all newlines with ParagraphSeparators. By replacing the newlines by ourself, one
+ //error msg will be one paragraph.
+ QString paragraph(msg);
+ paragraph.replace(QLatin1Char('\n'), QChar::LineSeparator);
+ this->Output->append(paragraph);
+
}
void CMakeSetupDialog::message(const QString& msg)
@@ -1172,6 +1183,9 @@ void CMakeSetupDialog::doOutputContextMenu(const QPoint &pt)
this, SLOT(doOutputFindNext()), QKeySequence::FindNext);
menu->addAction(tr("Find Previous"),
this, SLOT(doOutputFindPrev()), QKeySequence::FindPrevious);
+ menu->addSeparator();
+ menu->addAction(tr("Goto Next Error"),
+ this, SLOT(doOutputErrorNext()), QKeySequence(Qt::Key_F8));
menu->exec(this->Output->mapToGlobal(pt));
delete menu;
@@ -1182,7 +1196,9 @@ void CMakeSetupDialog::doOutputFindDialog()
QStringList strings(this->FindHistory);
QString selection = this->Output->textCursor().selectedText();
- if (!selection.isEmpty() && !selection.contains(QChar::ParagraphSeparator))
+ if (!selection.isEmpty() &&
+ !selection.contains(QChar::ParagraphSeparator) &&
+ !selection.contains(QChar::LineSeparator))
{
strings.push_front(selection);
}
@@ -1239,3 +1255,51 @@ void CMakeSetupDialog::doOutputFindNext(bool directionForward)
this->Output->setTextCursor(cursor);
}
}
+
+void CMakeSetupDialog::doOutputErrorNext()
+{
+ QTextCursor cursor = this->Output->textCursor();
+ bool atEnd = false;
+
+ // move cursor out of current error-block
+ if (cursor.blockCharFormat() == this->ErrorFormat)
+ {
+ atEnd = !cursor.movePosition(QTextCursor::NextBlock);
+ }
+
+ // move cursor to next error-block
+ while (cursor.blockCharFormat() != this->ErrorFormat && !atEnd)
+ {
+ atEnd = !cursor.movePosition(QTextCursor::NextBlock);
+ }
+
+ if (atEnd)
+ {
+ // first search found nothing, wrap around and search again
+ atEnd = !cursor.movePosition(QTextCursor::Start);
+
+ // move cursor to next error-block
+ while (cursor.blockCharFormat() != this->ErrorFormat && !atEnd)
+ {
+ atEnd = !cursor.movePosition(QTextCursor::NextBlock);
+ }
+ }
+
+ if (!atEnd)
+ {
+ cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
+
+ QTextCharFormat selectionFormat;
+ selectionFormat.setBackground(Qt::yellow);
+ QTextEdit::ExtraSelection extraSelection = {cursor, selectionFormat};
+ this->Output->setExtraSelections(QList<QTextEdit::ExtraSelection>()
+ << extraSelection);
+
+ // make the whole error-block visible
+ this->Output->setTextCursor(cursor);
+
+ // remove the selection to see the extraSelection
+ cursor.setPosition(cursor.anchor());
+ this->Output->setTextCursor(cursor);
+ }
+}
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 100834d..963c7d1 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -81,6 +81,7 @@ protected slots:
void doOutputFindDialog();
void doOutputFindNext(bool directionForward = true);
void doOutputFindPrev();
+ void doOutputErrorNext();
protected:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7be2d8acc64e371748b8758f16b7aa6bdaf3fd0f
commit 7be2d8acc64e371748b8758f16b7aa6bdaf3fd0f
Author: Marc Bartholomaeus <marc.bartholomaeus at carmeq.com>
AuthorDate: Thu Apr 18 01:03:02 2013 +0200
Commit: Alex Neundorf <neundorf at kde.org>
CommitDate: Wed Apr 24 15:32:42 2013 -0400
cmake-gui: Change shortcut of the search field from Ctrl-F to Alt-E
Ctrl-F is now used by "Find in Output".
Signed-off-by: Alex Neundorf <neundorf at kde.org>
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 0be45c6..fb74aaf 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -125,7 +125,8 @@ CMakeSetupDialog::CMakeSetupDialog()
#endif
ToolsMenu->addSeparator();
ToolsMenu->addAction(tr("&Find in Output..."),
- this, SLOT(doOutputFindDialog()));
+ this, SLOT(doOutputFindDialog()),
+ QKeySequence::Find);
ToolsMenu->addAction(tr("&Find Next"),
this, SLOT(doOutputFindNext()),
QKeySequence::FindNext);
@@ -165,10 +166,6 @@ CMakeSetupDialog::CMakeSetupDialog()
QObject::connect(a, SIGNAL(triggered(bool)),
this, SLOT(doHelp()));
- QShortcut* filterShortcut = new QShortcut(QKeySequence::Find, this);
- QObject::connect(filterShortcut, SIGNAL(activated()),
- this, SLOT(startSearch()));
-
this->setAcceptDrops(true);
// get the saved binary directories
@@ -1170,7 +1167,7 @@ void CMakeSetupDialog::doOutputContextMenu(const QPoint &pt)
menu->addSeparator();
menu->addAction(tr("Find..."),
- this, SLOT(doOutputFindDialog()));
+ this, SLOT(doOutputFindDialog()), QKeySequence::Find);
menu->addAction(tr("Find Next"),
this, SLOT(doOutputFindNext()), QKeySequence::FindNext);
menu->addAction(tr("Find Previous"),
diff --git a/Source/QtDialog/CMakeSetupDialog.ui b/Source/QtDialog/CMakeSetupDialog.ui
index dc8ee3f..98da249 100644
--- a/Source/QtDialog/CMakeSetupDialog.ui
+++ b/Source/QtDialog/CMakeSetupDialog.ui
@@ -107,7 +107,10 @@
</sizepolicy>
</property>
<property name="text">
- <string>Search:</string>
+ <string>S&earch:</string>
+ </property>
+ <property name="buddy">
+ <cstring>Search</cstring>
</property>
</widget>
</item>
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ce65e82f5865469f392b0d021da588366bc14c3
commit 4ce65e82f5865469f392b0d021da588366bc14c3
Author: Marc Bartholomaeus <marc.bartholomaeus at carmeq.com>
AuthorDate: Thu Apr 18 00:53:12 2013 +0200
Commit: Alex Neundorf <neundorf at kde.org>
CommitDate: Wed Apr 24 15:32:42 2013 -0400
cmake-gui: Add search functions to the context menu of the Output widget
Signed-off-by: Alex Neundorf <neundorf at kde.org>
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();
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df3663bfabc9de99a7338ea0a19a1101a8dbc703
commit df3663bfabc9de99a7338ea0a19a1101a8dbc703
Author: Marc Bartholomaeus <marc.bartholomaeus at carmeq.com>
AuthorDate: Thu Apr 18 01:01:10 2013 +0200
Commit: Alex Neundorf <neundorf at kde.org>
CommitDate: Wed Apr 24 15:32:34 2013 -0400
cmake-gui: Add search functions for Output window (#9733)
Signed-off-by: Alex Neundorf <neundorf at kde.org>
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index c0dde1c..3cf799f 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -28,6 +28,7 @@
#include <QShortcut>
#include <QKeySequence>
#include <QMacInstallDialog.h>
+#include <QInputDialog>
#include "QCMake.h"
#include "QCMakeCacheView.h"
@@ -122,6 +123,16 @@ CMakeSetupDialog::CMakeSetupDialog()
QObject::connect(this->InstallForCommandLineAction, SIGNAL(triggered(bool)),
this, SLOT(doInstallForCommandLine()));
#endif
+ ToolsMenu->addSeparator();
+ ToolsMenu->addAction(tr("&Find in Output..."),
+ this, SLOT(doOutputFindDialog()));
+ ToolsMenu->addAction(tr("&Find Next"),
+ this, SLOT(doOutputFindNext()),
+ QKeySequence::FindNext);
+ ToolsMenu->addAction(tr("&Find Previous"),
+ this, SLOT(doOutputFindPrev()),
+ QKeySequence::FindPrevious);
+
QMenu* OptionsMenu = this->menuBar()->addMenu(tr("&Options"));
this->SuppressDevWarningsAction =
OptionsMenu->addAction(tr("&Suppress dev Warnings (-Wno-dev)"));
@@ -1149,4 +1160,65 @@ void CMakeSetupDialog::setSearchFilter(const QString& str)
this->CacheValues->setSearchFilter(str);
}
+void CMakeSetupDialog::doOutputFindDialog()
+{
+ QStringList strings(this->FindHistory);
+
+ QString selection = this->Output->textCursor().selectedText();
+ if (!selection.isEmpty() && !selection.contains(QChar::ParagraphSeparator))
+ {
+ strings.push_front(selection);
+ }
+
+ bool ok;
+ QString search = QInputDialog::getItem(this, tr("Find in Output"),
+ tr("Find:"), strings, 0, true, &ok);
+ if (ok && !search.isEmpty())
+ {
+ if (!this->FindHistory.contains(search))
+ {
+ this->FindHistory.push_front(search);
+ }
+ doOutputFindNext();
+ }
+}
+
+void CMakeSetupDialog::doOutputFindPrev()
+{
+ doOutputFindNext(false);
+}
+
+void CMakeSetupDialog::doOutputFindNext(bool directionForward)
+{
+ if (this->FindHistory.isEmpty())
+ {
+ doOutputFindDialog(); //will re-call this function again
+ return;
+ }
+
+ QString search = this->FindHistory.front();
+
+ QTextCursor cursor = this->Output->textCursor();
+ QTextDocument* document = this->Output->document();
+ QTextDocument::FindFlags flags;
+ if (!directionForward)
+ {
+ flags |= QTextDocument::FindBackward;
+ }
+ cursor = document->find(search, cursor, flags);
+
+ if (cursor.isNull())
+ {
+ // first search found nothing, wrap around and search again
+ cursor = this->Output->textCursor();
+ cursor.movePosition(directionForward ? QTextCursor::Start
+ : QTextCursor::End);
+ cursor = document->find(search, cursor, flags);
+ }
+
+ if (cursor.hasSelection())
+ {
+ this->Output->setTextCursor(cursor);
+ }
+}
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 2599675..88fefcc 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -77,6 +77,9 @@ protected slots:
bool doConfigureInternal();
bool doGenerateInternal();
void exitLoop(int);
+ void doOutputFindDialog();
+ void doOutputFindNext(bool directionForward = true);
+ void doOutputFindPrev();
protected:
@@ -106,6 +109,7 @@ protected:
QTextCharFormat MessageFormat;
QStringList AddVariableCompletions;
+ QStringList FindHistory;
QEventLoop LocalLoop;
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list