SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ModuleLogWindow.h
Go to the documentation of this file.
1 /*
2  For more information, please see: http://software.sci.utah.edu
3 
4  The MIT License
5 
6  Copyright (c) 2012 Scientific Computing and Imaging Institute,
7  University of Utah.
8 
9  License for the specific language governing rights and limitations under
10  Permission is hereby granted, free of charge, to any person obtaining a
11  copy of this software and associated documentation files (the "Software"),
12  to deal in the Software without restriction, including without limitation
13  the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  and/or sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following conditions:
16 
17  The above copyright notice and this permission notice shall be included
18  in all copies or substantial portions of the Software.
19 
20  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  DEALINGS IN THE SOFTWARE.
27 */
28 
29 #ifndef INTERFACE_APPLICATION_MODULELOGWINDOW_H
30 #define INTERFACE_APPLICATION_MODULELOGWINDOW_H
31 
32 #include "ui_ModuleLogWindow.h"
33 
36 
37 
38 namespace SCIRun {
39 namespace Gui {
40 
41 class DialogErrorControl;
42 
43 class ModuleLogWindow : public QDialog, public Ui::ModuleLogWindow
44 {
45  Q_OBJECT
46 
47 public:
48  explicit ModuleLogWindow(const QString& moduleName, boost::shared_ptr<DialogErrorControl> dialogErrorControl, QWidget* parent = 0);
49 public Q_SLOTS:
50  void appendMessage(const QString& message, const QColor& color = Qt::black);
51  void popupMessageBox(const QString& message);
52 
53 Q_SIGNALS:
54  void messageReceived(const QColor& color);
55 
56 private:
57  QString moduleName_;
58  boost::shared_ptr<DialogErrorControl> dialogErrorControl_;
59 };
60 
61 class ModuleLogger : public QObject, public Core::Logging::LegacyLoggerInterface
62 {
63  Q_OBJECT
64 public:
65  explicit ModuleLogger(ModuleLogWindow* window);
66  virtual void error(const std::string& msg) const;
67  virtual void warning(const std::string& msg) const;
68  virtual void remark(const std::string& msg) const;
69  virtual void status(const std::string& msg) const;
70 
71 Q_SIGNALS:
72  void logSignal(const QString& message, const QColor& color) const;
73  void alert(const QColor& color) const;
74  void popup(const QString& message) const;
75 };
76 
77 }
78 }
79 
80 #endif
#define msg(m)
Definition: PiecewiseInterp.h:55
Definition: LoggerInterface.h:43
void popupMessageBox(const QString &message)
Definition: ModuleLogWindow.cc:54
ModuleLogWindow(const QString &moduleName, boost::shared_ptr< DialogErrorControl > dialogErrorControl, QWidget *parent=0)
Definition: ModuleLogWindow.cc:39
void logSignal(const QString &message, const QColor &color) const
void messageReceived(const QColor &color)
virtual void warning(const std::string &msg) const
Definition: ModuleLogWindow.cc:77
Definition: ModuleLogWindow.h:61
void popup(const QString &message) const
virtual void error(const std::string &msg) const
Definition: ModuleLogWindow.cc:68
virtual void remark(const std::string &msg) const
Definition: ModuleLogWindow.cc:84
void alert(const QColor &color) const
Definition: ModuleLogWindow.h:43
virtual void status(const std::string &msg) const
Definition: ModuleLogWindow.cc:91
ModuleLogger(ModuleLogWindow *window)
Definition: ModuleLogWindow.cc:61
void appendMessage(const QString &message, const QColor &color=Qt::black)
Definition: ModuleLogWindow.cc:49