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.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
@@ -6,6 +6,7 @@
#include <qtoolbar.h>
#include <qpe/resource.h>
#include <opie/ofiledialog.h>
+#include <qmessagebox.h>
#include "profileeditordialog.h"
#include "configdialog.h"
@@ -309,6 +310,15 @@ void MainWindow::slotProfile( int id) {
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;