Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auth server column to account list #139

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions launcher/minecraft/auth/AccountList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

#include <FileSystem.h>
#include <QSaveFile>
#include <QString>

#include <chrono>

Expand Down Expand Up @@ -333,6 +334,17 @@ QVariant AccountList::data(const QModelIndex& index, int role) const
}
}

case AuthServerColumn: {
QString suffix = "/authlib-injector/authserver";
QString server = account->authServerUrl();
if (server.endsWith(suffix)) {
server.chop(suffix.length());
return server;
} else {
return server;
}
}

case MigrationColumn: {
if (!account->isMojang()) {
return tr("N/A", "Can Migrate");
Expand Down Expand Up @@ -379,6 +391,8 @@ QVariant AccountList::headerData(int section, [[maybe_unused]] Qt::Orientation o
return tr("Type");
case StatusColumn:
return tr("Status");
case AuthServerColumn:
return tr("Server");
default:
return QVariant();
}
Expand All @@ -393,6 +407,8 @@ QVariant AccountList::headerData(int section, [[maybe_unused]] Qt::Orientation o
return tr("Type of the account (MSA or Offline)");
case StatusColumn:
return tr("Current status of the account.");
case AuthServerColumn:
return tr("Auth server the account is using.");
default:
return QVariant();
}
Expand Down
1 change: 1 addition & 0 deletions launcher/minecraft/auth/AccountList.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class AccountList : public QAbstractListModel {
MigrationColumn,
TypeColumn,
StatusColumn,
AuthServerColumn,

NUM_COLUMNS
};
Expand Down