summaryrefslogtreecommitdiffstats
path: root/kmailcvt/kmailcvt.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /kmailcvt/kmailcvt.cpp
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmailcvt/kmailcvt.cpp')
-rw-r--r--kmailcvt/kmailcvt.cpp76
1 files changed, 76 insertions, 0 deletions
diff --git a/kmailcvt/kmailcvt.cpp b/kmailcvt/kmailcvt.cpp
new file mode 100644
index 000000000..840715de0
--- /dev/null
+++ b/kmailcvt/kmailcvt.cpp
@@ -0,0 +1,76 @@
+/***************************************************************************
+ kmailcvt.cpp - description
+ -------------------
+ copyright : (C) 2003 by Laurence Anderson
+ email : l.d.anderson@warwick.ac.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmailcvt.h"
+#include <kaboutapplication.h>
+#include <qpushbutton.h>
+
+#include "filters.hxx"
+
+KMailCVT::KMailCVT(QWidget *parent, const char *name)
+ : KWizard(parent, name, true) {
+
+ setCaption( i18n( "KMailCVT Import Tool" ) );
+
+ selfilterpage = new KSelFilterPage(this);
+ addPage( selfilterpage, i18n( "Step 1: Select Filter" ) );
+
+ importpage = new KImportPage(this);
+ addPage( importpage, i18n( "Step 2: Importing..." ) );
+
+}
+
+KMailCVT::~KMailCVT() {
+}
+
+void KMailCVT::next() {
+ if( currentPage() == selfilterpage ){
+ // Save selected filter
+ Filter *selectedFilter = selfilterpage->getSelectedFilter();
+ // without filter don't go next
+ if (!selectedFilter)
+ return;
+ // Goto next page
+ KWizard::next();
+ // Disable back & finish
+ setBackEnabled( currentPage(), false );
+ setFinishEnabled( currentPage(), false );
+ // Start import
+ FilterInfo *info = new FilterInfo(importpage, this, selfilterpage->removeDupMsg_checked());
+ info->setStatusMsg(i18n("Import in progress"));
+ info->clear(); // Clear info from last time
+ selectedFilter->import(info);
+ info->setStatusMsg(i18n("Import finished"));
+ // Cleanup
+ delete info;
+ // Enable finish & back buttons
+ setFinishEnabled( currentPage(), true );
+ setBackEnabled( currentPage(), true );
+ } else KWizard::next();
+}
+
+void KMailCVT::reject() {
+ if ( currentPage() == importpage && ! finishButton()->isEnabled() ) FilterInfo::terminateASAP(); // ie. import in progress
+ else KWizard::reject();
+}
+
+void KMailCVT::help()
+{
+ KAboutApplication a( this );
+ a.exec();
+}
+
+#include "kmailcvt.moc"