Isa Nanic | 6e4a39a | 2018-12-04 14:26:02 -0500 | [diff] [blame] | 1 | /************************************************************************** |
| 2 | * Copyright (C) 2018 by Savoir-faire Linux * |
| 3 | * Author: Isa Nanic <isa.nanic@savoirfairelinux.com> * |
| 4 | * * |
| 5 | * This program is free software; you can redistribute it and/or modify * |
| 6 | * it under the terms of the GNU General Public License as published by * |
| 7 | * the Free Software Foundation; either version 3 of the License, or * |
| 8 | * (at your option) any later version. * |
| 9 | * * |
| 10 | * This program is distributed in the hope that it will be useful, * |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 13 | * GNU General Public License for more details. * |
| 14 | * * |
| 15 | * You should have received a copy of the GNU General Public License * |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. * |
| 17 | **************************************************************************/ |
| 18 | |
| 19 | #pragma once |
| 20 | #include <QDialog> |
Isa Nanic | 26c8661 | 2018-12-14 12:21:56 -0500 | [diff] [blame] | 21 | #include <QMovie> |
| 22 | |
| 23 | #include "lrcinstance.h" |
| 24 | #include "api/newaccountmodel.h" |
Isa Nanic | 6e4a39a | 2018-12-04 14:26:02 -0500 | [diff] [blame] | 25 | |
| 26 | namespace Ui { |
| 27 | class RegNameDialog; |
| 28 | } |
| 29 | |
Isa Nanic | 26c8661 | 2018-12-14 12:21:56 -0500 | [diff] [blame] | 30 | class RegNameDialog : public QDialog |
| 31 | { |
| 32 | Q_OBJECT |
| 33 | RegNameDialog(const RegNameDialog& cpy); |
Isa Nanic | 6e4a39a | 2018-12-04 14:26:02 -0500 | [diff] [blame] | 34 | |
| 35 | public: |
| 36 | RegNameDialog(const QString& newRegName = "", QWidget* parent = nullptr); |
Isa Nanic | 26c8661 | 2018-12-14 12:21:56 -0500 | [diff] [blame] | 37 | ~RegNameDialog(); |
| 38 | |
| 39 | private slots: |
| 40 | void nameRegistrationResultSlot(const std::string& accountId, |
| 41 | lrc::api::account::RegisterNameStatus status, const std::string& registerdName); |
| 42 | void startNameRegistration(); |
Isa Nanic | 6e4a39a | 2018-12-04 14:26:02 -0500 | [diff] [blame] | 43 | |
| 44 | private: |
| 45 | Ui::RegNameDialog* ui; |
Isa Nanic | 26c8661 | 2018-12-14 12:21:56 -0500 | [diff] [blame] | 46 | QString registeredName_; |
| 47 | QMovie* gif; |
| 48 | |
| 49 | void startSpinner(); |
Isa Nanic | 6e4a39a | 2018-12-04 14:26:02 -0500 | [diff] [blame] | 50 | }; |