1/*
2 * Copyright (C) by Klaas Freitag <freitag@owncloud.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 */
14
15#ifndef LOGBROWSER_H
16#define LOGBROWSER_H
17
18#include <QCheckBox>
19#include <QPlainTextEdit>
20#include <QTextStream>
21#include <QFile>
22#include <QObject>
23#include <QList>
24#include <QDateTime>
25#include <QDialog>
26#include <QLineEdit>
27#include <QPushButton>
28#include <QLabel>
29
30namespace OCC {
31
32/**
33 * @brief The LogWidget class
34 * @ingroup gui
35 */
36class LogWidget : public QPlainTextEdit
37{
38 Q_OBJECT
39public:
40 explicit LogWidget(QWidget *parent = 0);
41
42signals:
43};
44
45/**
46 * @brief The LogBrowser class
47 * @ingroup gui
48 */
49class LogBrowser : public QDialog
50{
51 Q_OBJECT
52public:
53 explicit LogBrowser(QWidget *parent = 0);
54 ~LogBrowser();
55
56 void setLogFile(const QString &, bool);
57
58protected:
59 void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
60 void closeEvent(QCloseEvent *) Q_DECL_OVERRIDE;
61
62protected slots:
63 void slotNewLog(const QString &msg);
64 void slotFind();
65 void slotDebugCheckStateChanged(int);
66 void search(const QString &);
67 void slotSave();
68 void slotClearLog();
69 void togglePermanentLogging(bool enabled);
70
71private:
72 LogWidget *_logWidget;
73 QLineEdit *_findTermEdit;
74 QCheckBox *_logDebugCheckBox;
75 QCheckBox *_permanentLogging;
76 QPushButton *_saveBtn;
77 QPushButton *_clearBtn;
78 QLabel *_statusLabel;
79};
80
81} // namespace
82
83#endif // LOGBROWSER_H
84