summaryrefslogtreecommitdiff
authortreke <treke>2002-09-05 04:42:25 (UTC)
committer treke <treke>2002-09-05 04:42:25 (UTC)
commite2186a49cb5cbdf01b56f57818a15a760ff25b2e (patch) (unidiff)
treef22e7342c7a3adcccb6eed52a314fe8e301cc624
parentfd3239820e471044bf279a2964702573572859d6 (diff)
downloadopie-e2186a49cb5cbdf01b56f57818a15a760ff25b2e.zip
opie-e2186a49cb5cbdf01b56f57818a15a760ff25b2e.tar.gz
opie-e2186a49cb5cbdf01b56f57818a15a760ff25b2e.tar.bz2
Added support for client side scaling of the screen. Slow, but sometimes usable.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/comm/keypebble/krfbbuffer.cpp17
-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.ui752
12 files changed, 461 insertions, 364 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
@@ -1,194 +1,203 @@
1#include <assert.h> 1#include <assert.h>
2#include <qpixmap.h> 2#include <qpixmap.h>
3#include <qbrush.h> 3#include <qbrush.h>
4#include <qimage.h> 4#include <qimage.h>
5#include <qpainter.h> 5#include <qpainter.h>
6#include <qapplication.h> 6#include <qapplication.h>
7#include "krfbdecoder.h" 7#include "krfbdecoder.h"
8#include "krfbbuffer.h" 8#include "krfbbuffer.h"
9#include "krfbconnection.h"
10#include "krfbserver.h"
9#include "krfbserverinfo.h" 11#include "krfbserverinfo.h"
10 12
11// 13//
12// Endian stuff 14// Endian stuff
13// 15//
14#ifndef KDE_USE_FINAL 16#ifndef KDE_USE_FINAL
15const int endianTest = 1; 17const int endianTest = 1;
16#endif 18#endif
17 19
18#define Swap16IfLE(s) \ 20#define Swap16IfLE(s) \
19 (*(char *)&endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s)) 21 (*(char *)&endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s))
20 22
21#define Swap32IfLE(l) \ 23#define Swap32IfLE(l) \
22 (*(char *)&endianTest ? ((((l) & 0xff000000) >> 24) | \ 24 (*(char *)&endianTest ? ((((l) & 0xff000000) >> 24) | \
23 (((l) & 0x00ff0000) >> 8) | \ 25 (((l) & 0x00ff0000) >> 8) | \
24 (((l) & 0x0000ff00) << 8) | \ 26 (((l) & 0x0000ff00) << 8) | \
25 (((l) & 0x000000ff) << 24)) : (l)) 27 (((l) & 0x000000ff) << 24)) : (l))
26 28
27KRFBBuffer::KRFBBuffer( KRFBDecoder *decoder, 29KRFBBuffer::KRFBBuffer( KRFBDecoder *decoder,
28 QObject *parent, const char *name ) 30 QObject *parent, const char *name )
29 : QObject( parent, name ) 31 : QObject( parent, name )
30{ 32{
31 assert( decoder ); 33 assert( decoder );
32 this->decoder = decoder; 34 this->decoder = decoder;
33 pix = new QPixmap(); 35 pix = new QPixmap();
34} 36}
35 37
36KRFBBuffer::~KRFBBuffer() 38KRFBBuffer::~KRFBBuffer()
37{ 39{
38 delete pix; 40 delete pix;
39} 41}
40 42
41void KRFBBuffer::resize( int w, int h ) 43void KRFBBuffer::resize( int w, int h )
42{ 44{
43 qWarning( "Resizing buffer" ); 45 qWarning( "Resizing buffer" );
44 46
45 pix->resize( w, h ); 47 pix->resize( w, h );
46 48
47 QPalette pal = qApp->palette(); 49 QPalette pal = qApp->palette();
48 pix->fill( pal.active().base() ); 50 pix->fill( pal.active().base() );
49 51
50 emit sizeChanged( w, h ); 52 emit sizeChanged( w, h );
51} 53}
52 54
53void KRFBBuffer::soundBell() 55void KRFBBuffer::soundBell()
54{ 56{
55 emit bell(); 57 emit bell();
56} 58}
57 59
58void KRFBBuffer::mouseEvent( QMouseEvent *e ) 60void KRFBBuffer::mouseEvent( QMouseEvent *e )
59{ 61{
60 decoder->sendMouseEvent( e ); 62 decoder->sendMouseEvent( e );
61} 63}
62 64
63void KRFBBuffer::keyPressEvent( QKeyEvent *e ) 65void KRFBBuffer::keyPressEvent( QKeyEvent *e )
64{ 66{
65 qWarning( "Buffer got a key" ); 67 qWarning( "Buffer got a key" );
66 68
67 decoder->sendKeyPressEvent( e ); 69 decoder->sendKeyPressEvent( e );
68} 70}
69 71
70void KRFBBuffer::keyReleaseEvent( QKeyEvent *e ) 72void KRFBBuffer::keyReleaseEvent( QKeyEvent *e )
71{ 73{
72 decoder->sendKeyReleaseEvent( e ); 74 decoder->sendKeyReleaseEvent( e );
73} 75}
74 76
75void KRFBBuffer::copyRect( int srcX, int srcY, 77void KRFBBuffer::copyRect( int srcX, int srcY,
76 int destX, int destY, int w, int h ) 78 int destX, int destY, int w, int h )
77{ 79{
78// qWarning( "Got copy rect" ); 80// qWarning( "Got copy rect" );
79 bitBlt( pix, destX, destY, pix, srcX, srcY, w, h, CopyROP ); 81 bitBlt( pix, destX, destY, pix, srcX, srcY, w, h, CopyROP );
80 82
81 emit updated( destX, destY, w, h ); 83 emit updated( destX, destY, w, h );
82} 84}
83 85
84void KRFBBuffer::drawRawRectChunk( void *data, 86void KRFBBuffer::drawRawRectChunk( void *data,
85 int x, int y, int w, int h ) 87 int x, int y, int w, int h )
86{ 88{
87 QImage img( w, h, 32 ); 89 QImage img( w, h, 32 );
88 90
91 int scaleFactor=decoder->con->options()->scaleFactor;
89 int redMax = Swap16IfLE( decoder->format->redMax ); 92 int redMax = Swap16IfLE( decoder->format->redMax );
90 int greenMax = Swap16IfLE( decoder->format->greenMax ); 93 int greenMax = Swap16IfLE( decoder->format->greenMax );
91 int blueMax = Swap16IfLE( decoder->format->blueMax ); 94 int blueMax = Swap16IfLE( decoder->format->blueMax );
92 95
93 QPainter p( pix ); 96 QPainter p( pix );
94 97
95 if ( decoder->format->bpp == 8 ) { 98 if ( decoder->format->bpp == 8 ) {
96 uchar *d = (unsigned char *) data; 99 uchar *d = (unsigned char *) data;
97 100
98 uint r,g,b; 101 uint r,g,b;
99 102
100 for ( int j = 0; j < h; j++ ) { 103
104 for ( int j = 0; j < h; j++) {
101 for ( int i = 0; i < w ; i++ ) { 105 for ( int i = 0; i < w ; i++ ) {
102 r = d[ j * w + i ]; 106 r = d[ j * w + i ];
103 r = r >> decoder->format->redShift; 107 r = r >> decoder->format->redShift;
104 r = r & redMax; 108 r = r & redMax;
105 109
106 g = d[ j * w + i ]; 110 g = d[ j * w + i ];
107 g = g >> decoder->format->greenShift; 111 g = g >> decoder->format->greenShift;
108 g = g & greenMax; 112 g = g & greenMax;
109 113
110 b = d[ j * w + i ]; 114 b = d[ j * w + i ];
111 b = b >> decoder->format->blueShift; 115 b = b >> decoder->format->blueShift;
112 b = b & blueMax; 116 b = b & blueMax;
113 117
114 r = ( r * 255 ) / redMax; 118 r = ( r * 255 ) / redMax;
115 g = ( g * 255 ) / greenMax; 119 g = ( g * 255 ) / greenMax;
116 b = ( b * 255 ) / blueMax; 120 b = ( b * 255 ) / blueMax;
117 121
118 uint *p = ( uint * ) img.scanLine( j ) + i; 122 uint *p = ( uint * ) img.scanLine( j ) + i;
119 *p = qRgb( r,g,b ); 123 *p = qRgb( r,g,b );
120 } 124 }
121 } 125 }
122 } 126 }
123 else if ( decoder->format->bpp == 32 ) { 127 else if ( decoder->format->bpp == 32 ) {
124 ulong *d = (ulong *) data; 128 ulong *d = (ulong *) data;
125 129
126 ulong r,g,b; 130 ulong r,g,b;
127 131
128 for ( int j = 0; j < h; j++ ) { 132 for ( int j = 0; j < h; j++ ) {
129 for ( int i = 0; i < w ; i++ ) { 133 for ( int i = 0; i < w ; i++ ) {
130 ulong pixel = d[ j * w + i ]; 134 ulong pixel = d[ j * w + i ];
131 pixel = Swap32IfLE( pixel ); 135 pixel = Swap32IfLE( pixel );
132 136
133 r = pixel; 137 r = pixel;
134 r = r >> decoder->format->redShift; 138 r = r >> decoder->format->redShift;
135 r = r & redMax; 139 r = r & redMax;
136 140
137 g = pixel; 141 g = pixel;
138 g = g >> decoder->format->greenShift; 142 g = g >> decoder->format->greenShift;
139 g = g & greenMax; 143 g = g & greenMax;
140 144
141 b = pixel; 145 b = pixel;
142 b = b >> decoder->format->blueShift; 146 b = b >> decoder->format->blueShift;
143 b = b & blueMax; 147 b = b & blueMax;
144 148
145 r = ( r * 255 ) / redMax; 149 r = ( r * 255 ) / redMax;
146 g = ( g * 255 ) / greenMax; 150 g = ( g * 255 ) / greenMax;
147 b = ( b * 255 ) / blueMax; 151 b = ( b * 255 ) / blueMax;
148 152
149 uint *p = ( uint * ) img.scanLine( j ) + i; 153 uint *p = ( uint * ) img.scanLine( j ) + i;
150 *p = qRgb( r,g,b ); 154 *p = qRgb( r,g,b );
151 } 155 }
152 } 156 }
153 } else if (decoder->format->bpp == 16 ) { 157 } else if (decoder->format->bpp == 16 ) {
154 158
155 CARD16 *d = (CARD16 *) data; 159 CARD16 *d = (CARD16 *) data;
156 160
157 uint r,g,b; 161 uint r,g,b;
158 162
159 for ( int j = 0; j < h; j++ ) { 163 for ( int j = 0; j < h; j++ ) {
160 for ( int i = 0; i < w ; i++ ) { 164 for ( int i = 0; i < w ; i++ ) {
161 CARD16 pixel = d[ j * w + i ]; 165 CARD16 pixel = d[ j * w + i ];
162 pixel = Swap16IfLE( pixel ); 166 pixel = Swap16IfLE( pixel );
163 167
164 r = pixel; 168 r = pixel;
165 r = r >> decoder->format->redShift; 169 r = r >> decoder->format->redShift;
166 r = r & redMax; 170 r = r & redMax;
167 171
168 g = pixel; 172 g = pixel;
169 g = g >> decoder->format->greenShift; 173 g = g >> decoder->format->greenShift;
170 g = g & greenMax; 174 g = g & greenMax;
171 175
172 b = pixel; 176 b = pixel;
173 b = b >> decoder->format->blueShift; 177 b = b >> decoder->format->blueShift;
174 b = b & blueMax; 178 b = b & blueMax;
175 179
176 r = ( r * 255 ) / redMax; 180 r = ( r * 255 ) / redMax;
177 g = ( g * 255 ) / greenMax; 181 g = ( g * 255 ) / greenMax;
178 b = ( b * 255 ) / blueMax; 182 b = ( b * 255 ) / blueMax;
179 183
180 ulong *p = ( ulong * ) img.scanLine( j ) + i; 184 ulong *p = ( ulong * ) img.scanLine( j ) + i;
181 *p = qRgb( r,g,b ); 185 *p = qRgb( r,g,b );
182 } 186 }
183 } 187 }
184 } 188 }
185 else { 189 else {
186 p.setBrush( QBrush( Qt::black ) ); 190 p.setBrush( QBrush( Qt::black ) );
187 p.drawRect( x, y, w, h ); 191 p.drawRect( x, y, w, h );
188 } 192 }
189 193
190 p.drawImage( x, y, img ); 194 if (scaleFactor > 1) {
191 195 p.drawImage( x/scaleFactor, y/scaleFactor, img.smoothScale(w/scaleFactor,h/scaleFactor) );
192 emit updated( x, y, w, h ); 196 emit updated( x/scaleFactor, y/scaleFactor, w/scaleFactor, h/scaleFactor );
197 }
198 else {
199 p.drawImage( x, y, img);
200 emit updated( x, y, w, h );
201 }
193} 202}
194 203
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
@@ -1,170 +1,173 @@
1#include "krfbconnection.h" 1#include "krfbconnection.h"
2#include "krfbcanvas.h" 2#include "krfbcanvas.h"
3#include "krfbserver.h" 3#include "krfbserver.h"
4#include "krfbbuffer.h" 4#include "krfbbuffer.h"
5 5
6#include <qpe/config.h> 6#include <qpe/config.h>
7#include <qpe/qpeapplication.h> 7#include <qpe/qpeapplication.h>
8 8
9#include <qapplication.h> 9#include <qapplication.h>
10#include <qclipboard.h> 10#include <qclipboard.h>
11#include <qaction.h> 11#include <qaction.h>
12#include <qpixmap.h> 12#include <qpixmap.h>
13#include <qapplication.h> 13#include <qapplication.h>
14#include <qmainwindow.h> 14#include <qmainwindow.h>
15#include <qiconset.h> 15#include <qiconset.h>
16 16
17KRFBCanvas::KRFBCanvas( QWidget *parent, const char *name ) 17KRFBCanvas::KRFBCanvas( QWidget *parent, const char *name )
18 : QScrollView( parent, name ) 18 : QScrollView( parent, name )
19{ 19{
20 connection_ = new KRFBConnection(); 20 connection_ = new KRFBConnection();
21 connect( connection_, SIGNAL( loggedIn() ), 21 connect( connection_, SIGNAL( loggedIn() ),
22 this, SLOT( loggedIn() ) ); 22 this, SLOT( loggedIn() ) );
23 23
24 loggedIn_ = false; 24 loggedIn_ = false;
25 QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold); 25
26 //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold);
26 27
27 viewport()->setFocusPolicy( QWidget::StrongFocus ); 28 viewport()->setFocusPolicy( QWidget::StrongFocus );
28 viewport()->setFocus(); 29 viewport()->setFocus();
29} 30}
30 31
31KRFBCanvas::~KRFBCanvas() 32KRFBCanvas::~KRFBCanvas()
32{ 33{
33} 34}
34 35
35 36
36void KRFBCanvas::openConnection(KRFBServer server) 37void KRFBCanvas::openConnection(KRFBServer server)
37{ 38{
38 39
39 40
40 QCString host = server.hostname.latin1(); 41 QCString host = server.hostname.latin1();
41 password=server.password; 42 password=server.password;
42 connection_->connectTo( server); 43 connection_->connectTo( server);
43} 44}
44 45
45 46
46void KRFBCanvas::openURL( const QUrl &url ) 47void KRFBCanvas::openURL( const QUrl &url )
47{ 48{
48 if ( loggedIn_ ) { 49 if ( loggedIn_ ) {
49 qWarning( "openURL invoked when logged in\n" ); 50 qWarning( "openURL invoked when logged in\n" );
50 return; 51 return;
51 } 52 }
52 53
53 QCString host = url.host().latin1(); 54 QCString host = url.host().latin1();
54 int display = url.port(); 55 int display = url.port();
55 56
56// connection_->connectTo( host, display ); 57// connection_->connectTo( host, display );
57} 58}
58 59
59void KRFBCanvas::closeConnection() 60void KRFBCanvas::closeConnection()
60{ 61{
61 loggedIn_ = false; 62 loggedIn_ = false;
62 connection_->disconnect(); 63 connection_->disconnect();
63 64
64 viewport()->setMouseTracking( false ); 65 viewport()->setMouseTracking( false );
65 viewport()->setBackgroundMode( PaletteDark ); 66 viewport()->setBackgroundMode( PaletteDark );
66 setBackgroundMode( PaletteDark ); 67 setBackgroundMode( PaletteDark );
67 update(); 68 update();
68} 69}
69 70
70 71
71void KRFBCanvas::bell() 72void KRFBCanvas::bell()
72{ 73{
73 if ( connection_->options()->deIconify ) { 74 if ( connection_->options()->deIconify ) {
74 topLevelWidget()->raise(); 75 topLevelWidget()->raise();
75 topLevelWidget()->show(); 76 topLevelWidget()->show();
76 } 77 }
77} 78}
78 79
79void KRFBCanvas::loggedIn() 80void KRFBCanvas::loggedIn()
80{ 81{
81 qWarning( "Ok, we're logged in" ); 82 qWarning( "Ok, we're logged in" );
82 83
83 // 84 //
84 // Get ready for action 85 // Get ready for action
85 // 86 //
86 loggedIn_ = true; 87 loggedIn_ = true;
87 viewport()->setMouseTracking( true ); 88 viewport()->setMouseTracking( true );
88 viewport()->setBackgroundMode( NoBackground ); 89 viewport()->setBackgroundMode( NoBackground );
89 setBackgroundMode( NoBackground ); 90 setBackgroundMode( NoBackground );
90 91
91 // Start using the buffer 92 // Start using the buffer
92 connect( connection_->buffer(), SIGNAL( sizeChanged( int, int ) ), 93 connect( connection_->buffer(), SIGNAL( sizeChanged( int, int ) ),
93 this, SLOT( resizeContents(int,int) ) ); 94 this, SLOT( resizeContents(int,int) ) );
94 connect( connection_->buffer(), SIGNAL( updated( int, int, int, int ) ), 95 connect( connection_->buffer(), SIGNAL( updated( int, int, int, int ) ),
95 this, SLOT( viewportUpdate(int,int,int,int) ) ); 96 this, SLOT( viewportUpdate(int,int,int,int) ) );
96 connect( connection_->buffer(), SIGNAL( bell() ), 97 connect( connection_->buffer(), SIGNAL( bell() ),
97 this, SLOT( bell() ) ); 98 this, SLOT( bell() ) );
98 connect( qApp->clipboard(), SIGNAL( dataChanged() ), 99 connect( qApp->clipboard(), SIGNAL( dataChanged() ),
99 this, SLOT( clipboardChanged() ) ); 100 this, SLOT( clipboardChanged() ) );
100} 101}
101 102
102void KRFBCanvas::viewportPaintEvent( QPaintEvent *e ) 103void KRFBCanvas::viewportPaintEvent( QPaintEvent *e )
103{ 104{
104 QRect r = e->rect(); 105 QRect r = e->rect();
105 106
106 if ( loggedIn_ ) { 107 if ( loggedIn_ ) {
108 QPixmap p;
109
107 bitBlt( viewport(), r.x(), r.y(), 110 bitBlt( viewport(), r.x(), r.y(),
108 connection_->buffer()->pixmap(), 111 connection_->buffer()->pixmap(),
109 r.x() + contentsX(), r.y() + contentsY(), 112 r.x() + contentsX(), r.y() + contentsY(),
110 r.width(), r.height() ); 113 r.width(), r.height() );
111 } 114 }
112 else { 115 else {
113 QScrollView::viewportPaintEvent( e ); 116 QScrollView::viewportPaintEvent( e );
114 } 117 }
115} 118}
116 119
117void KRFBCanvas::viewportUpdate( int x, int y, int w, int h ) 120void KRFBCanvas::viewportUpdate( int x, int y, int w, int h )
118{ 121{
119 updateContents( x, y, w, h ); 122 updateContents( x, y, w, h );
120} 123}
121 124
122void KRFBCanvas::contentsMousePressEvent( QMouseEvent *e ) 125void KRFBCanvas::contentsMousePressEvent( QMouseEvent *e )
123{ 126{
124 if ( loggedIn_ ) 127 if ( loggedIn_ )
125 connection_->buffer()->mouseEvent( e ); 128 connection_->buffer()->mouseEvent( e );
126} 129}
127 130
128void KRFBCanvas::contentsMouseReleaseEvent( QMouseEvent *e ) 131void KRFBCanvas::contentsMouseReleaseEvent( QMouseEvent *e )
129{ 132{
130 if ( loggedIn_ ) 133 if ( loggedIn_ )
131 connection_->buffer()->mouseEvent( e ); 134 connection_->buffer()->mouseEvent( e );
132} 135}
133 136
134void KRFBCanvas::contentsMouseMoveEvent( QMouseEvent *e ) 137void KRFBCanvas::contentsMouseMoveEvent( QMouseEvent *e )
135{ 138{
136 if ( loggedIn_ ) 139 if ( loggedIn_ )
137 connection_->buffer()->mouseEvent( e ); 140 connection_->buffer()->mouseEvent( e );
138} 141}
139 142
140void KRFBCanvas::keyPressEvent( QKeyEvent *e ) 143void KRFBCanvas::keyPressEvent( QKeyEvent *e )
141{ 144{
142 if ( loggedIn_ ) 145 if ( loggedIn_ )
143 connection_->buffer()->keyPressEvent( e ); 146 connection_->buffer()->keyPressEvent( e );
144} 147}
145 148
146void KRFBCanvas::keyReleaseEvent( QKeyEvent *e ) 149void KRFBCanvas::keyReleaseEvent( QKeyEvent *e )
147{ 150{
148 if ( loggedIn_ ) 151 if ( loggedIn_ )
149 connection_->buffer()->keyReleaseEvent( e ); 152 connection_->buffer()->keyReleaseEvent( e );
150} 153}
151 154
152void KRFBCanvas::refresh() 155void KRFBCanvas::refresh()
153{ 156{
154 if ( loggedIn_ ) 157 if ( loggedIn_ )
155 connection_->refresh(); 158 connection_->refresh();
156} 159}
157 160
158void KRFBCanvas::clipboardChanged() 161void KRFBCanvas::clipboardChanged()
159{ 162{
160 if ( loggedIn_ ) { 163 if ( loggedIn_ ) {
161 connection_->sendCutText( qApp->clipboard()->text() ); 164 connection_->sendCutText( qApp->clipboard()->text() );
162 } 165 }
163} 166}
164void KRFBCanvas::sendCtlAltDel( void) 167void KRFBCanvas::sendCtlAltDel( void)
165{ 168{
166 169
167 qDebug("Here"); 170 qDebug("Here");
168 if ( loggedIn_ ) { 171 if ( loggedIn_ ) {
169 connection_->buffer()->keyPressEvent( &QKeyEvent(QEvent::KeyPress,Qt::Key_Delete, 0x7f,ControlButton|AltButton)); 172 connection_->buffer()->keyPressEvent( &QKeyEvent(QEvent::KeyPress,Qt::Key_Delete, 0x7f,ControlButton|AltButton));
170 // connection_->buffer()->keyPressEvent( &QKeyEvent(QEvent::KeyRelease,Qt::Key_Delete, 0x7f,ControlButton|AltButton)); 173 // connection_->buffer()->keyPressEvent( &QKeyEvent(QEvent::KeyRelease,Qt::Key_Delete, 0x7f,ControlButton|AltButton));
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
@@ -134,129 +134,129 @@ KRFBDecoder::~KRFBDecoder()
134void KRFBDecoder::start() 134void KRFBDecoder::start()
135{ 135{
136 sendClientInit(); 136 sendClientInit();
137} 137}
138 138
139void KRFBDecoder::sendClientInit() 139void KRFBDecoder::sendClientInit()
140{ 140{
141 con->write( &( con->options()->shared ), 1 ); 141 con->write( &( con->options()->shared ), 1 );
142 142
143 // Wait for server init 143 // Wait for server init
144 qWarning( "Waiting for server init" ); 144 qWarning( "Waiting for server init" );
145 145
146 static QString statusMsg = tr( "Waiting for server initialisation..." ); 146 static QString statusMsg = tr( "Waiting for server initialisation..." );
147 emit status( statusMsg ); 147 emit status( statusMsg );
148 148
149 currentState = AwaitingServerInit; 149 currentState = AwaitingServerInit;
150 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerInit() ) ); 150 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerInit() ) );
151 con->waitForData( ServerInitLength ); 151 con->waitForData( ServerInitLength );
152} 152}
153 153
154void KRFBDecoder::gotServerInit() 154void KRFBDecoder::gotServerInit()
155{ 155{
156 qWarning( "Got server init" ); 156 qWarning( "Got server init" );
157 disconnect( con, SIGNAL( gotEnoughData() ), this, SLOT( gotServerInit() ) ); 157 disconnect( con, SIGNAL( gotEnoughData() ), this, SLOT( gotServerInit() ) );
158 158
159 if ( info ) 159 if ( info )
160 delete info; 160 delete info;
161 info = new KRFBServerInfo; 161 info = new KRFBServerInfo;
162 CHECK_PTR( info ); 162 CHECK_PTR( info );
163 163
164 con->read( &(info->width), 2 ); 164 con->read( &(info->width), 2 );
165 info->width = Swap16IfLE( info->width ); 165 info->width = Swap16IfLE( info->width );
166 con->read( &info->height, 2 ); 166 con->read( &info->height, 2 );
167 info->height = Swap16IfLE( info->height ); 167 info->height = Swap16IfLE( info->height );
168 168
169 con->read( &(info->bpp), 1 ); 169 con->read( &(info->bpp), 1 );
170 con->read( &(info->depth), 1 ); 170 con->read( &(info->depth), 1 );
171 con->read( &(info->bigEndian), 1 ); 171 con->read( &(info->bigEndian), 1 );
172 con->read( &(info->trueColor), 1 ); 172 con->read( &(info->trueColor), 1 );
173 173
174 con->read( &(info->redMax), 2 ); 174 con->read( &(info->redMax), 2 );
175 info->redMax = Swap16IfLE( info->redMax ); 175 info->redMax = Swap16IfLE( info->redMax );
176 con->read( &(info->greenMax), 2 ); 176 con->read( &(info->greenMax), 2 );
177 info->greenMax = Swap16IfLE( info->greenMax ); 177 info->greenMax = Swap16IfLE( info->greenMax );
178 con->read( &(info->blueMax), 2 ); 178 con->read( &(info->blueMax), 2 );
179 info->blueMax = Swap16IfLE( info->blueMax ); 179 info->blueMax = Swap16IfLE( info->blueMax );
180 180
181 con->read( &(info->redShift), 1 ); 181 con->read( &(info->redShift), 1 );
182 con->read( &(info->greenShift), 1 ); 182 con->read( &(info->greenShift), 1 );
183 con->read( &(info->blueShift), 1 ); 183 con->read( &(info->blueShift), 1 );
184 184
185 con->read( info->padding, 3 ); 185 con->read( info->padding, 3 );
186 186
187 con->read( &(info->nameLength), 4 ); 187 con->read( &(info->nameLength), 4 );
188 info->nameLength = Swap32IfLE( info->nameLength ); 188 info->nameLength = Swap32IfLE( info->nameLength );
189 189
190 qWarning( "Width = %d, Height = %d", info->width, info->height ); 190 qWarning( "Width = %d, Height = %d", info->width, info->height );
191 qWarning( "Bpp = %d, Depth = %d, Big = %d, True = %d", 191 qWarning( "Bpp = %d, Depth = %d, Big = %d, True = %d",
192 info->bpp, info->depth, info->bigEndian, info->trueColor ); 192 info->bpp, info->depth, info->bigEndian, info->trueColor );
193 qWarning( "RedMax = %d, GreenMax = %d, BlueMax = %d", 193 qWarning( "RedMax = %d, GreenMax = %d, BlueMax = %d",
194 info->redMax, info->greenMax, info->blueMax ); 194 info->redMax, info->greenMax, info->blueMax );
195 qWarning( "RedShift = %d, GreenShift = %d, BlueShift = %d", 195 qWarning( "RedShift = %d, GreenShift = %d, BlueShift = %d",
196 info->redShift, info->greenShift,info-> blueShift ); 196 info->redShift, info->greenShift,info-> blueShift );
197 197
198 buf->resize( info->width, info->height ); 198 buf->resize( info->width/con->options()->scaleFactor, info->height /con->options()->scaleFactor);
199 199
200 // Wait for desktop name 200 // Wait for desktop name
201 qWarning( "Waiting for desktop name" ); 201 qWarning( "Waiting for desktop name" );
202 202
203 static QString statusMsg = tr( "Waiting for desktop name..." ); 203 static QString statusMsg = tr( "Waiting for desktop name..." );
204 emit status( statusMsg ); 204 emit status( statusMsg );
205 205
206 currentState = AwaitingDesktopName; 206 currentState = AwaitingDesktopName;
207 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotDesktopName() ) ); 207 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotDesktopName() ) );
208 con->waitForData( info->nameLength ); 208 con->waitForData( info->nameLength );
209} 209}
210 210
211void KRFBDecoder::gotDesktopName() 211void KRFBDecoder::gotDesktopName()
212{ 212{
213 assert( info ); 213 assert( info );
214 assert( currentState == AwaitingDesktopName ); 214 assert( currentState == AwaitingDesktopName );
215 215
216 qWarning( "Got desktop name" ); 216 qWarning( "Got desktop name" );
217 217
218 disconnect( con, SIGNAL( gotEnoughData() ), 218 disconnect( con, SIGNAL( gotEnoughData() ),
219 this, SLOT( gotDesktopName() ) ); 219 this, SLOT( gotDesktopName() ) );
220 220
221 char *buf = new char[ info->nameLength + 1 ]; 221 char *buf = new char[ info->nameLength + 1 ];
222 CHECK_PTR( buf ); 222 CHECK_PTR( buf );
223 223
224 con->read( buf, info->nameLength ); 224 con->read( buf, info->nameLength );
225 buf[ info->nameLength ] = '\0'; 225 buf[ info->nameLength ] = '\0';
226 info->name = buf; 226 info->name = buf;
227 227
228 qWarning( "Desktop: %s", info->name.latin1() ); 228 qWarning( "Desktop: %s", info->name.latin1() );
229 229
230 delete buf; 230 delete buf;
231 231
232 // Get the format we'll really use and tell the server 232 // Get the format we'll really use and tell the server
233 decidePixelFormat(); 233 decidePixelFormat();
234 sendPixelFormat(); 234 sendPixelFormat();
235 sendAllowedEncodings(); 235 sendAllowedEncodings();
236 currentState = Idle; 236 currentState = Idle;
237 237
238 QString msg; 238 QString msg;
239 msg = tr( "Connected to %1" ); 239 msg = tr( "Connected to %1" );
240 msg = msg.arg( info->name ); 240 msg = msg.arg( info->name );
241 emit status( msg ); 241 emit status( msg );
242 242
243 sendUpdateRequest( false ); 243 sendUpdateRequest( false );
244} 244}
245 245
246void KRFBDecoder::decidePixelFormat() 246void KRFBDecoder::decidePixelFormat()
247{ 247{
248 assert( info ); 248 assert( info );
249 249
250 if ( format ) 250 if ( format )
251 delete format; 251 delete format;
252 format = new KRFBPixelFormat; 252 format = new KRFBPixelFormat;
253 CHECK_PTR( format ); 253 CHECK_PTR( format );
254 254
255 // What depth do we want? 255 // What depth do we want?
256 // 256 //
257 // We'll use the minimum of the remote and local depths, UNLESS an 257 // We'll use the minimum of the remote and local depths, UNLESS an
258 // eight bit session has been specifically requested by the user. 258 // eight bit session has been specifically requested by the user.
259 int screenDepth = QPixmap::defaultDepth(); 259 int screenDepth = QPixmap::defaultDepth();
260 int bestDepth = ( screenDepth > info->depth ) ? info->depth : screenDepth; 260 int bestDepth = ( screenDepth > info->depth ) ? info->depth : screenDepth;
261 int chosenDepth; 261 int chosenDepth;
262 262
@@ -581,130 +581,131 @@ void KRFBDecoder::gotCopyRectPos()
581 this, SLOT( gotCopyRectPos() ) ); 581 this, SLOT( gotCopyRectPos() ) );
582 582
583 CARD16 srcX; 583 CARD16 srcX;
584 CARD16 srcY; 584 CARD16 srcY;
585 585
586 con->read( &srcX, 2 ); 586 con->read( &srcX, 2 );
587 con->read( &srcY, 2 ); 587 con->read( &srcY, 2 );
588 588
589 srcX = Swap16IfLE( srcX ); 589 srcX = Swap16IfLE( srcX );
590 srcY = Swap16IfLE( srcY ); 590 srcY = Swap16IfLE( srcY );
591 591
592 buf->copyRect( srcX, srcY, x, y, w, h ); 592 buf->copyRect( srcX, srcY, x, y, w, h );
593 593
594 noRects--; 594 noRects--;
595 595
596 // qWarning( "There are %d rects left", noRects ); 596 // qWarning( "There are %d rects left", noRects );
597 597
598 if ( noRects ) { 598 if ( noRects ) {
599 currentState = AwaitingRectHeader; 599 currentState = AwaitingRectHeader;
600 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRectHeader() ) ); 600 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRectHeader() ) );
601 con->waitForData( RectHeaderLength ); 601 con->waitForData( RectHeaderLength );
602 } 602 }
603 else 603 else
604 currentState = Idle; 604 currentState = Idle;
605} 605}
606 606
607void KRFBDecoder::handleRRERect() 607void KRFBDecoder::handleRRERect()
608{ 608{
609 qWarning( "RRE not implemented" ); 609 qWarning( "RRE not implemented" );
610} 610}
611 611
612void KRFBDecoder::handleCoRRERect() 612void KRFBDecoder::handleCoRRERect()
613{ 613{
614 qWarning( "CoRRE not implemented" ); 614 qWarning( "CoRRE not implemented" );
615} 615}
616 616
617void KRFBDecoder::handleHexTileRect() 617void KRFBDecoder::handleHexTileRect()
618{ 618{
619 qWarning( "HexTile not implemented" ); 619 qWarning( "HexTile not implemented" );
620} 620}
621 621
622void KRFBDecoder::sendMouseEvent( QMouseEvent *e ) 622void KRFBDecoder::sendMouseEvent( QMouseEvent *e )
623{ 623{
624 // Deal with the buttons 624 // Deal with the buttons
625 if ( e->type() != QEvent::MouseMove ) { 625 if ( e->type() != QEvent::MouseMove ) {
626 buttonMask = 0; 626 buttonMask = 0;
627 if ( e->type() == QEvent::MouseButtonPress ) { 627 if ( e->type() == QEvent::MouseButtonPress ) {
628 if ( e->button() & LeftButton ) 628 if ( e->button() & LeftButton )
629 buttonMask |= 0x01; 629 buttonMask |= 0x01;
630 if ( e->button() & MidButton ) 630 if ( e->button() & MidButton )
631 buttonMask |= 0x04; 631 buttonMask |= 0x04;
632 if ( e->button() & RightButton ) 632 if ( e->button() & RightButton )
633 buttonMask |= 0x02; 633 buttonMask |= 0x02;
634 } 634 }
635 else if ( e->type() == QEvent::MouseButtonRelease ) { 635 else if ( e->type() == QEvent::MouseButtonRelease ) {
636 if ( e->button() & LeftButton ) 636 if ( e->button() & LeftButton )
637 buttonMask &= 0x06; 637 buttonMask &= 0x06;
638 if ( e->button() & MidButton ) 638 if ( e->button() & MidButton )
639 buttonMask |= 0x03; 639 buttonMask |= 0x03;
640 if ( e->button() & RightButton ) 640 if ( e->button() & RightButton )
641 buttonMask |= 0x05; 641 buttonMask |= 0x05;
642 } 642 }
643 } 643 }
644 644
645 CARD16 x = Swap16IfLE( e->x() ); 645 // HACK: Scaling
646 CARD16 y = Swap16IfLE( e->y() ); 646 CARD16 x = Swap16IfLE( e->x() * con->options()->scaleFactor );
647 CARD16 y = Swap16IfLE( e->y() *con->options()->scaleFactor );
647 648
648 con->write( &PointerEventId, 1 ); 649 con->write( &PointerEventId, 1 );
649 con->write( &buttonMask, 1 ); 650 con->write( &buttonMask, 1 );
650 con->write( &x, 2 ); 651 con->write( &x, 2 );
651 con->write( &y, 2 ); 652 con->write( &y, 2 );
652} 653}
653 654
654 655
655void KRFBDecoder::sendCutEvent( const QString &unicode ) 656void KRFBDecoder::sendCutEvent( const QString &unicode )
656{ 657{
657 // 658 //
658 // Warning: There is a bug in the RFB protocol because there is no way to find 659 // Warning: There is a bug in the RFB protocol because there is no way to find
659 // out the codepage in use on the remote machine. This could be fixed by requiring 660 // out the codepage in use on the remote machine. This could be fixed by requiring
660 // the remote server to use utf8 etc. but for now we have to assume they're the 661 // the remote server to use utf8 etc. but for now we have to assume they're the
661 // same. I've reported this problem to the ORL guys, but they apparantly have no 662 // same. I've reported this problem to the ORL guys, but they apparantly have no
662 // immediate plans to fix the issue. :-( (rich) 663 // immediate plans to fix the issue. :-( (rich)
663 // 664 //
664 665
665 CARD8 padding[3]; 666 CARD8 padding[3];
666 QCString text = unicode.local8Bit(); 667 QCString text = unicode.local8Bit();
667 CARD32 length = text.length(); 668 CARD32 length = text.length();
668 length = Swap32IfLE( length ); 669 length = Swap32IfLE( length );
669 670
670 con->write( &ClientCutTextId, 1 ); 671 con->write( &ClientCutTextId, 1 );
671 con->write( &padding, 3 ); 672 con->write( &padding, 3 );
672 con->write( &length, 4 ); 673 con->write( &length, 4 );
673 con->write( text.data(), length ); 674 con->write( text.data(), length );
674} 675}
675 676
676void KRFBDecoder::gotServerCut() 677void KRFBDecoder::gotServerCut()
677{ 678{
678 qWarning( "Got server cut" ); 679 qWarning( "Got server cut" );
679 680
680 currentState = AwaitingServerCutLength; 681 currentState = AwaitingServerCutLength;
681 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerCutLength() ) ); 682 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerCutLength() ) );
682 con->waitForData( ServerCutLenLength ); 683 con->waitForData( ServerCutLenLength );
683} 684}
684 685
685void KRFBDecoder::gotServerCutLength() 686void KRFBDecoder::gotServerCutLength()
686{ 687{
687 assert( currentState = AwaitingServerCutLength ); 688 assert( currentState = AwaitingServerCutLength );
688 disconnect( con, SIGNAL( gotEnoughData() ), 689 disconnect( con, SIGNAL( gotEnoughData() ),
689 this, SLOT( gotServerCutLength() ) ); 690 this, SLOT( gotServerCutLength() ) );
690 691
691 CARD8 padding[3]; 692 CARD8 padding[3];
692 con->read( padding, 3 ); 693 con->read( padding, 3 );
693 694
694 con->read( &serverCutTextLen, 4 ); 695 con->read( &serverCutTextLen, 4 );
695 serverCutTextLen = Swap32IfLE( serverCutTextLen ); 696 serverCutTextLen = Swap32IfLE( serverCutTextLen );
696 697
697 currentState = AwaitingServerCutText; 698 currentState = AwaitingServerCutText;
698 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerCutText() ) ); 699 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerCutText() ) );
699 con->waitForData( serverCutTextLen ); 700 con->waitForData( serverCutTextLen );
700} 701}
701 702
702void KRFBDecoder::gotServerCutText() 703void KRFBDecoder::gotServerCutText()
703{ 704{
704 assert( currentState = AwaitingServerCutText ); 705 assert( currentState = AwaitingServerCutText );
705 706
706 disconnect( con, SIGNAL( gotEnoughData() ), 707 disconnect( con, SIGNAL( gotEnoughData() ),
707 this, SLOT( gotServerCutText() ) ); 708 this, SLOT( gotServerCutText() ) );
708 709
709 // 710 //
710 // Warning: There is a bug in the RFB protocol because there is no way to find 711 // Warning: There is a bug in the RFB protocol because there is no way to find
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
@@ -37,98 +37,99 @@ public:
37 AwaitingCopyRectPos, 37 AwaitingCopyRectPos,
38 AwaitingServerCutLength, 38 AwaitingServerCutLength,
39 AwaitingServerCutText, 39 AwaitingServerCutText,
40 Idle, 40 Idle,
41 Error 41 Error
42 }; 42 };
43 43
44 /** 44 /**
45 * Create a KRFBDecoder that reads data from a logged in KRFBConnection 45 * Create a KRFBDecoder that reads data from a logged in KRFBConnection
46 * and sends its output to a KRFBBuffer. 46 * and sends its output to a KRFBBuffer.
47 */ 47 */
48 KRFBDecoder( KRFBConnection *con ); 48 KRFBDecoder( KRFBConnection *con );
49 ~KRFBDecoder(); 49 ~KRFBDecoder();
50 50
51 void setBuffer( KRFBBuffer *buf ) { this->buf = buf; }; 51 void setBuffer( KRFBBuffer *buf ) { this->buf = buf; };
52 void start(); 52 void start();
53 53
54 int toKeySym( QKeyEvent *k ); 54 int toKeySym( QKeyEvent *k );
55 55
56 // 56 //
57 // Client -> Server messages 57 // Client -> Server messages
58 // 58 //
59 void sendUpdateRequest( bool incremental ); 59 void sendUpdateRequest( bool incremental );
60 void sendMouseEvent( QMouseEvent *e ); 60 void sendMouseEvent( QMouseEvent *e );
61 void sendKeyPressEvent( QKeyEvent *e ); 61 void sendKeyPressEvent( QKeyEvent *e );
62 void sendKeyReleaseEvent( QKeyEvent *e ); 62 void sendKeyReleaseEvent( QKeyEvent *e );
63 void sendCutEvent( const QString &text ); 63 void sendCutEvent( const QString &text );
64 64
65protected: 65protected:
66 // 66 //
67 // Initial format negotiation 67 // Initial format negotiation
68 // 68 //
69 void decidePixelFormat(); 69 void decidePixelFormat();
70 void sendPixelFormat(); 70 void sendPixelFormat();
71 void sendClientInit(); 71 void sendClientInit();
72 void sendAllowedEncodings(); 72 void sendAllowedEncodings();
73 73
74 // 74 //
75 // Rectange processing 75 // Rectange processing
76 // 76 //
77 void handleRawRect(); 77 void handleRawRect();
78 void handleCopyRect(); 78 void handleCopyRect();
79 void handleRRERect(); 79 void handleRRERect();
80 void handleCoRRERect(); 80 void handleCoRRERect();
81 void handleHexTileRect(); 81 void handleHexTileRect();
82 82
83 void getRawRectChunk( int lines ); 83 void getRawRectChunk( int lines );
84 84
85protected slots: 85protected slots:
86 void gotServerInit(); 86 void gotServerInit();
87 void gotDesktopName(); 87 void gotDesktopName();
88 void gotUpdateHeader(); 88 void gotUpdateHeader();
89 void gotRectHeader(); 89 void gotRectHeader();
90 void gotRawRectChunk(); 90 void gotRawRectChunk();
91 void gotCopyRectPos(); 91 void gotCopyRectPos();
92 void gotServerCut(); 92 void gotServerCut();
93 void gotServerCutLength(); 93 void gotServerCutLength();
94 void gotServerCutText(); 94 void gotServerCutText();
95 void gotBell(); 95 void gotBell();
96 96
97signals: 97signals:
98 void error( const QString & ); 98 void error( const QString & );
99 void status( const QString & ); 99 void status( const QString & );
100 100
101protected:
102 /** The connection to the server. */
103 KRFBConnection *con;
101private: 104private:
102 State currentState; 105 State currentState;
103 106
104 // Used to store the state we were in before a cut or bell msg 107 // Used to store the state we were in before a cut or bell msg
105 State oldState; 108 State oldState;
106 109
107 // The number of rects we're expecting 110 // The number of rects we're expecting
108 CARD16 noRects; 111 CARD16 noRects;
109 112
110 // 113 //
111 // Info about the current rect. 114 // Info about the current rect.
112 // 115 //
113 CARD16 x, y, w, h; 116 CARD16 x, y, w, h;
114 int lines; 117 int lines;
115 CARD32 encoding; 118 CARD32 encoding;
116 119
117 CARD32 serverCutTextLen; 120 CARD32 serverCutTextLen;
118 121
119 /** Where we draw the data (and the source of our events). */ 122 /** Where we draw the data (and the source of our events). */
120 KRFBBuffer *buf; 123 KRFBBuffer *buf;
121 /** The connection to the server. */
122 KRFBConnection *con;
123 124
124 /** Info about the RFB server. */ 125 /** Info about the RFB server. */
125 KRFBServerInfo *info; 126 KRFBServerInfo *info;
126 /** The pixel format we want. */ 127 /** The pixel format we want. */
127 KRFBPixelFormat *format; 128 KRFBPixelFormat *format;
128 129
129 CARD8 buttonMask; 130 CARD8 buttonMask;
130}; 131};
131 132
132#endif // KRFBDECODER_H 133#endif // KRFBDECODER_H
133 134
134 135
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
@@ -1,39 +1,41 @@
1#include <qpe/config.h> 1#include <qpe/config.h>
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include "krfbserver.h" 3#include "krfbserver.h"
4 4
5KRFBServer::KRFBServer() 5KRFBServer::KRFBServer()
6{ 6{
7 QString name; 7 QString name;
8 QString hostname; 8 QString hostname;
9 QString password; 9 QString password;
10 display=0; 10 display=0;
11 11
12 scaleFactor=1;
13
12 hexTile=0; 14 hexTile=0;
13 corre=0; 15 corre=0;
14 rre=0; 16 rre=0;
15 copyrect=1; 17 copyrect=1;
16 18
17 colors256=1; 19 colors256=1;
18 shared=0; 20 shared=0;
19 readOnly=0; 21 readOnly=0;
20 deIconify=0; 22 deIconify=0;
21 23
22 updateRate=0; 24 updateRate=0;
23} 25}
24KRFBServer::~KRFBServer() 26KRFBServer::~KRFBServer()
25{ 27{
26} 28}
27 29
28int KRFBServer::encodings() 30int KRFBServer::encodings()
29{ 31{
30 // Initially one because we always support raw encoding 32 // Initially one because we always support raw encoding
31 int count = 1; 33 int count = 1;
32 34
33 count += hexTile ? 1 : 0; 35 count += hexTile ? 1 : 0;
34 count += corre ? 1 : 0; 36 count += corre ? 1 : 0;
35 count += rre ? 1 : 0; 37 count += rre ? 1 : 0;
36 count += copyrect ? 1 : 0; 38 count += copyrect ? 1 : 0;
37 39
38 return count; 40 return count;
39} 41}
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
@@ -1,34 +1,35 @@
1// -*- c++ -*- 1// -*- c++ -*-
2 2
3#ifndef KRFBOPTIONS_H 3#ifndef KRFBOPTIONS_H
4#define KRFBOPTIONS_H 4#define KRFBOPTIONS_H
5 5
6class Config; 6class Config;
7 7
8class KRFBServer 8class KRFBServer
9{ 9{
10public: 10public:
11 KRFBServer(); 11 KRFBServer();
12 ~KRFBServer(); 12 ~KRFBServer();
13 13
14 int encodings(); 14 int encodings();
15 15
16 QString name; 16 QString name;
17 QString hostname; 17 QString hostname;
18 QString password; 18 QString password;
19 int display; 19 int display;
20 20
21 bool hexTile; 21 bool hexTile;
22 bool corre; 22 bool corre;
23 bool rre; 23 bool rre;
24 bool copyrect; 24 bool copyrect;
25 25
26 bool colors256; 26 bool colors256;
27 bool shared; 27 bool shared;
28 bool readOnly; 28 bool readOnly;
29 bool deIconify; 29 bool deIconify;
30 30
31 int updateRate; 31 int updateRate;
32 int scaleFactor;
32}; 33};
33 34
34#endif // KRFBOPTIONS_H 35#endif // KRFBOPTIONS_H
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
@@ -11,149 +11,153 @@
11#include <qtimer.h> 11#include <qtimer.h>
12#include <qmessagebox.h> 12#include <qmessagebox.h>
13#include <qspinbox.h> 13#include <qspinbox.h>
14#include <qlistbox.h> 14#include <qlistbox.h>
15#include <qlineedit.h> 15#include <qlineedit.h>
16#include <qpe/qpeapplication.h> 16#include <qpe/qpeapplication.h>
17#include <qpe/global.h> 17#include <qpe/global.h>
18#include <qpe/qpetoolbar.h> 18#include <qpe/qpetoolbar.h>
19#include <qpe/resource.h> 19#include <qpe/resource.h>
20 20
21#include <assert.h> 21#include <assert.h>
22 22
23#include "kvnc.h" 23#include "kvnc.h"
24#include "krfbcanvas.h" 24#include "krfbcanvas.h"
25#include "krfbconnection.h" 25#include "krfbconnection.h"
26#include "kvncconndlg.h" 26#include "kvncconndlg.h"
27#include "krfbserver.h" 27#include "krfbserver.h"
28 28
29static int u_id = 1; 29static int u_id = 1;
30static int get_unique_id() 30static int get_unique_id()
31{ 31{
32 return u_id++; 32 return u_id++;
33} 33}
34 34
35 35
36/* XPM */ 36/* XPM */
37static char * menu_xpm[] = { 37static char * menu_xpm[] = {
38"12 12 5 1", 38"12 12 5 1",
39 " c None", 39 " c None",
40 ".c #000000", 40 ".c #000000",
41 "+c #FFFDAD", 41 "+c #FFFDAD",
42 "@c #FFFF00", 42 "@c #FFFF00",
43 "#c #E5E100", 43 "#c #E5E100",
44" ", 44" ",
45" ", 45" ",
46" ......... ", 46" ......... ",
47" .+++++++. ", 47" .+++++++. ",
48" .+@@@@#. ", 48" .+@@@@#. ",
49" .+@@@#. ", 49" .+@@@#. ",
50" .+@@#. ", 50" .+@@#. ",
51" .+@#. ", 51" .+@#. ",
52" .+#. ", 52" .+#. ",
53" .+. ", 53" .+. ",
54" .. ", 54" .. ",
55" "}; 55" "};
56 56
57const int StatusTextId = 0; 57const int StatusTextId = 0;
58 58
59KVNC::KVNC( const char *name ) : QMainWindow( 0, name ) 59KVNC::KVNC( const char *name ) : QMainWindow( 0, name )
60{ 60{
61 setCaption( tr("VNC Viewer") ); 61 setCaption( tr("VNC Viewer") );
62 fullscreen = false; 62 fullscreen = false;
63 63
64 stack = new QWidgetStack( this ); 64 stack = new QWidgetStack( this );
65 setCentralWidget( stack ); 65 setCentralWidget( stack );
66 66
67 bookmarkSelector=new KVNCBookmarkDlg(); 67 bookmarkSelector=new KVNCBookmarkDlg();
68 stack->addWidget(bookmarkSelector,get_unique_id()); 68 stack->addWidget(bookmarkSelector,get_unique_id());
69 stack->raiseWidget( bookmarkSelector ); 69 stack->raiseWidget( bookmarkSelector );
70 70
71 canvas = new KRFBCanvas( stack, "canvas" ); 71 canvas = new KRFBCanvas( stack, "canvas" );
72 stack->addWidget(canvas,get_unique_id()); 72 stack->addWidget(canvas,get_unique_id());
73 setCentralWidget( stack ); 73 setCentralWidget( stack );
74 74
75
75 connect( bookmarkSelector->bookmarkList, SIGNAL(doubleClicked(QListBoxItem *)), 76 connect( bookmarkSelector->bookmarkList, SIGNAL(doubleClicked(QListBoxItem *)),
76 this, SLOT(openConnection(QListBoxItem *)) ); 77 this, SLOT(openConnection(QListBoxItem *)) );
77 connect( canvas->connection(), SIGNAL(statusChanged(const QString &)), 78 connect( canvas->connection(), SIGNAL(statusChanged(const QString &)),
78 this, SLOT(statusMessage(const QString &)) ); 79 this, SLOT(statusMessage(const QString &)) );
79 connect( canvas->connection(), SIGNAL(error(const QString &)), 80 connect( canvas->connection(), SIGNAL(error(const QString &)),
80 this, SLOT(error(const QString &)) ); 81 this, SLOT(error(const QString &)) );
81 connect( canvas->connection(), SIGNAL(connected()), this, SLOT(connected()) ); 82 connect( canvas->connection(), SIGNAL(connected()), this, SLOT(connected()) );
82 connect( canvas->connection(), SIGNAL(loggedIn()), this, SLOT(loggedIn()) ); 83 connect( canvas->connection(), SIGNAL(loggedIn()), this, SLOT(loggedIn()) );
83 connect( canvas->connection(), SIGNAL(disconnected()), this, SLOT(disconnected()) ); 84 connect( canvas->connection(), SIGNAL(disconnected()), this, SLOT(disconnected()) );
84 85
85 setupActions(); 86 setupActions();
86 87
87 cornerButton = new QPushButton( this ); 88 cornerButton = new QPushButton( this );
88 cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) ); 89 cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) );
89 connect( cornerButton, SIGNAL(pressed()), this, SLOT(showMenu()) ); 90 connect( cornerButton, SIGNAL(pressed()), this, SLOT(showMenu()) );
90 canvas->setCornerWidget( cornerButton ); 91 canvas->setCornerWidget( cornerButton );
91 92
92 stack->raiseWidget( bookmarkSelector ); 93 stack->raiseWidget( bookmarkSelector );
93 94
94 95
95 QPEToolBar *bar = new QPEToolBar( this ); 96 bar= new QToolBar( this );
97 setToolBarsMovable( false );
98 setRightJustification(false);
99
96 100
97 QAction *n = new QAction( tr( "New Connection" ), Resource::loadPixmap( "new" ), 101 QAction *n = new QAction( tr( "New Connection" ), Resource::loadPixmap( "new" ),
98 QString::null, 0, this, 0 ); 102 QString::null, 0, this, 0 );
99 connect( n, SIGNAL( activated() ), 103 connect( n, SIGNAL( activated() ),
100 this, SLOT( newConnection() ) ); 104 this, SLOT( newConnection() ) );
101 n->addTo( bar ); 105 n->addTo( bar );
102 106
103 QAction *o = new QAction( tr( "Open Bookmark" ), Resource::loadPixmap( "edit" ), 107 QAction *o = new QAction( tr( "Open Bookmark" ), Resource::loadPixmap( "edit" ),
104 QString::null, 0, this, 0 ); 108 QString::null, 0, this, 0 );
105 connect( o, SIGNAL( activated() ), 109 connect( o, SIGNAL( activated() ),
106 this, SLOT( openConnection() ) ); 110 this, SLOT( openConnection() ) );
107 o->addTo( bar ); 111 o->addTo( bar );
108 112
109 QAction *d = new QAction( tr( "Delete Bookmark" ), Resource::loadPixmap( "trash" ), 113 QAction *d = new QAction( tr( "Delete Bookmark" ), Resource::loadPixmap( "trash" ),
110 QString::null, 0, this, 0 ); 114 QString::null, 0, this, 0 );
111 connect( d, SIGNAL( activated() ), 115 connect( d, SIGNAL( activated() ),
112 this, SLOT( deleteBookmark() ) ); 116 this, SLOT( deleteBookmark() ) );
113 d->addTo( bar ); 117 d->addTo( bar );
114} 118}
115 119
116KVNC::~KVNC() 120KVNC::~KVNC()
117{ 121{
118 122
119} 123}
120 124
121void KVNC::newConnection() 125void KVNC::newConnection()
122{ 126{
123 curServer=new KRFBServer; 127 curServer=new KRFBServer;
124 128
125 KVNCConnDlg dlg( curServer,this); 129 KVNCConnDlg dlg( curServer,this);
126 dlg.showMaximized(); 130 dlg.showMaximized();
127 if (dlg.exec()) { 131 if (dlg.exec()) {
128 if (!curServer->name.isEmpty()) 132 if (!curServer->name.isEmpty())
129 bookmarkSelector->addBookmark(curServer); 133 bookmarkSelector->addBookmark(curServer);
130 canvas->openConnection(*curServer); 134 canvas->openConnection(*curServer);
131 } else 135 } else
132 curServer=0; 136 curServer=0;
133} 137}
134 138
135void KVNC::openConnection( QString name) 139void KVNC::openConnection( QString name)
136{ 140{
137 curServer=bookmarkSelector->getServer(name); 141 curServer=bookmarkSelector->getServer(name);
138 142
139 if (curServer) { 143 if (curServer) {
140 KVNCConnDlg dlg( curServer,this); 144 KVNCConnDlg dlg( curServer,this);
141 dlg.showMaximized(); 145 dlg.showMaximized();
142 146
143 if ( dlg.exec() ) { 147 if ( dlg.exec() ) {
144 canvas->openConnection(*curServer); 148 canvas->openConnection(*curServer);
145 bookmarkSelector->writeBookmarks(); 149 bookmarkSelector->writeBookmarks();
146 } else 150 } else
147 curServer=0; 151 curServer=0;
148 } 152 }
149} 153}
150 154
151void KVNC::openConnection( void ) 155void KVNC::openConnection( void )
152{ 156{
153 openConnection( bookmarkSelector->selectedBookmark()); 157 openConnection( bookmarkSelector->selectedBookmark());
154} 158}
155 159
156void KVNC::openConnection( QListBoxItem * item) 160void KVNC::openConnection( QListBoxItem * item)
157{ 161{
158 openConnection(item->text()); 162 openConnection(item->text());
159} 163}
@@ -174,99 +178,101 @@ void KVNC::setupActions()
174 ctlAltDelAction->addTo( cornerMenu ); 178 ctlAltDelAction->addTo( cornerMenu );
175 ctlAltDelAction->setEnabled( false ); 179 ctlAltDelAction->setEnabled( false );
176 180
177 disconnectAction = new QAction( tr("Disconnect"), QString::null, 0, 0 ); 181 disconnectAction = new QAction( tr("Disconnect"), QString::null, 0, 0 );
178 connect( disconnectAction, SIGNAL(activated()), 182 connect( disconnectAction, SIGNAL(activated()),
179 this, SLOT( closeConnection() ) ); 183 this, SLOT( closeConnection() ) );
180 disconnectAction->addTo( cornerMenu ); 184 disconnectAction->addTo( cornerMenu );
181 disconnectAction->setEnabled( false ); 185 disconnectAction->setEnabled( false );
182} 186}
183 187
184void KVNC::toggleFullScreen() 188void KVNC::toggleFullScreen()
185{ 189{
186 if ( fullscreen ) { 190 if ( fullscreen ) {
187 canvas->releaseKeyboard(); 191 canvas->releaseKeyboard();
188 canvas->reparent( stack, 0, QPoint(0,0), false ); 192 canvas->reparent( stack, 0, QPoint(0,0), false );
189 canvas->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 193 canvas->setFrameStyle( QFrame::Panel | QFrame::Sunken );
190 setCentralWidget( stack ); 194 setCentralWidget( stack );
191 stack->addWidget(canvas,get_unique_id()); 195 stack->addWidget(canvas,get_unique_id());
192 stack->raiseWidget(canvas); 196 stack->raiseWidget(canvas);
193 canvas->show(); 197 canvas->show();
194 stack->show(); 198 stack->show();
195 fullScreenAction->setText( tr("Full Screen") ); 199 fullScreenAction->setText( tr("Full Screen") );
196 } else { 200 } else {
197 canvas->setFrameStyle( QFrame::NoFrame ); 201 canvas->setFrameStyle( QFrame::NoFrame );
198 stack->removeWidget(canvas); 202 stack->removeWidget(canvas);
199 canvas->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop, 203 canvas->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop,
200 QPoint(0,0),false); 204 QPoint(0,0),false);
201 canvas->resize(qApp->desktop()->width(), qApp->desktop()->height()); 205 canvas->resize(qApp->desktop()->width(), qApp->desktop()->height());
202 canvas->raise(); 206 canvas->raise();
203 canvas->setFocus(); 207 canvas->setFocus();
204 canvas->grabKeyboard(); 208 canvas->grabKeyboard();
205 canvas->show(); 209 canvas->show();
206 210
207 fullScreenAction->setText( tr("Stop Full Screen") ); 211 fullScreenAction->setText( tr("Stop Full Screen") );
208 } 212 }
209 213
210 214
211 fullscreen = !fullscreen; 215 fullscreen = !fullscreen;
212} 216}
213 217
214void KVNC::closeConnection() 218void KVNC::closeConnection()
215{ 219{
216 if ( fullscreen ) 220 if ( fullscreen )
217 toggleFullScreen(); 221 toggleFullScreen();
218 canvas->closeConnection(); 222 canvas->closeConnection();
219} 223}
220 224
221void KVNC::showMenu() 225void KVNC::showMenu()
222{ 226{
223 QPoint pt = mapToGlobal(cornerButton->pos()); 227 QPoint pt = mapToGlobal(cornerButton->pos());
224 QSize s = cornerMenu->sizeHint(); 228 QSize s = cornerMenu->sizeHint();
225 pt.ry() -= s.height(); 229 pt.ry() -= s.height();
226 pt.rx() -= s.width(); 230 pt.rx() -= s.width();
227 cornerMenu->popup( pt ); 231 cornerMenu->popup( pt );
228} 232}
229 233
230void KVNC::connected() 234void KVNC::connected()
231{ 235{
232 static QString msg = tr( "Connected to remote host" ); 236 static QString msg = tr( "Connected to remote host" );
233 statusMessage( msg ); 237 statusMessage( msg );
234 ctlAltDelAction->setEnabled(true); 238 ctlAltDelAction->setEnabled(true);
235 disconnectAction->setEnabled( true ); 239 disconnectAction->setEnabled( true );
236 fullScreenAction->setEnabled( true ); 240 fullScreenAction->setEnabled( true );
237 stack->raiseWidget(canvas); 241 stack->raiseWidget(canvas);
242 bar->hide();
238} 243}
239 244
240void KVNC::loggedIn() 245void KVNC::loggedIn()
241{ 246{
242 static QString msg = tr( "Logged in to remote host" ); 247 static QString msg = tr( "Logged in to remote host" );
243 statusMessage( msg ); 248 statusMessage( msg );
244} 249}
245 250
246void KVNC::disconnected() 251void KVNC::disconnected()
247{ 252{
248 253
249 if ( fullscreen ) 254 if ( fullscreen )
250 toggleFullScreen(); 255 toggleFullScreen();
251 static QString msg = tr( "Connection closed" ); 256 static QString msg = tr( "Connection closed" );
252 statusMessage( msg ); 257 statusMessage( msg );
253 ctlAltDelAction->setEnabled(false); 258 ctlAltDelAction->setEnabled(false);
254 disconnectAction->setEnabled( false ); 259 disconnectAction->setEnabled( false );
255 fullScreenAction->setEnabled( false ); 260 fullScreenAction->setEnabled( false );
256 stack->raiseWidget(bookmarkSelector); 261 stack->raiseWidget(bookmarkSelector);
262 bar->show();
257} 263}
258 264
259void KVNC::statusMessage( const QString &m ) 265void KVNC::statusMessage( const QString &m )
260{ 266{
261 Global::statusMessage( m ); 267 Global::statusMessage( m );
262} 268}
263 269
264void KVNC::error( const QString &msg ) 270void KVNC::error( const QString &msg )
265{ 271{
266 statusMessage( msg ); 272 statusMessage( msg );
267 QMessageBox::warning( this, tr("VNC Viewer"), msg ); 273 QMessageBox::warning( this, tr("VNC Viewer"), msg );
268} 274}
269void KVNC::deleteBookmark(void) 275void KVNC::deleteBookmark(void)
270{ 276{
271 bookmarkSelector->deleteBookmark(bookmarkSelector->selectedBookmark()); 277 bookmarkSelector->deleteBookmark(bookmarkSelector->selectedBookmark());
272} 278}
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
@@ -1,66 +1,67 @@
1// -*- c++ -*- 1// -*- c++ -*-
2 2
3#ifndef KVNC_H 3#ifndef KVNC_H
4#define KVNC_H 4#define KVNC_H
5 5
6#include <qmainwindow.h> 6#include <qmainwindow.h>
7#include <qurl.h> 7#include <qtoolbar.h>
8#include <qwidgetstack.h> 8#include <qwidgetstack.h>
9#include "kvncbookmarkdlg.h" 9#include "kvncbookmarkdlg.h"
10 10
11class QAction; 11class QAction;
12class KRFBCanvas; 12class KRFBCanvas;
13class QPushButton; 13class QPushButton;
14class QToolBar; 14class QToolBar;
15 15
16/** 16/**
17 * Top level window for Keystone. 17 * Top level window for Keystone.
18 * 18 *
19 * @author Richard Moore, rich@kde.org 19 * @author Richard Moore, rich@kde.org
20 * @version $Id$ 20 * @version $Id$
21 */ 21 */
22class KVNC : public QMainWindow 22class KVNC : public QMainWindow
23{ 23{
24 Q_OBJECT 24 Q_OBJECT
25public: 25public:
26 KVNC( const char *name = 0 ); 26 KVNC( const char *name = 0 );
27 ~KVNC(); 27 ~KVNC();
28 28
29public slots: 29public slots:
30 void newConnection(); 30 void newConnection();
31 void deleteBookmark(); 31 void deleteBookmark();
32 void openConnection(QListBoxItem *); 32 void openConnection(QListBoxItem *);
33 void openConnection(QString); 33 void openConnection(QString);
34 void openConnection(void); 34 void openConnection(void);
35 void toggleFullScreen(); 35 void toggleFullScreen();
36 void closeConnection(); 36 void closeConnection();
37 37
38protected: 38protected:
39 void setupActions(); 39 void setupActions();
40 40
41protected slots: 41protected slots:
42 void showMenu(); 42 void showMenu();
43 43
44 void connected(); 44 void connected();
45 void loggedIn(); 45 void loggedIn();
46 void disconnected(); 46 void disconnected();
47 void statusMessage( const QString & ); 47 void statusMessage( const QString & );
48 void error( const QString & ); 48 void error( const QString & );
49 49
50private: 50private:
51 bool fullscreen; 51 bool fullscreen;
52 KRFBCanvas *canvas; 52 KRFBCanvas *canvas;
53 QPopupMenu *cornerMenu; 53 QPopupMenu *cornerMenu;
54 QPushButton *cornerButton; 54 QPushButton *cornerButton;
55 QAction *fullScreenAction; 55 QAction *fullScreenAction;
56 QAction *optionsAction; 56 QAction *optionsAction;
57 QAction *disconnectAction; 57 QAction *disconnectAction;
58 QAction *ctlAltDelAction;; 58 QAction *ctlAltDelAction;;
59 QAction *connectAction; 59 QAction *connectAction;
60 QToolBar * bar;
60 61
61 KVNCBookmarkDlg * bookmarkSelector; 62 KVNCBookmarkDlg * bookmarkSelector;
62 QWidgetStack * stack; 63 QWidgetStack * stack;
63 KRFBServer * curServer; 64 KRFBServer * curServer;
64}; 65};
65 66
66#endif // KVNC_H 67#endif // KVNC_H
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
@@ -100,121 +100,124 @@ QString KVNCBookmarkDlg::decipher(const QString& cipher)
100 int u = x.toInt(0,36) ^ mix; 100 int u = x.toInt(0,36) ^ mix;
101 plain.append(QChar(u)); 101 plain.append(QChar(u));
102 mix *= u; 102 mix *= u;
103 } 103 }
104 return plain; 104 return plain;
105} 105}
106 106
107void KVNCBookmarkDlg::readBookmarks(void) 107void KVNCBookmarkDlg::readBookmarks(void)
108{ 108{
109 QFile f(QDir::homeDirPath() + QString("/Applications/keypebble/bookmarks")); 109 QFile f(QDir::homeDirPath() + QString("/Applications/keypebble/bookmarks"));
110 110
111 QStringList entry; 111 QStringList entry;
112 QString key, val; 112 QString key, val;
113 KRFBServer * server=0; 113 KRFBServer * server=0;
114 114
115 if ( f.open(IO_ReadOnly) ) { 115 if ( f.open(IO_ReadOnly) ) {
116 QTextStream t( &f ); 116 QTextStream t( &f );
117 QString s; 117 QString s;
118 int n = 1; 118 int n = 1;
119 while ( !t.eof() ) { 119 while ( !t.eof() ) {
120 s = t.readLine(); 120 s = t.readLine();
121 121
122 122
123 entry=QStringList::split('=',s); 123 entry=QStringList::split('=',s);
124 key=entry[0].stripWhiteSpace().lower(); 124 key=entry[0].stripWhiteSpace().lower();
125 val=entry[1].stripWhiteSpace(); 125 val=entry[1].stripWhiteSpace();
126 126
127 if (key=="server") { 127 if (key=="server") {
128 128
129 if (server){ 129 if (server){
130 servers.append(server); 130 servers.append(server);
131 server=0; 131 server=0;
132 } 132 }
133 server = new KRFBServer(); 133 server = new KRFBServer();
134 134
135 if (!server) 135 if (!server)
136 return; 136 return;
137 server->name=val; 137 server->name=val;
138 138
139 } 139 }
140 else if (key=="hostname") 140 else if (key=="hostname")
141 server->hostname=val; 141 server->hostname=val;
142 else if (key=="password") 142 else if (key=="password")
143 server->password=decipher(val); 143 server->password=decipher(val);
144 else if (key=="display") 144 else if (key=="display")
145 server->display=val.toInt(); 145 server->display=val.toInt();
146 else if (key=="hextile") 146 else if (key=="hextile")
147 server->hexTile=val.toInt(); 147 server->hexTile=val.toInt();
148 else if (key=="corre") 148 else if (key=="corre")
149 server->corre=val.toInt(); 149 server->corre=val.toInt();
150 else if (key=="rre") 150 else if (key=="rre")
151 server->rre=val.toInt(); 151 server->rre=val.toInt();
152 else if (key=="copyrect") 152 else if (key=="copyrect")
153 server->copyrect=val.toInt(); 153 server->copyrect=val.toInt();
154 else if (key=="colors256") 154 else if (key=="colors256")
155 server->colors256=val.toInt(); 155 server->colors256=val.toInt();
156 else if (key=="shared") 156 else if (key=="shared")
157 server->shared=val.toInt(); 157 server->shared=val.toInt();
158 else if (key=="readonly") 158 else if (key=="readonly")
159 server->readOnly=val.toInt(); 159 server->readOnly=val.toInt();
160 else if (key=="deiconify") 160 else if (key=="deiconify")
161 server->deIconify=val.toInt(); 161 server->deIconify=val.toInt();
162 else if (key=="updaterate") 162 else if (key=="updaterate")
163 server->updateRate=val.toInt(); 163 server->updateRate=val.toInt();
164 else if (key=="scalefactor")
165 server->scaleFactor=val.toInt();
164 166
165 } 167 }
166 if (server){ 168 if (server){
167 servers.append(server); 169 servers.append(server);
168 server=0; 170 server=0;
169 } 171 }
170 f.close(); 172 f.close();
171 } 173 }
172} 174}
173 175
174void KVNCBookmarkDlg::writeBookmarks(void) 176void KVNCBookmarkDlg::writeBookmarks(void)
175{ 177{
176 QString filename=Global::applicationFileName("keypebble","bookmarks"); 178 QString filename=Global::applicationFileName("keypebble","bookmarks");
177 179
178 QFile f(filename); 180 QFile f(filename);
179 181
180 QString key, val; 182 QString key, val;
181 KRFBServer * server=0; 183 KRFBServer * server=0;
182 184
183 if ( f.open(IO_ReadWrite) ) { 185 if ( f.open(IO_ReadWrite) ) {
184 QTextStream t( &f ); 186 QTextStream t( &f );
185 QString s; 187 QString s;
186 int n = 1; 188 int n = 1;
187 KRFBServer *server; 189 KRFBServer *server;
188 190
189 for ( server=servers.first(); server != 0; server=servers.next() ) { 191 for ( server=servers.first(); server != 0; server=servers.next() ) {
190 qDebug(server->name); 192 qDebug(server->name);
191 t << "server=" << server->name << '\n'; 193 t << "server=" << server->name << '\n';
192 t << "\thostname=" << server->hostname << '\n'; 194 t << "\thostname=" << server->hostname << '\n';
193 t << "\tpassword=" << encipher(server->password )<< '\n'; 195 t << "\tpassword=" << encipher(server->password )<< '\n';
194 t << "\tdisplay=" << server->display << '\n'; 196 t << "\tdisplay=" << server->display << '\n';
195 t << "\thextile=" << server->hexTile << '\n'; 197 t << "\thextile=" << server->hexTile << '\n';
196 t << "\tcorre=" << server->corre << '\n'; 198 t << "\tcorre=" << server->corre << '\n';
197 t << "\trre=" << server->rre << '\n'; 199 t << "\trre=" << server->rre << '\n';
198 t << "\tcopyrect=" << server->copyrect << '\n'; 200 t << "\tcopyrect=" << server->copyrect << '\n';
199 t << "\tshared=" << server->shared << '\n'; 201 t << "\tshared=" << server->shared << '\n';
200 t << "\treadonly=" << server->readOnly << '\n'; 202 t << "\treadonly=" << server->readOnly << '\n';
201 t << "\tdeiconify=" << server->deIconify << '\n'; 203 t << "\tdeiconify=" << server->deIconify << '\n';
202 t << "\tupdaterate=" << server->updateRate << '\n'; 204 t << "\tupdaterate=" << server->updateRate << '\n';
205 t << "\tscalefactor=" << server->scaleFactor << '\n';
203 206
204 } 207 }
205 f.close(); 208 f.close();
206 } 209 }
207} 210}
208void KVNCBookmarkDlg::refresh(void) 211void KVNCBookmarkDlg::refresh(void)
209{ 212{
210 bookmarkList->clear(); 213 bookmarkList->clear();
211 KRFBServer * server=0; 214 KRFBServer * server=0;
212 for ( server=servers.first(); server != 0; server=servers.next() ) { 215 for ( server=servers.first(); server != 0; server=servers.next() ) {
213 bookmarkList->insertItem(server->name); 216 bookmarkList->insertItem(server->name);
214 } 217 }
215} 218}
216 219
217QString KVNCBookmarkDlg::selectedBookmark() 220QString KVNCBookmarkDlg::selectedBookmark()
218{ 221{
219 return bookmarkList->currentText(); 222 return bookmarkList->currentText();
220} 223}
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
@@ -1,75 +1,94 @@
1#include <qframe.h> 1#include <qframe.h>
2#include <qvbox.h> 2#include <qvbox.h>
3#include <qcheckbox.h> 3#include <qcheckbox.h>
4#include <qcombobox.h>
4#include <qspinbox.h> 5#include <qspinbox.h>
5#include <qlabel.h> 6#include <qlabel.h>
6#include <qlayout.h> 7#include <qlayout.h>
7#include <qwhatsthis.h> 8#include <qwhatsthis.h>
8#include <qapplication.h> 9#include <qapplication.h>
9#include <qlineedit.h> 10#include <qlineedit.h>
10#include <qpushbutton.h> 11#include <qpushbutton.h>
11#include "krfbserver.h" 12#include "krfbserver.h"
12 13
13#include "kvncconndlg.h" 14#include "kvncconndlg.h"
14 15
15KVNCConnDlg::KVNCConnDlg( KRFBServer *options, 16KVNCConnDlg::KVNCConnDlg( KRFBServer *options,
16 QWidget *parent, char *name, bool modal ) 17 QWidget *parent, char *name, bool modal )
17: KVNCConnDlgBase( parent, name, modal ) 18: KVNCConnDlgBase( parent, name, modal )
18{ 19{
19 this->options=options; 20 this->options=options;
20 tmpOptions=*options; 21 tmpOptions=*options;
21 22
22 serverHostname->setText(options->hostname); 23 serverHostname->setText(options->hostname);
23 serverDisplay->setValue(options->display); 24 serverDisplay->setValue(options->display);
24 serverPassword->setText(options->password); 25 serverPassword->setText(options->password);
25 serverBookmark->setText(options->name); 26 serverBookmark->setText(options->name);
26 27
27 hex->setChecked( options->hexTile ); 28 hex->setChecked( options->hexTile );
28 corre->setChecked( options->corre ); 29 corre->setChecked( options->corre );
29 rre->setChecked( options->rre ); 30 rre->setChecked( options->rre );
30 copyRect->setChecked( options->copyrect ); 31 copyRect->setChecked( options->copyrect );
31 32
33 for (int i=0; i < scaleFactor->count(); ++i) {
34 if (scaleFactor->text(i).toInt()==tmpOptions.scaleFactor) {
35 scaleFactor->setCurrentItem(i);
36 }
37 }
38
32 // TODO 39 // TODO
33 hex->setEnabled( false ); 40 hex->setEnabled( false );
34 corre->setEnabled( false ); 41 corre->setEnabled( false );
35 rre->setEnabled( false ); 42 rre->setEnabled( false );
36 // /TODO 43 // /TODO
37 44
38 deIconify->setChecked( options->deIconify ); 45 deIconify->setChecked( options->deIconify );
39 bit->setChecked( options->colors256 ); 46 bit->setChecked( options->colors256 );
40 shared->setChecked( options->shared ); 47 shared->setChecked( options->shared );
41 timeBox->setValue( options->updateRate ); 48 timeBox->setValue( options->updateRate );
42 49
50 serverPassword->setEchoMode(QLineEdit::Password);
43 51
44} 52 connect(togglePassword, SIGNAL( stateChanged(int) ), this, SLOT( showPassword(int) ) );
45 53
54
55}
46KVNCConnDlg::~KVNCConnDlg() 56KVNCConnDlg::~KVNCConnDlg()
47{ 57{
48} 58}
49 59
50void KVNCConnDlg::accept() 60void KVNCConnDlg::accept()
51{ 61{
52 save(); 62 save();
53 QDialog::accept(); 63 QDialog::accept();
54} 64}
55 65
56void KVNCConnDlg::save() 66void KVNCConnDlg::save()
57{ 67{
58 tmpOptions.hexTile = hex->isChecked(); 68 tmpOptions.hexTile = hex->isChecked();
59 tmpOptions.corre = corre->isChecked(); 69 tmpOptions.corre = corre->isChecked();
60 tmpOptions.rre = rre->isChecked(); 70 tmpOptions.rre = rre->isChecked();
61 tmpOptions.copyrect = copyRect->isChecked(); 71 tmpOptions.copyrect = copyRect->isChecked();
62 tmpOptions.deIconify = deIconify->isChecked(); 72 tmpOptions.deIconify = deIconify->isChecked();
63 tmpOptions.colors256 = bit->isChecked(); 73 tmpOptions.colors256 = bit->isChecked();
64 tmpOptions.shared = shared->isChecked(); 74 tmpOptions.shared = shared->isChecked();
65 tmpOptions.hostname = serverHostname->text(); 75 tmpOptions.hostname = serverHostname->text();
66 tmpOptions.password = serverPassword->text(); 76 tmpOptions.password = serverPassword->text();
67 tmpOptions.display = serverDisplay->value(); 77 tmpOptions.display = serverDisplay->value();
68 tmpOptions.name = serverBookmark->text(); 78 tmpOptions.name = serverBookmark->text();
79 tmpOptions.scaleFactor = scaleFactor->currentText().toInt();
69 80
70 if (!serverBookmark->text().isEmpty()) { 81 if (!serverBookmark->text().isEmpty()) {
71 if ( options) { 82 if ( options) {
72 *options=tmpOptions; 83 *options=tmpOptions;
73 } 84 }
74 } 85 }
75} 86}
87
88void KVNCConnDlg::showPassword(int show)
89{
90 if (show)
91 serverPassword->setEchoMode(QLineEdit::Normal);
92 else
93 serverPassword->setEchoMode(QLineEdit::Password);
94}
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
@@ -1,33 +1,34 @@
1// -*- c++ -*- 1// -*- c++ -*-
2 2
3#ifndef KVNCCONNECTION_H 3#ifndef KVNCCONNECTION_H
4#define KVNCCONNECTION_H 4#define KVNCCONNECTION_H
5 5
6#include "kvncconndlgbase.h" 6#include "kvncconndlgbase.h"
7#include "krfbserver.h" 7#include "krfbserver.h"
8 8
9 9
10class KVNCConnDlg : public KVNCConnDlgBase 10class KVNCConnDlg : public KVNCConnDlgBase
11{ 11{
12 Q_OBJECT 12 Q_OBJECT
13 13
14 public: 14 public:
15 KVNCConnDlg( KRFBServer *options, 15 KVNCConnDlg( KRFBServer *options,
16 QWidget *parent = 0, char *name = 0, bool modal = true ); 16 QWidget *parent = 0, char *name = 0, bool modal = true );
17 ~KVNCConnDlg(); 17 ~KVNCConnDlg();
18 18
19 protected: 19 protected:
20 void accept(); 20 void accept();
21 private slots: 21 private slots:
22 void save(); 22 void save();
23 void showPassword(int);
23 24
24 private: 25 private:
25 KRFBServer tmpOptions; 26 KRFBServer tmpOptions;
26 KRFBServer * options; 27 KRFBServer * options;
27}; 28};
28 29
29#endif // KVNCCONNECTION_H 30#endif // KVNCCONNECTION_H
30 31
31 32
32 33
33 34
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
@@ -1,432 +1,482 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>KVNCConnDlgBase</class> 2<class>KVNCConnDlgBase</class>
3<widget> 3<widget>
4 <class>QDialog</class> 4 <class>QDialog</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>KVNCConnDlgBase</cstring> 7 <cstring>KVNCConnDlgBase</cstring>
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>984</width> 14 <width>260</width>
15 <height>676</height> 15 <height>242</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>VNC Viewer Connection</string> 20 <string>VNC Viewer Connection</string>
21 </property> 21 </property>
22 <property> 22 <property>
23 <name>layoutMargin</name> 23 <name>layoutMargin</name>
24 </property> 24 </property>
25 <vbox> 25 <widget>
26 <class>QTabWidget</class>
26 <property stdset="1"> 27 <property stdset="1">
27 <name>margin</name> 28 <name>name</name>
28 <number>0</number> 29 <cstring>TabWidget3</cstring>
29 </property> 30 </property>
30 <property stdset="1"> 31 <property stdset="1">
31 <name>spacing</name> 32 <name>geometry</name>
32 <number>6</number> 33 <rect>
34 <x>0</x>
35 <y>0</y>
36 <width>266</width>
37 <height>233</height>
38 </rect>
33 </property> 39 </property>
34 <widget> 40 <widget>
35 <class>QTabWidget</class> 41 <class>QWidget</class>
36 <property stdset="1"> 42 <property stdset="1">
37 <name>name</name> 43 <name>name</name>
38 <cstring>TabWidget3</cstring> 44 <cstring>tab</cstring>
39 </property> 45 </property>
40 <widget> 46 <attribute>
41 <class>QWidget</class> 47 <name>title</name>
48 <string>Server</string>
49 </attribute>
50 <grid>
42 <property stdset="1"> 51 <property stdset="1">
43 <name>name</name> 52 <name>margin</name>
44 <cstring>tab</cstring> 53 <number>11</number>
45 </property> 54 </property>
46 <attribute> 55 <property stdset="1">
47 <name>title</name> 56 <name>spacing</name>
48 <string>Server</string> 57 <number>6</number>
49 </attribute> 58 </property>
50 <grid> 59 <widget row="2" column="1" rowspan="1" colspan="2" >
60 <class>QLineEdit</class>
51 <property stdset="1"> 61 <property stdset="1">
52 <name>margin</name> 62 <name>name</name>
53 <number>11</number> 63 <cstring>serverPassword</cstring>
54 </property> 64 </property>
55 <property stdset="1"> 65 <property stdset="1">
56 <name>spacing</name> 66 <name>autoMask</name>
57 <number>6</number> 67 <bool>true</bool>
58 </property> 68 </property>
59 <widget row="0" column="0" > 69 <property stdset="1">
60 <class>QLabel</class> 70 <name>echoMode</name>
61 <property stdset="1"> 71 <enum>Password</enum>
62 <name>name</name> 72 </property>
63 <cstring>hostname</cstring> 73 </widget>
64 </property> 74 <widget row="3" column="1" >
65 <property stdset="1"> 75 <class>QCheckBox</class>
66 <name>text</name> 76 <property stdset="1">
67 <string>Host Name:</string> 77 <name>name</name>
68 </property> 78 <cstring>togglePassword</cstring>
69 </widget> 79 </property>
70 <widget row="1" column="0" > 80 <property stdset="1">
71 <class>QLabel</class> 81 <name>text</name>
72 <property stdset="1"> 82 <string>Show Password</string>
73 <name>name</name> 83 </property>
74 <cstring>TextLabel2_2</cstring> 84 </widget>
75 </property> 85 <widget row="2" column="0" >
76 <property stdset="1"> 86 <class>QLabel</class>
77 <name>text</name> 87 <property stdset="1">
78 <string>Display Number:</string> 88 <name>name</name>
79 </property> 89 <cstring>TextLabel3</cstring>
80 </widget> 90 </property>
81 <widget row="2" column="1" rowspan="1" colspan="2" > 91 <property stdset="1">
82 <class>QLineEdit</class> 92 <name>text</name>
83 <property stdset="1"> 93 <string>Password:</string>
84 <name>name</name> 94 </property>
85 <cstring>serverPassword</cstring> 95 </widget>
86 </property> 96 <widget row="4" column="1" rowspan="1" colspan="2" >
87 <property stdset="1"> 97 <class>QLineEdit</class>
88 <name>autoMask</name> 98 <property stdset="1">
89 <bool>true</bool> 99 <name>name</name>
90 </property> 100 <cstring>serverBookmark</cstring>
91 </widget> 101 </property>
92 <widget row="1" column="1" rowspan="1" colspan="2" > 102 </widget>
93 <class>QSpinBox</class> 103 <widget row="4" column="0" >
94 <property stdset="1"> 104 <class>QLabel</class>
95 <name>name</name> 105 <property stdset="1">
96 <cstring>serverDisplay</cstring> 106 <name>name</name>
97 </property> 107 <cstring>TextLabel1_2</cstring>
98 <property stdset="1"> 108 </property>
99 <name>maxValue</name> 109 <property stdset="1">
100 <number>500</number> 110 <name>text</name>
101 </property> 111 <string>Bookmark Name:</string>
102 <property stdset="1"> 112 </property>
103 <name>minValue</name> 113 </widget>
104 <number>0</number> 114 <widget row="0" column="1" rowspan="1" colspan="2" >
105 </property> 115 <class>QLineEdit</class>
116 <property stdset="1">
117 <name>name</name>
118 <cstring>serverHostname</cstring>
119 </property>
120 </widget>
121 <widget row="0" column="0" >
122 <class>QLabel</class>
123 <property stdset="1">
124 <name>name</name>
125 <cstring>hostname</cstring>
126 </property>
127 <property stdset="1">
128 <name>text</name>
129 <string>Host Name:</string>
130 </property>
131 </widget>
132 <widget row="1" column="0" >
133 <class>QLabel</class>
134 <property stdset="1">
135 <name>name</name>
136 <cstring>TextLabel2_2</cstring>
137 </property>
138 <property stdset="1">
139 <name>text</name>
140 <string>Display Number:</string>
141 </property>
142 </widget>
143 <widget row="1" column="1" rowspan="1" colspan="2" >
144 <class>QSpinBox</class>
145 <property stdset="1">
146 <name>name</name>
147 <cstring>serverDisplay</cstring>
148 </property>
149 <property stdset="1">
150 <name>maxValue</name>
151 <number>500</number>
152 </property>
153 <property stdset="1">
154 <name>minValue</name>
155 <number>0</number>
156 </property>
157 <property stdset="1">
158 <name>value</name>
159 <number>0</number>
160 </property>
161 </widget>
162 <spacer row="5" column="2" >
163 <property>
164 <name>name</name>
165 <cstring>Spacer2</cstring>
166 </property>
167 <property stdset="1">
168 <name>orientation</name>
169 <enum>Vertical</enum>
170 </property>
171 <property stdset="1">
172 <name>sizeType</name>
173 <enum>Expanding</enum>
174 </property>
175 <property>
176 <name>sizeHint</name>
177 <size>
178 <width>20</width>
179 <height>20</height>
180 </size>
181 </property>
182 </spacer>
183 </grid>
184 </widget>
185 <widget>
186 <class>QWidget</class>
187 <property stdset="1">
188 <name>name</name>
189 <cstring>tab</cstring>
190 </property>
191 <attribute>
192 <name>title</name>
193 <string>Options</string>
194 </attribute>
195 <vbox>
196 <property stdset="1">
197 <name>margin</name>
198 <number>11</number>
199 </property>
200 <property stdset="1">
201 <name>spacing</name>
202 <number>6</number>
203 </property>
204 <widget>
205 <class>QLabel</class>
206 <property stdset="1">
207 <name>name</name>
208 <cstring>TextLabel1</cstring>
209 </property>
210 <property stdset="1">
211 <name>text</name>
212 <string>Check for screen updates every:</string>
213 </property>
214 </widget>
215 <widget>
216 <class>QLayoutWidget</class>
217 <property stdset="1">
218 <name>name</name>
219 <cstring>Layout2</cstring>
220 </property>
221 <hbox>
106 <property stdset="1"> 222 <property stdset="1">
107 <name>value</name> 223 <name>margin</name>
108 <number>0</number> 224 <number>0</number>
109 </property> 225 </property>
110 </widget>
111 <widget row="0" column="1" rowspan="1" colspan="2" >
112 <class>QLineEdit</class>
113 <property stdset="1">
114 <name>name</name>
115 <cstring>serverHostname</cstring>
116 </property>
117 </widget>
118 <widget row="2" column="0" >
119 <class>QLabel</class>
120 <property stdset="1">
121 <name>name</name>
122 <cstring>TextLabel3</cstring>
123 </property>
124 <property stdset="1"> 226 <property stdset="1">
125 <name>text</name> 227 <name>spacing</name>
126 <string>Password:</string> 228 <number>6</number>
127 </property> 229 </property>
128 </widget> 230 <widget>
129 <widget row="3" column="1" rowspan="1" colspan="2" > 231 <class>QSpinBox</class>
130 <class>QLineEdit</class>
131 <property stdset="1">
132 <name>name</name>
133 <cstring>serverBookmark</cstring>
134 </property>
135 </widget>
136 <widget row="3" column="0" >
137 <class>QLabel</class>
138 <property stdset="1">
139 <name>name</name>
140 <cstring>TextLabel1_2</cstring>
141 </property>
142 <property stdset="1">
143 <name>text</name>
144 <string>Bookmark Name:</string>
145 </property>
146 </widget>
147 <spacer row="5" column="2" >
148 <property>
149 <name>name</name>
150 <cstring>Spacer2</cstring>
151 </property>
152 <property stdset="1">
153 <name>orientation</name>
154 <enum>Vertical</enum>
155 </property>
156 <property stdset="1">
157 <name>sizeType</name>
158 <enum>Expanding</enum>
159 </property>
160 <property>
161 <name>sizeHint</name>
162 <size>
163 <width>20</width>
164 <height>20</height>
165 </size>
166 </property>
167 </spacer>
168 <widget row="4" column="1" >
169 <class>QLayoutWidget</class>
170 <property stdset="1">
171 <name>name</name>
172 <cstring>Layout3</cstring>
173 </property>
174 <hbox>
175 <property stdset="1"> 232 <property stdset="1">
176 <name>margin</name> 233 <name>name</name>
177 <number>0</number> 234 <cstring>timeBox</cstring>
178 </property> 235 </property>
179 <property stdset="1"> 236 <property stdset="1">
180 <name>spacing</name> 237 <name>maxValue</name>
181 <number>6</number> 238 <number>500</number>
182 </property> 239 </property>
183 </hbox> 240 <property stdset="1">
184 </widget> 241 <name>minValue</name>
185 </grid> 242 <number>1</number>
186 </widget> 243 </property>
187 <widget> 244 </widget>
188 <class>QWidget</class> 245 <widget>
189 <property stdset="1"> 246 <class>QLabel</class>
190 <name>name</name> 247 <property stdset="1">
191 <cstring>tab</cstring> 248 <name>name</name>
192 </property> 249 <cstring>TextLabel2</cstring>
193 <attribute> 250 </property>
194 <name>title</name> 251 <property stdset="1">
195 <string>Options</string> 252 <name>text</name>
196 </attribute> 253 <string>Milliseconds</string>
197 <vbox> 254 </property>
255 </widget>
256 </hbox>
257 </widget>
258 <widget>
259 <class>QCheckBox</class>
198 <property stdset="1"> 260 <property stdset="1">
199 <name>margin</name> 261 <name>name</name>
200 <number>11</number> 262 <cstring>bit</cstring>
201 </property> 263 </property>
202 <property stdset="1"> 264 <property stdset="1">
203 <name>spacing</name> 265 <name>text</name>
204 <number>6</number> 266 <string>Request 8-bit session</string>
205 </property> 267 </property>
206 <widget> 268 </widget>
207 <class>QLabel</class> 269 <widget>
208 <property stdset="1"> 270 <class>QCheckBox</class>
209 <name>name</name> 271 <property stdset="1">
210 <cstring>TextLabel1</cstring> 272 <name>name</name>
211 </property> 273 <cstring>deIconify</cstring>
274 </property>
275 <property stdset="1">
276 <name>text</name>
277 <string>Raise on bell</string>
278 </property>
279 </widget>
280 <widget>
281 <class>QCheckBox</class>
282 <property stdset="1">
283 <name>name</name>
284 <cstring>shared</cstring>
285 </property>
286 <property stdset="1">
287 <name>text</name>
288 <string>Request shared session</string>
289 </property>
290 </widget>
291 <widget>
292 <class>QLayoutWidget</class>
293 <property stdset="1">
294 <name>name</name>
295 <cstring>Layout3</cstring>
296 </property>
297 <hbox>
212 <property stdset="1"> 298 <property stdset="1">
213 <name>text</name> 299 <name>margin</name>
214 <string>Check for screen updates every:</string> 300 <number>0</number>
215 </property> 301 </property>
216 </widget>
217 <widget>
218 <class>QLayoutWidget</class>
219 <property stdset="1"> 302 <property stdset="1">
220 <name>name</name> 303 <name>spacing</name>
221 <cstring>Layout2</cstring> 304 <number>6</number>
222 </property> 305 </property>
223 <hbox> 306 <widget>
224 <property stdset="1"> 307 <class>QComboBox</class>
225 <name>margin</name> 308 <item>
226 <number>0</number> 309 <property>
227 </property> 310 <name>text</name>
228 <property stdset="1"> 311 <string>1</string>
229 <name>spacing</name>
230 <number>6</number>
231 </property>
232 <widget>
233 <class>QSpinBox</class>
234 <property stdset="1">
235 <name>name</name>
236 <cstring>timeBox</cstring>
237 </property>
238 <property stdset="1">
239 <name>maxValue</name>
240 <number>500</number>
241 </property>
242 <property stdset="1">
243 <name>minValue</name>
244 <number>1</number>
245 </property> 312 </property>
246 </widget> 313 </item>
247 <widget> 314 <item>
248 <class>QLabel</class> 315 <property>
249 <property stdset="1"> 316 <name>text</name>
250 <name>name</name> 317 <string>2</string>
251 <cstring>TextLabel2</cstring>
252 </property> 318 </property>
253 <property stdset="1"> 319 </item>
320 <item>
321 <property>
254 <name>text</name> 322 <name>text</name>
255 <string>Milliseconds</string> 323 <string>4</string>
256 </property> 324 </property>
257 </widget> 325 </item>
258 </hbox> 326 <property stdset="1">
259 </widget> 327 <name>name</name>
260 <widget> 328 <cstring>scaleFactor</cstring>
261 <class>QCheckBox</class> 329 </property>
262 <property stdset="1"> 330 </widget>
263 <name>name</name> 331 <widget>
264 <cstring>bit</cstring> 332 <class>QLabel</class>
265 </property> 333 <property stdset="1">
266 <property stdset="1"> 334 <name>name</name>
267 <name>text</name> 335 <cstring>TextLabel2_3</cstring>
268 <string>Request 8-bit session</string> 336 </property>
269 </property> 337 <property stdset="1">
270 </widget> 338 <name>text</name>
271 <widget> 339 <string>Scale Factor</string>
272 <class>QCheckBox</class> 340 </property>
273 <property stdset="1"> 341 </widget>
274 <name>name</name> 342 </hbox>
275 <cstring>deIconify</cstring> 343 </widget>
276 </property> 344 <spacer>
277 <property stdset="1"> 345 <property>
278 <name>text</name> 346 <name>name</name>
279 <string>Raise on bell</string> 347 <cstring>Spacer2</cstring>
280 </property> 348 </property>
281 </widget> 349 <property stdset="1">
282 <widget> 350 <name>orientation</name>
283 <class>QCheckBox</class> 351 <enum>Vertical</enum>
284 <property stdset="1"> 352 </property>
285 <name>name</name> 353 <property stdset="1">
286 <cstring>shared</cstring> 354 <name>sizeType</name>
287 </property> 355 <enum>Expanding</enum>
288 <property stdset="1"> 356 </property>
289 <name>text</name> 357 <property>
290 <string>Request shared session</string> 358 <name>sizeHint</name>
291 </property> 359 <size>
292 </widget> 360 <width>20</width>
293 <spacer> 361 <height>20</height>
294 <property> 362 </size>
295 <name>name</name> 363 </property>
296 <cstring>Spacer2</cstring> 364 </spacer>
297 </property> 365 </vbox>
298 <property stdset="1"> 366 </widget>
299 <name>orientation</name> 367 <widget>
300 <enum>Vertical</enum> 368 <class>QWidget</class>
301 </property> 369 <property stdset="1">
302 <property stdset="1"> 370 <name>name</name>
303 <name>sizeType</name> 371 <cstring>tab</cstring>
304 <enum>Expanding</enum> 372 </property>
305 </property> 373 <attribute>
306 <property> 374 <name>title</name>
307 <name>sizeHint</name> 375 <string>Encodings</string>
308 <size> 376 </attribute>
309 <width>20</width> 377 <vbox>
310 <height>20</height> 378 <property stdset="1">
311 </size> 379 <name>margin</name>
312 </property> 380 <number>11</number>
313 </spacer> 381 </property>
314 </vbox>
315 </widget>
316 <widget>
317 <class>QWidget</class>
318 <property stdset="1"> 382 <property stdset="1">
319 <name>name</name> 383 <name>spacing</name>
320 <cstring>tab</cstring> 384 <number>6</number>
321 </property> 385 </property>
322 <attribute> 386 <widget>
323 <name>title</name> 387 <class>QCheckBox</class>
324 <string>Encodings</string>
325 </attribute>
326 <vbox>
327 <property stdset="1"> 388 <property stdset="1">
328 <name>margin</name> 389 <name>name</name>
329 <number>11</number> 390 <cstring>hex</cstring>
330 </property> 391 </property>
331 <property stdset="1"> 392 <property stdset="1">
332 <name>spacing</name> 393 <name>enabled</name>
333 <number>6</number> 394 <bool>false</bool>
334 </property> 395 </property>
335 <widget> 396 <property stdset="1">
336 <class>QCheckBox</class> 397 <name>text</name>
337 <property stdset="1"> 398 <string>Hextile encoding</string>
338 <name>name</name> 399 </property>
339 <cstring>hex</cstring> 400 </widget>
340 </property> 401 <widget>
341 <property stdset="1"> 402 <class>QCheckBox</class>
342 <name>enabled</name> 403 <property stdset="1">
343 <bool>false</bool> 404 <name>name</name>
344 </property> 405 <cstring>corre</cstring>
345 <property stdset="1"> 406 </property>
346 <name>text</name> 407 <property stdset="1">
347 <string>Hextile encoding</string> 408 <name>enabled</name>
348 </property> 409 <bool>false</bool>
349 </widget> 410 </property>
350 <widget> 411 <property stdset="1">
351 <class>QCheckBox</class> 412 <name>text</name>
352 <property stdset="1"> 413 <string>CoRRE encoding</string>
353 <name>name</name> 414 </property>
354 <cstring>corre</cstring> 415 </widget>
355 </property> 416 <widget>
356 <property stdset="1"> 417 <class>QCheckBox</class>
357 <name>enabled</name> 418 <property stdset="1">
358 <bool>false</bool> 419 <name>name</name>
359 </property> 420 <cstring>rre</cstring>
360 <property stdset="1"> 421 </property>
361 <name>text</name> 422 <property stdset="1">
362 <string>CoRRE encoding</string> 423 <name>enabled</name>
363 </property> 424 <bool>false</bool>
364 </widget> 425 </property>
365 <widget> 426 <property stdset="1">
366 <class>QCheckBox</class> 427 <name>text</name>
367 <property stdset="1"> 428 <string>RRE encoding</string>
368 <name>name</name> 429 </property>
369 <cstring>rre</cstring> 430 </widget>
370 </property> 431 <widget>
371 <property stdset="1"> 432 <class>QCheckBox</class>
372 <name>enabled</name> 433 <property stdset="1">
373 <bool>false</bool> 434 <name>name</name>
374 </property> 435 <cstring>copyRect</cstring>
375 <property stdset="1"> 436 </property>
376 <name>text</name> 437 <property stdset="1">
377 <string>RRE encoding</string> 438 <name>text</name>
378 </property> 439 <string>Copy rectangle encoding</string>
379 </widget> 440 </property>
380 <widget> 441 </widget>
381 <class>QCheckBox</class> 442 <spacer>
382 <property stdset="1"> 443 <property>
383 <name>name</name> 444 <name>name</name>
384 <cstring>copyRect</cstring> 445 <cstring>Spacer3</cstring>
385 </property> 446 </property>
386 <property stdset="1"> 447 <property stdset="1">
387 <name>text</name> 448 <name>orientation</name>
388 <string>Copy rectangle encoding</string> 449 <enum>Vertical</enum>
389 </property> 450 </property>
390 </widget> 451 <property stdset="1">
391 <spacer> 452 <name>sizeType</name>
392 <property> 453 <enum>Expanding</enum>
393 <name>name</name> 454 </property>
394 <cstring>Spacer3</cstring> 455 <property>
395 </property> 456 <name>sizeHint</name>
396 <property stdset="1"> 457 <size>
397 <name>orientation</name> 458 <width>20</width>
398 <enum>Vertical</enum> 459 <height>20</height>
399 </property> 460 </size>
400 <property stdset="1"> 461 </property>
401 <name>sizeType</name> 462 </spacer>
402 <enum>Expanding</enum> 463 </vbox>
403 </property>
404 <property>
405 <name>sizeHint</name>
406 <size>
407 <width>20</width>
408 <height>20</height>
409 </size>
410 </property>
411 </spacer>
412 </vbox>
413 </widget>
414 </widget> 464 </widget>
415 </vbox> 465 </widget>
416</widget> 466</widget>
417<tabstops> 467<tabstops>
418 <tabstop>TabWidget3</tabstop> 468 <tabstop>TabWidget3</tabstop>
419 <tabstop>serverHostname</tabstop> 469 <tabstop>serverHostname</tabstop>
420 <tabstop>serverDisplay</tabstop> 470 <tabstop>serverDisplay</tabstop>
421 <tabstop>serverPassword</tabstop> 471 <tabstop>serverPassword</tabstop>
422 <tabstop>serverBookmark</tabstop> 472 <tabstop>serverBookmark</tabstop>
423 <tabstop>timeBox</tabstop> 473 <tabstop>timeBox</tabstop>
424 <tabstop>bit</tabstop> 474 <tabstop>bit</tabstop>
425 <tabstop>deIconify</tabstop> 475 <tabstop>deIconify</tabstop>
426 <tabstop>shared</tabstop> 476 <tabstop>shared</tabstop>
427 <tabstop>hex</tabstop> 477 <tabstop>hex</tabstop>
428 <tabstop>corre</tabstop> 478 <tabstop>corre</tabstop>
429 <tabstop>rre</tabstop> 479 <tabstop>rre</tabstop>
430 <tabstop>copyRect</tabstop> 480 <tabstop>copyRect</tabstop>
431</tabstops> 481</tabstops>
432</UI> 482</UI>