MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / exec

Method exec

launcher/ui/dialogs/MSALoginDialog.cpp:75–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75int MSALoginDialog::exec()
76{
77 // Setup the login task and start it
78 m_account = MinecraftAccount::createBlankMSA();
79 m_authflow_task = m_account->login(false);
80 connect(m_authflow_task.get(), &Task::failed, this, &MSALoginDialog::onTaskFailed);
81 connect(m_authflow_task.get(), &Task::succeeded, this, &QDialog::accept);
82 connect(m_authflow_task.get(), &Task::aborted, this, &MSALoginDialog::reject);
83 connect(m_authflow_task.get(), &Task::status, this, &MSALoginDialog::onAuthFlowStatus);
84 connect(m_authflow_task.get(), &AuthFlow::authorizeWithBrowser, this, &MSALoginDialog::authorizeWithBrowser);
85 connect(m_authflow_task.get(), &AuthFlow::authorizeWithBrowserWithExtra, this, &MSALoginDialog::authorizeWithBrowserWithExtra);
86 connect(ui->buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, m_authflow_task.get(), &Task::abort);
87
88 m_devicecode_task.reset(new AuthFlow(m_account->accountData(), AuthFlow::Action::DeviceCode));
89 connect(m_devicecode_task.get(), &Task::failed, this, &MSALoginDialog::onTaskFailed);
90 connect(m_devicecode_task.get(), &Task::succeeded, this, &QDialog::accept);
91 connect(m_devicecode_task.get(), &Task::aborted, this, &MSALoginDialog::reject);
92 connect(m_devicecode_task.get(), &Task::status, this, &MSALoginDialog::onDeviceFlowStatus);
93 connect(m_devicecode_task.get(), &AuthFlow::authorizeWithBrowser, this, &MSALoginDialog::authorizeWithBrowser);
94 connect(m_devicecode_task.get(), &AuthFlow::authorizeWithBrowserWithExtra, this, &MSALoginDialog::authorizeWithBrowserWithExtra);
95 connect(ui->buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, m_devicecode_task.get(), &Task::abort);
96 QMetaObject::invokeMethod(m_authflow_task.get(), &Task::start, Qt::QueuedConnection);
97 QMetaObject::invokeMethod(m_devicecode_task.get(), &Task::start, Qt::QueuedConnection);
98
99 return QDialog::exec();
100}
101
102MSALoginDialog::~MSALoginDialog()
103{

Callers 12

checkCandidatesMethod · 0.45
ensureMetadataMethod · 0.45
onMetadataFailedMethod · 0.45
newAccountMethod · 0.45
rejectMethod · 0.45
confirmMethod · 0.45
newAccountMethod · 0.45
acceptMethod · 0.45
on_resetBtn_clickedMethod · 0.45
show_context_menuMethod · 0.45
executeTaskMethod · 0.45

Calls 4

accountDataMethod · 0.80
loginMethod · 0.45
getMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected