From bdecd392488dee486d302f683b91acf89708d4a6 Mon Sep 17 00:00:00 2001 From: treke Date: Sun, 17 Nov 2002 18:30:27 +0000 Subject: Resized a couple dialogs to fit better. Now can synthesize right click events from the corner menu. Still having problems with double click though --- (limited to 'noncore/comm') diff --git a/noncore/comm/keypebble/krfbcanvas.cpp b/noncore/comm/keypebble/krfbcanvas.cpp index 918ce8b..049bbd4 100644 --- a/noncore/comm/keypebble/krfbcanvas.cpp +++ b/noncore/comm/keypebble/krfbcanvas.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -27,6 +28,9 @@ KRFBCanvas::KRFBCanvas( QWidget *parent, const char *name ) viewport()->setFocusPolicy( QWidget::StrongFocus ); viewport()->setFocus(); + + nextRightClick=0; + nextDoubleClick=0; } KRFBCanvas::~KRFBCanvas() @@ -124,14 +128,35 @@ void KRFBCanvas::viewportUpdate( int x, int y, int w, int h ) void KRFBCanvas::contentsMousePressEvent( QMouseEvent *e ) { - if ( loggedIn_ ) + + if (nextDoubleClick) { + connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),LeftButton,LeftButton)); + connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),LeftButton,0)); + connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),LeftButton,0)); + connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),NoButton,NoButton)); + connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),NoButton,0)); + } if (nextRightClick) { + connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),RightButton,RightButton)); + connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),RightButton,0)); + connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),NoButton,NoButton)); + connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),NoButton,0)); + } else if ( loggedIn_ ) connection_->buffer()->mouseEvent( e ); + + qDebug("Press"); + qDebug(QString::number(e->type()==QEvent::MouseButtonPress)); } void KRFBCanvas::contentsMouseReleaseEvent( QMouseEvent *e ) { - if ( loggedIn_ ) + if ( loggedIn_ && !nextRightClick && !nextDoubleClick) { connection_->buffer()->mouseEvent( e ); + } + + nextRightClick=0; + nextDoubleClick=0; + qDebug("Release"); + qDebug(QString::number(e->button())); } void KRFBCanvas::contentsMouseMoveEvent( QMouseEvent *e ) @@ -167,7 +192,6 @@ void KRFBCanvas::clipboardChanged() void KRFBCanvas::sendCtlAltDel( void) { - qDebug("Here"); if ( loggedIn_ ) { connection_->buffer()->keyPressEvent( &QKeyEvent(QEvent::KeyPress,Qt::Key_Control, 0,0)); connection_->buffer()->keyPressEvent( &QKeyEvent(QEvent::KeyPress,Qt::Key_Alt, 0,0)); @@ -177,3 +201,13 @@ void KRFBCanvas::sendCtlAltDel( void) connection_->buffer()->keyPressEvent( &QKeyEvent(QEvent::KeyRelease,Qt::Key_Delete, 0,0)); } } + +void KRFBCanvas::markDoubleClick( void) +{ + nextRightClick=1; +} + +void KRFBCanvas::markRightClick( void) +{ + nextRightClick=1; +} diff --git a/noncore/comm/keypebble/krfbcanvas.h b/noncore/comm/keypebble/krfbcanvas.h index cd3047c..5c7b949 100644 --- a/noncore/comm/keypebble/krfbcanvas.h +++ b/noncore/comm/keypebble/krfbcanvas.h @@ -32,6 +32,8 @@ public slots: void refresh(); void bell(); void sendCtlAltDel(void); + void markRightClick(void); + void markDoubleClick(void); protected: virtual void keyPressEvent( QKeyEvent * ); @@ -48,6 +50,8 @@ protected slots: void clipboardChanged(); private: + int nextRightClick; + int nextDoubleClick; KRFBConnection *connection_; QString password; bool loggedIn_; diff --git a/noncore/comm/keypebble/kvnc.cpp b/noncore/comm/keypebble/kvnc.cpp index ef57366..abdb1e0 100644 --- a/noncore/comm/keypebble/kvnc.cpp +++ b/noncore/comm/keypebble/kvnc.cpp @@ -183,6 +183,18 @@ void KVNC::setupActions() this, SLOT( closeConnection() ) ); disconnectAction->addTo( cornerMenu ); disconnectAction->setEnabled( false ); + + doubleClickAction = new QAction( tr("Next Click is Double Click"), QString::null, 0, 0 ); + connect( doubleClickAction, SIGNAL(activated()), + canvas, SLOT( markDoubleClick() ) ); + doubleClickAction->addTo( cornerMenu ); + doubleClickAction->setEnabled( false ); + + rightClickAction = new QAction( tr("Next Click is Right Click"), QString::null, 0, 0 ); + connect( rightClickAction, SIGNAL(activated()), + canvas, SLOT( markRightClick() ) ); + rightClickAction->addTo( cornerMenu ); + rightClickAction->setEnabled( false ); } void KVNC::toggleFullScreen() @@ -238,6 +250,8 @@ void KVNC::connected() ctlAltDelAction->setEnabled(true); disconnectAction->setEnabled( true ); fullScreenAction->setEnabled( true ); + doubleClickAction->setEnabled( false ); + rightClickAction->setEnabled( true ); stack->raiseWidget(canvas); bar->hide(); } @@ -258,6 +272,8 @@ void KVNC::disconnected() ctlAltDelAction->setEnabled(false); disconnectAction->setEnabled( false ); fullScreenAction->setEnabled( false ); + doubleClickAction->setEnabled( false ); + rightClickAction->setEnabled( false ); stack->raiseWidget(bookmarkSelector); bar->show(); } diff --git a/noncore/comm/keypebble/kvnc.h b/noncore/comm/keypebble/kvnc.h index 82a24fc..51c7151 100644 --- a/noncore/comm/keypebble/kvnc.h +++ b/noncore/comm/keypebble/kvnc.h @@ -57,6 +57,8 @@ private: QAction *disconnectAction; QAction *ctlAltDelAction;; QAction *connectAction; + QAction *rightClickAction; + QAction *doubleClickAction; QToolBar * bar; KVNCBookmarkDlg * bookmarkSelector; diff --git a/noncore/comm/keypebble/kvncbookmarkdlgbase.ui b/noncore/comm/keypebble/kvncbookmarkdlgbase.ui index 69d8a14..4ca4f26 100644 --- a/noncore/comm/keypebble/kvncbookmarkdlgbase.ui +++ b/noncore/comm/keypebble/kvncbookmarkdlgbase.ui @@ -11,7 +11,7 @@ 0 0 - 580 + 576 480 @@ -19,10 +19,13 @@ caption Bookmarks + + layoutMargin + margin - 11 + 0 spacing diff --git a/noncore/comm/keypebble/kvncconndlgbase.ui b/noncore/comm/keypebble/kvncconndlgbase.ui index de3f785..003aad2 100644 --- a/noncore/comm/keypebble/kvncconndlgbase.ui +++ b/noncore/comm/keypebble/kvncconndlgbase.ui @@ -11,8 +11,8 @@ 0 0 - 256 - 242 + 253 + 408 @@ -22,487 +22,531 @@ layoutMargin - - QTabWidget + - name - TabWidget3 + margin + 11 - geometry - - 0 - 0 - 266 - 233 - + spacing + 6 - - QWidget + + QTabWidget name - tab + TabWidget3 - - title - Server - - + + QWidget - margin - 11 + name + tab - - spacing - 6 - - - QLineEdit - - name - serverPassword - - - autoMask - true - - - echoMode - Password - - - whatsThis - The password of the VNC server - - - - QCheckBox + + title + Server + + - name - togglePassword + margin + 11 - text - Show Password - - - whatsThis - Toggle obscuring the password - - - - QLabel - - name - TextLabel3 - - - text - Password: - - - - QLineEdit - - name - serverBookmark - - - whatsThis - The name of the VNC server + spacing + 6 - - - QLabel - - name - TextLabel1_2 - - - text - Bookmark Name: - - - - QLineEdit - - name - serverHostname - - - whatsThis - The host name of the VNC server - - - - QLabel - - name - hostname - - - text - Host Name: - - - - QLabel - - name - TextLabel2_2 - - - text - Display Number: - - - - QSpinBox - - name - serverDisplay - - - maxValue - 500 - - - minValue - 0 - - - value - 0 - - - whatsThis - The display number of the VNC server - - - - - name - Spacer2 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - QWidget - - name - tab - - - title - Options - - - - margin - 11 - + + QLineEdit + + name + serverPassword + + + autoMask + true + + + echoMode + Password + + + whatsThis + The password of the VNC server + + + + QCheckBox + + name + togglePassword + + + sizePolicy + + 7 + 0 + + + + text + Show Password + + + whatsThis + Toggle obscuring the password + + + + QLabel + + name + TextLabel3 + + + text + Password: + + + + QLineEdit + + name + serverBookmark + + + whatsThis + The name of the VNC server + + + + QLabel + + name + TextLabel1_2 + + + text + Bookmark Name: + + + + QLineEdit + + name + serverHostname + + + whatsThis + The host name of the VNC server + + + + QLabel + + name + hostname + + + text + Host Name: + + + + QLabel + + name + TextLabel2_2 + + + text + Display Number: + + + + QSpinBox + + name + serverDisplay + + + sizePolicy + + 7 + 0 + + + + maxValue + 500 + + + minValue + 0 + + + value + 0 + + + whatsThis + The display number of the VNC server + + + + + name + Spacer4 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + + + QWidget - spacing - 6 + name + tab - - QLabel - - name - TextLabel1 - + + title + Options + + - text - Check for screen updates every: + margin + 11 - - - QLayoutWidget - name - Layout2 + spacing + 6 - + + QCheckBox - margin - 0 + name + shared - spacing - 6 + sizePolicy + + 7 + 0 + - - QSpinBox - - name - timeBox - - - maxValue - 500 - - - minValue - 1 - - - whatsThis - Delay between requesting updates from the server - - - - QLabel - - name - TextLabel2 - - - text - Milliseconds - - - - - - QCheckBox - - name - bit - - - text - Request 8-bit session - - - whatsThis - Request that the VNC server transfer 8 bit color - - - - QCheckBox - - name - deIconify - - - text - Raise on bell - - - - QCheckBox - - name - shared - - - text - Request shared session - - - whatsThis - Allow other users to connect to the VNC server - - - - QLayoutWidget - - name - Layout3 - - - margin - 0 + text + Request shared session + + + whatsThis + Allow other users to connect to the VNC server + + + + + name + Spacer2 - spacing - 6 - - - QComboBox - - - text - 1 - - - - - text - 2 - - - - - text - 4 - - - - name - scaleFactor - + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QCheckBox + + name + bit + + + sizePolicy + + 7 + 0 + + + + text + Request 8-bit session + + + whatsThis + Request that the VNC server transfer 8 bit color + + + + QSpinBox + + name + timeBox + + + sizePolicy + + 7 + 0 + + + + maxValue + 500 + + + minValue + 1 + + + whatsThis + Delay between requesting updates from the server + + + + QComboBox + - whatsThis - Scale the remote display to fit on the PDA (Slow) + text + 1 - - - QLabel - - name - TextLabel2_3 + + + + text + 2 - + + + text - Scale Factor + 4 - - - - - - name - Spacer2 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - QWidget - - name - tab - - - title - Encodings - - - - margin - 11 - + + + name + scaleFactor + + + sizePolicy + + 7 + 0 + + + + whatsThis + Scale the remote display to fit on the PDA (Slow) + + + + QLabel + + name + TextLabel2_3 + + + text + Scale Factor + + + + QLabel + + name + TextLabel2 + + + text + Milliseconds + + + + QCheckBox + + name + deIconify + + + sizePolicy + + 7 + 0 + + + + text + Raise on bell + + + + QLabel + + name + TextLabel1 + + + text + Check for screen updates every: + + + + + + QWidget - spacing - 6 + name + tab - - QCheckBox - - name - hex - - - enabled - false - - - text - Hextile encoding - - - - QCheckBox - - name - corre - - - enabled - false - - - text - CoRRE encoding - - - - QCheckBox - - name - rre - + + title + Encodings + + - enabled - false + margin + 11 - text - RRE encoding + spacing + 6 - - - QCheckBox - - name - copyRect - - - text - Copy rectangle encoding - - - whatsThis - Enable transmiting identical rectangles as references to existing data - - - - - name - Spacer3 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - + + + name + Spacer3 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QCheckBox + + name + hex + + + enabled + false + + + sizePolicy + + 7 + 0 + + + + text + Hextile encoding + + + + QCheckBox + + name + corre + + + enabled + false + + + sizePolicy + + 7 + 0 + + + + text + CoRRE encoding + + + + QCheckBox + + name + rre + + + enabled + false + + + sizePolicy + + 7 + 0 + + + + text + RRE encoding + + + + QCheckBox + + name + copyRect + + + sizePolicy + + 7 + 0 + + + + text + Copy rectangle encoding + + + whatsThis + Enable transmiting identical rectangles as references to existing data + + + + - + TabWidget3 -- cgit v0.9.0.2