-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (30 loc) · 1.09 KB
/
main.cpp
File metadata and controls
37 lines (30 loc) · 1.09 KB
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
#include <QtWidgets/QApplication>
#include <QtWidgets/QSystemTrayIcon>
#include <QSettings>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setApplicationName("Clint");
a.setApplicationVersion("0.1");
a.setOrganizationName("sje");
a.setOrganizationDomain("scottellis.com.au");
// select port
unsigned short port = 34123;
for(int i = 1; i < argc - 1; i+=2) {
if(a.arguments().at(i) == "-p" || a.arguments().at(i) == "--port") {
port = a.arguments().at(i + 1).toShort();
}
}
MainWindow w(port);
// add nodes to send to
for(int i = 1; i < argc - 1; i+=2) {
if(a.arguments().at(i) == "-n" || a.arguments().at(i) == "--node") {
w.addNode(QHostAddress(a.arguments().at(i + 1)));
}
}
QSystemTrayIcon sysTray(QIcon(":/images/clipboard"), &a);
w.connect(&sysTray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), &w, SLOT(sysTrayActivate(QSystemTrayIcon::ActivationReason)));
sysTray.show();
return a.exec();
}