diff options
Diffstat (limited to 'gui/lwjglselectdialog.cpp')
-rw-r--r-- | gui/lwjglselectdialog.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gui/lwjglselectdialog.cpp b/gui/lwjglselectdialog.cpp index 9de92754..09963ce0 100644 --- a/gui/lwjglselectdialog.cpp +++ b/gui/lwjglselectdialog.cpp @@ -13,8 +13,10 @@ * limitations under the License. */ +#include "MultiMC.h" #include "lwjglselectdialog.h" #include "ui_lwjglselectdialog.h" +#include "gui/platform.h" #include "logic/lists/LwjglVersionList.h" @@ -22,13 +24,15 @@ LWJGLSelectDialog::LWJGLSelectDialog(QWidget *parent) : QDialog(parent), ui(new Ui::LWJGLSelectDialog) { + MultiMCPlatform::fixWM_CLASS(this); ui->setupUi(this); ui->labelStatus->setVisible(false); - ui->lwjglListView->setModel(&LWJGLVersionList::get()); + auto lwjgllist = MMC->lwjgllist(); + ui->lwjglListView->setModel(lwjgllist.get()); - connect(&LWJGLVersionList::get(), SIGNAL(loadingStateUpdated(bool)), SLOT(loadingStateUpdated(bool))); - connect(&LWJGLVersionList::get(), SIGNAL(loadListFailed(QString)), SLOT(loadingFailed(QString))); - loadingStateUpdated(LWJGLVersionList::get().isLoading()); + connect(lwjgllist.get(), SIGNAL(loadingStateUpdated(bool)), SLOT(loadingStateUpdated(bool))); + connect(lwjgllist.get(), SIGNAL(loadListFailed(QString)), SLOT(loadingFailed(QString))); + loadingStateUpdated(lwjgllist->isLoading()); } LWJGLSelectDialog::~LWJGLSelectDialog() @@ -38,15 +42,15 @@ LWJGLSelectDialog::~LWJGLSelectDialog() QString LWJGLSelectDialog::selectedVersion() const { - return LWJGLVersionList::get().data( + return MMC->lwjgllist()->data( ui->lwjglListView->selectionModel()->currentIndex(), Qt::DisplayRole).toString(); } void LWJGLSelectDialog::on_refreshButton_clicked() { - if (!LWJGLVersionList::get().isLoading()) - LWJGLVersionList::get().loadList(); + if (!MMC->lwjgllist()->isLoading()) + MMC->lwjgllist()->loadList(); } void LWJGLSelectDialog::loadingStateUpdated(bool loading) @@ -54,7 +58,7 @@ void LWJGLSelectDialog::loadingStateUpdated(bool loading) setEnabled(!loading); if (loading) { - ui->labelStatus->setText("Loading LWJGL version list..."); + ui->labelStatus->setText(tr("Loading LWJGL version list...")); ui->labelStatus->setStyleSheet("QLabel { color: black; }"); } ui->labelStatus->setVisible(loading); |