1
0
mirror of https://invent.kde.org/network/krfb synced 2024-07-01 07:24:29 +00:00

Last before version

svn path=/trunk/kdenetwork/krfb/; revision=128023
This commit is contained in:
Tim Jansen 2001-12-20 03:48:30 +00:00
parent dbda058e7f
commit f271e5c9ec
6 changed files with 50 additions and 18 deletions

2
TODO
View File

@ -1,6 +1,4 @@
Todo:
- idle singleton to destroy XTest resources
- i18n (0.2)

View File

@ -1,4 +1,6 @@
METASOURCES = AUTO
KDE_ICON = AUTO
POFILES=AUTO
bin_PROGRAMS = krfb
krfb_SOURCES = rfbcontroller.cc configuration.cc trayicon.cpp XUpdateScanner.cc rfbconnection.cc main.cpp configurationdialog.ui newconnectiondialog.ui
@ -17,15 +19,15 @@ install-data-local:
$(INSTALL_DATA) $(srcdir)/lo16-app-krfb.png $(kde_icondir)/locolor/16x16/apps/krfb.png
$(mkinstalldirs) $(kde_datadir)/krfb/pics
$(INSTALL_DATA) $(srcdir)/eyes-closed24.png $(kde_datadir)/krfb/pics/eyes-closed24.png
$(mkinstalldirs) $(kde_datadir)/krfb/pics
$(INSTALL_DATA) $(srcdir)/eyes-open24.png $(kde_datadir)/krfb/pics/eyes-open24.png
$(INSTALL_DATA) $(srcdir)/connection-side-image.png $(kde_datadir)/krfb/pics/connection-side-image.png
uninstall-local:
-rm -f $(kde_appsdir)/Applications/krfb.desktop
-rm -f $(kde_icondir)/locolor/32x32/apps/krfb.png
-rm -f $(kde_icondir)/locolor/16x16/apps/krfb.png
-rm -f $(kde_datadir)/krfb/pics
-rm -f $(kde_datadir)/krfb/pics
-rm -f $(kde_datadir)/krfb/pics/eyes-open24.png
-rm -f $(kde_datadir)/krfb/pics/eyes-closed24.png
# this 10 paths are KDE specific. Use them:
# kde_htmldir Where your docs should go to. (contains lang subdirs)
@ -51,6 +53,8 @@ krfb_LDFLAGS = $(all_libraries) $(KDE_RPATH) -lXtst
#rcdir = $(kde_datadir)/krfb
#rc_DATA = krfbui.rc
podir = ../po
messages:
LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \
if test -n "$$LIST"; then \

View File

