Misc version dialog changes
This commit is contained in:
parent
50035e9aa1
commit
346087efbb
@ -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())
|
||||
{
|
||||
|
@ -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())
|
||||
{
|
||||
|
@ -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());
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
*/
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user