* Support triggering actions via the context menu in the regular tray like it is already possible in the Plasmoid * Support copying via the context menu in the Plasmoid like it is already possible in the regular tray * Reduce repetition of coding patterns using templates
37 lines
809 B
C++
37 lines
809 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;
|
|
|
|
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
|