diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-08-05 19:09:10 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-08-05 19:09:10 +0300 |
commit | b2fdd8359405c93d0d93aa8c68971c986a1f68cb (patch) | |
tree | 59859119373213ce04b2f5e2d7a95227b57be609 /launcher/ui/dialogs/ProfileSelectDialog.cpp | |
parent | 149b6d59cf848a3b3cd50b3aee1c112e9c47e633 (diff) | |
parent | ae793f6cf11658c9abc5111e82d5ba7b3e6af127 (diff) | |
download | PrismLauncher-b2fdd8359405c93d0d93aa8c68971c986a1f68cb.tar.gz PrismLauncher-b2fdd8359405c93d0d93aa8c68971c986a1f68cb.tar.bz2 PrismLauncher-b2fdd8359405c93d0d93aa8c68971c986a1f68cb.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into download_threads
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/ui/dialogs/ProfileSelectDialog.cpp')
-rw-r--r-- | launcher/ui/dialogs/ProfileSelectDialog.cpp | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/launcher/ui/dialogs/ProfileSelectDialog.cpp b/launcher/ui/dialogs/ProfileSelectDialog.cpp index 7882cf45..a62238bd 100644 --- a/launcher/ui/dialogs/ProfileSelectDialog.cpp +++ b/launcher/ui/dialogs/ProfileSelectDialog.cpp @@ -16,43 +16,38 @@ #include "ProfileSelectDialog.h" #include "ui_ProfileSelectDialog.h" -#include <QItemSelectionModel> #include <QDebug> +#include <QItemSelectionModel> -#include "SkinUtils.h" #include "Application.h" +#include "SkinUtils.h" #include "ui/dialogs/ProgressDialog.h" -ProfileSelectDialog::ProfileSelectDialog(const QString &message, int flags, QWidget *parent) +ProfileSelectDialog::ProfileSelectDialog(const QString& message, int flags, QWidget* parent) : QDialog(parent), ui(new Ui::ProfileSelectDialog) { ui->setupUi(this); m_accounts = APPLICATION->accounts(); auto view = ui->listView; - //view->setModel(m_accounts.get()); - //view->hideColumn(AccountList::ActiveColumn); + // view->setModel(m_accounts.get()); + // view->hideColumn(AccountList::ActiveColumn); view->setColumnCount(1); view->setRootIsDecorated(false); // FIXME: use a real model, not this - if(QTreeWidgetItem* header = view->headerItem()) - { + if (QTreeWidgetItem* header = view->headerItem()) { header->setText(0, tr("Name")); - } - else - { + } else { view->setHeaderLabel(tr("Name")); } - QList <QTreeWidgetItem *> items; - for (int i = 0; i < m_accounts->count(); i++) - { + QList<QTreeWidgetItem*> items; + for (int i = 0; i < m_accounts->count(); i++) { MinecraftAccountPtr account = m_accounts->at(i); QString profileLabel; - if(account->isInUse()) { + if (account->isInUse()) { profileLabel = tr("%1 (in use)").arg(account->profileName()); - } - else { + } else { profileLabel = account->profileName(); } auto item = new QTreeWidgetItem(view); @@ -101,8 +96,7 @@ bool ProfileSelectDialog::useAsInstDefaullt() const void ProfileSelectDialog::on_buttonBox_accepted() { QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); - if (selection.size() > 0) - { + if (selection.size() > 0) { QModelIndex selected = selection.first(); m_selected = selected.data(AccountList::PointerRole).value<MinecraftAccountPtr>(); } |