Clear text fields after login

This commit is contained in:
Konstantinos Sideris 2017-04-09 02:32:48 +03:00
parent 239780557f
commit 407afcd2f2
3 changed files with 9 additions and 0 deletions

View File

@ -36,6 +36,8 @@ public:
explicit LoginPage(QWidget *parent = 0); explicit LoginPage(QWidget *parent = 0);
~LoginPage(); ~LoginPage();
void reset();
signals: signals:
void backButtonClicked(); void backButtonClicked();

View File

@ -137,6 +137,12 @@ void LoginPage::onLoginButtonClicked()
} }
} }
void LoginPage::reset()
{
username_input_->clear();
password_input_->clear();
}
void LoginPage::onBackButtonClicked() void LoginPage::onBackButtonClicked()
{ {
emit backButtonClicked(); emit backButtonClicked();

View File

@ -89,6 +89,7 @@ void MainWindow::showChatPage(QString userid, QString homeserver, QString token)
int index = sliding_stack_->getWidgetIndex(chat_page_); int index = sliding_stack_->getWidgetIndex(chat_page_);
sliding_stack_->slideInIndex(index, SlidingStackWidget::AnimationDirection::LEFT_TO_RIGHT); sliding_stack_->slideInIndex(index, SlidingStackWidget::AnimationDirection::LEFT_TO_RIGHT);
login_page_->reset();
chat_page_->bootstrap(userid, homeserver, token); chat_page_->bootstrap(userid, homeserver, token);
} }