PrismLauncher/launcher/ui/dialogs/OfflineLoginDialog.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
916 B
C
Raw Normal View History

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