2022-01-17 11:08:10 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QtCore/QEventLoop>
|
2023-08-02 17:35:35 +01:00
|
|
|
#include <QtWidgets/QDialog>
|
2022-01-17 11:08:10 +00:00
|
|
|
|
|
|
|
#include "minecraft/auth/MinecraftAccount.h"
|
|
|
|
#include "tasks/Task.h"
|
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
namespace Ui {
|
2022-01-17 11:08:10 +00:00
|
|
|
class OfflineLoginDialog;
|
|
|
|
}
|
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
class OfflineLoginDialog : public QDialog {
|
2022-01-17 11:08:10 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
public:
|
2022-01-17 11:08:10 +00:00
|
|
|
~OfflineLoginDialog();
|
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
static MinecraftAccountPtr newAccount(QWidget* parent, QString message);
|
2022-01-17 11:08:10 +00:00
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
private:
|
|
|
|
explicit OfflineLoginDialog(QWidget* parent = 0);
|
2022-01-17 11:08:10 +00:00
|
|
|
|
|
|
|
void setUserInputsEnabled(bool enable);
|
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
protected slots:
|
2022-01-17 11:08:10 +00:00
|
|
|
void accept();
|
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
void onTaskFailed(const QString& reason);
|
2022-01-17 11:08:10 +00:00
|
|
|
void onTaskSucceeded();
|
2023-08-02 17:35:35 +01:00
|
|
|
void onTaskStatus(const QString& status);
|
2022-01-17 11:08:10 +00:00
|
|
|
void onTaskProgress(qint64 current, qint64 total);
|
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
void on_userTextBox_textEdited(const QString& newText);
|
2022-03-18 01:47:34 +00:00
|
|
|
void on_allowLongUsernames_stateChanged(int value);
|
2022-01-17 11:08:10 +00:00
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
private:
|
|
|
|
Ui::OfflineLoginDialog* ui;
|
2022-01-17 11:08:10 +00:00
|
|
|
MinecraftAccountPtr m_account;
|
|
|
|
Task::Ptr m_loginTask;
|
|
|
|
};
|