[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2807-ged86e1a

Alexander Neundorf neundorf at kde.org
Thu Apr 18 14:00:16 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  ed86e1ad349626d9e71af0ced368df6361bab2cc (commit)
       via  2e24abce3a088c7c445abfda62e46f88941de782 (commit)
       via  cf6275c947414e17c2cc541cc47704efe3ae623b (commit)
       via  cb1ab6f61c38a6a12a4b7ccba44927eb07256312 (commit)
       via  230f4505bfbeec9a1dc6181aa9d349c4ee38a9e7 (commit)
       via  c479bba4ef10c702109f8b1e091bb27186aa6df3 (commit)
       via  6a3ee5dd4e177c007459218612c45f9e6c9ec83b (commit)
      from  f6b24625389d80acb6c55b294b9d56bc652c5892 (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=ed86e1ad349626d9e71af0ced368df6361bab2cc
commit ed86e1ad349626d9e71af0ced368df6361bab2cc
Merge: f6b2462 2e24abc
Author:     Alexander Neundorf <neundorf at kde.org>
AuthorDate: Thu Apr 18 14:00:13 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Apr 18 14:00:13 2013 -0400

    Merge topic 'refs/heads/QtDialogSearchText2' into next
    
    2e24abc QtDialog: use shortcut F only for "Find in Output"
    cf6275c Function for Going to next error message in Output window
    cb1ab6f Changed shortcut of the search field from Ctrl-F to Alt-E
    230f450 Search functions added to context menu of the Output widget
    c479bba Search functions for Output window
    6a3ee5d CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e24abce3a088c7c445abfda62e46f88941de782
commit 2e24abce3a088c7c445abfda62e46f88941de782
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Thu Apr 18 19:59:11 2013 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Thu Apr 18 19:59:11 2013 +0200

    QtDialog: 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 28192b4..31e89cb 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=cf6275c947414e17c2cc541cc47704efe3ae623b
commit cf6275c947414e17c2cc541cc47704efe3ae623b
Author:     nagger n <nagger at gmx.de>
AuthorDate: Thu Apr 18 01:06:00 2013 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Thu Apr 18 19:58:46 2013 +0200

    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 90f186f..28192b4 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);
     }
@@ -1237,3 +1253,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=cb1ab6f61c38a6a12a4b7ccba44927eb07256312
commit cb1ab6f61c38a6a12a4b7ccba44927eb07256312
Author:     nagger n <nagger at gmx.de>
AuthorDate: Thu Apr 18 01:03:02 2013 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Thu Apr 18 19:58:42 2013 +0200

    Changed 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 da735d0..90f186f 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&amp;earch:</string>
+           </property>
+           <property name="buddy">
+            <cstring>Search</cstring>
            </property>
           </widget>
          </item>

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=230f4505bfbeec9a1dc6181aa9d349c4ee38a9e7
commit 230f4505bfbeec9a1dc6181aa9d349c4ee38a9e7
Author:     nagger n <nagger at gmx.de>
AuthorDate: Thu Apr 18 00:53:12 2013 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Thu Apr 18 19:58:37 2013 +0200

    Search functions added to 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 6d60e13..da735d0 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=c479bba4ef10c702109f8b1e091bb27186aa6df3
commit c479bba4ef10c702109f8b1e091bb27186aa6df3
Author:     nagger n <nagger at gmx.de>
AuthorDate: Thu Apr 18 01:01:10 2013 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Thu Apr 18 19:58:31 2013 +0200

    Search functions for Output window
    
    Signed-off-by: Alex Neundorf <neundorf at kde.org>

diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index c0dde1c..6d60e13 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,63 @@ 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())
+    {
+    this->FindHistory.push_front(search);
+    this->FindHistory.removeDuplicates();
+    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:
 Source/CMakeVersion.cmake            |    2 +-
 Source/QtDialog/CMakeSetupDialog.cxx |  161 ++++++++++++++++++++++++++++++++-
 Source/QtDialog/CMakeSetupDialog.h   |    6 ++
 Source/QtDialog/CMakeSetupDialog.ui  |    5 +-
 4 files changed, 167 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list