QtPass 1.4.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
singleapplication.h
Go to the documentation of this file.
1#ifndef SINGLEAPPLICATION_H_
2#define SINGLEAPPLICATION_H_
3
4#include <QApplication>
5#include <QLocalServer>
6#include <QSharedMemory>
7
14class SingleApplication : public QApplication {
15 Q_OBJECT
16public:
17 SingleApplication(int &argc, char *argv[], QString uniqueKey);
18 bool isRunning();
19 bool sendMessage(const QString &message);
20
21public slots:
22 void receiveMessage();
23
24signals:
29 void messageAvailable(QString message);
30
31private:
32 bool _isRunning;
33 QString _uniqueKey;
34 QSharedMemory sharedMemory;
35 QScopedPointer<QLocalServer> localServer;
36
37 static const int timeout = 1000;
38};
39
40#endif // SINGLEAPPLICATION_H_
The SingleApplication class is used for commandline intergration.
bool isRunning()
SingleApplication::isRunning is there already a QtPass instance running, to check wether to be server...
void receiveMessage()
SingleApplication::receiveMessage we have received (a command line) message.
bool sendMessage(const QString &message)
SingleApplication::sendMessage send a message (from commandline) to an already running QtPass instanc...
void messageAvailable(QString message)
messageAvailable notification from commandline
#define SingleApplication
Definition: mainwindow.h:15