dismissing pw dialog now closes program
authorchristian <christian@christian-laptop.(none)>
Tue, 3 Aug 2010 20:26:34 +0000 (22:26 +0200)
committerchristian <christian@christian-laptop.(none)>
Tue, 3 Aug 2010 20:26:34 +0000 (22:26 +0200)
13 files changed:
debian/changelog
debian/copyright
debian/rules
libvnc/config.log
presencevnc.desktop
src/main.cpp
src/mainwindow.cpp
src/mainwindow.h
src/preferences.cpp
src/vncclientthread.cpp
src/vncview.cpp
src/vncview.h
vnc.pro

index 4a35165..fd0fd49 100644 (file)
@@ -1,3 +1,9 @@
+presencevnc (0.3) unstable; urgency=low
+
+  * Compatibility fix for RealVNC Personal/Enterprise
+
+ -- Christian Pulvermacher <pulvermacher@gmx.de>  Tue, 03 Aug 2010 18:35:57 +0200
+
 presencevnc (0.2) unstable; urgency=low
 
   * Add dependency on libjpeg
 presencevnc (0.2) unstable; urgency=low
 
   * Add dependency on libjpeg
index e73b00d..9b5b88b 100644 (file)
@@ -5,6 +5,10 @@ Author: Christian Pulvermacher
 
 Copyright (c) 2010 Christian Pulvermacher
 
 
 Copyright (c) 2010 Christian Pulvermacher
 
+Based on
+KRDC, Copyright (c) 2007-2008 Urs Wolfer
+LibVNCServer, Copyright (c) 2001-2003 Johannes E. Schindelin
+
 Icon derived from Crystal Project Icons, Copyright (c) 2006-2007 Everaldo Coelho, LGPL
 
 
 Icon derived from Crystal Project Icons, Copyright (c) 2006-2007 Everaldo Coelho, LGPL
 
 
index 0af3df8..0d0166c 100755 (executable)
@@ -5,7 +5,7 @@ export DH_VERBOSE=1
 #currently builds a maemo-only package
 
 #comment this line for quick builds
 #currently builds a maemo-only package
 
 #comment this line for quick builds
-buildlibs=foo
+#buildlibs=foo
 
 SOURCEDIR=./
 BUILDDIR=debian/build/
 
 SOURCEDIR=./
 BUILDDIR=debian/build/
@@ -42,7 +42,7 @@ binary-arch: build install
        dh_testroot
        dh_installdocs
        dh_installchangelogs
        dh_testroot
        dh_installdocs
        dh_installchangelogs
-       dh_strip
+       #dh_strip
        dh_compress
        dh_fixperms
        dh_installdeb
        dh_compress
        dh_fixperms
        dh_installdeb
index af6361a..007f7dc 100644 (file)
@@ -1383,9 +1383,9 @@ configure:26983: $? = 0
 configure:26995: result: yes
 configure:27002: checking for _doprnt
 configure:27059: gcc -o conftest -g -O2   conftest.c -lpthread -lz -ljpeg  >&5
 configure:26995: result: yes
 configure:27002: checking for _doprnt
 configure:27059: gcc -o conftest -g -O2   conftest.c -lpthread -lz -ljpeg  >&5
-/tmp/ccYsUjHg.o: In function `main':
+/tmp/cc6wOTSk.o: In function `main':
 /home/christian/presencevnc/libvnc/conftest.c:91: undefined reference to `_doprnt'
 /home/christian/presencevnc/libvnc/conftest.c:91: undefined reference to `_doprnt'
-/tmp/ccYsUjHg.o:(.data+0x0): undefined reference to `_doprnt'
+/tmp/cc6wOTSk.o:(.data+0x0): undefined reference to `_doprnt'
 collect2: ld returned 1 exit status
 configure:27065: $? = 1
 configure: failed program was:
 collect2: ld returned 1 exit status
 configure:27065: $? = 1
 configure: failed program was:
index 40f5f50..5289328 100644 (file)
@@ -1,6 +1,6 @@
 [Desktop Entry]
 Name=Presence VNC
 [Desktop Entry]
 Name=Presence VNC
