blob: 26cb20a66aa11ccf437997c891e1c9487917ffdd [file] [log] [blame]
Isa Nanic6e4a39a2018-12-04 14:26:02 -05001/**************************************************************************
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 Nanic26c86612018-12-14 12:21:56 -050021#include <QMovie>
22
23#include "lrcinstance.h"
24#include "api/newaccountmodel.h"
Isa Nanic6e4a39a2018-12-04 14:26:02 -050025
26namespace Ui {
27 class RegNameDialog;
28}
29
Isa Nanic26c86612018-12-14 12:21:56 -050030class RegNameDialog : public QDialog
31{
32 Q_OBJECT
33 RegNameDialog(const RegNameDialog& cpy);
Isa Nanic6e4a39a2018-12-04 14:26:02 -050034
35public:
36 RegNameDialog(const QString& newRegName = "", QWidget* parent = nullptr);
Isa Nanic26c86612018-12-14 12:21:56 -050037 ~RegNameDialog();
38
39private slots:
40 void nameRegistrationResultSlot(const std::string& accountId,
41 lrc::api::account::RegisterNameStatus status, const std::string& registerdName);
42 void startNameRegistration();
Isa Nanic6e4a39a2018-12-04 14:26:02 -050043
44private:
45 Ui::RegNameDialog* ui;
Isa Nanic26c86612018-12-14 12:21:56 -050046 QString registeredName_;
47 QMovie* gif;
48
49 void startSpinner();
Isa Nanic6e4a39a2018-12-04 14:26:02 -050050};