summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 28d561b9..57988663 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -2409,6 +2409,16 @@ void MainWindow::reinstallMod_clicked()
}
}
+void MainWindow::backupMod_clicked()
+{
+ ModInfo::Ptr modInfo = ModInfo::getByIndex(m_ContextRow);
+ QString backupDirectory = m_OrganizerCore.installationManager()->generateBackupName(modInfo->absolutePath());
+ if (!copyDir(modInfo->absolutePath(), backupDirectory, false)) {
+ QMessageBox::information(this, tr("Failed"),
+ tr("Failed to create backup."));
+ }
+ m_OrganizerCore.refreshModList();
+}
void MainWindow::resumeDownload(int downloadIndex)
{
@@ -3626,6 +3636,8 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos)
menu->addAction(tr("Rename Mod..."), this, SLOT(renameMod_clicked()));
menu->addAction(tr("Reinstall Mod"), this, SLOT(reinstallMod_clicked()));
menu->addAction(tr("Remove Mod..."), this, SLOT(removeMod_clicked()));
+ menu->addAction(tr("Create Backup"), this, SLOT(backupMod_clicked()));
+
menu->addSeparator();