Fix conflict again

This commit is contained in:
Sebastian-byte
2021-09-12 20:52:56 -05:00
18 changed files with 83 additions and 970 deletions

View File

@@ -129,7 +129,7 @@ void LoginDialog::onTaskProgress(qint64 current, qint64 total)
}
// Public interface
AccountPtr LoginDialog::newAccount(QWidget *parent, QString msg)
MinecraftAccountPtr LoginDialog::newAccount(QWidget *parent, QString msg)
{
LoginDialog dlg(parent);
dlg.ui->label->setText(msg);

View File

@@ -19,7 +19,7 @@
#include <QtWidgets/QRadioButton>
#include <QtCore/QEventLoop>
#include "minecraft/auth/Account.h"
#include "minecraft/auth/MinecraftAccount.h"
namespace Ui
{
@@ -33,7 +33,7 @@ class LoginDialog : public QDialog
public:
~LoginDialog();
static AccountPtr newAccount(QWidget *parent, QString message);
static MinecraftAccountPtr newAccount(QWidget *parent, QString message);
private:
explicit LoginDialog(QWidget *parent = 0);
@@ -54,7 +54,6 @@ slots:
private:
Ui::LoginDialog *ui;
AccountPtr m_account;
QMap<QString, QRadioButton*> m_radioButtons;
MinecraftAccountPtr m_account;
std::shared_ptr<Task> m_loginTask;
};

View File

@@ -48,19 +48,10 @@ ProfileSelectDialog::ProfileSelectDialog(const QString &message, int flags, QWid
QList <QTreeWidgetItem *> items;
for (int i = 0; i < m_accounts->count(); i++)
{
AccountPtr account = m_accounts->at(i);
for (auto profile : account->profiles())
{
auto profileLabel = profile.name;
if(account->isInUse())
{
profileLabel += tr(" (in use)");
}
auto item = new QTreeWidgetItem(view);
item->setText(0, profileLabel);
item->setIcon(0, SkinUtils::getFaceFromCache(profile.id));
item->setData(0, AccountList::PointerRole, QVariant::fromValue(account));
items.append(item);
MinecraftAccountPtr account = m_accounts->at(i);
QString profileLabel;
if(account->isInUse()) {
profileLabel = tr("%1 (in use)").arg(account->profileName());
}
else {
profileLabel = account->profileName();
@@ -93,7 +84,7 @@ ProfileSelectDialog::~ProfileSelectDialog()
delete ui;
}
AccountPtr ProfileSelectDialog::selectedAccount() const
MinecraftAccountPtr ProfileSelectDialog::selectedAccount() const
{
return m_selected;
}
@@ -114,7 +105,7 @@ void ProfileSelectDialog::on_buttonBox_accepted()
if (selection.size() > 0)
{
QModelIndex selected = selection.first();
m_selected = selected.data(AccountList::PointerRole).value<AccountPtr>();
m_selected = selected.data(AccountList::PointerRole).value<MinecraftAccountPtr>();
}
close();
}

View File

@@ -59,7 +59,7 @@ public:
* Gets a pointer to the account that the user selected.
* This is null if the user clicked cancel or hasn't clicked OK yet.
*/
AccountPtr selectedAccount() const;
MinecraftAccountPtr selectedAccount() const;
/*!
* Returns true if the user checked the "use as global default" checkbox.
@@ -83,7 +83,7 @@ protected:
std::shared_ptr<AccountList> m_accounts;
//! The account that was selected when the user clicked OK.
AccountPtr m_selected;
MinecraftAccountPtr m_selected;
private:
Ui::ProfileSelectDialog *ui;

View File

@@ -117,7 +117,7 @@ void SkinUploadDialog::on_skinBrowseBtn_clicked()
ui->skinPathTextBox->setText(cooked_path);
}
SkinUploadDialog::SkinUploadDialog(AccountPtr acct, QWidget *parent)
SkinUploadDialog::SkinUploadDialog(MinecraftAccountPtr acct, QWidget *parent)
:QDialog(parent), m_acct(acct), ui(new Ui::SkinUploadDialog)
{
ui->setupUi(this);

View File

@@ -1,7 +1,7 @@
#pragma once
#include <QDialog>
#include <minecraft/auth/Account.h>
#include <minecraft/auth/MinecraftAccount.h>
namespace Ui
{
@@ -11,7 +11,7 @@ namespace Ui
class SkinUploadDialog : public QDialog {
Q_OBJECT
public:
explicit SkinUploadDialog(AccountPtr acct, QWidget *parent = 0);
explicit SkinUploadDialog(MinecraftAccountPtr acct, QWidget *parent = 0);
virtual ~SkinUploadDialog() {};
public slots:
@@ -22,7 +22,7 @@ public slots:
void on_skinBrowseBtn_clicked();
protected:
AccountPtr m_acct;
MinecraftAccountPtr m_acct;
private:
Ui::SkinUploadDialog *ui;