+void ArchiveWidget::done ( int r )
+{
+ if (closeAccepted()) QDialog::done(r);
+}
+
+void ArchiveWidget::closeEvent ( QCloseEvent * e )
+{
+
+ if (closeAccepted()) e->accept();
+ else e->ignore();
+}
+
+
+bool ArchiveWidget::closeAccepted()
+{
+ if (!archive_url->isEnabled()) {
+ // Archiving in progress, should we stop?
+ if (KMessageBox::warningContinueCancel(this, i18n("Archiving in progress, do you want to stop it?"), i18n("Stop Archiving"), KGuiItem(i18n("Stop Archiving"))) != KMessageBox::Continue) {
+ return false;
+ }
+ if (m_copyJob) m_copyJob->kill();
+ }
+ return true;
+}
+
+