summaryrefslogtreecommitdiffstats
path: root/application/MainWindow.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-04-19 04:19:29 +0200
committerPetr Mrázek <peterix@gmail.com>2015-04-19 16:14:32 +0200
commitc7c81463fd3ab01c9e096f75e7e8ad8b50902a98 (patch)
treeab19d0316cd293bcc05bc6b1b6e937c858814b90 /application/MainWindow.cpp
parent6cfac115b1f18b9ff5130b2b9a6d5e2fcf052e6c (diff)
downloadMultiMC-c7c81463fd3ab01c9e096f75e7e8ad8b50902a98.tar
MultiMC-c7c81463fd3ab01c9e096f75e7e8ad8b50902a98.tar.gz
MultiMC-c7c81463fd3ab01c9e096f75e7e8ad8b50902a98.tar.lz
MultiMC-c7c81463fd3ab01c9e096f75e7e8ad8b50902a98.tar.xz
MultiMC-c7c81463fd3ab01c9e096f75e7e8ad8b50902a98.zip
GH-885 export dialog for filtering exported files
Includes implementation of a separator based prefix tree and some related bits
Diffstat (limited to 'application/MainWindow.cpp')
-rw-r--r--application/MainWindow.cpp26
1 files changed, 3 insertions, 23 deletions
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index ff890d6e..ca6754b5 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -349,6 +349,7 @@ namespace Ui {
#include "dialogs/UpdateDialog.h"
#include "dialogs/EditAccountDialog.h"
#include "dialogs/NotificationDialog.h"
+#include "dialogs/ExportInstanceDialog.h"
#include "pages/global/MultiMCPage.h"
#include "pages/global/ExternalToolsPage.h"
@@ -1475,29 +1476,8 @@ void MainWindow::on_actionExportInstance_triggered()
{
if (m_selectedInstance)
{
- auto name = RemoveInvalidFilenameChars(m_selectedInstance->name());
-
- const QString output = QFileDialog::getSaveFileName(this, tr("Export %1")
- .arg(m_selectedInstance->name()),
- PathCombine(QDir::homePath(), name + ".zip") , "Zip (*.zip)");
- if (output.isNull())
- {
- return;
- }
- if (QFile::exists(output))
- {
- int ret = QMessageBox::question(this, tr("Overwrite?"), tr("This file already exists. Do you want to overwrite it?"),
- QMessageBox::No, QMessageBox::Yes);
- if (ret == QMessageBox::No)
- {
- return;
- }
- }
-
- if (!MMCZip::compressDir(output, m_selectedInstance->instanceRoot(), name))
- {
- QMessageBox::warning(this, tr("Error"), tr("Unable to export instance"));
- }
+ ExportInstanceDialog dlg(m_selectedInstance, this);
+ dlg.exec();
}
}