no more compiling warnings in the whole KGet source code:
[kdenetwork.git] / krfb / main.cpp
blobcf437d4c08aa948368e7345d67b42862a2c30d18
1 /***************************************************************************
2 main.cpp
3 -------------------
4 begin : Sat Dec 8 03:23:02 CET 2001
5 copyright : (C) 2001-2003 by Tim Jansen
6 email : tim@tjansen.de
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
18 #include "trayicon.h"
19 //#include "configuration.h"
20 #include "krfbserver.h"
21 #include "manageinvitationsdialog.h"
23 #include <QPixmap>
24 #include <kaction.h>
25 #include <kdebug.h>
26 #include <KNotification>
27 #include <ksystemtrayicon.h>
28 #include <kcmdlineargs.h>
29 #include <kaboutdata.h>
30 #include <kaboutapplicationdialog.h>
31 #include <klocale.h>
32 #include <kapplication.h>
33 #include <kmessagebox.h>
34 #include <qwindowdefs.h>
36 #include <signal.h>
38 #define VERSION "1.0"
40 static const char description[] = I18N_NOOP("VNC-compatible server to share "
41 "KDE desktops");
44 int main(int argc, char *argv[])
46 KAboutData aboutData( "krfb", I18N_NOOP("Desktop Sharing"),
47 VERSION, description, KAboutData::License_GPL,
48 "(c) 2007, Alessandro Praduroux\n"
49 "(c) 2001-2003, Tim Jansen\n"
50 "(c) 2001, Johannes E. Schindelin\n"
51 "(c) 2000, heXoNet Support GmbH, D-66424 Homburg\n"
52 "(c) 2000-2001, Const Kaplinsky\n"
53 "(c) 2000, Tridia Corporation\n"
54 "(c) 1999, AT&T Laboratories Cambridge\n");
55 aboutData.addAuthor("Alessandro Praduroux", I18N_NOOP("KDE4 porting"), "pradu@pradu.it");
56 aboutData.addAuthor("Tim Jansen", "", "tim@tjansen.de");
57 aboutData.addAuthor("Ian Reinhart Geiser", I18N_NOOP("DCOP interface"), "geiseri@kde.org");
58 aboutData.addCredit("Johannes E. Schindelin",
59 I18N_NOOP("libvncserver"));
60 aboutData.addCredit("Const Kaplinsky",
61 I18N_NOOP("TightVNC encoder"));
62 aboutData.addCredit("Tridia Corporation",
63 I18N_NOOP("ZLib encoder"));
64 aboutData.addCredit("AT&T Laboratories Cambridge",
65 I18N_NOOP("original VNC encoders and "
66 "protocol design"));
67 aboutData.addCredit("Jens Wagner (heXoNet Support GmbH)",
68 I18N_NOOP("X11 update scanner, "
69 "original code base"));
70 aboutData.addCredit("Jason Spisak",
71 I18N_NOOP("Connection side image"),
72 "kovalid@yahoo.com");
73 aboutData.addCredit("Karl Vogel",
74 I18N_NOOP("KDesktop background deactivation"));
75 KCmdLineArgs::init(argc, argv, &aboutData);
77 KApplication app;
79 TrayIcon trayicon(new ManageInvitationsDialog);
81 KrfbServer *server = KrfbServer::self(); // initialize the server manager
82 if (!server->checkX11Capabilities()) {
83 return 1;
86 QObject::connect(&trayicon, SIGNAL(enableDesktopControl(bool)),
87 server, SLOT(enableDesktopControl(bool)));
88 QObject::connect(server, SIGNAL(sessionEstablished(QString)),
89 &trayicon, SLOT(showConnectedMessage(QString)));
90 QObject::connect(server, SIGNAL(sessionFinished()),
91 &trayicon, SLOT(showDisconnectedMessage()));
92 QObject::connect(server, SIGNAL(desktopControlSettingChanged(bool)),
93 &trayicon, SLOT(setDesktopControlSetting(bool)));
94 QObject::connect(&trayicon, SIGNAL(quitSelected()),
95 server, SLOT(disconnectAndQuit()));
96 QObject::connect(server, SIGNAL(quitApp()),
97 &app, SLOT(quit()));
99 sigset_t sigs;
100 sigemptyset(&sigs);
101 sigaddset(&sigs, SIGPIPE);
102 sigprocmask(SIG_BLOCK, &sigs, 0);
104 return app.exec();