diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-04-19 04:19:29 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-04-19 16:14:32 +0200 |
commit | c7c81463fd3ab01c9e096f75e7e8ad8b50902a98 (patch) | |
tree | ab19d0316cd293bcc05bc6b1b6e937c858814b90 /application/MainWindow.cpp | |
parent | 6cfac115b1f18b9ff5130b2b9a6d5e2fcf052e6c (diff) | |
download | MultiMC-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.cpp | 26 |
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(); } } |