[UI] minor source reorg
This commit is contained in:
@@ -92,14 +92,25 @@ LmsApplication::LmsApplication(const Wt::WEnvironment& env, boost::filesystem::p
|
|||||||
|
|
||||||
// If here is no account in the database, launch the first connection wizard
|
// If here is no account in the database, launch the first connection wizard
|
||||||
if (firstConnection)
|
if (firstConnection)
|
||||||
|
createFirstConnectionUI();
|
||||||
|
else
|
||||||
|
createLmsUI();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LmsApplication::createFirstConnectionUI()
|
||||||
{
|
{
|
||||||
// Hack, use the auth widget builtin strings
|
// Hack, use the auth widget builtin strings
|
||||||
builtinLocalizedStrings().useBuiltin(skeletons::AuthStrings_xml1);
|
builtinLocalizedStrings().useBuiltin(skeletons::AuthStrings_xml1);
|
||||||
|
|
||||||
root()->addWidget( new Settings::FirstConnectionFormView(_sessionData));
|
root()->addWidget( new Settings::FirstConnectionFormView(_sessionData));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
void
|
||||||
|
LmsApplication::createLmsUI()
|
||||||
{
|
{
|
||||||
|
|
||||||
_sessionData.getDatabaseHandler().getLogin().changed().connect(this, &LmsApplication::handleAuthEvent);
|
_sessionData.getDatabaseHandler().getLogin().changed().connect(this, &LmsApplication::handleAuthEvent);
|
||||||
|
|
||||||
LmsAuth *authWidget = new LmsAuth(_sessionData.getDatabaseHandler());
|
LmsAuth *authWidget = new LmsAuth(_sessionData.getDatabaseHandler());
|
||||||
@@ -111,7 +122,6 @@ LmsApplication::LmsApplication(const Wt::WEnvironment& env, boost::filesystem::p
|
|||||||
|
|
||||||
root()->addWidget(authWidget);
|
root()->addWidget(authWidget);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ class LmsApplication : public Wt::WApplication
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
void handleAuthEvent(void);
|
void handleAuthEvent(void);
|
||||||
|
void createFirstConnectionUI();
|
||||||
|
void createLmsUI();
|
||||||
|
|
||||||
SessionData _sessionData;
|
SessionData _sessionData;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user