summaryrefslogtreecommitdiffabout
path: root/libkdepim
Unidiff
Diffstat (limited to 'libkdepim') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/categoryeditdialog.h24
-rw-r--r--libkdepim/categoryselectdialog.cpp6
2 files changed, 28 insertions, 2 deletions
diff --git a/libkdepim/categoryeditdialog.h b/libkdepim/categoryeditdialog.h
index 4ebc802..3e8ab45 100644
--- a/libkdepim/categoryeditdialog.h
+++ b/libkdepim/categoryeditdialog.h
@@ -15,29 +15,53 @@
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KPIM_CATEGORYEDITDIALOG_H 23#ifndef KPIM_CATEGORYEDITDIALOG_H
24#define KPIM_CATEGORYEDITDIALOG_H 24#define KPIM_CATEGORYEDITDIALOG_H
25 25
26#include <categoryeditdialog_base.h> 26#include <categoryeditdialog_base.h>
27#include <qlistview.h>
27 28
28class KPimPrefs; 29class KPimPrefs;
29 30
30namespace KPIM { 31namespace KPIM {
31 32
33 class CategorySelectItem :public QObject, public QCheckListItem
34{
35
36 Q_OBJECT
37 public:
38
39 CategorySelectItem(QListView * parent, const QString & text, Type tt) :
40 QCheckListItem (parent, text, tt ) , QObject( parent )
41 {;}
42
43 signals:
44 void stateChanged( QListViewItem*);
45
46 protected:
47
48 virtual void stateChange(bool b)
49 {
50 QCheckListItem::stateChange(b);
51 emit stateChanged( this );
52 }
53};
54
55
32class CategoryEditDialog : public CategoryEditDialog_base 56class CategoryEditDialog : public CategoryEditDialog_base
33{ 57{
34 Q_OBJECT 58 Q_OBJECT
35 public: 59 public:
36 CategoryEditDialog( KPimPrefs *prefs, QWidget* parent = 0, 60 CategoryEditDialog( KPimPrefs *prefs, QWidget* parent = 0,
37 const char* name = 0, 61 const char* name = 0,
38 bool modal = FALSE, WFlags fl = 0 ); 62 bool modal = FALSE, WFlags fl = 0 );
39 ~CategoryEditDialog(); 63 ~CategoryEditDialog();
40 64
41 public slots: 65 public slots:
42 void add(); 66 void add();
43 void remove(); 67 void remove();
diff --git a/libkdepim/categoryselectdialog.cpp b/libkdepim/categoryselectdialog.cpp
index 8038934..4d80726 100644
--- a/libkdepim/categoryselectdialog.cpp
+++ b/libkdepim/categoryselectdialog.cpp
@@ -45,44 +45,46 @@ CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent,
45 mColorItem = 0; 45 mColorItem = 0;
46 mColorEnabled = false; 46 mColorEnabled = false;
47 mCategories->header()->hide(); 47 mCategories->header()->hide();
48 48
49 setCategories(); 49 setCategories();
50 50
51 connect(mButtonEdit,SIGNAL(clicked()),this, SLOT(editCategoriesDialog())); 51 connect(mButtonEdit,SIGNAL(clicked()),this, SLOT(editCategoriesDialog()));
52 if ( QApplication::desktop()->width() > 460 ) 52 if ( QApplication::desktop()->width() > 460 )
53 resize( 300, 360 ); 53 resize( 300, 360 );
54 else 54 else
55 showMaximized(); 55 showMaximized();
56 connect( mSetColorCat, SIGNAL( clicked() ), this, SLOT( setColorCat() ) ); 56 connect( mSetColorCat, SIGNAL( clicked() ), this, SLOT( setColorCat() ) );
57 connect( mCategories, SIGNAL( clicked(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) ); 57 // connect( mCategories, SIGNAL( clicked(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) );
58} 58}
59void CategorySelectDialog::editCategoriesDialog() 59void CategorySelectDialog::editCategoriesDialog()
60{ 60{
61 KPIM::CategoryEditDialog* ced = new KPIM::CategoryEditDialog(mPrefs,this ); 61 KPIM::CategoryEditDialog* ced = new KPIM::CategoryEditDialog(mPrefs,this );
62 62
63 ced->exec(); 63 ced->exec();
64 delete ced; 64 delete ced;
65 setCategories(); 65 setCategories();
66} 66}
67void CategorySelectDialog::setCategories() 67void CategorySelectDialog::setCategories()
68{ 68{
69 mColorItem = 0; 69 mColorItem = 0;
70 mCategories->clear(); 70 mCategories->clear();
71 mCategoryList.clear(); 71 mCategoryList.clear();
72 72
73 QStringList::Iterator it; 73 QStringList::Iterator it;
74 for (it = mPrefs->mCustomCategories.begin(); 74 for (it = mPrefs->mCustomCategories.begin();
75 it != mPrefs->mCustomCategories.end(); ++it ) { 75 it != mPrefs->mCustomCategories.end(); ++it ) {
76 new QCheckListItem(mCategories,*it,QCheckListItem::CheckBox); 76 CategorySelectItem * item = new CategorySelectItem(mCategories,*it,QCheckListItem::CheckBox);
77 QObject::connect( item, SIGNAL( stateChanged(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) );
78
77 } 79 }
78} 80}
79 81
80CategorySelectDialog::~CategorySelectDialog() 82CategorySelectDialog::~CategorySelectDialog()
81{ 83{
82} 84}
83 85
84void CategorySelectDialog::setSelected(const QStringList &selList) 86void CategorySelectDialog::setSelected(const QStringList &selList)
85{ 87{
86 clear(); 88 clear();
87 89
88 QStringList::ConstIterator it; 90 QStringList::ConstIterator it;