summaryrefslogtreecommitdiffstats
path: root/application/dialogs/CopyInstanceDialog.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-07-15 14:51:05 +0200
committerPetr Mrázek <peterix@gmail.com>2018-07-15 14:51:05 +0200
commitbbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9 (patch)
treee6497e304b7b9368367565fbc7c06efab1124b1c /application/dialogs/CopyInstanceDialog.cpp
parent03280cc62e75f8073f8d3d9e9e3952acf21fa77d (diff)
downloadMultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar
MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.gz
MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.lz
MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.xz
MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.zip
NOISSUE tabs -> spaces
Diffstat (limited to 'application/dialogs/CopyInstanceDialog.cpp')
-rw-r--r--application/dialogs/CopyInstanceDialog.cpp92
1 files changed, 46 insertions, 46 deletions
diff --git a/application/dialogs/CopyInstanceDialog.cpp b/application/dialogs/CopyInstanceDialog.cpp
index 72ef00fa..c565510c 100644
--- a/application/dialogs/CopyInstanceDialog.cpp
+++ b/application/dialogs/CopyInstanceDialog.cpp
@@ -29,87 +29,87 @@
#include "InstanceList.h"
CopyInstanceDialog::CopyInstanceDialog(InstancePtr original, QWidget *parent)
- :QDialog(parent), ui(new Ui::CopyInstanceDialog), m_original(original)
+ :QDialog(parent), ui(new Ui::CopyInstanceDialog), m_original(original)
{
- ui->setupUi(this);
- resize(minimumSizeHint());
- layout()->setSizeConstraint(QLayout::SetFixedSize);
-
- InstIconKey = original->iconKey();
- ui->iconButton->setIcon(MMC->icons()->getIcon(InstIconKey));
- ui->instNameTextBox->setText(original->name());
- ui->instNameTextBox->setFocus();
- auto groups = MMC->instances()->getGroups().toSet();
- auto groupList = QStringList(groups.toList());
- groupList.sort(Qt::CaseInsensitive);
- groupList.removeOne("");
- groupList.push_front("");
- ui->groupBox->addItems(groupList);
- int index = groupList.indexOf(m_original->group());
- if(index == -1)
- {
- index = 0;
- }
- ui->groupBox->setCurrentIndex(index);
- ui->groupBox->lineEdit()->setPlaceholderText(tr("No group"));
- ui->copySavesCheckbox->setChecked(m_copySaves);
+ ui->setupUi(this);
+ resize(minimumSizeHint());
+ layout()->setSizeConstraint(QLayout::SetFixedSize);
+
+ InstIconKey = original->iconKey();
+ ui->iconButton->setIcon(MMC->icons()->getIcon(InstIconKey));
+ ui->instNameTextBox->setText(original->name());
+ ui->instNameTextBox->setFocus();
+ auto groups = MMC->instances()->getGroups().toSet();
+ auto groupList = QStringList(groups.toList());
+ groupList.sort(Qt::CaseInsensitive);
+ groupList.removeOne("");
+ groupList.push_front("");
+ ui->groupBox->addItems(groupList);
+ int index = groupList.indexOf(m_original->group());
+ if(index == -1)
+ {
+ index = 0;
+ }
+ ui->groupBox->setCurrentIndex(index);
+ ui->groupBox->lineEdit()->setPlaceholderText(tr("No group"));
+ ui->copySavesCheckbox->setChecked(m_copySaves);
}
CopyInstanceDialog::~CopyInstanceDialog()
{
- delete ui;
+ delete ui;
}
void CopyInstanceDialog::updateDialogState()
{
- ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!instName().isEmpty());
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!instName().isEmpty());
}
QString CopyInstanceDialog::instName() const
{
- return ui->instNameTextBox->text();
+ return ui->instNameTextBox->text();
}
QString CopyInstanceDialog::iconKey() const
{
- return InstIconKey;
+ return InstIconKey;
}
QString CopyInstanceDialog::instGroup() const
{
- return ui->groupBox->currentText();
+ return ui->groupBox->currentText();
}
void CopyInstanceDialog::on_iconButton_clicked()
{
- IconPickerDialog dlg(this);
- dlg.execWithSelection(InstIconKey);
-
- if (dlg.result() == QDialog::Accepted)
- {
- InstIconKey = dlg.selectedIconKey;
- ui->iconButton->setIcon(MMC->icons()->getIcon(InstIconKey));
- }
+ IconPickerDialog dlg(this);
+ dlg.execWithSelection(InstIconKey);
+
+ if (dlg.result() == QDialog::Accepted)
+ {
+ InstIconKey = dlg.selectedIconKey;
+ ui->iconButton->setIcon(MMC->icons()->getIcon(InstIconKey));
+ }
}
void CopyInstanceDialog::on_instNameTextBox_textChanged(const QString &arg1)
{
- updateDialogState();
+ updateDialogState();
}
bool CopyInstanceDialog::shouldCopySaves() const
{
- return m_copySaves;
+ return m_copySaves;
}
void CopyInstanceDialog::on_copySavesCheckbox_stateChanged(int state)
{
- if(state == Qt::Unchecked)
- {
- m_copySaves = false;
- }
- else if(state == Qt::Checked)
- {
- m_copySaves = true;
- }
+ if(state == Qt::Unchecked)
+ {
+ m_copySaves = false;
+ }
+ else if(state == Qt::Checked)
+ {
+ m_copySaves = true;
+ }
}