summaryrefslogtreecommitdiffstats
path: root/kmailcvt/kselfilterpage.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/kselfilterpage.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/kselfilterpage.cpp')
-rw-r--r--kmailcvt/kselfilterpage.cpp98
1 files changed, 98 insertions, 0 deletions
diff --git a/kmailcvt/kselfilterpage.cpp b/kmailcvt/kselfilterpage.cpp
new file mode 100644
index 00000000..1fa13b13
--- /dev/null
+++ b/kmailcvt/kselfilterpage.cpp
@@ -0,0 +1,98 @@
+/***************************************************************************
+ kselfilterpage.cpp - description
+ -------------------
+ begin : Fri Jan 17 2003
+ 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 <kstandarddirs.h>
+#include <qtextedit.h>
+#include <qcheckbox.h>
+#include <klocale.h>
+#include "filters.hxx"
+
+#include "filter_mbox.hxx"
+#include "filter_oe.hxx"
+#include "filter_outlook.hxx"
+#include "filter_pmail.hxx"
+#include "filter_plain.hxx"
+#include "filter_evolution.hxx"
+#include "filter_mailapp.hxx"
+#include "filter_evolution_v2.hxx"
+#include "filter_opera.hxx"
+#include "filter_thunderbird.hxx"
+#include "filter_kmail_maildir.hxx"
+#include "filter_sylpheed.hxx"
+#include "filter_thebat.hxx"
+#include "filter_lnotes.hxx"
+
+#include "kselfilterpage.h"
+
+KSelFilterPage::KSelFilterPage(QWidget *parent, const char *name ) : KSelFilterPageDlg(parent,name) {
+
+ mIntroSidebar->setPixmap(locate("data", "kmailcvt/pics/step1.png"));
+ mFilterList.setAutoDelete( TRUE );
+ connect(mFilterCombo, SIGNAL(activated(int)), SLOT(filterSelected(int)));
+
+ // Add new filters below. If this annoys you, please rewrite the stuff to use a factory.
+ // The former approach was overengineered and only worked around problems in the design
+ // For now, we have to live without the warm and fuzzy feeling a refactoring might give.
+ // Patches appreciated. (danimo)
+
+ addFilter(new FilterEvolution);
+ addFilter(new FilterEvolution_v2);
+ addFilter(new FilterKMail_maildir);
+ addFilter(new FilterMailApp);
+ addFilter(new FilterOpera);
+ addFilter(new FilterSylpheed);
+ addFilter(new FilterThunderbird);
+ addFilter(new FilterTheBat);
+ addFilter(new FilterOE);
+// addFilter(new FilterOutlook);
+ addFilter(new FilterPMail);
+ addFilter(new FilterMBox);
+ addFilter(new FilterLNotes);
+ addFilter(new FilterPlain);
+}
+
+KSelFilterPage::~KSelFilterPage() {
+}
+
+void KSelFilterPage::filterSelected(int i)
+{
+ QString info = mFilterList.at(i)->info();
+ QString author = mFilterList.at(i)->author();
+ if(!author.isEmpty())
+ info += i18n("<p><i>Written by %1.</i></p>").arg(author);
+ mDesc->setText(info);
+}
+
+void KSelFilterPage::addFilter(Filter *f)
+{
+ mFilterList.append(f);
+ mFilterCombo->insertItem(f->name());
+ if (mFilterCombo->count() == 1) filterSelected(0); // Setup description box with fist filter selected
+}
+
+bool KSelFilterPage::removeDupMsg_checked()
+{
+ return remDupMsg->isChecked();
+}
+
+Filter * KSelFilterPage::getSelectedFilter(void)
+{
+ return mFilterList.at(mFilterCombo->currentItem());
+}
+
+#include "kselfilterpage.moc"
+