+presencevnc (0.4) unstable; urgency=low
+
+ *
+
+ -- Christian Pulvermacher <pulvermacher@gmx.de> Sat, 07 Aug 2010 11:52:56 +0200
+
presencevnc (0.3) unstable; urgency=low
* Compatibility fix for RealVNC Personal/Enterprise
#currently builds a maemo-only package
#comment this line for quick builds
-buildlibs=foo
+#buildlibs=foo
SOURCEDIR=./
BUILDDIR=debian/build/
rm -f build
[ ! -f Makefile ] || $(MAKE) clean
ifdef buildlibs
- [ ! -f libvnc/Makefile ] || cd libvnc && make clean
+ [ ! -f libvnc/Makefile ] || ( cd libvnc && make clean )
endif
dh_clean
rm -rf ${BUILDDIR}
configure:26995: result: yes
configure:27002: checking for _doprnt
configure:27059: gcc -o conftest -g -O2 conftest.c -lpthread -lz -ljpeg >&5
-/tmp/cc4Tdnej.o: In function `main':
+/tmp/ccOMucA4.o: In function `main':
/home/christian/presencevnc/libvnc/conftest.c:91: undefined reference to `_doprnt'
-/tmp/cc4Tdnej.o:(.data+0x0): undefined reference to `_doprnt'
+/tmp/ccOMucA4.o:(.data+0x0): undefined reference to `_doprnt'
collect2: ld returned 1 exit status
configure:27065: $? = 1
configure: failed program was:
--- /dev/null
+/*
+ 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 <QtGui>
+
+#include "connectdialog.h"
+
+
+ConnectDialog::ConnectDialog(QWidget *parent):
+ QDialog(parent)
+{
+ setWindowTitle("Connect to Host");
+ QSettings settings;
+
+ QHBoxLayout *layout1 = new QHBoxLayout();
+ QVBoxLayout *layout2 = new QVBoxLayout();
+
+ hostname = new QLineEdit(settings.value("last_hostname", "").toString(), this);
+ hostname->setInputMethodHints(Qt::ImhLowercaseOnly);
+ layout2->addWidget(hostname);
+
+ QPushButton *ok = new QPushButton("Done");
+ ok->setMaximumWidth(100);
+
+ layout1->addLayout(layout2);
+ layout1->addWidget(ok);
+
+ setLayout(layout1);
+
+ connect(ok, SIGNAL(clicked()),
+ this, SLOT(accept()));
+}
+
+QString ConnectDialog::getUrl()
+{
+ QSettings settings;
+ settings.setValue("last_hostname", hostname->text());
+ settings.sync();
+
+ return QString("vnc://") + hostname->text();
+}
--- /dev/null
+/*
+ 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 CONNECTDIALOG_H
+#define CONNECTDIALOG_H
+
+#include <QtGui>
+
+class ConnectDialog : public QDialog {
+ Q_OBJECT
+public:
+ ConnectDialog(QWidget *parent);
+ QString getUrl();
+private:
+ QLineEdit *hostname;
+};
+#endif
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include "connectdialog.h"
#include "mainwindow.h"
#include "preferences.h"
#include "vncview.h"
//set up toolbar
toolbar = new QToolBar(0);
- //toolbar->setAttribute(Qt::WA_InputMethodEnabled, true);
toolbar->addAction("Mod", this, SLOT(showModifierMenu()));
toolbar->addAction("Tab", this, SLOT(sendTab()));
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", this, SLOT(showInputPanel()));
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());
connect(pref_action, SIGNAL(triggered()),
this, SLOT(showPreferences()));
connect(connect_action, SIGNAL(triggered()),
- this, SLOT(connectDialog()));
+ this, SLOT(showConnectDialog()));
connect(disconnect_action, SIGNAL(triggered()),
this, SLOT(disconnectFromHost()));
connect(show_toolbar, SIGNAL(toggled(bool)),
if(url.isNull()) {
disconnect_action->setEnabled(false);
toolbar->setEnabled(false);
- connectDialog();
+ showConnectDialog();
} else {
vnc_view = new VncView(this, url, RemoteView::Quality(quality));
connect(scaling, SIGNAL(toggled(bool)),
void MainWindow::about() {
QMessageBox::about(this, tr("About Presence VNC"),
- tr("<center><h1>Presence VNC 0.3</h1>\
+ tr("<center><h1>Presence VNC 0.4</h1>\
A touchscreen friendly VNC client\
<small><p>©2010 Christian Pulvermacher <pulvermacher@gmx.de></p>\
<p>Based on KRDC, © 2007-2008 Urs Wolfer</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>"));
}
-void MainWindow::connectDialog()
+void MainWindow::showConnectDialog()
{
+ /*
QSettings settings;
QString url = QInputDialog::getText(this, "Connect to Host", "VNC Server:", QLineEdit::Normal, settings.value("last_hostname", "").toString());
if(url.isEmpty()) { //dialog dismissed or nothing entered
return;
}
- settings.setValue("last_hostname", url);
- url = "vnc://" + url;
+ */
+
+ ConnectDialog *connect_dialog = new ConnectDialog(this);
+ if(!connect_dialog->exec()) { //dialog rejected
+ delete connect_dialog;
+ return;
+ }
+
+ QString url = connect_dialog->getUrl();
+ delete connect_dialog;
disconnectFromHost();
if(vnc_view)
vnc_view->reloadSettings();
}
+
+void MainWindow::showInputPanel()
+{
+ vnc_view->setAttribute(Qt::WA_InputMethodEnabled, true);
+ QEvent event(QEvent::RequestSoftwareInputPanel);
+ QApplication::sendEvent(vnc_view, &event);
+}
MainWindow(QString url, int quality);
public slots:
void about();
- void connectDialog();
+ void showConnectDialog();
void disconnectFromHost();
void forceResize();
void forceResizeDelayed();
void sendEsc() { vnc_view->sendKey(Qt::Key_Escape); }
void sendPgUp() { vnc_view->sendKey(Qt::Key_PageUp); }
void sendPgDn() { vnc_view->sendKey(Qt::Key_PageDown); }
+ void showInputPanel();
void showModifierMenu();
void showPreferences();
void statusChanged(RemoteView::RemoteStatus status);
void toggleFullscreen();
protected:
- //virtual bool event(QEvent *event);
void closeEvent(QCloseEvent*);
private:
void grabZoomKeys(bool grab);
void reloadSettings();
VncView *vnc_view;
QScrollArea *scroll_area;
- //QWidget *menu;
QToolBar *toolbar;
- //QPoint swipe_start;
QAction *scaling;
QAction *disconnect_action;
};
disable_tapping->setChecked(settings.value("disable_tapping", false).toBool());
layout2->addWidget(disable_tapping);
- QPushButton *ok = new QPushButton("OK");
+ QPushButton *ok = new QPushButton("Done");
ok->setMaximumWidth(100);
layout1->addLayout(layout2);
event->type() == QEvent::MouseMove)
return true;
}
+ if(event->type() == 200)
+ kDebug(5011) << "eventFilter: 200";
return RemoteView::eventFilter(obj, event);
}
wheelEventHandler(static_cast<QWheelEvent*>(event));
return true;
break;
+ case QEvent::WindowActivate: //input panel may have been closed, prevent IM from interfering with hardware keyboard
+ setAttribute(Qt::WA_InputMethodEnabled, false);
+ //fall through
default:
return RemoteView::event(event);
}
static QTime press_time;
static QTime up_time; //used for double clicks/tap&drag, for time after first tap
- const int TAP_PRESS_TIME = 200;
+ const int TAP_PRESS_TIME = 180;
const int DOUBLE_TAP_UP_TIME = 500;
if(!e) { //flush held taps
current_zoom = right_zoom;
else if (k)
vncThread.keyEvent(k, pressed);
+ else {
+ kDebug(5011) << "nativeVirtualKey() for '" << e->text() << "' failed.";
+ return;
+ }
if(current_zoom == -1)
return;
disable_tapping = settings.value("disable_tapping", false).toBool();
}
+//convert commitString into keyevents
+void VncView::inputMethodEvent(QInputMethodEvent *event)
+{
+ //TODO handle replacements
+ //TODO convert utf8 to X11 keysyms myself, should work with umlauts, kana...
+ //TODO Enter?
+ QString letters = event->commitString();
+ for(int i = 0; i < letters.length(); i++) {
+ char k = letters.at(i).toLatin1(); //works with all 'normal' keys, not umlauts.
+ if(!k) {
+ kDebug(5011) << "unhandled key";
+ continue;
+ }
+ vncThread.keyEvent(k, true);
+ vncThread.keyEvent(k, false);
+ }
+}
+
#include "moc_vncview.cpp"
bool event(QEvent *event);
void resizeEvent(QResizeEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
+ void inputMethodEvent(QInputMethodEvent *event);
private:
VncClientThread vncThread;
VPATH = $${PWD}/src
INCLUDEPATH = $${PWD}/src
-HEADERS += remoteview.h vncclientthread.h vncview.h mainwindow.h preferences.h
-SOURCES += main.cpp remoteview.cpp vncclientthread.cpp vncview.cpp mainwindow.cpp preferences.cpp
+HEADERS += remoteview.h vncclientthread.h vncview.h mainwindow.h preferences.h connectdialog.h
+SOURCES += main.cpp remoteview.cpp vncclientthread.cpp vncview.cpp mainwindow.cpp preferences.cpp connectdialog.cpp