author | harlekin <harlekin> | 2002-10-15 10:46:40 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-15 10:46:40 (UTC) |
commit | daae7a75b0e9ccbf1ea4c699c631ad77825e6301 (patch) (unidiff) | |
tree | 94bd75c58f42d8752b62a2281a5175a8e746f9ff /noncore/apps/opie-console/mainwindow.cpp | |
parent | e09b7ab685d29eba947c3bb021192408acae70be (diff) | |
download | opie-daae7a75b0e9ccbf1ea4c699c631ad77825e6301.zip opie-daae7a75b0e9ccbf1ea4c699c631ad77825e6301.tar.gz opie-daae7a75b0e9ccbf1ea4c699c631ad77825e6301.tar.bz2 |
- more menu handling \n - added 2 more color shemes
Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 6dc9e6e..b770551 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -314,18 +314,23 @@ void MainWindow::slotRunScript() { | |||
314 | void MainWindow::slotConnect() { | 314 | void MainWindow::slotConnect() { |
315 | if ( currentSession() ) { | 315 | if ( currentSession() ) { |
316 | bool ret = currentSession()->layer()->open(); | 316 | bool ret = currentSession()->layer()->open(); |
317 | if(!ret) QMessageBox::warning(currentSession()->widgetStack(), | 317 | if(!ret) QMessageBox::warning(currentSession()->widgetStack(), |
318 | QObject::tr("Failed"), | 318 | QObject::tr("Failed"), |
319 | QObject::tr("Connecting failed for this session.")); | 319 | QObject::tr("Connecting failed for this session.")); |
320 | m_connect->setEnabled( false ); | ||
321 | m_disconnect->setEnabled( true ); | ||
320 | } | 322 | } |
321 | } | 323 | } |
322 | 324 | ||
323 | void MainWindow::slotDisconnect() { | 325 | void MainWindow::slotDisconnect() { |
324 | if ( currentSession() ) | 326 | if ( currentSession() ) { |
325 | currentSession()->layer()->close(); | 327 | currentSession()->layer()->close(); |
328 | m_connect->setEnabled( true ); | ||
329 | m_disconnect->setEnabled( false ); | ||
330 | } | ||
326 | } | 331 | } |
327 | 332 | ||
328 | void MainWindow::slotTerminate() { | 333 | void MainWindow::slotTerminate() { |
329 | if ( currentSession() ) | 334 | if ( currentSession() ) |
330 | currentSession()->layer()->close(); | 335 | currentSession()->layer()->close(); |
331 | 336 | ||
@@ -402,29 +407,29 @@ void MainWindow::create( const Profile& prof ) { | |||
402 | m_sessions.append( ses ); | 407 | m_sessions.append( ses ); |
403 | tabWidget()->add( ses ); | 408 | tabWidget()->add( ses ); |
404 | m_curSession = ses; | 409 | m_curSession = ses; |
405 | 410 | ||
406 | // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it | 411 | // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it |
407 | m_connect->setEnabled( true ); | 412 | m_connect->setEnabled( true ); |
408 | m_disconnect->setEnabled( true ); | 413 | m_disconnect->setEnabled( false ); |
409 | m_terminate->setEnabled( true ); | 414 | m_terminate->setEnabled( true ); |
410 | m_transfer->setEnabled( true ); | 415 | m_transfer->setEnabled( true ); |
411 | m_recordScript->setEnabled( true ); | 416 | m_recordScript->setEnabled( true ); |
412 | m_saveScript->setEnabled( true ); | 417 | m_saveScript->setEnabled( true ); |
413 | m_runScript->setEnabled( true ); | 418 | m_runScript->setEnabled( true ); |
414 | m_fullscreen->setEnabled( true ); | 419 | m_fullscreen->setEnabled( true ); |
415 | m_closewindow->setEnabled( true ); | 420 | m_closewindow->setEnabled( true ); |
416 | } | 421 | } |
417 | 422 | ||
418 | void MainWindow::slotTransfer() | 423 | void MainWindow::slotTransfer() |
419 | { | 424 | { |
420 | // if ( currentSession() ) { | 425 | if ( currentSession() ) { |
421 | TransferDialog dlg(this); | 426 | TransferDialog dlg(this); |
422 | dlg.showMaximized(); | 427 | dlg.showMaximized(); |
423 | dlg.exec(); | 428 | dlg.exec(); |
424 | // } | 429 | } |
425 | } | 430 | } |
426 | 431 | ||
427 | 432 | ||
428 | void MainWindow::slotOpenKeb(bool state) { | 433 | void MainWindow::slotOpenKeb(bool state) { |
429 | 434 | ||
430 | if (state) m_keyBar->show(); | 435 | if (state) m_keyBar->show(); |
@@ -432,12 +437,20 @@ void MainWindow::slotOpenKeb(bool state) { | |||
432 | 437 | ||
433 | } | 438 | } |
434 | void MainWindow::slotSessionChanged( Session* ses ) { | 439 | void MainWindow::slotSessionChanged( Session* ses ) { |
435 | if ( ses ) { | 440 | if ( ses ) { |
436 | qWarning("changing %s", ses->name().latin1() ); | 441 | qWarning("changing %s", ses->name().latin1() ); |
437 | m_curSession = ses; | 442 | m_curSession = ses; |
443 | |||
444 | if ( m_curSession->isConnected() ) { | ||
445 | m_connect->setEnabled( false ); | ||
446 | m_disconnect->setEnabled( true ); | ||
447 | } else { | ||
448 | m_connect->setEnabled( true ); | ||
449 | m_disconnect->setEnabled( false ); | ||
450 | } | ||
438 | } | 451 | } |
439 | } | 452 | } |
440 | 453 | ||
441 | void MainWindow::slotFullscreen() { | 454 | void MainWindow::slotFullscreen() { |
442 | 455 | ||
443 | if ( m_isFullscreen ) { | 456 | if ( m_isFullscreen ) { |
@@ -452,13 +465,13 @@ void MainWindow::slotFullscreen() { | |||
452 | ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop, | 465 | ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop, |
453 | QPoint(0,0), false); | 466 | QPoint(0,0), false); |
454 | ( m_curSession->widgetStack() )->resize(qApp->desktop()->width(), qApp->desktop()->height()); | 467 | ( m_curSession->widgetStack() )->resize(qApp->desktop()->width(), qApp->desktop()->height()); |
455 | ( m_curSession->widgetStack() )->setFocus(); | 468 | ( m_curSession->widgetStack() )->setFocus(); |
456 | ( m_curSession->widgetStack() )->show(); | 469 | ( m_curSession->widgetStack() )->show(); |
457 | 470 | ||
458 | // QPushButton *cornerButton = new QPushButton( this ); | 471 | //QPushButton *cornerButton = new QPushButton( ); |
459 | //cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) ); | 472 | //cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) ); |
460 | //connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); | 473 | //connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); |
461 | // need teh scrollbar | 474 | // need teh scrollbar |
462 | // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton ); | 475 | // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton ); |
463 | m_fullscreen->setText( tr("Stop full screen") ); | 476 | m_fullscreen->setText( tr("Stop full screen") ); |
464 | } | 477 | } |