Profiles of both types now can be created. Ready for review

This commit is contained in:
Zakhar Afonin
2021-05-30 17:08:55 +03:00
parent 0e436b45f2
commit 1c23483425
2 changed files with 30 additions and 3 deletions

View File

@@ -43,14 +43,17 @@ void LoginDialog::accept()
// Setup the login task and start it
m_account = MojangAccount::createFromUsername(ui->userTextBox->text());
m_account->setLoginType("dummy"); // TODO: Add the login type selector
if (ui->radioMojang->isChecked())
m_account->setLoginType("mojang");
else if (ui->radioDummy->isChecked())
m_account->setLoginType("dummy");
m_loginTask = m_account->login(nullptr, ui->passTextBox->text());
connect(m_loginTask.get(), &Task::failed, this, &LoginDialog::onTaskFailed);
connect(m_loginTask.get(), &Task::succeeded, this,
&LoginDialog::onTaskSucceeded);
connect(m_loginTask.get(), &Task::status, this, &LoginDialog::onTaskStatus);
connect(m_loginTask.get(), &Task::progress, this, &LoginDialog::onTaskProgress);
if (true)
if (!m_loginTask)
{
onTaskSucceeded();
} else {

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>400</width>
<height>162</height>
<height>219</height>
</rect>
</property>
<property name="sizePolicy">
@@ -60,6 +60,30 @@
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="radioLayout">
<item>
<widget class="QRadioButton" name="radioMojang">
<property name="text">
<string>Mojang / Minecraft</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioDummy">
<property name="text">
<string>Offline (cracked)</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">