syncthingtray/tray/gui/downloadview.h
Martchus 3e1beaa11d Sort directories by name/ID
* Use the name as sorting criteria and fall back to the ID if there's no
  name
* Use new SyncthingSortFilterDirectoryModel also for Plasmoid's filtering
* See https://github.com/Martchus/syncthingtray/issues/75
2020-10-18 15:48:02 +02:00

38 lines
847 B
C++

#ifndef DOWNLOADVIEW_H
#define DOWNLOADVIEW_H
#include <QTreeView>
namespace Data {
struct SyncthingItemDownloadProgress;
struct SyncthingDir;
class SyncthingDownloadModel;
} // namespace Data
namespace QtGui {
class DownloadView : public QTreeView {
Q_OBJECT
public:
using ModelType = Data::SyncthingDownloadModel;
using SortFilterModelType = void;
DownloadView(QWidget *parent = nullptr);
Q_SIGNALS:
void openDir(const Data::SyncthingDir &dir);
void openItemDir(const Data::SyncthingItemDownloadProgress &dir);
protected:
void mouseReleaseEvent(QMouseEvent *event) override;
private Q_SLOTS:
void showContextMenu(const QPoint &position);
private:
void emitOpenDir(QPair<const Data::SyncthingDir *, const Data::SyncthingItemDownloadProgress *> info);
};
} // namespace QtGui
#endif // DOWNLOADVIEW_H