-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathlafdup_window.h
65 lines (63 loc) · 1.82 KB
/
lafdup_window.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef LAFDUP_WINDOW_H
#define LAFDUP_WINDOW_H
#include <QtCore/qabstractitemmodel.h>
#include <QtWidgets/qwidget.h>
#include <QtWidgets/qsystemtrayicon.h>
#include <QtCore/qcoreevent.h>
#include <QtWidgets/qmessagebox.h>
#include "peer.h"
namespace Ui {
class LafdupWindow;
}
class GuideDialog;
class MessageTips;
class CopyPasteModel;
class LafdupWindow : public QWidget
{
Q_OBJECT
public:
LafdupWindow();
virtual ~LafdupWindow() override;
protected:
virtual void showEvent(QShowEvent *event) override;
virtual void changeEvent(QEvent *event) override;
virtual void closeEvent(QCloseEvent *event) override;
virtual void dropEvent(QDropEvent *event) override;
virtual void dragEnterEvent(QDragEnterEvent *event) override;
bool event(QEvent *e) override;
public slots:
void sendContent();
void showAndGetFocus();
private slots:
void updateClipboard(const CopyPaste ©Paste);
void onPeerStateChanged(bool ok);
void configure();
void setPassword();
void useOldContent(const QModelIndex ¤t);
void showContextMenu(const QPoint &pos);
void copyToRemote();
void setToClipboard();
void removeCopyPaste();
void clearAll();
void sendFiles();
void sendFeedBackTips(QString tips);
void sendAction();
public slots:
void onClipboardChanged();
private:
bool outgoing(const CopyPaste ©Paste);
bool outgoing(const QString &text, bool ignoreLimits);
bool outgoing(const QList<QUrl> urls, bool showError, bool ignoreLimits);
bool outgoing(const QImage &image);
void updateMyIP();
void loadPassword();
void loadConfiguration(bool withPassword);
private:
Ui::LafdupWindow *ui;
QSharedPointer<LafdupPeer> peer;
CopyPasteModel *copyPasteModel;
QSystemTrayIcon *trayIcon;
QMenu *trayMenu;
bool started;
};
#endif