ParaView
pqOutputWindow.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqOutputWindow.h
5 
6  Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 =========================================================================*/
32 
33 #ifndef _pqOutputWindow_h
34 #define _pqOutputWindow_h
35 
36 #include "pqCoreModule.h"
37 
38 #include <QDialog>
39 
48 class PQCORE_EXPORT pqOutputWindow : public QDialog
49 {
50  typedef QDialog Superclass;
51  Q_OBJECT
52 
53 public:
55  {
59  MESSAGE_TYPE_COUNT
60  };
61 
62  pqOutputWindow(QWidget* Parent);
63  ~pqOutputWindow();
64 
68  static pqOutputWindow* instance();
69 
70 public slots:
71  void onDisplayText(const QString&);
72  void onDisplayErrorText(const QString&);
73  void onDisplayWarningText(const QString&);
74  void onDisplayGenericWarningText(const QString&);
75 
81  void onDisplayTextInWindow(const QString&);
82  void onDisplayErrorTextInWindow(const QString&);
83 
84 private slots:
88  void accept();
89  void reject();
90 
94  void clear();
95 
99  void setConsoleView(int on);
100 
104  void errorToggled(bool checked);
105  void warningToggled(bool checked);
106  void debugToggled(bool checked);
107 
111  void onProgressStartEvent();
112 
113 private:
115  pqOutputWindow& operator=(const pqOutputWindow&);
116 
120  void setupSuppressionExpressions();
121 
125  bool shouldMessageBeSuppressed(const QString& text);
126 
127  void addMessage(int messageType, const QString& text);
128  void addPythonMessages(int messageType, const QString& text);
129 
130  void addMessage(int messageType, const QString& location, const QString& message);
131 
132  virtual void showEvent(QShowEvent*);
133  virtual void hideEvent(QHideEvent*);
134 
135  bool Show[MESSAGE_TYPE_COUNT];
136 
140  int StartEventIndex;
141  struct pqImplementation;
142  const QScopedPointer<pqImplementation> Implementation;
143 };
144 
145 #endif // !_pqOutputWindow_h
Provides an output dialog that will display all VTK/ParaView debug/warning/error output.