Misc version dialog changes

This commit is contained in:
Petr Mrázek 2013-10-06 14:43:46 +02:00
parent 50035e9aa1
commit 346087efbb
6 changed files with 25 additions and 25 deletions

View File

@ -195,7 +195,7 @@ void LegacyModEditDialog::on_addCoreBtn_clicked()
} }
void LegacyModEditDialog::on_addForgeBtn_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()); vselect.setFilter(1, m_inst->intendedVersionId());
if (vselect.exec() && vselect.selectedVersion()) if (vselect.exec() && vselect.selectedVersion())
{ {

View File

@ -121,7 +121,7 @@ void OneSixModEditDialog::on_revertBtn_clicked()
void OneSixModEditDialog::on_forgeBtn_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()); vselect.setFilter(1, m_inst->currentVersionId());
if (vselect.exec() && vselect.selectedVersion()) if (vselect.exec() && vselect.selectedVersion())
{ {

View File

@ -600,7 +600,8 @@ void MainWindow::on_actionChangeInstMCVersion_triggered()
if (view->selectionModel()->selectedIndexes().count() < 1) if (view->selectionModel()->selectedIndexes().count() < 1)
return; return;
VersionSelectDialog vselect(m_selectedInstance->versionList().get(), this); VersionSelectDialog vselect(m_selectedInstance->versionList().get(),
tr("Change Minecraft version"), this);
if (vselect.exec() && vselect.selectedVersion()) if (vselect.exec() && vselect.selectedVersion())
{ {
m_selectedInstance->setIntendedVersionId(vselect.selectedVersion()->descriptor()); m_selectedInstance->setIntendedVersionId(vselect.selectedVersion()->descriptor());

View File

@ -30,11 +30,8 @@
#include <QLayout> #include <QLayout>
#include <QPushButton> #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); ui->setupUi(this);
resize(minimumSizeHint()); resize(minimumSizeHint());
@ -60,7 +57,8 @@ NewInstanceDialog::~NewInstanceDialog()
void NewInstanceDialog::updateDialogState() 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) void NewInstanceDialog::setSelectedVersion(BaseVersionPtr version)
@ -96,7 +94,8 @@ BaseVersionPtr NewInstanceDialog::selectedVersion() const
void NewInstanceDialog::on_btnChangeVersion_clicked() void NewInstanceDialog::on_btnChangeVersion_clicked()
{ {
VersionSelectDialog vselect(MMC->minecraftlist().get(), this); VersionSelectDialog vselect(MMC->minecraftlist().get(), tr("Change Minecraft version"),
this);
vselect.exec(); vselect.exec();
if (vselect.result() == QDialog::Accepted) if (vselect.result() == QDialog::Accepted)
{ {
@ -111,7 +110,7 @@ void NewInstanceDialog::on_iconButton_clicked()
IconPickerDialog dlg(this); IconPickerDialog dlg(this);
dlg.exec(InstIconKey); dlg.exec(InstIconKey);
if(dlg.result() == QDialog::Accepted) if (dlg.result() == QDialog::Accepted)
{ {
InstIconKey = dlg.selectedIconKey; InstIconKey = dlg.selectedIconKey;
ui->iconButton->setIcon(MMC->icons()->getIcon(InstIconKey)); ui->iconButton->setIcon(MMC->icons()->getIcon(InstIconKey));

View File

@ -26,12 +26,12 @@
#include <logic/lists/BaseVersionList.h> #include <logic/lists/BaseVersionList.h>
#include <logic/tasks/Task.h> #include <logic/tasks/Task.h>
VersionSelectDialog::VersionSelectDialog(BaseVersionList *vlist, QWidget *parent) : VersionSelectDialog::VersionSelectDialog(BaseVersionList *vlist, QString title, QWidget *parent)
QDialog(parent), : QDialog(parent), ui(new Ui::VersionSelectDialog)
ui(new Ui::VersionSelectDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
setWindowModality(Qt::WindowModal); setWindowModality(Qt::WindowModal);
setWindowTitle(title);
m_vlist = vlist; m_vlist = vlist;

View File

@ -33,7 +33,7 @@ class VersionSelectDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit VersionSelectDialog(BaseVersionList *vlist, QWidget *parent = 0); explicit VersionSelectDialog(BaseVersionList *vlist, QString title, QWidget *parent = 0);
~VersionSelectDialog(); ~VersionSelectDialog();
virtual int exec(); virtual int exec();