summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-10-06 14:43:46 +0200
committerPetr Mrázek <peterix@gmail.com>2013-10-08 01:38:26 +0200
commit346087efbb1eadf462b8b448a0d4c0458d3a2c0c (patch)
treeb20d8a3245984d07c9f0ddbe8c19bc1554ed23fe /gui
parent50035e9aa1b4f04c91cce3830effbc11c0eec269 (diff)
downloadMultiMC-346087efbb1eadf462b8b448a0d4c0458d3a2c0c.tar
MultiMC-346087efbb1eadf462b8b448a0d4c0458d3a2c0c.tar.gz
MultiMC-346087efbb1eadf462b8b448a0d4c0458d3a2c0c.tar.lz
MultiMC-346087efbb1eadf462b8b448a0d4c0458d3a2c0c.tar.xz
MultiMC-346087efbb1eadf462b8b448a0d4c0458d3a2c0c.zip
Misc version dialog changes
Diffstat (limited to 'gui')
-rw-r--r--gui/LegacyModEditDialog.cpp2
-rw-r--r--gui/OneSixModEditDialog.cpp2
-rw-r--r--gui/mainwindow.cpp3
-rw-r--r--gui/newinstancedialog.cpp23
-rw-r--r--gui/versionselectdialog.cpp18
-rw-r--r--gui/versionselectdialog.h2
6 files changed, 25 insertions, 25 deletions
diff --git a/gui/LegacyModEditDialog.cpp b/gui/LegacyModEditDialog.cpp
index c240daff..45f041f3 100644
--- a/gui/LegacyModEditDialog.cpp
+++ b/gui/LegacyModEditDialog.cpp
@@ -195,7 +195,7 @@ void LegacyModEditDialog::on_addCoreBtn_clicked()
}
void LegacyModEditDialog::on_addForgeBtn_clicked()
{
- VersionSelectDialog vselect(MMC->forgelist().get(), this);
+ VersionSelectDialog vselect(MMC->forgelist().get(), tr("Select Forge version"), this);
vselect.setFilter(1, m_inst->intendedVersionId());
if (vselect.exec() && vselect.selectedVersion())
{
diff --git a/gui/OneSixModEditDialog.cpp b/gui/OneSixModEditDialog.cpp
index e8c7f9ed..24f01c53 100644
--- a/gui/OneSixModEditDialog.cpp
+++ b/gui/OneSixModEditDialog.cpp
@@ -121,7 +121,7 @@ void OneSixModEditDialog::on_revertBtn_clicked()
void OneSixModEditDialog::on_forgeBtn_clicked()
{
- VersionSelectDialog vselect(MMC->forgelist().get(), this);
+ VersionSelectDialog vselect(MMC->forgelist().get(), tr("Select Forge version"), this);
vselect.setFilter(1, m_inst->currentVersionId());
if (vselect.exec() && vselect.selectedVersion())
{
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp
index 3ba6e52b..080ce4b2 100644
--- a/gui/mainwindow.cpp
+++ b/gui/mainwindow.cpp
@@ -600,7 +600,8 @@ void MainWindow::on_actionChangeInstMCVersion_triggered()
if (view->selectionModel()->selectedIndexes().count() < 1)
return;
- VersionSelectDialog vselect(m_selectedInstance->versionList().get(), this);
+ VersionSelectDialog vselect(m_selectedInstance->versionList().get(),
+ tr("Change Minecraft version"), this);
if (vselect.exec() && vselect.selectedVersion())
{
m_selectedInstance->setIntendedVersionId(vselect.selectedVersion()->descriptor());
diff --git a/gui/newinstancedialog.cpp b/gui/newinstancedialog.cpp
index c035302c..04b38316 100644
--- a/gui/newinstancedialog.cpp
+++ b/gui/newinstancedialog.cpp
@@ -3,7 +3,7 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@@ -30,11 +30,8 @@
#include <QLayout>
#include <QPushButton>
-
-
-NewInstanceDialog::NewInstanceDialog(QWidget *parent) :
- QDialog(parent),
- ui(new Ui::NewInstanceDialog)
+NewInstanceDialog::NewInstanceDialog(QWidget *parent)
+ : QDialog(parent), ui(new Ui::NewInstanceDialog)
{
ui->setupUi(this);
resize(minimumSizeHint());
@@ -60,13 +57,14 @@ NewInstanceDialog::~NewInstanceDialog()
void NewInstanceDialog::updateDialogState()
{
- ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!instName().isEmpty() && m_selectedVersion);
+ ui->buttonBox->button(QDialogButtonBox::Ok)
+ ->setEnabled(!instName().isEmpty() && m_selectedVersion);
}
void NewInstanceDialog::setSelectedVersion(BaseVersionPtr version)
{
m_selectedVersion = version;
-
+
if (m_selectedVersion)
{
ui->versionTextBox->setText(version->name());
@@ -75,7 +73,7 @@ void NewInstanceDialog::setSelectedVersion(BaseVersionPtr version)
{
ui->versionTextBox->setText("");
}
-
+
updateDialogState();
}
@@ -96,7 +94,8 @@ BaseVersionPtr NewInstanceDialog::selectedVersion() const
void NewInstanceDialog::on_btnChangeVersion_clicked()
{
- VersionSelectDialog vselect(MMC->minecraftlist().get(), this);
+ VersionSelectDialog vselect(MMC->minecraftlist().get(), tr("Change Minecraft version"),
+ this);
vselect.exec();
if (vselect.result() == QDialog::Accepted)
{
@@ -110,8 +109,8 @@ void NewInstanceDialog::on_iconButton_clicked()
{
IconPickerDialog dlg(this);
dlg.exec(InstIconKey);
-
- if(dlg.result() == QDialog::Accepted)
+
+ if (dlg.result() == QDialog::Accepted)
{
InstIconKey = dlg.selectedIconKey;
ui->iconButton->setIcon(MMC->icons()->getIcon(InstIconKey));
diff --git a/gui/versionselectdialog.cpp b/gui/versionselectdialog.cpp
index ff990188..d975a7b4 100644
--- a/gui/versionselectdialog.cpp
+++ b/gui/versionselectdialog.cpp
@@ -3,7 +3,7 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@@ -26,18 +26,18 @@
#include <logic/lists/BaseVersionList.h>
#include <logic/tasks/Task.h>
-VersionSelectDialog::VersionSelectDialog(BaseVersionList *vlist, QWidget *parent) :
- QDialog(parent),
- ui(new Ui::VersionSelectDialog)
+VersionSelectDialog::VersionSelectDialog(BaseVersionList *vlist, QString title, QWidget *parent)
+ : QDialog(parent), ui(new Ui::VersionSelectDialog)
{
ui->setupUi(this);
setWindowModality(Qt::WindowModal);
-
+ setWindowTitle(title);
+
m_vlist = vlist;
-
+
m_proxyModel = new QSortFilterProxyModel(this);
m_proxyModel->setSourceModel(vlist);
-
+
ui->listView->setModel(m_proxyModel);
ui->listView->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
ui->listView->header()->setSectionResizeMode(0, QHeaderView::Stretch);
@@ -86,11 +86,11 @@ void VersionSelectDialog::setFilter(int column, QString filter)
filteredTypes += "Snapshot";
if (!ui->filterMCNostalgiaCheckbox->isChecked())
filteredTypes += "Nostalgia";
-
+
QString regexStr = "^.*$";
if (filteredTypes.length() > 0)
regexStr = QString("^((?!%1).)*$").arg(filteredTypes.join('|'));
-
+
QLOG_DEBUG() << "Filter:" << regexStr;
*/
}
diff --git a/gui/versionselectdialog.h b/gui/versionselectdialog.h
index 0bb1745a..4be048af 100644
--- a/gui/versionselectdialog.h
+++ b/gui/versionselectdialog.h
@@ -33,7 +33,7 @@ class VersionSelectDialog : public QDialog
Q_OBJECT
public:
- explicit VersionSelectDialog(BaseVersionList *vlist, QWidget *parent = 0);
+ explicit VersionSelectDialog(BaseVersionList *vlist, QString title, QWidget *parent = 0);
~VersionSelectDialog();
virtual int exec();