@ -44,12 +44,12 @@ static const char *description = I18N_NOOP("RFB (VNC) Server to share "
static KCmdLineOptions options[] =
{
{ "p ", 0, 0},
{ ARG_PORT " ", I18N_NOOP("Set the display number the server is listening on."), "0"},
{ "p", 0, 0},
{ ARG_PORT " ", I18N_NOOP("Set the port number the server is listening on."), "0"},
{ "o", 0, 0},
{ ARG_ONE_SESSION, I18N_NOOP("Terminate when the first session is finished."), 0},
{ "w ", 0, 0},
{ ARG_PASSWORD " ", I18N_NOOP("Set the password."), 0},
{ "w", 0, 0},
{ ARG_PASSWORD " ", I18N_NOOP("Set the password."), ""},
{ "d", 0, 0},
{ ARG_DONT_CONFIRM_CONNECT, I18N_NOOP("Allow connections without asking the user."), 0},
{ "c", 0, 0},
@ -86,10 +86,10 @@ int main(int argc, char *argv[])
"(c) 2000, heXoNet Support GmbH, D-66424 Homburg\n"
"(c) 2001, Tim Jansen", 0, "http://www.tjansen.de/krfb",
"ml@tjansen.de");
aboutData.addAuthor("Tim Jansen", "KDE Port", "tim@tjansen.de");
aboutData.addAuthor("Jens Wagner (heXoNet Support GmbH)",
"RFB library, original x0rfbserver",
"");
aboutData.addAuthor("Tim Jansen", "KDE Port", "tim@tjansen.de");
KCmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions(options);
@ -139,9 +139,9 @@ int main(int argc, char *argv[])
&trayicon, SLOT(openConnection()));
if (config->oneConnection()) {
QObject::connect(&controller, SIGNAL(sessionRefused()),
&controller, SLOT(quit()));
&app, SLOT(quit()));
QObject::connect(&controller, SIGNAL(sessionFinished()),
&trayicon, SLOT(quit()));
&app, SLOT(quit()));
} else {
QObject::connect(&controller, SIGNAL(sessionFinished()),
&trayicon, SLOT(closeConnection()));

View File

@ -24,11 +24,13 @@
#include <kdebug.h>
#include <qapplication.h>
#include <qtimer.h>
#include <X11/Xutil.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
static XTestDisabler disabler;
RFBConnection::RFBConnection(Display *_dpy,
int _fd,
@ -51,6 +53,8 @@ RFBConnection::RFBConnection(Display *_dpy,
connection = bufferedConnection;
XTestGrabControl(dpy, true);
disabler.disable = false;
createFramebuffer();
InitBlocks(32, 32);
@ -62,9 +66,11 @@ RFBConnection::~RFBConnection() {
DeleteBlocks();
destroyFramebuffer();
// XTestDiscard(dpy); // (makes problems with Qt??)
delete bufferedConnection;
disabler.disable = true;
disabler.dpy = dpy;
QTimer::singleShot(0, &disabler, SLOT(exec()));
}
void RFBConnection::handleKeyEvent(KeyEvent &keyEvent) {
@ -172,4 +178,13 @@ void RFBConnection::getServerInitialisation( ServerInitialisation &_serverInit )
strcpy( (char*) _serverInit.name_string, getenv( "HOSTNAME" ) );
}
XTestDisabler::XTestDisabler() :
disable(false) {
}
void XTestDisabler::exec() {
if (disable)
XTestDiscard(dpy);
}
#include "rfbconnection.moc"

View File

@ -76,4 +76,18 @@ private:
XImage *framebufferImage;
};
/*
* Class to calls XTestDiscard at idle time (because otherwise
* it will not work with QT)
*/
class XTestDisabler : public QObject {
Q_OBJECT
public:
XTestDisabler();
bool disable;
Display *dpy;
public slots:
void exec();
};
#endif

View File

@ -16,7 +16,7 @@
***************************************************************************/
#include "trayicon.h"
#include <kdebug.h>
#include <kapplication.h>
#include <klocale.h>
#include <kdialog.h>
#include <kglobal.h>
@ -25,14 +25,14 @@
TrayIcon::TrayIcon(KDialog *d, Configuration *c) :
KSystemTray(),
aboutDialog(d)
aboutDialog(d)
{
KIconLoader *loader = KGlobal::iconLoader();
trayIconOpen = loader->loadIcon("eyes-open24", KIcon::User);
trayIconClosed = loader->loadIcon("eyes-closed24", KIcon::User);
setPixmap(trayIconClosed);
configureAction = new KAction(i18n("&Configure KRfb"));
configureAction = new KAction(i18n("&Configure KRfb..."));
if (!c->preconfigured())
configureAction->plug(contextMenu());
@ -41,7 +41,8 @@ TrayIcon::TrayIcon(KDialog *d, Configuration *c) :
closeConnectionAction->setEnabled(false);
contextMenu()->insertSeparator();
aboutAction = new KAction(i18n("&About KRfb"));
aboutAction = new KAction(i18n("&About KRfb"),
KApplication::kApplication()->instanceName());
aboutAction->plug(contextMenu());
connect(configureAction, SIGNAL(activated()), SIGNAL(showConfigure()));
connect(aboutAction, SIGNAL(activated()), SLOT(showAbout()));