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) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 415259e..1adb43d 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -1,20 +1,21 @@
#include <qaction.h>
#include <qmenubar.h>
#include <qlabel.h>
#include <qpopupmenu.h>
#include <qtoolbar.h>
#include <qpe/resource.h>
#include <opie/ofiledialog.h>
+#include <qmessagebox.h>
#include "profileeditordialog.h"
#include "configdialog.h"
#include "default.h"
#include "metafactory.h"
#include "profile.h"
#include "profilemanager.h"
#include "mainwindow.h"
#include "tabwidget.h"
#include "transferdialog.h"
#include "function_keyboard.h"
#include "script.h"
@@ -300,24 +301,33 @@ void MainWindow::slotClose() {
/*
* We will get the name
* Then the profile
* and then we will make a profile
*/
void MainWindow::slotProfile( int id) {
Profile prof = manager()->profile( m_sessionsPop->text( id) );
create( prof );
}
void MainWindow::create( const Profile& prof ) {
Session *ses = manager()->fromProfile( prof, tabWidget() );
+ if((!ses) || (!ses->layer()) || (!ses->widgetStack()))
+ {
+ QMessageBox::warning(this,
+ QObject::tr("Session failed"),
+ QObject::tr("Cannot open session: Not all components were found."));
+ //if(ses) delete ses;
+ return;
+ }
+
m_sessions.append( ses );
tabWidget()->add( ses );
m_curSession = ses;
}
void MainWindow::slotTransfer()
{
// if ( currentSession() ) {
TransferDialog dlg(this);
dlg.showMaximized();
dlg.exec();