MultiMC5/launcher/ui/dialogs/OfflineNameDialog.h
Petr Mrázek a026fabd20 GH-5166 refine offline account handling on launch to allow going online
Added a button to the offline name selection dialog that allows
switching the intent from offline launch to online launch.

This lets you launch online with a currently offline account when you regain
network connectivity.
2024-12-17 03:40:09 +01:00

41 lines
826 B
C++

#pragma once
/*
* Copyright 2024 Petr Mrázek
*
* This source is subject to the Microsoft Permissive License (MS-PL).
* Please see the COPYING.md file for more information.
*/
#include <QDialog>
#include <QString>
class OfflineNameDialog : public QDialog
{
Q_OBJECT
public:
enum OfflineNameDialogCode {
Rejected = QDialog::Rejected,
Accepted = QDialog::Accepted,
OnlineRequested,
};
OfflineNameDialog(QString current_name, QWidget * parent = nullptr);
virtual ~OfflineNameDialog() = default;
QString textValue() const;
public slots:
void accept() override;
private slots:
void textChanged(const QString& text);
void retryOnline();
private:
class QDialogButtonBox * m_buttonBox;
class QLineEdit* m_lineEdit;
bool m_acceptEnabled = false;
};