[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/utils/charm
From: Mirko Boehm <mirko () kde ! org>
Date: 2009-07-15 21:37:53
Message-ID: 1247693873.726030.9720.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 997492 by mirko:
r58231@silberpfeil: mirko | 2009-07-15 23:37:12 +0200
- introduce explicit "Configuring" state on startup
- this should get rid of the weird switching back and forth between states in case \
the configuration was not ok
_M . (directory)
M +17 -11 trunk/Charm/Application.cpp
M +2 -0 trunk/Charm/Application.h
M +1 -0 trunk/Core/State.cpp
M +1 -0 trunk/Core/State.h
--- trunk/playground/utils/charm/trunk/Charm/Application.cpp #997491:997492
@@ -242,6 +242,9 @@
case StartingUp:
leaveStartingUpState();
break;
+ case Configuring:
+ leaveConfiguringState();
+ break;
case Connecting:
leaveConnectingState();
break;
@@ -274,6 +277,9 @@
// m_timeTracker.stateChanged( previous );
enterStartingUpState();
break;
+ case Configuring:
+ enterConfiguringState();
+ break;
case Connecting:
m_model.charmDataModel()->stateChanged(previous, state);
m_controller.stateChanged(previous, state);
@@ -331,25 +337,25 @@
void Application::enterStartingUpState()
{
- // load configuration
- // ...
- // verify configuration
- // ...
- // if configuration is incomplete or buggy configure
- // FIXME ^^^
- // then go to connecting state
+ emit goToState( Configuring );
+}
+
+void Application::leaveStartingUpState()
+{
+}
+
+void Application::enterConfiguringState()
+{
if (configure())
{ // if all ok, go to connecting state
emit goToState(Connecting);
- }
- else
- {
+ } else {
// user has cancelled configure, exit the application
quit();
}
}
-void Application::leaveStartingUpState()
+void Application::leaveConfiguringState()
{
}
--- trunk/playground/utils/charm/trunk/Charm/Application.h #997491:997492
@@ -103,6 +103,8 @@
private:
void enterStartingUpState();
void leaveStartingUpState();
+ void enterConfiguringState();
+ void leaveConfiguringState();
void enterConnectingState();
void leaveConnectingState();
void enterConnectedState();
--- trunk/playground/utils/charm/trunk/Core/State.cpp #997491:997492
@@ -3,6 +3,7 @@
const char* StateNames[] = {
"Constructed",
"StartingUp",
+ "Configuring",
"Connecting",
"Connected",
"Disconnecting",
--- trunk/playground/utils/charm/trunk/Core/State.h #997491:997492
@@ -6,6 +6,7 @@
enum State {
Constructed,
StartingUp,
+ Configuring,
Connecting,
Connected,
Disconnecting,
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic