syncthingtray/widgets/misc/textviewdialog.h

43 lines
859 B
C
Raw Normal View History

#ifndef SYNCTHINGWIDGETS_TEXTVIEWDIALOG_H
#define SYNCTHINGWIDGETS_TEXTVIEWDIALOG_H
#include "../global.h"
#include <QWidget>
QT_FORWARD_DECLARE_CLASS(QTextBrowser)
namespace Data {
class SyncthingConnection;
struct SyncthingDir;
}
namespace QtGui {
2017-05-01 03:34:43 +02:00
class SYNCTHINGWIDGETS_EXPORT TextViewDialog : public QWidget {
Q_OBJECT
public:
TextViewDialog(const QString &title = QString(), QWidget *parent = nullptr);
QTextBrowser *browser();
static TextViewDialog *forDirectoryErrors(const Data::SyncthingDir &dir);
static TextViewDialog *forLogEntries(Data::SyncthingConnection &connection);
Q_SIGNALS:
2016-12-11 20:52:46 +01:00
void reload();
protected:
void keyPressEvent(QKeyEvent *event);
private:
QTextBrowser *m_browser;
};
inline QTextBrowser *TextViewDialog::browser()
{
return m_browser;
}
}
#endif // SYNCTHINGWIDGETS_TEXTVIEWDIALOG_H