summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/comm/keypebble/krfbbuffer.cpp11
-rw-r--r--noncore/comm/keypebble/krfbcanvas.cpp5
-rw-r--r--noncore/comm/keypebble/krfbdecoder.cpp7
-rw-r--r--noncore/comm/keypebble/krfbdecoder.h5
-rw-r--r--noncore/comm/keypebble/krfbserver.cpp2
-rw-r--r--noncore/comm/keypebble/krfbserver.h1
-rw-r--r--noncore/comm/keypebble/kvnc.cpp8
-rw-r--r--noncore/comm/keypebble/kvnc.h3
-rw-r--r--noncore/comm/keypebble/kvncbookmarkdlg.cpp3
-rw-r--r--noncore/comm/keypebble/kvncconndlg.cpp21
-rw-r--r--noncore/comm/keypebble/kvncconndlg.h1
-rw-r--r--noncore/comm/keypebble/kvncconndlgbase.ui180
12 files changed, 172 insertions, 75 deletions
diff --git a/noncore/comm/keypebble/krfbbuffer.cpp b/noncore/comm/keypebble/krfbbuffer.cpp
index 5a52f31..f1cb929 100644
--- a/noncore/comm/keypebble/krfbbuffer.cpp
+++ b/noncore/comm/keypebble/krfbbuffer.cpp
@@ -8,2 +8,4 @@
#include "krfbbuffer.h"
+#include "krfbconnection.h"
+#include "krfbserver.h"
#include "krfbserverinfo.h"
@@ -88,2 +90,3 @@ void KRFBBuffer::drawRawRectChunk( void *data,
+ int scaleFactor=decoder->con->options()->scaleFactor;
int redMax = Swap16IfLE( decoder->format->redMax );
@@ -99,2 +102,3 @@ void KRFBBuffer::drawRawRectChunk( void *data,
+
for ( int j = 0; j < h; j++ ) {
@@ -189,6 +193,11 @@ void KRFBBuffer::drawRawRectChunk( void *data,
+ if (scaleFactor > 1) {
+ p.drawImage( x/scaleFactor, y/scaleFactor, img.smoothScale(w/scaleFactor,h/scaleFactor) );
+ emit updated( x/scaleFactor, y/scaleFactor, w/scaleFactor, h/scaleFactor );
+ }
+ else {
p.drawImage( x, y, img );
-
emit updated( x, y, w, h );
}
+}
diff --git a/noncore/comm/keypebble/krfbcanvas.cpp b/noncore/comm/keypebble/krfbcanvas.cpp
index 8b56795..896de7f 100644
--- a/noncore/comm/keypebble/krfbcanvas.cpp
+++ b/noncore/comm/keypebble/krfbcanvas.cpp
@@ -24,3 +24,4 @@ KRFBCanvas::KRFBCanvas( QWidget *parent, const char *name )
loggedIn_ = false;
- QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold);
+
+ //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold);
@@ -106,2 +107,4 @@ void KRFBCanvas::viewportPaintEvent( QPaintEvent *e )
if ( loggedIn_ ) {
+ QPixmap p;
+
bitBlt( viewport(), r.x(), r.y(),
diff --git a/noncore/comm/keypebble/krfbdecoder.cpp b/noncore/comm/keypebble/krfbdecoder.cpp
index a964c09..94e3b79 100644
--- a/noncore/comm/keypebble/krfbdecoder.cpp
+++ b/noncore/comm/keypebble/krfbdecoder.cpp
@@ -197,3 +197,3 @@ void KRFBDecoder::gotServerInit()
- buf->resize( info->width, info->height );
+ buf->resize( info->width/con->options()->scaleFactor, info->height /con->options()->scaleFactor);
@@ -644,4 +644,5 @@ void KRFBDecoder::sendMouseEvent( QMouseEvent *e )
- CARD16 x = Swap16IfLE( e->x() );
- CARD16 y = Swap16IfLE( e->y() );
+ // HACK: Scaling
+ CARD16 x = Swap16IfLE( e->x() * con->options()->scaleFactor );
+ CARD16 y = Swap16IfLE( e->y() * con->options()->scaleFactor );
diff --git a/noncore/comm/keypebble/krfbdecoder.h b/noncore/comm/keypebble/krfbdecoder.h
index 4ba0185..db6271d 100644
--- a/noncore/comm/keypebble/krfbdecoder.h
+++ b/noncore/comm/keypebble/krfbdecoder.h
@@ -100,2 +100,5 @@ signals:
+protected:
+ /** The connection to the server. */
+ KRFBConnection *con;
private:
@@ -120,4 +123,2 @@ private:
KRFBBuffer *buf;
- /** The connection to the server. */
- KRFBConnection *con;
diff --git a/noncore/comm/keypebble/krfbserver.cpp b/noncore/comm/keypebble/krfbserver.cpp
index 5775f09..b47534e 100644
--- a/noncore/comm/keypebble/krfbserver.cpp
+++ b/noncore/comm/keypebble/krfbserver.cpp
@@ -11,2 +11,4 @@ KRFBServer::KRFBServer()
+ scaleFactor=1;
+
hexTile=0;
diff --git a/noncore/comm/keypebble/krfbserver.h b/noncore/comm/keypebble/krfbserver.h
index f87eecc..e38e2d2 100644
--- a/noncore/comm/keypebble/krfbserver.h
+++ b/noncore/comm/keypebble/krfbserver.h
@@ -31,2 +31,3 @@ public:
int updateRate;
+ int scaleFactor;
};
diff --git a/noncore/comm/keypebble/kvnc.cpp b/noncore/comm/keypebble/kvnc.cpp
index aa46e2f..b173004 100644
--- a/noncore/comm/keypebble/kvnc.cpp
+++ b/noncore/comm/keypebble/kvnc.cpp
@@ -74,2 +74,3 @@ KVNC::KVNC( const char *name ) : QMainWindow( 0, name )
+
connect( bookmarkSelector->bookmarkList, SIGNAL(doubleClicked(QListBoxItem *)),
@@ -94,3 +95,6 @@ KVNC::KVNC( const char *name ) : QMainWindow( 0, name )
- QPEToolBar *bar = new QPEToolBar( this );
+ bar= new QToolBar( this );
+ setToolBarsMovable( false );
+ setRightJustification(false);
+
@@ -237,2 +241,3 @@ void KVNC::connected()
stack->raiseWidget(canvas);
+ bar->hide();
}
@@ -256,2 +261,3 @@ void KVNC::disconnected()
stack->raiseWidget(bookmarkSelector);
+ bar->show();
}
diff --git a/noncore/comm/keypebble/kvnc.h b/noncore/comm/keypebble/kvnc.h
index 6e0a385..82a24fc 100644
--- a/noncore/comm/keypebble/kvnc.h
+++ b/noncore/comm/keypebble/kvnc.h
@@ -6,3 +6,3 @@
#include <qmainwindow.h>
-#include <qurl.h>
+#include <qtoolbar.h>
#include <qwidgetstack.h>
@@ -59,2 +59,3 @@ private:
QAction *connectAction;
+ QToolBar * bar;
diff --git a/noncore/comm/keypebble/kvncbookmarkdlg.cpp b/noncore/comm/keypebble/kvncbookmarkdlg.cpp
index 1f97d13..1e2f3c3 100644
--- a/noncore/comm/keypebble/kvncbookmarkdlg.cpp
+++ b/noncore/comm/keypebble/kvncbookmarkdlg.cpp
@@ -163,2 +163,4 @@ void KVNCBookmarkDlg::readBookmarks(void)
server->updateRate=val.toInt();
+ else if (key=="scalefactor")
+ server->scaleFactor=val.toInt();
@@ -202,2 +204,3 @@ void KVNCBookmarkDlg::writeBookmarks(void)
t << "\tupdaterate=" << server->updateRate << '\n';
+ t << "\tscalefactor=" << server->scaleFactor << '\n';
diff --git a/noncore/comm/keypebble/kvncconndlg.cpp b/noncore/comm/keypebble/kvncconndlg.cpp
index 6873feb..2f073f8 100644
--- a/noncore/comm/keypebble/kvncconndlg.cpp
+++ b/noncore/comm/keypebble/kvncconndlg.cpp
@@ -3,2 +3,3 @@
#include <qcheckbox.h>
+#include <qcombobox.h>
#include <qspinbox.h>
@@ -31,2 +32,8 @@ KVNCConnDlg::KVNCConnDlg( KRFBServer *options,
+ for (int i=0; i < scaleFactor->count(); ++i) {
+ if (scaleFactor->text(i).toInt()==tmpOptions.scaleFactor) {
+ scaleFactor->setCurrentItem(i);
+ }
+ }
+
// TODO
@@ -42,5 +49,8 @@ KVNCConnDlg::KVNCConnDlg( KRFBServer *options,
+ serverPassword->setEchoMode(QLineEdit::Password);
+
+ connect(togglePassword, SIGNAL( stateChanged(int) ), this, SLOT( showPassword(int) ) );
-}
+}
KVNCConnDlg::~KVNCConnDlg()
@@ -68,2 +78,3 @@ void KVNCConnDlg::save()
tmpOptions.name = serverBookmark->text();
+ tmpOptions.scaleFactor = scaleFactor->currentText().toInt();
@@ -75 +86,9 @@ void KVNCConnDlg::save()
}
+
+void KVNCConnDlg::showPassword(int show)
+{
+ if (show)
+ serverPassword->setEchoMode(QLineEdit::Normal);
+ else
+ serverPassword->setEchoMode(QLineEdit::Password);
+}
diff --git a/noncore/comm/keypebble/kvncconndlg.h b/noncore/comm/keypebble/kvncconndlg.h
index fae7d62..5e84750 100644
--- a/noncore/comm/keypebble/kvncconndlg.h
+++ b/noncore/comm/keypebble/kvncconndlg.h
@@ -22,2 +22,3 @@ class KVNCConnDlg : public KVNCConnDlgBase
void save();
+ void showPassword(int);
diff --git a/noncore/comm/keypebble/kvncconndlgbase.ui b/noncore/comm/keypebble/kvncconndlgbase.ui
index df0d375..42765c1 100644
--- a/noncore/comm/keypebble/kvncconndlgbase.ui
+++ b/noncore/comm/keypebble/kvncconndlgbase.ui
@@ -13,4 +13,4 @@
<y>0</y>
- <width>984</width>
- <height>676</height>
+ <width>260</width>
+ <height>242</height>
</rect>
@@ -24,11 +24,2 @@
</property>
- <vbox>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
<widget>
@@ -39,2 +30,11 @@
</property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>266</width>
+ <height>233</height>
+ </rect>
+ </property>
<widget>
@@ -58,18 +58,22 @@
</property>
- <widget row="0" column="0" >
- <class>QLabel</class>
+ <widget row="2" column="1" rowspan="1" colspan="2" >
+ <class>QLineEdit</class>
<property stdset="1">
<name>name</name>
- <cstring>hostname</cstring>
+ <cstring>serverPassword</cstring>
</property>
<property stdset="1">
- <name>text</name>
- <string>Host Name:</string>
+ <name>autoMask</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>echoMode</name>
+ <enum>Password</enum>
</property>
</widget>
- <widget row="1" column="0" >
- <class>QLabel</class>
+ <widget row="3" column="1" >
+ <class>QCheckBox</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel2_2</cstring>
+ <cstring>togglePassword</cstring>
</property>
@@ -77,33 +81,32 @@
<name>text</name>
- <string>Display Number:</string>
+ <string>Show Password</string>
</property>
</widget>
- <widget row="2" column="1" rowspan="1" colspan="2" >
- <class>QLineEdit</class>
+ <widget row="2" column="0" >
+ <class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>serverPassword</cstring>
+ <cstring>TextLabel3</cstring>
</property>
<property stdset="1">
- <name>autoMask</name>
- <bool>true</bool>
+ <name>text</name>
+ <string>Password:</string>
</property>
</widget>
- <widget row="1" column="1" rowspan="1" colspan="2" >
- <class>QSpinBox</class>
+ <widget row="4" column="1" rowspan="1" colspan="2" >
+ <class>QLineEdit</class>
<property stdset="1">
<name>name</name>
- <cstring>serverDisplay</cstring>
- </property>
- <property stdset="1">
- <name>maxValue</name>
- <number>500</number>
+ <cstring>serverBookmark</cstring>
</property>
+ </widget>
+ <widget row="4" column="0" >
+ <class>QLabel</class>
<property stdset="1">
- <name>minValue</name>
- <number>0</number>
+ <name>name</name>
+ <cstring>TextLabel1_2</cstring>
</property>
<property stdset="1">
- <name>value</name>
- <number>0</number>
+ <name>text</name>
+ <string>Bookmark Name:</string>
</property>
@@ -117,3 +120,3 @@
</widget>
- <widget row="2" column="0" >
+ <widget row="0" column="0" >
<class>QLabel</class>
@@ -121,3 +124,3 @@
<name>name</name>
- <cstring>TextLabel3</cstring>
+ <cstring>hostname</cstring>
</property>
@@ -125,21 +128,33 @@
<name>text</name>
- <string>Password:</string>
+ <string>Host Name:</string>
</property>
</widget>
- <widget row="3" column="1" rowspan="1" colspan="2" >
- <class>QLineEdit</class>
+ <widget row="1" column="0" >
+ <class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>serverBookmark</cstring>
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Display Number:</string>
</property>
</widget>
- <widget row="3" column="0" >
- <class>QLabel</class>
+ <widget row="1" column="1" rowspan="1" colspan="2" >
+ <class>QSpinBox</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel1_2</cstring>
+ <cstring>serverDisplay</cstring>
</property>
<property stdset="1">
- <name>text</name>
- <string>Bookmark Name:</string>
+ <name>maxValue</name>
+ <number>500</number>
+ </property>
+ <property stdset="1">
+ <name>minValue</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>value</name>
+ <number>0</number>
</property>
@@ -167,19 +182,2 @@
</spacer>
- <widget row="4" column="1" >
- <class>QLayoutWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>Layout3</cstring>
- </property>
- <hbox>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- </hbox>
- </widget>
</grid>
@@ -292,2 +290,55 @@
</widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QComboBox</class>
+ <item>
+ <property>
+ <name>text</name>
+ <string>1</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>2</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>4</string>
+ </property>
+ </item>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>scaleFactor</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel2_3</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Scale Factor</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
<spacer>
@@ -414,3 +465,2 @@
</widget>
- </vbox>
</widget>