2001-12-08 02:23:04 +00:00
|
|
|
/***************************************************************************
|
2001-12-19 20:35:12 +00:00
|
|
|
main.cpp
|
2001-12-08 02:23:04 +00:00
|
|
|
-------------------
|
|
|
|
|
begin : Sat Dec 8 03:23:02 CET 2001
|
2003-09-20 09:47:08 +00:00
|
|
|
copyright : (C) 2001-2003 by Tim Jansen
|
2001-12-08 02:23:04 +00:00
|
|
|
email : tim@tjansen.de
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
|
* *
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
|
* (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
2001-12-14 16:25:06 +00:00
|
|
|
#include "trayicon.h"
|
2007-03-29 20:54:53 +00:00
|
|
|
//#include "configuration.h"
|
|
|
|
|
#include "krfbserver.h"
|
2007-03-30 21:54:18 +00:00
|
|
|
#include "manageinvitationsdialog.h"
|
2001-12-14 16:25:06 +00:00
|
|
|
|
2007-01-21 12:51:14 +00:00
|
|
|
#include <QPixmap>
|
2001-12-14 16:25:06 +00:00
|
|
|
#include <kaction.h>
|
2001-12-19 20:35:12 +00:00
|
|
|
#include <kdebug.h>
|
2007-01-21 12:51:14 +00:00
|
|
|
#include <KNotification>
|
|
|
|
|
#include <ksystemtrayicon.h>
|
2001-12-08 02:23:04 +00:00
|
|
|
#include <kcmdlineargs.h>
|
|
|
|
|
#include <kaboutdata.h>
|
2007-01-29 23:28:40 +00:00
|
|
|
#include <kaboutapplicationdialog.h>
|
2001-12-08 02:23:04 +00:00
|
|
|
#include <klocale.h>
|
2007-04-16 14:10:59 +00:00
|
|
|
#include <kapplication.h>
|
2001-12-19 20:35:12 +00:00
|
|
|
#include <kmessagebox.h>
|
|
|
|
|
#include <qwindowdefs.h>
|
2001-12-08 02:23:04 +00:00
|
|
|
|
2002-01-09 23:15:05 +00:00
|
|
|
#include <signal.h>
|
|
|
|
|
|
2002-10-29 18:40:44 +00:00
|
|
|
#define VERSION "1.0"
|
2001-12-10 00:06:13 +00:00
|
|
|
|
2003-06-25 07:03:04 +00:00
|
|
|
static const char description[] = I18N_NOOP("VNC-compatible server to share "
|
2002-01-03 23:41:05 +00:00
|
|
|
"KDE desktops");
|
2001-12-19 20:35:12 +00:00
|
|
|
|
2007-04-12 16:12:37 +00:00
|
|
|
|
2001-12-08 02:23:04 +00:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
{
|
2002-01-03 23:41:05 +00:00
|
|
|
KAboutData aboutData( "krfb", I18N_NOOP("Desktop Sharing"),
|
2007-03-30 21:54:18 +00:00
|
|
|
VERSION, description, KAboutData::License_GPL,
|
|
|
|
|
"(c) 2007, Alessandro Praduroux\n"
|
|
|
|
|
"(c) 2001-2003, Tim Jansen\n"
|
|
|
|
|
"(c) 2001, Johannes E. Schindelin\n"
|
|
|
|
|
"(c) 2000, heXoNet Support GmbH, D-66424 Homburg\n"
|
|
|
|
|
"(c) 2000-2001, Const Kaplinsky\n"
|
|
|
|
|
"(c) 2000, Tridia Corporation\n"
|
2007-03-31 09:44:33 +00:00
|
|
|
"(c) 1999, AT&T Laboratories Cambridge\n");
|
2007-03-30 21:54:18 +00:00
|
|
|
aboutData.addAuthor("Alessandro Praduroux", I18N_NOOP("KDE4 porting"), "pradu@pradu.it");
|
|
|
|
|
aboutData.addAuthor("Tim Jansen", "", "tim@tjansen.de");
|
|
|
|
|
aboutData.addAuthor("Ian Reinhart Geiser", I18N_NOOP("DCOP interface"), "geiseri@kde.org");
|
2002-03-10 23:22:25 +00:00
|
|
|
aboutData.addCredit("Johannes E. Schindelin",
|
2002-02-04 22:54:01 +00:00
|
|
|
I18N_NOOP("libvncserver"));
|
2002-03-11 00:04:38 +00:00
|
|
|
aboutData.addCredit("Const Kaplinsky",
|
2002-02-04 22:54:01 +00:00
|
|
|
I18N_NOOP("TightVNC encoder"));
|
2002-03-11 00:04:38 +00:00
|
|
|
aboutData.addCredit("Tridia Corporation",
|
2002-02-04 22:54:01 +00:00
|
|
|
I18N_NOOP("ZLib encoder"));
|
2002-03-10 23:22:25 +00:00
|
|
|
aboutData.addCredit("AT&T Laboratories Cambridge",
|
2002-02-04 22:54:01 +00:00
|
|
|
I18N_NOOP("original VNC encoders and "
|
|
|
|
|
"protocol design"));
|
2002-03-11 00:04:38 +00:00
|
|
|
aboutData.addCredit("Jens Wagner (heXoNet Support GmbH)",
|
2002-04-03 22:04:05 +00:00
|
|
|
I18N_NOOP("X11 update scanner, "
|
2002-02-04 22:54:01 +00:00
|
|
|
"original code base"));
|
2002-03-10 23:22:25 +00:00
|
|
|
aboutData.addCredit("Jason Spisak",
|
|
|
|
|
I18N_NOOP("Connection side image"),
|
2002-01-03 23:41:05 +00:00
|
|
|
"kovalid@yahoo.com");
|
2003-01-16 20:23:26 +00:00
|
|
|
aboutData.addCredit("Karl Vogel",
|
|
|
|
|
I18N_NOOP("KDesktop background deactivation"));
|
2001-12-19 20:35:12 +00:00
|
|
|
KCmdLineArgs::init(argc, argv, &aboutData);
|
2001-12-08 02:23:04 +00:00
|
|
|
|
2002-04-02 22:42:10 +00:00
|
|
|
KApplication app;
|
2001-12-16 19:55:13 +00:00
|
|
|
|
2007-03-30 21:54:18 +00:00
|
|
|
TrayIcon trayicon(new ManageInvitationsDialog);
|
2007-04-04 14:57:27 +00:00
|
|
|
|
|
|
|
|
KrfbServer *server = KrfbServer::self(); // initialize the server manager
|
2007-04-12 16:12:37 +00:00
|
|
|
if (!server->checkX11Capabilities()) {
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2001-12-19 20:35:12 +00:00
|
|
|
|
2002-04-16 22:37:40 +00:00
|
|
|
QObject::connect(&trayicon, SIGNAL(enableDesktopControl(bool)),
|
2007-04-04 14:57:27 +00:00
|
|
|
server, SLOT(enableDesktopControl(bool)));
|
|
|
|
|
QObject::connect(server, SIGNAL(sessionEstablished(QString)),
|
2002-12-26 02:55:34 +00:00
|
|
|
&trayicon, SLOT(showConnectedMessage(QString)));
|
2007-04-04 14:57:27 +00:00
|
|
|
QObject::connect(server, SIGNAL(sessionFinished()),
|
2002-04-13 15:07:01 +00:00
|
|
|
&trayicon, SLOT(showDisconnectedMessage()));
|
2007-04-04 14:57:27 +00:00
|
|
|
QObject::connect(server, SIGNAL(desktopControlSettingChanged(bool)),
|
2002-05-23 23:13:49 +00:00
|
|
|
&trayicon, SLOT(setDesktopControlSetting(bool)));
|
2007-04-18 21:42:12 +00:00
|
|
|
QObject::connect(&trayicon, SIGNAL(quitSelected()),
|
2007-04-04 14:57:27 +00:00
|
|
|
server, SLOT(disconnectAndQuit()));
|
|
|
|
|
QObject::connect(server, SIGNAL(quitApp()),
|
2007-03-29 20:54:53 +00:00
|
|
|
&app, SLOT(quit()));
|
|
|
|
|
|
2002-01-09 23:15:05 +00:00
|
|
|
sigset_t sigs;
|
|
|
|
|
sigemptyset(&sigs);
|
|
|
|
|
sigaddset(&sigs, SIGPIPE);
|
|
|
|
|
sigprocmask(SIG_BLOCK, &sigs, 0);
|
2002-03-02 18:24:40 +00:00
|
|
|
|
2001-12-11 20:29:19 +00:00
|
|
|
return app.exec();
|
2001-12-08 02:23:04 +00:00
|
|
|
}
|
2002-03-19 00:03:39 +00:00
|
|
|
|