Diffstat (limited to 'noncore/comm/keypebble/kvnc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/comm/keypebble/kvnc.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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 | |||
@@ -63,45 +63,49 @@ KVNC::KVNC( const char *name ) : QMainWindow( 0, name ) | |||
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 ); |
@@ -226,43 +230,45 @@ void KVNC::showMenu() | |||
226 | pt.rx() -= s.width(); | 230 | pt.rx() -= s.width(); |
227 | cornerMenu->popup( pt ); | 231 | cornerMenu->popup( pt ); |
228 | } | 232 | } |
229 | 233 | ||
230 | void KVNC::connected() | 234 | void 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 | ||
240 | void KVNC::loggedIn() | 245 | void 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 | ||
246 | void KVNC::disconnected() | 251 | void 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 | ||
259 | void KVNC::statusMessage( const QString &m ) | 265 | void KVNC::statusMessage( const QString &m ) |
260 | { | 266 | { |
261 | Global::statusMessage( m ); | 267 | Global::statusMessage( m ); |
262 | } | 268 | } |
263 | 269 | ||
264 | void KVNC::error( const QString &msg ) | 270 | void 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 | } |