| 790 | } |
| 791 | |
| 792 | void GrWorkspace::ProcessUserAction(int index) { |
| 793 | // modify username |
| 794 | if (index == 0) { |
| 795 | ModifyUsernameDialog dialog(context_); |
| 796 | if (dialog.exec() == kDoneOk) { |
| 797 | this->UpdateUsername(); |
| 798 | } |
| 799 | } |
| 800 | else if (index == 1) { |
| 801 | // modify password |
| 802 | ModifyPasswordDialog dialog(context_); |
| 803 | if (dialog.exec() == kDoneOk) { |
| 804 | |
| 805 | } |
| 806 | } |
| 807 | else if (index == 2) { |
| 808 | // update avatar |
| 809 | ShowSelectAvatarDialog(); |
| 810 | } |
| 811 | // else if (index == 4) { |
| 812 | // // user center |
| 813 | // } |
| 814 | else if (index == 4) { |
| 815 | // exit |
| 816 | TcDialog dialog(tcTr("id_exit_login"), tcTr("id_exit_login_msg")); |
| 817 | if (dialog.exec() == kDoneOk) { |
| 818 | // logout |
| 819 | user_mgr_->Logout(); |
| 820 | |
| 821 | // clear avatar |
| 822 | ClearAvatar(); |
| 823 | |
| 824 | // clear database |
| 825 | user_mgr_->Clear(); |
| 826 | |
| 827 | // clear ui |
| 828 | ClearUserInfo(); |
| 829 | // avatar |
| 830 | |
| 831 | // send a logged in message |
| 832 | context_->SendAppMessage(MsgUserLoggedOut {}); |
| 833 | } |
| 834 | } |
| 835 | } |
| 836 | |
| 837 | void GrWorkspace::LoadAvatar() { |
| 838 | context_->PostTask([=, this]() { |
nothing calls this directly
no test coverage detected