summaryrefslogtreecommitdiffstats
path: root/application/dialogs
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-04-11 01:30:50 +0200
committerPetr Mrázek <peterix@gmail.com>2016-04-11 01:30:50 +0200
commit432ec7417499c6fa6b0c2935c96ad5f3d1d097c1 (patch)
treeff18776574ceb0023bfa373dddc4601252776b72 /application/dialogs
parentb795ad52099562a90b961e2e294daf6a3dc00883 (diff)
downloadMultiMC-432ec7417499c6fa6b0c2935c96ad5f3d1d097c1.tar
MultiMC-432ec7417499c6fa6b0c2935c96ad5f3d1d097c1.tar.gz
MultiMC-432ec7417499c6fa6b0c2935c96ad5f3d1d097c1.tar.lz
MultiMC-432ec7417499c6fa6b0c2935c96ad5f3d1d097c1.tar.xz
MultiMC-432ec7417499c6fa6b0c2935c96ad5f3d1d097c1.zip
GH-1404 allow deleting groups and creating instances in groups directly using context menu
Diffstat (limited to 'application/dialogs')
-rw-r--r--application/dialogs/NewInstanceDialog.cpp7
-rw-r--r--application/dialogs/NewInstanceDialog.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/application/dialogs/NewInstanceDialog.cpp b/application/dialogs/NewInstanceDialog.cpp
index 0d54172d..a883d1dc 100644
--- a/application/dialogs/NewInstanceDialog.cpp
+++ b/application/dialogs/NewInstanceDialog.cpp
@@ -55,7 +55,7 @@ public:
}
};
-NewInstanceDialog::NewInstanceDialog(QWidget *parent)
+NewInstanceDialog::NewInstanceDialog(const QString & initialGroup, QWidget *parent)
: QDialog(parent), ui(new Ui::NewInstanceDialog)
{
ui->setupUi(this);
@@ -79,11 +79,10 @@ NewInstanceDialog::NewInstanceDialog(QWidget *parent)
auto groupList = QStringList(groups.toList());
groupList.sort(Qt::CaseInsensitive);
groupList.removeOne("");
- QString oldValue = MMC->settings()->get("LastUsedGroupForNewInstance").toString();
- groupList.push_front(oldValue);
+ groupList.push_front(initialGroup);
groupList.push_front("");
ui->groupBox->addItems(groupList);
- int index = groupList.indexOf(oldValue);
+ int index = groupList.indexOf(initialGroup);
if(index == -1)
{
index = 0;
diff --git a/application/dialogs/NewInstanceDialog.h b/application/dialogs/NewInstanceDialog.h
index 1a2be10c..578b2c45 100644
--- a/application/dialogs/NewInstanceDialog.h
+++ b/application/dialogs/NewInstanceDialog.h
@@ -29,7 +29,7 @@ class NewInstanceDialog : public QDialog
Q_OBJECT
public:
- explicit NewInstanceDialog(QWidget *parent = 0);
+ explicit NewInstanceDialog(const QString & initialGroup, QWidget *parent = 0);
~NewInstanceDialog();
void updateDialogState();