-Comment=A touch-screen friendly VNC client
+Comment=A touchscreen friendly VNC client
 Exec=presencevnc
 Icon=presencevnc
 Type=Application
 Exec=presencevnc
 Icon=presencevnc
 Type=Application
index 6e73cd6..ccb7dc2 100644 (file)
@@ -1,26 +1,21 @@
-/****************************************************************************
-**
-** Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org>
-**
-** This file is part of KDE.
-**
-** 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.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; see the file COPYING. If not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-** Boston, MA 02110-1301, USA.
-**
-****************************************************************************/
+/*
+    Presence VNC
+    Copyright (C) 2010 Christian Pulvermacher
 
 
+    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.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
 #include <QApplication>
 #include <QInputDialog>
 #include <QString>
 #include <QApplication>
 #include <QInputDialog>
 #include <QString>
@@ -33,7 +28,7 @@ int main(int argc, char *argv[])
        QCoreApplication::setApplicationName("Presence VNC");
 
        QApplication app(argc, argv);
        QCoreApplication::setApplicationName("Presence VNC");
 
        QApplication app(argc, argv);
-       app.setAutoSipEnabled(true);
+       //app.setAutoSipEnabled(true);
 
        QString url;
        int quality = 2;
 
        QString url;
        int quality = 2;
index ef629d6..a9e4828 100644 (file)
@@ -1,3 +1,21 @@
+/*
+    Presence VNC
+    Copyright (C) 2010 Christian Pulvermacher
+
+    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.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
 #include "mainwindow.h"
 #include "preferences.h"
 #include "vncview.h"
 #include "mainwindow.h"
 #include "preferences.h"
 #include "vncview.h"
@@ -123,8 +141,9 @@ void MainWindow::about() {
        QMessageBox::about(this, tr("About Presence VNC"),
                tr("<center><h1>Presence VNC 0.3</h1>\
 A touchscreen friendly VNC client\
        QMessageBox::about(this, tr("About Presence VNC"),
                tr("<center><h1>Presence VNC 0.3</h1>\
 A touchscreen friendly VNC client\
-<small><p>&copy;2010 Christian Pulvermacher &lt;pulvermacher@gmx.de&gt</p>\
-<p>Based on KRDC, &copy; 2007-2008 Urs Wolfer</small></center>\
+<small><p>&copy;2010 Christian Pulvermacher &lt;pulvermacher@gmx.de&gt;</p>\
+<p>Based on KRDC, &copy; 2007-2008 Urs Wolfer</p>\
+<p>and LibVNCServer, &copy; 2001-2003 Johannes E. Schindelin</p></small></center>\
 <p>This program is free software; License: <a href=\"http://www.gnu.org/licenses/gpl-2.0.html\">GNU GPL 2</a> or later.</p>"));
 }
 
 <p>This program is free software; License: <a href=\"http://www.gnu.org/licenses/gpl-2.0.html\">GNU GPL 2</a> or later.</p>"));
 }
 
@@ -158,13 +177,12 @@ void MainWindow::disconnectFromHost()
        if(!vnc_view)
                return;
 
        if(!vnc_view)
                return;
 
-//TODO: crashes when deleting vnc_view - no idea why
-       vnc_view->startQuitting();
+//     vnc_view->startQuitting();
        scroll_area->setWidget(0);
 
        scroll_area->setWidget(0);
 
-       vnc_view->disconnect(); //remove all connections
-       //delete vnc_view;
-       //vnc_view = 0;
+       vnc_view->disconnect(); //remove all signal-slot connections
+       delete vnc_view;
+       vnc_view = 0;
        disconnect_action->setEnabled(false);
        toolbar->setEnabled(false);
 }
        disconnect_action->setEnabled(false);
        toolbar->setEnabled(false);
 }
index f3451be..2801af4 100644 (file)
@@ -1,3 +1,21 @@
+/*
+    Presence VNC
+    Copyright (C) 2010 Christian Pulvermacher
+
+    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.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
 #ifndef MAINWINDOW_H
 #define MAINWINDOW_H
 
 #ifndef MAINWINDOW_H
 #define MAINWINDOW_H
 
index 9dc64ae..6c97a4f 100644 (file)
@@ -66,6 +66,7 @@ Preferences::Preferences(QWidget *parent):
        layout2->addWidget(rightzoom);
 
        QPushButton *ok = new QPushButton("OK");
        layout2->addWidget(rightzoom);
 
        QPushButton *ok = new QPushButton("OK");
+       ok->setMaximumWidth(100);
 
        layout1->addLayout(layout2);
        layout1->addWidget(ok);
 
        layout1->addLayout(layout2);
        layout1->addWidget(ok);
@@ -78,11 +79,7 @@ Preferences::Preferences(QWidget *parent):
                this, SLOT(save()));
 }
 
                this, SLOT(save()));
 }
 
-Preferences::~Preferences()
-{
-
-}
-
+Preferences::~Preferences() { }
 
 void Preferences::save()
 {
 
 void Preferences::save()
 {
index 49616fd..2d1fc9f 100644 (file)
@@ -173,10 +173,10 @@ VncClientThread::~VncClientThread()
 
     const bool quitSuccess = wait(500);
 
 
     const bool quitSuccess = wait(500);
 
-    kDebug(5011) << "Quit VNC thread success:" << quitSuccess;
+    kDebug(5011) << "~VncClientThread(): Quit VNC thread success:" << quitSuccess;
     
     delete [] frameBuffer;
     
     delete [] frameBuffer;
-    delete cl;
+    //cl is free()d when event loop exits.
 }
 
 void VncClientThread::checkOutputErrorMessage()
 }
 
 void VncClientThread::checkOutputErrorMessage()
@@ -241,7 +241,7 @@ void VncClientThread::emitGotCut(const QString &text)
 
 void VncClientThread::stop()
 {
 
 void VncClientThread::stop()
 {
-    QMutexLocker locker(&mutex);
+//TODO: not locking the mutex leads to a crash, but at least it stops.
     m_stopped = true;
 }
 
     m_stopped = true;
 }
 
@@ -250,6 +250,7 @@ void VncClientThread::run()
     QMutexLocker locker(&mutex);
 
     while (!m_stopped) { // try to connect as long as the server allows
     QMutexLocker locker(&mutex);
 
     while (!m_stopped) { // try to connect as long as the server allows
+           kDebug(5011) << "enter loop";
         m_passwordError = false;
 
         rfbClientLog = outputHandler;
         m_passwordError = false;
 
         rfbClientLog = outputHandler;
@@ -286,6 +287,7 @@ void VncClientThread::run()
 
     // Main VNC event loop
     while (!m_stopped) {
 
     // Main VNC event loop
     while (!m_stopped) {
+           kDebug(5011) << "entering main event loop";
         const int i = WaitForMessage(cl, 500);
         if (i < 0)
             break;
         const int i = WaitForMessage(cl, 500);
         if (i < 0)
             break;
index d21a4cd..51fbfa4 100644 (file)
@@ -54,7 +54,6 @@ VncView::VncView(QWidget *parent, const KUrl &url, RemoteView::Quality quality)
         m_repaint(false),
         m_quitFlag(false),
         m_firstPasswordTry(true),
         m_repaint(false),
         m_quitFlag(false),
         m_firstPasswordTry(true),
-        m_authenticaionCanceled(false),
         m_dontSendClipboard(false),
         m_horizontalFactor(1.0),
         m_verticalFactor(1.0),
         m_dontSendClipboard(false),
         m_horizontalFactor(1.0),
         m_verticalFactor(1.0),
@@ -83,10 +82,13 @@ VncView::~VncView()
     unpressModifiers();
 
     // Disconnect all signals so that we don't get any more callbacks from the client thread
     unpressModifiers();
 
     // Disconnect all signals so that we don't get any more callbacks from the client thread
+    vncThread.disconnect();
+    /*
     disconnect(&vncThread, SIGNAL(imageUpdated(int, int, int, int)), this, SLOT(updateImage(int, int, int, int)));
     disconnect(&vncThread, SIGNAL(gotCut(const QString&)), this, SLOT(setCut(const QString&)));
     disconnect(&vncThread, SIGNAL(passwordRequest()), this, SLOT(requestPassword()));
     disconnect(&vncThread, SIGNAL(outputErrorMessage(QString)), this, SLOT(outputErrorMessage(QString)));
     disconnect(&vncThread, SIGNAL(imageUpdated(int, int, int, int)), this, SLOT(updateImage(int, int, int, int)));
     disconnect(&vncThread, SIGNAL(gotCut(const QString&)), this, SLOT(setCut(const QString&)));
     disconnect(&vncThread, SIGNAL(passwordRequest()), this, SLOT(requestPassword()));
     disconnect(&vncThread, SIGNAL(outputErrorMessage(QString)), this, SLOT(outputErrorMessage(QString)));
+    */
 
     startQuitting();
 }
 
     startQuitting();
 }
