forked from kelolemon/Multi-Linux-Data-Transmission-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
executable file
·57 lines (51 loc) · 1.49 KB
/
main.cpp
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
# include "main.h"
char filename[255];
int to_hosts;
int main(int argc, char *argv[]) {
init();
int rt;
if (fork() != 0) {
QApplication b(argc, argv);
auto res = get_host(my_host);
receive_init((char *)res.first.c_str(), (char *)res.second.c_str());
} else {
QApplication a(argc, argv);
Drawer drawer;
drawer.resize(250,700);
drawer.show();
rt = QApplication::exec();
}
return rt;
// LoginForm *login = new LoginForm();
// login->show();
//
//
// //MainForm *main = new MainForm();
// if (login->exec() == QDialog::Accepted)
// {
//// main->show();
//// main->move ((QApplication::desktop()->width() - main->width())/2,(QApplication::desktop()->height() - main->height())/2);
// Drawer drawer;
// drawer.resize(250,700);
// drawer.show();
// return a.exec();
// }
// init();
// test();
// if (argc == 1) {
// puts("plz using para");
// return 1;
// }
//
// if (strcmp(argv[1], "1") == 0) {
// puts("begin to sender section");
// to_hosts = int(strtol(argv[2], nullptr, 10));
// auto hosts = get_host(to_hosts);
// sender_init((char *) hosts.first.c_str(), (char *) hosts.second.c_str(), to_hosts, true);
// } else {
// puts("begin to receive section");
// auto hosts = get_host(my_host);
// receive_init((char *)hosts.first.c_str(), (char *)hosts.second.c_str());
// }
// return 0;
}