add quality field for non-maemo enviroments
authorChristian Pulvermacher <christian@hazel.(none)>
Fri, 26 Nov 2010 17:24:26 +0000 (18:24 +0100)
committerChristian Pulvermacher <christian@hazel.(none)>
Fri, 26 Nov 2010 17:24:26 +0000 (18:24 +0100)
src/connectdialog.cpp
src/connectdialog.h
www/index.html

index fa595f7..9c21d24 100644 (file)
     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 <QtGui>
 
 #ifdef Q_WS_MAEMO_5
@@ -23,9 +27,6 @@
 #include <QMaemo5ListPickSelector>
 #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;
index 58b4904..98bcd3f 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <QtGui>
 
+
 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
index c3d85bb..5f09273 100644 (file)
@@ -48,7 +48,8 @@ Presence VNC can be <a href="http://maemo.org/downloads/product/raw/Maemo5/prese
 <p><img src="connecting.png" alt="Connect to VNC Server" /></p>\r
 <p>Enter the hostname or IP address of the computer running the VNC server.\r
 You can specify the display number after a colon. (e.g.: <tt>hostname:1</tt>)\r
-If no display is given, 0 will be assumed. (A number &ge;100 will be interpreted as a port number. Otherwise, Presence VNC will connect to port 5900 + display.)</p>\r
+If no display is given, 0 will be assumed.\r
+(A number &ge;100 will be interpreted as a port number. Otherwise, Presence VNC will connect to port 5900 + display.)</p>\r
 \r
 <p>Pressing the arrow symbol next to the input field will bring up the list of recently used hosts.\r
 Additionally, you can select the <strong>Listen for incoming connections</strong> option to accept a "reverse" connection from the server.\r