From 407afcd2f27202f9a95ff109a7fba562f9841f4f Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sun, 9 Apr 2017 02:32:48 +0300 Subject: [PATCH] Clear text fields after login --- include/LoginPage.h | 2 ++ src/LoginPage.cc | 6 ++++++ src/MainWindow.cc | 1 + 3 files changed, 9 insertions(+) diff --git a/include/LoginPage.h b/include/LoginPage.h index d6b57efb..760e1055 100644 --- a/include/LoginPage.h +++ b/include/LoginPage.h @@ -36,6 +36,8 @@ public: explicit LoginPage(QWidget *parent = 0); ~LoginPage(); + void reset(); + signals: void backButtonClicked(); diff --git a/src/LoginPage.cc b/src/LoginPage.cc index 54eda384..12b7aba8 100644 --- a/src/LoginPage.cc +++ b/src/LoginPage.cc @@ -137,6 +137,12 @@ void LoginPage::onLoginButtonClicked() } } +void LoginPage::reset() +{ + username_input_->clear(); + password_input_->clear(); +} + void LoginPage::onBackButtonClicked() { emit backButtonClicked(); diff --git a/src/MainWindow.cc b/src/MainWindow.cc index 12d680a0..146c4954 100644 --- a/src/MainWindow.cc +++ b/src/MainWindow.cc @@ -89,6 +89,7 @@ void MainWindow::showChatPage(QString userid, QString homeserver, QString token) int index = sliding_stack_->getWidgetIndex(chat_page_); sliding_stack_->slideInIndex(index, SlidingStackWidget::AnimationDirection::LEFT_TO_RIGHT); + login_page_->reset(); chat_page_->bootstrap(userid, homeserver, token); }