summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-19 20:30:34 (UTC)
committer zautrix <zautrix>2005-02-19 20:30:34 (UTC)
commit6f4d42c16c87668279db1e0a0d3e4f4aad5b84f6 (patch) (side-by-side diff)
tree89fbb2b107a1681a1fbb19b35c3a9484652dc352
parent11b5b0eb24cfb943df106f7ee97646955bec0fd3 (diff)
downloadkdepimpi-6f4d42c16c87668279db1e0a0d3e4f4aad5b84f6.zip
kdepimpi-6f4d42c16c87668279db1e0a0d3e4f4aad5b84f6.tar.gz
kdepimpi-6f4d42c16c87668279db1e0a0d3e4f4aad5b84f6.tar.bz2
cat select fix
Diffstat (more/less context) (ignore 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
@@ -21,17 +21,41 @@
without including the source code for Qt in the source distribution.
*/
#ifndef KPIM_CATEGORYEDITDIALOG_H
#define KPIM_CATEGORYEDITDIALOG_H
#include <categoryeditdialog_base.h>
+#include <qlistview.h>
class KPimPrefs;
namespace KPIM {
+ class CategorySelectItem :public QObject, public QCheckListItem
+{
+
+ Q_OBJECT
+ public:
+
+ CategorySelectItem(QListView * parent, const QString & text, Type tt) :
+ QCheckListItem (parent, text, tt ) , QObject( parent )
+ {;}
+
+ signals:
+ void stateChanged( QListViewItem*);
+
+ protected:
+
+ virtual void stateChange(bool b)
+ {
+ QCheckListItem::stateChange(b);
+ emit stateChanged( this );
+ }
+};
+
+
class CategoryEditDialog : public CategoryEditDialog_base
{
Q_OBJECT
public:
CategoryEditDialog( KPimPrefs *prefs, QWidget* parent = 0,
const char* name = 0,
diff --git a/libkdepim/categoryselectdialog.cpp b/libkdepim/categoryselectdialog.cpp
index 8038934..4d80726 100644
--- a/libkdepim/categoryselectdialog.cpp
+++ b/libkdepim/categoryselectdialog.cpp
@@ -51,13 +51,13 @@ CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent,
connect(mButtonEdit,SIGNAL(clicked()),this, SLOT(editCategoriesDialog()));
if ( QApplication::desktop()->width() > 460 )
resize( 300, 360 );
else
showMaximized();
connect( mSetColorCat, SIGNAL( clicked() ), this, SLOT( setColorCat() ) );
- connect( mCategories, SIGNAL( clicked(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) );
+ // connect( mCategories, SIGNAL( clicked(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) );
}
void CategorySelectDialog::editCategoriesDialog()
{
KPIM::CategoryEditDialog* ced = new KPIM::CategoryEditDialog(mPrefs,this );
ced->exec();
@@ -70,13 +70,15 @@ void CategorySelectDialog::setCategories()
mCategories->clear();
mCategoryList.clear();
QStringList::Iterator it;
for (it = mPrefs->mCustomCategories.begin();
it != mPrefs->mCustomCategories.end(); ++it ) {
- new QCheckListItem(mCategories,*it,QCheckListItem::CheckBox);
+ CategorySelectItem * item = new CategorySelectItem(mCategories,*it,QCheckListItem::CheckBox);
+ QObject::connect( item, SIGNAL( stateChanged(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) );
+
}
}
CategorySelectDialog::~CategorySelectDialog()
{
}