From: Christian Pulvermacher
Date: Fri, 26 Nov 2010 17:24:26 +0000 (+0100)
Subject: add quality field for non-maemo enviroments
X-Git-Tag: 0.8~40
X-Git-Url: https://vcs.maemo.org/git/?p=presencevnc;a=commitdiff_plain;h=f2329fd841a37dd62c55d60b5f89b9be200fb4dd
add quality field for non-maemo enviroments
---
diff --git a/src/connectdialog.cpp b/src/connectdialog.cpp
index fa595f7..9c21d24 100644
--- a/src/connectdialog.cpp
+++ b/src/connectdialog.cpp
@@ -16,6 +16,10 @@
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 "rfb/rfbclient.h"
+
#include
#ifdef Q_WS_MAEMO_5
@@ -23,9 +27,6 @@
#include
#endif
-#include "connectdialog.h"
-#include "rfb/rfbclient.h"
-
const QString LISTEN_FOR_INCOMING_CONNECTIONS_STRING = QObject::tr("Listen for incoming connections");
@@ -75,9 +76,16 @@ ConnectDialog::ConnectDialog(QWidget *parent):
quality->setValueLayout(QMaemo5ValueButton::ValueUnderText);
quality->setMaximumWidth(120);
layout.addWidget(quality);
+#else
+ //combobox numbering starts from 0, so currentIndex() == quality-1
+ quality_combobox.addItem(tr("High quality (LAN)")); //1
+ quality_combobox.addItem(tr("Medium quality (DSL)")); //2
+ quality_combobox.addItem(tr("Low quality (ISDN)")); //3
+ //quality_combobox.setMaximumWidth(120);
+ layout.addWidget(&quality_combobox);
+#endif
hostnameUpdated(hosts.lineEdit()->text()); //get saved quality for last host, or 2
-#endif
done->setText(tr("Connect"));
done->setMaximumWidth(110);
@@ -113,13 +121,15 @@ void ConnectDialog::hostnameUpdated(QString newtext)
hosts.lineEdit()->setText(newtext);
hosts.lineEdit()->setCursorPosition(cursorpos);
-#ifdef Q_WS_MAEMO_5
//saved quality setting available?
QSettings settings;
int quality = settings.value(QString("hosts/%1/quality").arg(hosts.lineEdit()->text()), 2).toInt();
if(quality < 1 or quality > 3)
quality = 2;
+#ifdef Q_WS_MAEMO_5
quality_selector->setCurrentIndex(quality-1);
+#else
+ quality_combobox.setCurrentIndex(quality-1);
#endif
}
@@ -135,7 +145,7 @@ void ConnectDialog::accept()
#ifdef Q_WS_MAEMO_5
int quality = quality_selector->currentIndex() + 1;
#else
- int quality = 2;
+ int quality = quality_combobox.currentIndex() + 1;
#endif
QSettings settings;
diff --git a/src/connectdialog.h b/src/connectdialog.h
index 58b4904..98bcd3f 100644
--- a/src/connectdialog.h
+++ b/src/connectdialog.h
@@ -22,6 +22,7 @@
#include
+
class QMaemo5ListPickSelector;
class ConnectDialog : public QDialog {
@@ -39,6 +40,11 @@ private:
QStringList hostnames_sorted;
QPushButton *done;
QComboBox hosts;
+
+#ifdef Q_WS_MAEMO_5
QMaemo5ListPickSelector *quality_selector;
+#else
+ QComboBox quality_combobox;
+#endif
};
#endif
diff --git a/www/index.html b/www/index.html
index c3d85bb..5f09273 100644
--- a/www/index.html
+++ b/www/index.html
@@ -48,7 +48,8 @@ Presence VNC can be
Enter the hostname or IP address of the computer running the VNC server.
You can specify the display number after a colon. (e.g.: hostname:1)
-If no display is given, 0 will be assumed. (A number ≥100 will be interpreted as a port number. Otherwise, Presence VNC will connect to port 5900 + display.)
+If no display is given, 0 will be assumed.
+(A number ≥100 will be interpreted as a port number. Otherwise, Presence VNC will connect to port 5900 + display.)
Pressing the arrow symbol next to the input field will bring up the list of recently used hosts.
Additionally, you can select the Listen for incoming connections option to accept a "reverse" connection from the server.