@ -17,65 +17,48 @@
|
||||
|
||||
#include <QDialog>
|
||||
#include <QIcon>
|
||||
#include <QTimer>
|
||||
#include <QNetworkReply>
|
||||
#include <QTimer>
|
||||
|
||||
#include <memory>
|
||||
#include <minecraft/auth/MinecraftAccount.h>
|
||||
#include <memory>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
namespace Ui {
|
||||
class ProfileSetupDialog;
|
||||
}
|
||||
|
||||
class ProfileSetupDialog : public QDialog
|
||||
{
|
||||
class ProfileSetupDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
explicit ProfileSetupDialog(MinecraftAccountPtr accountToSetup, QWidget *parent = 0);
|
||||
public:
|
||||
explicit ProfileSetupDialog(MinecraftAccountPtr accountToSetup, QWidget* parent = 0);
|
||||
~ProfileSetupDialog();
|
||||
|
||||
enum class NameStatus
|
||||
{
|
||||
NotSet,
|
||||
Pending,
|
||||
Available,
|
||||
Exists,
|
||||
Error
|
||||
} nameStatus = NameStatus::NotSet;
|
||||
enum class NameStatus { NotSet, Pending, Available, Exists, Error } nameStatus = NameStatus::NotSet;
|
||||
|
||||
private slots:
|
||||
private slots:
|
||||
void on_buttonBox_accepted();
|
||||
void on_buttonBox_rejected();
|
||||
|
||||
void nameEdited(const QString &name);
|
||||
void checkFinished(
|
||||
QNetworkReply::NetworkError error,
|
||||
QByteArray data,
|
||||
QList<QNetworkReply::RawHeaderPair> headers
|
||||
);
|
||||
void nameEdited(const QString& name);
|
||||
void checkFinished(QNetworkReply::NetworkError error, QByteArray data, QList<QNetworkReply::RawHeaderPair> headers);
|
||||
void startCheck();
|
||||
|
||||
void setupProfileFinished(
|
||||
QNetworkReply::NetworkError error,
|
||||
QByteArray data,
|
||||
QList<QNetworkReply::RawHeaderPair> headers
|
||||
);
|
||||
protected:
|
||||
void scheduleCheck(const QString &name);
|
||||
void checkName(const QString &name);
|
||||
void setupProfileFinished(QNetworkReply::NetworkError error, QByteArray data, QList<QNetworkReply::RawHeaderPair> headers);
|
||||
|
||||
protected:
|
||||
void scheduleCheck(const QString& name);
|
||||
void checkName(const QString& name);
|
||||
void setNameStatus(NameStatus status, QString errorString);
|
||||
|
||||
void setupProfile(const QString & profileName);
|
||||
void setupProfile(const QString& profileName);
|
||||
|
||||
private:
|
||||
private:
|
||||
MinecraftAccountPtr m_accountToSetup;
|
||||
Ui::ProfileSetupDialog *ui;
|
||||
Ui::ProfileSetupDialog* ui;
|
||||
QIcon goodIcon;
|
||||
QIcon yellowIcon;
|
||||
QIcon badIcon;
|
||||
QAction * validityAction = nullptr;
|
||||
QAction* validityAction = nullptr;
|
||||
|
||||
QString queuedCheck;
|
||||
|
||||
@ -85,4 +68,3 @@ private:
|
||||
|
||||
QTimer checkStartTimer;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user