summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp31
1 files changed, 22 insertions, 9 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
@@ -316,6 +316,8 @@ void MainWindow::slotConnect() {
bool ret = currentSession()->layer()->open();
- if(!ret) QMessageBox::warning(currentSession()->widgetStack(),
- QObject::tr("Failed"),
- QObject::tr("Connecting failed for this session."));
- }
+ if(!ret) QMessageBox::warning(currentSession()->widgetStack(),
+ QObject::tr("Failed"),
+ QObject::tr("Connecting failed for this session."));
+ m_connect->setEnabled( false );
+ m_disconnect->setEnabled( true );
+ }
}
@@ -323,4 +325,7 @@ void MainWindow::slotConnect() {
void MainWindow::slotDisconnect() {
- if ( currentSession() )
+ if ( currentSession() ) {
currentSession()->layer()->close();
+ m_connect->setEnabled( true );
+ m_disconnect->setEnabled( false );
+ }
}
@@ -407,3 +412,3 @@ void MainWindow::create( const Profile& prof ) {
m_connect->setEnabled( true );
- m_disconnect->setEnabled( true );
+ m_disconnect->setEnabled( false );
m_terminate->setEnabled( true );
@@ -419,3 +424,3 @@ void MainWindow::slotTransfer()
{
- // if ( currentSession() ) {
+ if ( currentSession() ) {
TransferDialog dlg(this);
@@ -423,3 +428,3 @@ void MainWindow::slotTransfer()
dlg.exec();
- // }
+ }
}
@@ -437,2 +442,10 @@ void MainWindow::slotSessionChanged( Session* ses ) {
m_curSession = ses;
+
+ if ( m_curSession->isConnected() ) {
+ m_connect->setEnabled( false );
+ m_disconnect->setEnabled( true );
+ } else {
+ m_connect->setEnabled( true );
+ m_disconnect->setEnabled( false );
+ }
}
@@ -457,3 +470,3 @@ void MainWindow::slotFullscreen() {
- // QPushButton *cornerButton = new QPushButton( this );
+ //QPushButton *cornerButton = new QPushButton( );
//cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) );