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()
{
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())
{

View File

@ -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())
{

View File

@ -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());

View File

@ -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,7 +57,8 @@ 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)
@ -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)
{

View File

@ -26,12 +26,12 @@
#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;

View File

@ -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();