author | harlekin <harlekin> | 2002-10-26 11:53:47 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-26 11:53:47 (UTC) |
commit | 88504fa6ed3e4ec1c11d3e1cde13c821b1a9b846 (patch) (side-by-side diff) | |
tree | b3acc8683f44c7fa960c4d422ae781ed7b854f65 | |
parent | 2dc92ada34785bbfff8ca1202e4d53eb0606c362 (diff) | |
download | opie-88504fa6ed3e4ec1c11d3e1cde13c821b1a9b846.zip opie-88504fa6ed3e4ec1c11d3e1cde13c821b1a9b846.tar.gz opie-88504fa6ed3e4ec1c11d3e1cde13c821b1a9b846.tar.bz2 |
only enable tranfer if layer supports it
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 5f6dc12..e3c3c38 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -429,49 +429,56 @@ void MainWindow::slotSaveScript() { populateScripts(); } } } void MainWindow::slotRunScript(int id) { if (currentSession()) { int index = m_scriptsPop->indexOf(id); DocLnk *lnk = m_scriptsData.at(index); QString filePath = lnk->file(); Script script(filePath); currentSession()->emulationHandler()->runScript(&script); } } void MainWindow::slotConnect() { if ( currentSession() ) { bool ret = currentSession()->layer()->open(); if(!ret) QMessageBox::warning(currentSession()->widgetStack(), QObject::tr("Failed"), QObject::tr("Connecting failed for this session.")); else { m_connect->setEnabled( false ); m_disconnect->setEnabled( true ); + + // if it does not support file transfer, disable the menu entry + if ( ( m_curSession->layer() )->supports()[1] == 0 ) { + m_transfer->setEnabled( false ); + } else { m_transfer->setEnabled( true ); + } + m_recordScript->setEnabled( true ); m_scripts->setItemEnabled(m_runScript_id, true); } } } void MainWindow::slotDisconnect() { if ( currentSession() ) { currentSession()->layer()->close(); m_connect->setEnabled( true ); m_disconnect->setEnabled( false ); m_transfer->setEnabled( false ); m_recordScript->setEnabled( false); m_saveScript->setEnabled( false ); m_scripts->setItemEnabled(m_runScript_id, false); } } void MainWindow::slotTerminate() { if ( currentSession() ) currentSession()->layer()->close(); slotClose(); /* FIXME move to the next session */ @@ -550,49 +557,48 @@ void MainWindow::create( const Profile& prof ) { m_sessions.append( ses ); tabWidget()->add( ses ); tabWidget()->repaint(); m_curSession = ses; // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it m_connect->setEnabled( true ); m_disconnect->setEnabled( false ); m_terminate->setEnabled( true ); m_fullscreen->setEnabled( true ); m_closewindow->setEnabled( true ); m_transfer->setEnabled( false ); m_recordScript->setEnabled( false ); m_saveScript->setEnabled( false ); m_scripts->setItemEnabled(m_runScript_id, false); // is io_layer wants direct connection, then autoconnect //if ( ( m_curSession->layer() )->supports()[0] == 1 ) { if (prof.autoConnect()) { slotConnect(); } - QWidget *w = currentSession()->widget(); if(w) w->setFocus(); m_kb->load(currentSession()->profile()); } void MainWindow::slotTransfer() { if ( currentSession() ) { Session *mysession = currentSession(); TransferDialog dlg(mysession->widgetStack(), this); mysession->setTransferDialog(&dlg); dlg.show(); //dlg.showMaximized(); //currentSession()->widgetStack()->add(dlg); //dlg.exec(); while(dlg.isRunning()) qApp->processEvents(); mysession->setTransferDialog(0l); } } void MainWindow::slotOpenKeb(bool state) { |