|
|
@@ -435,6 +435,16 @@ void MainWindow::on_button_restore_clicked() {
|
|
|
std::thread(&MainWindow::run_restore_job, this, cfg, std::string(std::getenv("HOME"))).detach();
|
|
|
}
|
|
|
|
|
|
+bool MainWindow::on_delete_event(GdkEventAny* any_event) {
|
|
|
+ if (m_WorkerRunning) {
|
|
|
+ Gtk::MessageDialog dialog(*this, "Job in Progress", false, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK);
|
|
|
+ dialog.set_secondary_text("A backup or restore is currently running. Closing the app now will corrupt your vault. Wait until it's bloody finished.");
|
|
|
+ dialog.run();
|
|
|
+ return true; // Stop the window from closing
|
|
|
+ }
|
|
|
+ return false; // Allow the window to close
|
|
|
+}
|
|
|
+
|
|
|
bool MainWindow::create_tar_archive(const std::string& s, const std::string& o, bool strip) {
|
|
|
struct archive *a = archive_write_new();
|
|
|
archive_write_add_filter_gzip(a);
|