2017-04-25 00:50:30 +02:00
|
|
|
#ifndef SYNCTHINGWIDGETS_STATUSINFO_H
|
|
|
|
#define SYNCTHINGWIDGETS_STATUSINFO_H
|
|
|
|
|
|
|
|
#include "../global.h"
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QIcon)
|
|
|
|
|
|
|
|
namespace Data {
|
|
|
|
class SyncthingConnection;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace QtGui {
|
|
|
|
|
2017-05-01 03:34:43 +02:00
|
|
|
class SYNCTHINGWIDGETS_EXPORT StatusInfo {
|
2017-04-25 00:50:30 +02:00
|
|
|
public:
|
|
|
|
explicit StatusInfo();
|
|
|
|
explicit StatusInfo(const Data::SyncthingConnection &connection);
|
|
|
|
|
2017-05-30 15:06:34 +02:00
|
|
|
const QString &statusText() const;
|
|
|
|
const QString &additionalStatusText() const;
|
2017-04-25 00:50:30 +02:00
|
|
|
const QIcon &statusIcon() const;
|
|
|
|
void update(const Data::SyncthingConnection &connection);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString m_statusText;
|
2017-05-30 15:06:34 +02:00
|
|
|
QString m_additionalStatusText;
|
2017-04-25 00:50:30 +02:00
|
|
|
const QIcon *m_statusIcon;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline StatusInfo::StatusInfo(const Data::SyncthingConnection &connection)
|
|
|
|
{
|
|
|
|
update(connection);
|
|
|
|
}
|
|
|
|
|
2017-05-30 15:06:34 +02:00
|
|
|
inline const QString &StatusInfo::statusText() const
|
2017-04-25 00:50:30 +02:00
|
|
|
{
|
|
|
|
return m_statusText;
|
|
|
|
}
|
|
|
|
|
2017-05-30 15:06:34 +02:00
|
|
|
inline const QString &StatusInfo::additionalStatusText() const
|
|
|
|
{
|
|
|
|
return m_additionalStatusText;
|
|
|
|
}
|
|
|
|
|
2017-04-25 00:50:30 +02:00
|
|
|
inline const QIcon &StatusInfo::statusIcon() const
|
|
|
|
{
|
|
|
|
return *m_statusIcon;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // SYNCTHINGWIDGETS_STATUSINFO_H
|