syncthingtray/widgets/misc/direrrorsdialog.h
Martchus 4a42a3f0c0 Fix and refactor directory error handling
* Rely not only on the FolderErrors event
* Request pull errors when opening the dialog
* Use "pullErrors" from FolderSummary
* Move code for directory error dialog into
  its own class

This should fix that sometimes obsolete errors
were still displayed or actually present errors
missing.
2018-11-03 21:30:17 +01:00

39 lines
1.0 KiB
C++

#ifndef SYNCTHINGWIDGETS_DIRECTORY_ERRORS_DIALOG_H
#define SYNCTHINGWIDGETS_DIRECTORY_ERRORS_DIALOG_H
#include "./textviewdialog.h"
QT_FORWARD_DECLARE_CLASS(QLabel)
QT_FORWARD_DECLARE_CLASS(QPushButton)
namespace Data {
class SyncthingConnection;
struct SyncthingDir;
} // namespace Data
namespace QtGui {
class SYNCTHINGWIDGETS_EXPORT DirectoryErrorsDialog : public TextViewDialog {
Q_OBJECT
public:
explicit DirectoryErrorsDialog(const Data::SyncthingConnection &connection, const Data::SyncthingDir &dir, QWidget *parent = nullptr);
~DirectoryErrorsDialog() override;
private Q_SLOTS:
void handleDirStatusChanged(const Data::SyncthingDir &dir);
void handleNewDirs();
void updateErrors(const Data::SyncthingDir &dir);
void removeNonEmptyDirs();
private:
const Data::SyncthingConnection &m_connection;
QString m_dirId;
QStringList m_nonEmptyDirs;
QLabel *m_statusLabel;
QPushButton *m_rmNonEmptyDirsButton;
};
} // namespace QtGui
#endif // SYNCTHINGWIDGETS_DIRECTORY_ERRORS_DIALOG_H