[UI] minor source reorg
This commit is contained in:
+24
-14
@@ -92,25 +92,35 @@ 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();
|
||||||
// Hack, use the auth widget builtin strings
|
|
||||||
builtinLocalizedStrings().useBuiltin(skeletons::AuthStrings_xml1);
|
|
||||||
|
|
||||||
root()->addWidget( new Settings::FirstConnectionFormView(_sessionData));
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
createLmsUI();
|
||||||
_sessionData.getDatabaseHandler().getLogin().changed().connect(this, &LmsApplication::handleAuthEvent);
|
|
||||||
|
|
||||||
LmsAuth *authWidget = new LmsAuth(_sessionData.getDatabaseHandler());
|
}
|
||||||
|
|
||||||
authWidget->model()->addPasswordAuth(&Database::Handler::getPasswordService());
|
void
|
||||||
authWidget->setRegistrationEnabled(false);
|
LmsApplication::createFirstConnectionUI()
|
||||||
|
{
|
||||||
|
// Hack, use the auth widget builtin strings
|
||||||
|
builtinLocalizedStrings().useBuiltin(skeletons::AuthStrings_xml1);
|
||||||
|
|
||||||
authWidget->processEnvironment();
|
root()->addWidget( new Settings::FirstConnectionFormView(_sessionData));
|
||||||
|
}
|
||||||
|
|
||||||
root()->addWidget(authWidget);
|
void
|
||||||
}
|
LmsApplication::createLmsUI()
|
||||||
|
{
|
||||||
|
|
||||||
|
_sessionData.getDatabaseHandler().getLogin().changed().connect(this, &LmsApplication::handleAuthEvent);
|
||||||
|
|
||||||
|
LmsAuth *authWidget = new LmsAuth(_sessionData.getDatabaseHandler());
|
||||||
|
|
||||||
|
authWidget->model()->addPasswordAuth(&Database::Handler::getPasswordService());
|
||||||
|
authWidget->setRegistrationEnabled(false);
|
||||||
|
|
||||||
|
authWidget->processEnvironment();
|
||||||
|
|
||||||
|
root()->addWidget(authWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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