-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 02f8451..b143361 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -216,98 +216,102 @@ void MainWindow::slotNew() { ProfileEditorDialog dlg(factory() ); dlg.showMaximized(); int ret = dlg.exec(); if ( ret == QDialog::Accepted ) { create( dlg.profile() ); } } void MainWindow::slotRecordScript() { /* if (currentSession()) { currentSession()->emulationLayer()->startRecording(); } */ } void MainWindow::slotSaveScript() { /* if (currentSession() && currentSession()->emulationLayer()->isRecording()) { MimeTypes types; QStringList script; script << "text/plain"; types.insert("Script", script); QString filename = OFileDialog::getSaveFileName(2, "/", QString::null, types); if (!filename.isEmpty()) { currentSession()->emulationLayer()->script()->saveTo(filename); currentSession()->emulationLayer()->clearScript(); } } */ } void MainWindow::slotRunScript() { /* if (currentSession()) { MimeTypes types; QStringList script; script << "text/plain"; types.insert("Script", script); QString filename = OFileDialog::getOpenFileName(2, "/", QString::null, types); if (!filename.isEmpty()) { Script script(DocLnk(filename).file()); currentSession()->emulationLayer()->runScript(&script); } } */ } void MainWindow::slotConnect() { - if ( currentSession() ) - currentSession()->layer()->open(); + if ( currentSession() ) { + bool ret = currentSession()->layer()->open(); + if(!ret) QMessageBox::warning(currentSession()->widgetStack(), + QObject::tr("Failed"), + QObject::tr("Connecting failed for this session.")); + } } void MainWindow::slotDisconnect() { if ( currentSession() ) currentSession()->layer()->close(); } void MainWindow::slotTerminate() { if ( currentSession() ) currentSession()->layer()->close(); slotClose(); /* FIXME move to the next session */ } void MainWindow::slotConfigure() { qWarning("configure"); ConfigDialog conf( manager()->all(), factory() ); conf.showMaximized(); int ret = conf.exec(); if ( QDialog::Accepted == ret ) { qWarning("conf %d", conf.list().count() ); manager()->setProfiles( conf.list() ); manager()->save(); populateProfiles(); } } /* * we will remove * this window from the tabwidget * remove it from the list * delete it * and set the currentSession() */ void MainWindow::slotClose() { qWarning("close"); if (!currentSession() ) return; tabWidget()->remove( currentSession() ); /*it's autodelete */ m_sessions.remove( m_curSession ); m_curSession = m_sessions.first(); tabWidget()->setCurrent( m_curSession ); } |