2017-07-04 15:08:41 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) by Klaas Freitag <freitag@owncloud.com>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ISSUESWIDGET_H
|
|
|
|
#define ISSUESWIDGET_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QDateTime>
|
|
|
|
#include <QLocale>
|
2018-01-04 15:53:27 +03:00
|
|
|
#include <QTimer>
|
2017-07-04 15:08:41 +03:00
|
|
|
|
|
|
|
#include "progressdispatcher.h"
|
|
|
|
#include "owncloudgui.h"
|
|
|
|
|
|
|
|
#include "ui_issueswidget.h"
|
|
|
|
|
|
|
|
class QPushButton;
|
|
|
|
|
|
|
|
namespace OCC {
|
|
|
|
class SyncResult;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ProtocolWidget;
|
|
|
|
}
|
|
|
|
class Application;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief The ProtocolWidget class
|
|
|
|
* @ingroup gui
|
|
|
|
*/
|
|
|
|
class IssuesWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit IssuesWidget(QWidget *parent = 0);
|
|
|
|
~IssuesWidget();
|
|
|
|
QSize sizeHint() const { return ownCloudGui::settingsDialogSize(); }
|
|
|
|
|
|
|
|
void storeSyncIssues(QTextStream &ts);
|
|
|
|
void showFolderErrors(const QString &folderAlias);
|
|
|
|
|
|
|
|
public slots:
|
2017-07-11 16:54:01 +03:00
|
|
|
void addError(const QString &folderAlias, const QString &message, ErrorCategory category);
|
2017-07-04 15:08:41 +03:00
|
|
|
void slotProgressInfo(const QString &folder, const ProgressInfo &progress);
|
|
|
|
void slotItemCompleted(const QString &folder, const SyncFileItemPtr &item);
|
|
|
|
void slotOpenFile(QTreeWidgetItem *item, int);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void showEvent(QShowEvent *);
|
|
|
|
void hideEvent(QHideEvent *);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void copyToClipboard();
|
|
|
|
void issueCountUpdated(int);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void slotRefreshIssues();
|
|
|
|
void slotUpdateFolderFilters();
|
|
|
|
void slotAccountAdded(AccountState *account);
|
|
|
|
void slotAccountRemoved(AccountState *account);
|
2017-11-07 18:12:07 +03:00
|
|
|
void slotItemContextMenu(const QPoint &pos);
|
2017-07-04 15:08:41 +03:00
|
|
|
|
|
|
|
private:
|
2017-07-06 15:03:22 +03:00
|
|
|
void updateAccountChoiceVisibility();
|
2017-07-04 15:08:41 +03:00
|
|
|
AccountState *currentAccountFilter() const;
|
|
|
|
QString currentFolderFilter() const;
|
|
|
|
bool shouldBeVisible(QTreeWidgetItem *item, AccountState *filterAccount,
|
|
|
|
const QString &filterFolderAlias) const;
|
|
|
|
void cleanItems(const QString &folder);
|
2017-06-28 13:45:54 +03:00
|
|
|
void addItem(QTreeWidgetItem *item);
|
2017-07-04 15:08:41 +03:00
|
|
|
|
2017-07-11 16:54:01 +03:00
|
|
|
/// Add the special error widget for the category, if any
|
|
|
|
void addErrorWidget(QTreeWidgetItem *item, const QString &message, ErrorCategory category);
|
|
|
|
|
|
|
|
/// Wipes all insufficient remote storgage blacklist entries
|
|
|
|
void retryInsufficentRemoteStorageErrors(const QString &folderAlias);
|
|
|
|
|
2018-01-04 15:53:27 +03:00
|
|
|
/// Each insert disables sorting, this timer reenables it
|
|
|
|
QTimer _reenableSorting;
|
|
|
|
|
2017-07-04 15:08:41 +03:00
|
|
|
Ui::IssuesWidget *_ui;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|