diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 18:42:24 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 18:42:24 +0000 |
commit | f508189682b6fba62e08feeb1596f682bad5fff9 (patch) | |
tree | 28aeb0e6c19386c385c1ce5edf8a92c1bca15281 /src/libgui/log_view.h | |
download | piklab-f508189682b6fba62e08feeb1596f682bad5fff9.tar.gz piklab-f508189682b6fba62e08feeb1596f682bad5fff9.zip |
Added KDE3 version of PikLab
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1095639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/libgui/log_view.h')
-rw-r--r-- | src/libgui/log_view.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/libgui/log_view.h b/src/libgui/log_view.h new file mode 100644 index 0000000..c84849e --- /dev/null +++ b/src/libgui/log_view.h @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (C) 2005 Nicolas Hadacek <hadacek@kde.org> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#ifndef LOG_VIEW_H +#define LOG_VIEW_H + +#include <qtextedit.h> +#include "common/global/log.h" + +namespace Log +{ +enum OutputType { GuiOnly = 0, GuiConsole, Nb_OutputTypes }; + +class Widget : public QTextEdit, public View +{ + Q_OBJECT +public: + Widget(QWidget *parent = 0, const char *name = 0); + virtual void appendToLastLine(const QString &text); + virtual void clear(); + virtual void sorry(const QString &message, const QString &details); + virtual bool askContinue(const QString &message); + +protected: + QPopupMenu *createPopupMenu(const QPoint &pos); + +private slots: + void toggleVisible(int i); + void toggleConsoleOutput(); + void saveAs(); + +private: + int _id[DebugLevel::Nb_Types]; + QPopupMenu *_popup; + QString _text; + + virtual void updateDebugLevel(); + virtual void doLog(LineType type, const QString &text, Action action = Immediate); + virtual void doLog(DebugLevel level, const QString &text, Action action = Immediate); + void doLog(const QString &text, const QString &color, bool bold, Action action = Immediate); + void logExtra(const QString &text); +}; + +} // namespace + +#endif |