@@ -177,7 +179,7 @@ void VncView::startQuitting()
 
     const bool quitSuccess = vncThread.wait(500);
 
 
     const bool quitSuccess = vncThread.wait(500);
 
-    kDebug(5011) << "Quit VNC thread success:" << quitSuccess;
+    kDebug(5011) << "startQuitting(): Quit VNC thread success:" << quitSuccess;
 
     setStatus(Disconnected);
 }
 
     setStatus(Disconnected);
 }
@@ -219,11 +221,6 @@ void VncView::requestPassword()
 {
     kDebug(5011) << "request password";
 
 {
     kDebug(5011) << "request password";
 
-    if (m_authenticaionCanceled) {
-        startQuitting();
-        return;
-    }
-
     setStatus(Authenticating);
 
     if (!m_url.password().isNull()) {
     setStatus(Authenticating);
 
     if (!m_url.password().isNull()) {
@@ -237,10 +234,11 @@ void VncView::requestPassword()
                                              tr("Please enter the password for the remote desktop:"),
                                              QLineEdit::Password, QString(), &ok);
     m_firstPasswordTry = false;
                                              tr("Please enter the password for the remote desktop:"),
                                              QLineEdit::Password, QString(), &ok);
     m_firstPasswordTry = false;
-    if (ok)
+    if (ok) {
         vncThread.setPassword(password);
         vncThread.setPassword(password);
-    else
-        m_authenticaionCanceled = true;
+    } else {
+        startQuitting();
+    }
 }
 
 void VncView::outputErrorMessage(const QString &message)
 }
 
 void VncView::outputErrorMessage(const QString &message)
