summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-03-21 23:38:17 (UTC)
committer harlekin <harlekin>2003-03-21 23:38:17 (UTC)
commitab8cb739c666f5f22049258a4bcbb06d1e1ad0c4 (patch) (side-by-side diff)
tree82690d415f22ffe554d4fcfe359ee8121b90d888
parent43b0fded770624c907aae043e88449f80040d7df (diff)
downloadopie-ab8cb739c666f5f22049258a4bcbb06d1e1ad0c4.zip
opie-ab8cb739c666f5f22049258a4bcbb06d1e1ad0c4.tar.gz
opie-ab8cb739c666f5f22049258a4bcbb06d1e1ad0c4.tar.bz2
even better then poping up an error dialog: make a new profile
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index a6fc30b..3acbfad 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -365,102 +365,109 @@ void MainWindow::slotRunScript(int id) {
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 */
}
+
+
+
+
+
void MainWindow::slotQuickLaunch() {
Profile prof = manager()->profile( "default" );
if ( prof.name() == "default" ) {
create( prof );
} else {
- QMessageBox::warning(this, tr("Failure"),tr("please configure one profile named \"default\""));
+ Profile newProf = Profile( "default", "console", "default" , 0, 3, 0 );
+ newProf.setAutoConnect( true );
+ create( newProf );
}
}
void MainWindow::slotConfigure() {
ConfigDialog conf( manager()->all(), factory() );
conf.showMaximized();
int ret = conf.exec();
if ( QDialog::Accepted == ret ) {
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() {
if (!currentSession() )
return;
Session* ses = currentSession();
qWarning("removing! currentSession %s", currentSession()->name().latin1() );
/* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */
m_curSession = NULL;
tabWidget()->remove( /*currentSession()*/ses );
/*it's autodelete */
m_sessions.remove( ses );
qWarning("after remove!!");
if (!currentSession() ) {
m_connect->setEnabled( false );
m_disconnect->setEnabled( false );
m_terminate->setEnabled( false );
m_transfer->setEnabled( false );
m_recordScript->setEnabled( false );
m_saveScript->setEnabled( false );
m_scripts->setItemEnabled(m_runScript_id, false);
m_fullscreen->setEnabled( false );
m_wrap->setEnabled( false );
m_closewindow->setEnabled( false );
}