X-Git-Url: https://vaikene.ee/gitweb/pswgen09.html?a=blobdiff_plain;f=src%2Fplugins%2FLogView%2Flogview.h;h=dd768585587f7e7cf5e8a19ffc6ea5f34409f4f7;hb=a81a943bee20df3c7eb34bafb3e3fe878facfe4e;hp=383588de454272efb192c1c019531688143004c6;hpb=d50faf159f17a66fb89ea3e7878b6f56e34b9e72;p=evaf
diff --git a/src/plugins/LogView/logview.h b/src/plugins/LogView/logview.h
index 383588d..dd76858 100644
--- a/src/plugins/LogView/logview.h
+++ b/src/plugins/LogView/logview.h
@@ -22,6 +22,7 @@
#include
#include
+#include
#include
#include
@@ -30,6 +31,11 @@
#include
#include
+class QListView;
+class QLabel;
+class QTabWidget;
+class QStatusBar;
+class QEvent;
namespace eVaf {
@@ -62,12 +68,14 @@ public:
: dt(QDateTime::currentDateTime())
, severity(s)
, text(t)
+ , simplified(t.simplified())
, where(w)
{}
QDateTime dt;
Common::iLogger::Severity severity;
QString text;
+ QString simplified;
QString where;
};
@@ -118,6 +126,8 @@ private: // Methods
/**
* The log view widget
+ *
+ * The Widget class implements a widget that shows messages from one logger source.
*/
class Widget : public QWidget
{
@@ -125,9 +135,59 @@ class Widget : public QWidget
public:
- Widget(QWidget * parent = 0, Qt::WindowFlags flags = 0);
+ Widget(QString const & source, QWidget * parent = 0);
+
+ QString const & source() const { return mSource; }
+
+ inline void addMessage(Common::iLogger::Severity severity, QString const & text, QString const & where)
+ {
+ mModel->addMessage(severity, text, where);
+ }
+
+
+private slots:
+
+ void messageAdded(QModelIndex const & index);
+
+ void currentChanged(QModelIndex const &, QModelIndex const &);
+
+ void copyToClipboard();
+
+ void saveToFile();
+
+
+private:
+
+ QString mSource;
+
+ Model * mModel;
+
+ bool mAutoScroll;
+
+ QListView * wList;
+ QLabel * wDetails;
+
+};
+
+/**
+ * The log view window
+ */
+class Window : public Gui::Panel
+{
+ Q_OBJECT
+
+public:
+
+ Window(QString const & args, QWidget * parent = 0, Qt::WindowFlags flags = 0);
- virtual ~Widget();
+ virtual ~Window();
+
+ virtual bool event(QEvent * e);
+
+
+public slots:
+
+ void loggerEvent(Common::iLogger::Severity severity, QString const & text, QString const & source, QString const & where);
private: // Methods
@@ -136,6 +196,16 @@ private: // Methods
void restoreSettings();
+ QString getPanelName(QString const & args) const;
+
+
+private: // Members
+
+ QString mDefSource;
+ QTabWidget * wTabs;
+ QHash mLogViews;
+ QStatusBar * wStatusBar;
+
};
/**
@@ -156,11 +226,11 @@ public:
virtual void done();
- virtual bool isReady() const { return wWidget != 0; }
+ virtual bool isReady() const { return wWindow != 0; }
private: // Members
- Widget * wWidget;
+ Window * wWindow;
};