index af5cc32..1f76385 100644 (file)
@@ -82,7 +82,6 @@ private:
     bool m_repaint;
     bool m_quitFlag;
     bool m_firstPasswordTry;
     bool m_repaint;
     bool m_quitFlag;
     bool m_firstPasswordTry;
-    bool m_authenticaionCanceled;
     bool m_dontSendClipboard;
     qreal m_horizontalFactor;
     qreal m_verticalFactor;
     bool m_dontSendClipboard;
     qreal m_horizontalFactor;
     qreal m_verticalFactor;
diff --git a/vnc.pro b/vnc.pro
index e4ef7b2..3edce47 100644 (file)
--- a/vnc.pro
+++ b/vnc.pro
@@ -3,7 +3,7 @@ TARGET = presencevnc-bin
 LIBS += -Llibvnc/libvncclient/.libs -lvncclient
 DEFINES += QTONLY
 QT += maemo5
 LIBS += -Llibvnc/libvncclient/.libs -lvncclient
 DEFINES += QTONLY
 QT += maemo5
-CONFIG += silent release
+CONFIG += silent debug
 
 OBJECTS_DIR = $${PWD}/tmp
 MOC_DIR = $${PWD}/tmp
 
 OBJECTS_DIR = $${PWD}/tmp
 MOC_DIR = $${PWD}/tmp