diff --git a/TODO b/TODO index 95ab3bf0..3ce56c7a 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,4 @@ Todo: -- idle singleton to destroy XTest resources - - i18n (0.2) diff --git a/krfb/Makefile.am b/krfb/Makefile.am index 6fe7ab91..8589ba3e 100644 --- a/krfb/Makefile.am +++ b/krfb/Makefile.am @@ -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 \ diff --git a/krfb/main.cpp b/krfb/main.cpp index 6efddf78..e26d4950 100644 --- a/krfb/main.cpp +++ b/krfb/main.cpp @@ -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())); diff --git a/krfb/rfbconnection.cc b/krfb/rfbconnection.cc index 74a04b7d..b89b8039 100644 --- a/krfb/rfbconnection.cc +++ b/krfb/rfbconnection.cc @@ -24,11 +24,13 @@ #include #include +#include #include #include #include #include +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" diff --git a/krfb/rfbconnection.h b/krfb/rfbconnection.h index 252fbdf8..5f7fa866 100644 --- a/krfb/rfbconnection.h +++ b/krfb/rfbconnection.h @@ -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 diff --git a/krfb/trayicon.cpp b/krfb/trayicon.cpp index 4cb2ec5e..2ed3c2c1 100644 --- a/krfb/trayicon.cpp +++ b/krfb/trayicon.cpp @@ -16,7 +16,7 @@ ***************************************************************************/ #include "trayicon.h" -#include +#include #include #include #include @@ -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()));