Show invite menu in wlm chat window immediately
[kdenetwork.git] / krfb / main.cpp
blobc43c82d0e05ad8fad03d93fc41c240571ecf432c
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", 0, ki18n("Desktop Sharing"),
47 VERSION, ki18n(description), KAboutData::License_GPL,
48 ki18n("(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 Boston\n"));
55 aboutData.addAuthor(ki18n("Alessandro Praduroux"), ki18n("KDE4 porting"), "pradu@pradu.it");
56 aboutData.addAuthor(ki18n("Tim Jansen"), KLocalizedString(), "tim@tjansen.de");
57 aboutData.addAuthor(ki18n("Ian Reinhart Geiser"), ki18n("DCOP interface"), "geiseri@kde.org");
58 aboutData.addCredit(ki18n("Johannes E. Schindelin"),
59 ki18n("libvncserver"));
60 aboutData.addCredit(ki18n("Const Kaplinsky"),
61 ki18n("TightVNC encoder"));
62 aboutData.addCredit(ki18n("Tridia Corporation"),
63 ki18n("ZLib encoder"));
64 aboutData.addCredit(ki18n("AT&T Laboratories Boston"),
65 ki18n("original VNC encoders and "
66 "protocol design"));
67 aboutData.addCredit(ki18n("Jens Wagner (heXoNet Support GmbH)"),
68 ki18n("X11 update scanner, "
69 "original code base"));
70 aboutData.addCredit(ki18n("Jason Spisak"),
71 ki18n("Connection side image"),
72 "kovalid@yahoo.com");
73 aboutData.addCredit(ki18n("Karl Vogel"),
74 ki18n("KDesktop background deactivation"));
75 KCmdLineArgs::init(argc, argv, &aboutData);
77 KCmdLineOptions options;
78 options.add("nodialog", ki18n("Do not show the invitations management dialog at startup"));
79 KCmdLineArgs::addCmdLineOptions(options);
81 KApplication app;
82 app.setQuitOnLastWindowClosed(false);
85 ManageInvitationsDialog invitationsDialog;
86 if ( KCmdLineArgs::parsedArgs()->isSet("dialog") )
87 invitationsDialog.show();
88 TrayIcon trayicon(&invitationsDialog);
90 KrfbServer *server = KrfbServer::self(); // initialize the server manager
91 if (!server->checkX11Capabilities()) {
92 return 1;
95 QObject::connect(&trayicon, SIGNAL(enableDesktopControl(bool)),
96 server, SLOT(enableDesktopControl(bool)));
97 QObject::connect(server, SIGNAL(sessionEstablished(QString)),
98 &trayicon, SLOT(showConnectedMessage(QString)));
99 QObject::connect(server, SIGNAL(sessionFinished()),
100 &trayicon, SLOT(showDisconnectedMessage()));
101 QObject::connect(server, SIGNAL(desktopControlSettingChanged(bool)),
102 &trayicon, SLOT(setDesktopControlSetting(bool)));
104 sigset_t sigs;
105 sigemptyset(&sigs);
106 sigaddset(&sigs, SIGPIPE);
107 sigprocmask(SIG_BLOCK, &sigs, 0);
109 return app.exec();