2018-11-28 20:57:48 +01:00
|
|
|
#ifndef SYNCTHINGMENUACTION_H
|
|
|
|
#define SYNCTHINGMENUACTION_H
|
|
|
|
|
2021-01-25 19:48:11 +01:00
|
|
|
#include <syncthingconnector/syncthingnotifier.h>
|
2018-12-24 17:19:11 +01:00
|
|
|
|
2018-11-28 20:57:48 +01:00
|
|
|
#include <KFileItemListProperties>
|
|
|
|
|
|
|
|
#include <QAction>
|
|
|
|
|
2023-02-07 20:57:21 +01:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QWidget)
|
|
|
|
|
2018-11-28 20:57:48 +01:00
|
|
|
namespace Data {
|
|
|
|
enum class SyncthingStatus;
|
|
|
|
}
|
|
|
|
|
2018-11-28 21:14:11 +01:00
|
|
|
/*!
|
|
|
|
* \brief The SyncthingMenuAction class provides the top-level menu "Syncthing" entry for the context menu.
|
|
|
|
*/
|
2018-11-28 20:57:48 +01:00
|
|
|
class SyncthingMenuAction : public QAction {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit SyncthingMenuAction(const KFileItemListProperties &properties = KFileItemListProperties(),
|
2023-02-07 20:57:21 +01:00
|
|
|
const QList<QAction *> &actions = QList<QAction *>(), QWidget *parentWidget = nullptr);
|
2019-06-12 21:00:49 +02:00
|
|
|
#ifdef CPP_UTILITIES_DEBUG_BUILD
|
2018-12-26 01:16:38 +01:00
|
|
|
~SyncthingMenuAction() override;
|
|
|
|
#endif
|
2018-11-28 20:57:48 +01:00
|
|
|
|
2018-12-24 17:19:11 +01:00
|
|
|
private Q_SLOTS:
|
|
|
|
void handleConnectedChanged();
|
|
|
|
void updateActionStatus();
|
2018-11-28 20:57:48 +01:00
|
|
|
|
|
|
|
private:
|
2018-12-24 17:19:11 +01:00
|
|
|
void createMenu(const QList<QAction *> &actions);
|
|
|
|
|
2018-11-28 20:57:48 +01:00
|
|
|
KFileItemListProperties m_properties;
|
2018-12-24 17:19:11 +01:00
|
|
|
Data::SyncthingNotifier m_notifier;
|
2023-02-07 20:57:21 +01:00
|
|
|
QWidget *m_parentWidget;
|
2018-11-28 20:57:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SYNCTHINGMENUACTION_H
|