From 923f244f93a28b8be9f00d02242ce80ae35354d2 Mon Sep 17 00:00:00 2001 From: christian Date: Sun, 1 Aug 2010 18:40:54 +0200 Subject: [PATCH] remove connect/disconnect items because of crash --- debian/changelog | 2 +- debian/control | 11 +++++++++-- src/mainwindow.cpp | 31 ++++++++++++++++++------------- src/vncview.cpp | 4 ++-- vnc.pro | 2 +- 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3cbbb87..e608596 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,4 +2,4 @@ presencevnc (0.1) unstable; urgency=low * Initial release. - -- Christian Pulvermacher Sun, 11 Jul 2010 22:21:32 +0200 + -- Christian Pulvermacher Sun, 01 Aug 2010 18:39:23 +0200 diff --git a/debian/control b/debian/control index abb8cc7..3d66ec3 100644 --- a/debian/control +++ b/debian/control @@ -9,8 +9,15 @@ Standards-Version: 3.7.3 Package: presencevnc Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, mce -Description: A touch-screen friendly VNC client - more text here +Description: A touchscreen friendly VNC client + Features: + * Viewport can be dragged around without using scrollbars + * Touchpad-like mouse input: Tap the screen for a single + click, tap twice for a double click, single tap plus + dragging motion to drag objects on the remote desktop + * Fit remote desktop to screen + * Configurable zoom buttons + * Portrait mode support XB-Maemo-Display-Name: Presence VNC #XSBC-Bugtracker: XB-Maemo-Icon-26: diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 70ebb9c..f6e1f1e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -28,7 +28,7 @@ MainWindow::MainWindow(QString url, int quality): toolbar->addAction("Esc", this, SLOT(sendEsc())); toolbar->addAction("PgUp", this, SLOT(sendPgUp())); toolbar->addAction("PgDn", this, SLOT(sendPgDn())); - toolbar->addAction("IM", toolbar, SLOT(setFocus())); //doesn't work +// toolbar->addAction("IM", toolbar, SLOT(setFocus())); //doesn't work toolbar->addAction(QIcon("/usr/share/icons/hicolor/48x48/hildon/general_fullsize.png"), "", this, SLOT(toggleFullscreen())); addToolBar(toolbar); toolbar->setVisible(settings.value("show_toolbar", true).toBool()); @@ -37,9 +37,9 @@ MainWindow::MainWindow(QString url, int quality): QMenuBar *menu = new QMenuBar(this); QAction *connect_action = new QAction("Connect", this); disconnect_action = new QAction("Disconnect", this); - menu->addAction(connect_action); - menu->addAction(disconnect_action); - scaling = new QAction("Rescale Remote Screen", this); +// menu->addAction(connect_action); +// menu->addAction(disconnect_action); + scaling = new QAction("Fit to Screen", this); scaling->setCheckable(true); scaling->setChecked(settings.value("rescale", true).toBool()); menu->addAction(scaling); @@ -81,7 +81,7 @@ MainWindow::MainWindow(QString url, int quality): toolbar->setEnabled(false); connectDialog(); } else { - vnc_view = new VncView(0, url, RemoteView::Quality(quality)); + vnc_view = new VncView(this, url, RemoteView::Quality(quality)); connect(scaling, SIGNAL(toggled(bool)), vnc_view, SLOT(enableScaling(bool))); connect(vnc_view, SIGNAL(statusChanged(RemoteView::RemoteStatus)), @@ -90,6 +90,9 @@ MainWindow::MainWindow(QString url, int quality): vnc_view->start(); vnc_view->enableScaling(scaling->isChecked()); } + + if(!vnc_view) //not connected + QTimer::singleShot(100, this, SLOT(close())); } void MainWindow::grabZoomKeys(bool grab) @@ -119,8 +122,8 @@ void MainWindow::closeEvent(QCloseEvent*) { void MainWindow::about() { QMessageBox::about(this, tr("About Presence VNC"), - tr("

Presence VNC 0.1 beta

\ -A touch screen friendly VNC client\ + tr("

Presence VNC 0.1

\ +A touchscreen friendly VNC client\

©2010 Christian Pulvermacher <pulvermacher@gmx.de>

\

Based on KRDC, © 2007-2008 Urs Wolfer

\

This program is free software; License: GNU GPL 2 or later.

")); @@ -165,7 +168,7 @@ void MainWindow::connectDialog() disconnectFromHost(); - vnc_view = new VncView(0, url, RemoteView::Quality(2)); //TODO: get quality in dialog + vnc_view = new VncView(this, url, RemoteView::Quality(2)); //TODO: get quality in dialog scroll_area->setWidget(vnc_view); connect(scaling, SIGNAL(toggled(bool)), @@ -183,12 +186,13 @@ void MainWindow::disconnectFromHost() if(!vnc_view) return; - vnc_view->startQuitting(); - scroll_area->setWidget(0); +//TODO: crashes when deleting vnc_view - no idea why + //vnc_view->startQuitting(); + //scroll_area->setWidget(0); - vnc_view->disconnect(); //remove all connections - delete vnc_view; - vnc_view = 0; +// vnc_view->disconnect(); //remove all connections + //delete vnc_view; + //vnc_view = 0; disconnect_action->setEnabled(false); toolbar->setEnabled(false); } @@ -207,6 +211,7 @@ void MainWindow::statusChanged(RemoteView::RemoteStatus status) case RemoteView::Disconnecting: if(old_status != RemoteView::Disconnected) { //Disconnecting also occurs while connecting, so check last state QMaemo5InformationBox::information(this, "Connection lost"); + close(); } break; case RemoteView::Disconnected: diff --git a/src/vncview.cpp b/src/vncview.cpp index 38836d5..d21a4cd 100644 --- a/src/vncview.cpp +++ b/src/vncview.cpp @@ -608,11 +608,11 @@ void VncView::keyEventHandler(QKeyEvent *e) m_buttonMask &= 0xfb; vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask); } else if(current_zoom == 2 and pressed) { //wheel up - int eb = 0x10; + int eb = 0x8; vncThread.mouseEvent(cursor_x, cursor_y, eb | m_buttonMask); vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask); } else if(current_zoom == 3 and pressed) { //wheel down - int eb = 0x8; + int eb = 0x10; vncThread.mouseEvent(cursor_x, cursor_y, eb | m_buttonMask); vncThread.mouseEvent(cursor_x, cursor_y, m_buttonMask); } else if(current_zoom == 4) { //page up diff --git a/vnc.pro b/vnc.pro index 3edce47..e4ef7b2 100644 --- a/vnc.pro +++ b/vnc.pro @@ -3,7 +3,7 @@ TARGET = presencevnc-bin LIBS += -Llibvnc/libvncclient/.libs -lvncclient DEFINES += QTONLY QT += maemo5 -CONFIG += silent debug +CONFIG += silent release OBJECTS_DIR = $${PWD}/tmp MOC_DIR = $${PWD}/tmp -- 1.7.9.5