diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-10-05 01:47:27 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-10-05 01:47:27 +0200 |
commit | f93f867c3da084c6d6c5e3ed23896609cff0e692 (patch) | |
tree | 3234c54d9aefb5566afc0c8ff52874e20ab35304 /application/dialogs | |
parent | 7459eb627c97d27ef6e12cdededa48e1ff03d533 (diff) | |
download | MultiMC-f93f867c3da084c6d6c5e3ed23896609cff0e692.tar MultiMC-f93f867c3da084c6d6c5e3ed23896609cff0e692.tar.gz MultiMC-f93f867c3da084c6d6c5e3ed23896609cff0e692.tar.lz MultiMC-f93f867c3da084c6d6c5e3ed23896609cff0e692.tar.xz MultiMC-f93f867c3da084c6d6c5e3ed23896609cff0e692.zip |
NOISSUE dissolve util library
Diffstat (limited to 'application/dialogs')
-rw-r--r-- | application/dialogs/CopyInstanceDialog.cpp | 18 | ||||
-rw-r--r-- | application/dialogs/CopyInstanceDialog.h | 3 | ||||
-rw-r--r-- | application/dialogs/CopyInstanceDialog.ui | 11 | ||||
-rw-r--r-- | application/dialogs/ExportInstanceDialog.cpp | 11 | ||||
-rw-r--r-- | application/dialogs/VersionSelectDialog.cpp | 1 |
5 files changed, 35 insertions, 9 deletions
diff --git a/application/dialogs/CopyInstanceDialog.cpp b/application/dialogs/CopyInstanceDialog.cpp index 54c42f29..67e2e8e1 100644 --- a/application/dialogs/CopyInstanceDialog.cpp +++ b/application/dialogs/CopyInstanceDialog.cpp @@ -52,6 +52,7 @@ CopyInstanceDialog::CopyInstanceDialog(InstancePtr original, QWidget *parent) } ui->groupBox->setCurrentIndex(index); ui->groupBox->lineEdit()->setPlaceholderText(tr("No group")); + ui->copySavesCheckbox->setChecked(m_copySaves); } CopyInstanceDialog::~CopyInstanceDialog() @@ -95,3 +96,20 @@ void CopyInstanceDialog::on_instNameTextBox_textChanged(const QString &arg1) { updateDialogState(); } + +bool CopyInstanceDialog::shouldCopySaves() const +{ + 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; + } +} diff --git a/application/dialogs/CopyInstanceDialog.h b/application/dialogs/CopyInstanceDialog.h index faa20615..a519443f 100644 --- a/application/dialogs/CopyInstanceDialog.h +++ b/application/dialogs/CopyInstanceDialog.h @@ -39,14 +39,17 @@ public: QString instName() const; QString instGroup() const; QString iconKey() const; + bool shouldCopySaves() const; private slots: void on_iconButton_clicked(); void on_instNameTextBox_textChanged(const QString &arg1); + void on_copySavesCheckbox_stateChanged(int state); private: Ui::CopyInstanceDialog *ui; QString InstIconKey; InstancePtr m_original; + bool m_copySaves = true; }; diff --git a/application/dialogs/CopyInstanceDialog.ui b/application/dialogs/CopyInstanceDialog.ui index 2615168c..bbb1bbb3 100644 --- a/application/dialogs/CopyInstanceDialog.ui +++ b/application/dialogs/CopyInstanceDialog.ui @@ -10,7 +10,7 @@ <x>0</x> <y>0</y> <width>345</width> - <height>205</height> + <height>240</height> </rect> </property> <property name="windowTitle"> @@ -87,7 +87,7 @@ <item row="0" column="0"> <widget class="QLabel" name="labelVersion_3"> <property name="text"> - <string>Group</string> + <string>&Group</string> </property> <property name="buddy"> <cstring>groupBox</cstring> @@ -110,6 +110,13 @@ </layout> </item> <item> + <widget class="QCheckBox" name="copySavesCheckbox"> + <property name="text"> + <string>Copy saves</string> + </property> + </widget> + </item> + <item> <widget class="QDialogButtonBox" name="buttonBox"> <property name="orientation"> <enum>Qt::Horizontal</enum> diff --git a/application/dialogs/ExportInstanceDialog.cpp b/application/dialogs/ExportInstanceDialog.cpp index ec46b6ba..8d320a3c 100644 --- a/application/dialogs/ExportInstanceDialog.cpp +++ b/application/dialogs/ExportInstanceDialog.cpp @@ -17,7 +17,6 @@ #include "ui_ExportInstanceDialog.h" #include <BaseInstance.h> #include <MMCZip.h> -#include <pathutils.h> #include <QFileDialog> #include <QMessageBox> #include <qfilesystemmodel.h> @@ -185,7 +184,7 @@ public: blocked.remove(cover); // block all contents, except for any cover QModelIndex rootIndex = - fsm->index(PathCombine(m_instance->instanceRoot(), cover)); + fsm->index(FS::PathCombine(m_instance->instanceRoot(), cover)); QModelIndex doing = rootIndex; int row = 0; QStack<QModelIndex> todo; @@ -376,18 +375,18 @@ void SaveIcon(InstancePtr m_instance) } } auto pixmap = icon.pixmap(largest); - pixmap.save(PathCombine(m_instance->instanceRoot(), iconKey + ".png")); + pixmap.save(FS::PathCombine(m_instance->instanceRoot(), iconKey + ".png")); } } } bool ExportInstanceDialog::doExport() { - auto name = RemoveInvalidFilenameChars(m_instance->name()); + auto name = FS::RemoveInvalidFilenameChars(m_instance->name()); const QString output = QFileDialog::getSaveFileName( this, tr("Export %1").arg(m_instance->name()), - PathCombine(QDir::homePath(), name + ".zip"), "Zip (*.zip)"); + FS::PathCombine(QDir::homePath(), name + ".zip"), "Zip (*.zip)"); if (output.isNull()) { return false; @@ -452,7 +451,7 @@ void ExportInstanceDialog::rowsInserted(QModelIndex parent, int top, int bottom) QString ExportInstanceDialog::ignoreFileName() { - return PathCombine(m_instance->instanceRoot(), ".packignore"); + return FS::PathCombine(m_instance->instanceRoot(), ".packignore"); } void ExportInstanceDialog::loadPackIgnore() diff --git a/application/dialogs/VersionSelectDialog.cpp b/application/dialogs/VersionSelectDialog.cpp index df72189b..50b543db 100644 --- a/application/dialogs/VersionSelectDialog.cpp +++ b/application/dialogs/VersionSelectDialog.cpp @@ -24,7 +24,6 @@ #include <BaseVersion.h> #include <BaseVersionList.h> #include <tasks/Task.h> -#include <modutils.h> #include <QDebug> #include "MultiMC.h" #include <VersionProxyModel.h> |