syncthingtray/fileitemactionplugin/syncthingmenuaction.h

39 lines
937 B
C
Raw Normal View History

#ifndef SYNCTHINGMENUACTION_H
#define SYNCTHINGMENUACTION_H
#include <syncthingconnector/syncthingnotifier.h>
2018-12-24 17:19:11 +01:00
#include <KFileItemListProperties>
#include <QAction>
namespace Data {
enum class SyncthingStatus;
}
/*!
* \brief The SyncthingMenuAction class provides the top-level menu "Syncthing" entry for the context menu.
*/
class SyncthingMenuAction : public QAction {
Q_OBJECT
public:
explicit SyncthingMenuAction(const KFileItemListProperties &properties = KFileItemListProperties(),
const QList<QAction *> &actions = QList<QAction *>(), QObject *parent = 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-12-24 17:19:11 +01:00
private Q_SLOTS:
void handleConnectedChanged();
void updateActionStatus();
private:
2018-12-24 17:19:11 +01:00
void createMenu(const QList<QAction *> &actions);
KFileItemListProperties m_properties;
2018-12-24 17:19:11 +01:00
Data::SyncthingNotifier m_notifier;
};
#endif // SYNCTHINGMENUACTION_H