clear login screen on failed login attempt
parent
ab36cf429f
commit
8bbe0a857f
|
@ -224,20 +224,18 @@ int EventHandler::pointerHandler(const int type, const int par1, const int par2)
|
|||
{
|
||||
_menu.drawLoadingScreen();
|
||||
|
||||
Log::writeLog("Start Login from loginscreen");
|
||||
|
||||
//TODO use progressbar and log (check what can go wrong?) catch?
|
||||
if (_nextcloud.login(_loginView->getURL(), _loginView->getUsername(), _loginView->getPassword()))
|
||||
{
|
||||
_listView = std::unique_ptr<ListView>(new ListView(_menu.getContentRect(), _nextcloud.getItems()));
|
||||
_loginView.reset();
|
||||
|
||||
FullUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
//TODO redraw login screen so that loading disappears
|
||||
Message(ICON_WARNING, "Warning", "Something went wrong...", 1200);
|
||||
_menu.clearLoadingScreen();
|
||||
Log::writeLog("login failed.");
|
||||
}
|
||||
FullUpdate();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,3 +89,9 @@ void MenuHandler::drawLoadingScreen()
|
|||
DrawTextRect2(&_loadingScreenRect, "Loading...");
|
||||
PartialUpdate(_loadingScreenRect.x, _loadingScreenRect.y, _loadingScreenRect.w, _loadingScreenRect.h);
|
||||
}
|
||||
|
||||
void MenuHandler::clearLoadingScreen()
|
||||
{
|
||||
FillArea(_loadingScreenRect.x, _loadingScreenRect.y, _loadingScreenRect.w, _loadingScreenRect.h/4, WHITE);
|
||||
PartialUpdate(_loadingScreenRect.x, _loadingScreenRect.y, _loadingScreenRect.w, _loadingScreenRect.h);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,8 @@ public:
|
|||
|
||||
void drawLoadingScreen();
|
||||
|
||||
void clearLoadingScreen();
|
||||
|
||||
private:
|
||||
ifont *_menuFont;
|
||||
ifont *_loadingFont;
|
||||
|
|
Loading…
Reference in New Issue