summaryrefslogtreecommitdiffstats
path: root/scc/examples/loginmvc
diff options
context:
space:
mode:
Diffstat (limited to 'scc/examples/loginmvc')
-rw-r--r--scc/examples/loginmvc/frame.ui2
-rw-r--r--scc/examples/loginmvc/main.cpp9
2 files changed, 6 insertions, 5 deletions
diff --git a/scc/examples/loginmvc/frame.ui b/scc/examples/loginmvc/frame.ui
index 7f984de..4b57955 100644
--- a/scc/examples/loginmvc/frame.ui
+++ b/scc/examples/loginmvc/frame.ui
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
- <string>Frame</string>
+ <string>Login Workflow</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
diff --git a/scc/examples/loginmvc/main.cpp b/scc/examples/loginmvc/main.cpp
index c01a3be..25b68d1 100644
--- a/scc/examples/loginmvc/main.cpp
+++ b/scc/examples/loginmvc/main.cpp
@@ -117,6 +117,7 @@ class MyView : public QFrame, public virtual Ui::Frame
{
Q_OBJECT
public:
+ QString welcomeText;
MyView(QWidget* o = NULL) : QFrame(o)
{
setupUi(this);
@@ -139,7 +140,7 @@ class MyView : public QFrame, public virtual Ui::Frame
}
void notifyWelcome()
{
- QMessageBox::information(this,"","Welcome!");
+ QMessageBox::information(this,"Welcome!",welcomeText);
}
void notifyError()
{
@@ -162,14 +163,15 @@ class MyView : public QFrame, public virtual Ui::Frame
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
-
- AbstractModel* model = QSslSocket::supportsSsl () ? (AbstractModel*)new GMailModel() : (AbstractModel*)new DummyModel();
+ bool use_gmail = QSslSocket::supportsSsl () && !a.arguments().contains("--dummy");
+ AbstractModel* model = use_gmail ? (AbstractModel*)new GMailModel() : (AbstractModel*)new DummyModel();
MyView* view = new MyView();
SMClass_controller *controller = new SMClass_controller();
controller->setupStateMachine();
controller->set_loginButton(view->loginButton);
controller->set_logoutButton(view->logoutButton);
controller->set_cancelButton(view->cancelButton);
+ view->welcomeText = (use_gmail ?"Please enter your GMail user/password":"Username=user, Password=password");
QObject::connect(controller,SIGNAL(event_login_action(QString,QString)),model,SLOT(login(QString,QString)));
QObject::connect(controller,SIGNAL(event_notify_loggedIn()),view,SLOT(notifyLogin()));
QObject::connect(controller,SIGNAL(event_notify_error()),view,SLOT(notifyError()));
@@ -186,7 +188,6 @@ int main(int argc, char *argv[])
QObject::connect(view->timeoutSlider,SIGNAL(valueChanged(int)),controller,SLOT(set_loginTimeout(int)));
controller->start();
view->show();
- QObject::connect(view,SIGNAL(closed()),qApp,SLOT(quit()));
return a.exec();
}
#include <main.moc>