-rw-r--r-- | libkdepim/categoryeditdialog.cpp | 2 | ||||
-rw-r--r-- | libkdepim/categoryselectdialog.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libkdepim/categoryeditdialog.cpp b/libkdepim/categoryeditdialog.cpp index f719c31..a19900f 100644 --- a/libkdepim/categoryeditdialog.cpp +++ b/libkdepim/categoryeditdialog.cpp | |||
@@ -37,48 +37,50 @@ using namespace KPIM; | |||
37 | CategoryEditDialog::CategoryEditDialog( KPimPrefs *prefs, QWidget* parent, | 37 | CategoryEditDialog::CategoryEditDialog( KPimPrefs *prefs, QWidget* parent, |
38 | const char* name, bool modal, | 38 | const char* name, bool modal, |
39 | WFlags fl ) | 39 | WFlags fl ) |
40 | : CategoryEditDialog_base( parent, name, modal, fl ), | 40 | : CategoryEditDialog_base( parent, name, modal, fl ), |
41 | mPrefs( prefs ) | 41 | mPrefs( prefs ) |
42 | { | 42 | { |
43 | mCategories->header()->hide(); | 43 | mCategories->header()->hide(); |
44 | 44 | ||
45 | QStringList::Iterator it; | 45 | QStringList::Iterator it; |
46 | bool categoriesExist=false; | 46 | bool categoriesExist=false; |
47 | for (it = mPrefs->mCustomCategories.begin(); | 47 | for (it = mPrefs->mCustomCategories.begin(); |
48 | it != mPrefs->mCustomCategories.end(); ++it ) { | 48 | it != mPrefs->mCustomCategories.end(); ++it ) { |
49 | new QListViewItem(mCategories,*it); | 49 | new QListViewItem(mCategories,*it); |
50 | categoriesExist=true; | 50 | categoriesExist=true; |
51 | } | 51 | } |
52 | 52 | ||
53 | connect(mCategories,SIGNAL(selectionChanged(QListViewItem *)), | 53 | connect(mCategories,SIGNAL(selectionChanged(QListViewItem *)), |
54 | SLOT(editItem(QListViewItem *))); | 54 | SLOT(editItem(QListViewItem *))); |
55 | connect(mEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(slotTextChanged(const QString &))); | 55 | connect(mEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(slotTextChanged(const QString &))); |
56 | mButtonRemove->setEnabled(categoriesExist); | 56 | mButtonRemove->setEnabled(categoriesExist); |
57 | mButtonModify->setEnabled(categoriesExist); | 57 | mButtonModify->setEnabled(categoriesExist); |
58 | mButtonAdd->setEnabled(!mEdit->text().isEmpty()); | 58 | mButtonAdd->setEnabled(!mEdit->text().isEmpty()); |
59 | if ( QApplication::desktop()->width() > 460 ) | 59 | if ( QApplication::desktop()->width() > 460 ) |
60 | resize( 300, 360 ); | 60 | resize( 300, 360 ); |
61 | else | ||
62 | showMaximized(); | ||
61 | } | 63 | } |
62 | 64 | ||
63 | /* | 65 | /* |
64 | * Destroys the object and frees any allocated resources | 66 | * Destroys the object and frees any allocated resources |
65 | */ | 67 | */ |
66 | CategoryEditDialog::~CategoryEditDialog() | 68 | CategoryEditDialog::~CategoryEditDialog() |
67 | { | 69 | { |
68 | // no need to delete child widgets, Qt does it all for us | 70 | // no need to delete child widgets, Qt does it all for us |
69 | } | 71 | } |
70 | 72 | ||
71 | void CategoryEditDialog::slotTextChanged(const QString &text) | 73 | void CategoryEditDialog::slotTextChanged(const QString &text) |
72 | { | 74 | { |
73 | mButtonAdd->setEnabled(!text.isEmpty()); | 75 | mButtonAdd->setEnabled(!text.isEmpty()); |
74 | } | 76 | } |
75 | 77 | ||
76 | void CategoryEditDialog::add() | 78 | void CategoryEditDialog::add() |
77 | { | 79 | { |
78 | if (!mEdit->text().isEmpty()) { | 80 | if (!mEdit->text().isEmpty()) { |
79 | new QListViewItem(mCategories,mEdit->text()); | 81 | new QListViewItem(mCategories,mEdit->text()); |
80 | mEdit->setText(""); | 82 | mEdit->setText(""); |
81 | mButtonRemove->setEnabled(mCategories->childCount()>0); | 83 | mButtonRemove->setEnabled(mCategories->childCount()>0); |
82 | mButtonModify->setEnabled(mCategories->childCount()>0); | 84 | mButtonModify->setEnabled(mCategories->childCount()>0); |
83 | } | 85 | } |
84 | } | 86 | } |
diff --git a/libkdepim/categoryselectdialog.cpp b/libkdepim/categoryselectdialog.cpp index 40b46cf..7df9154 100644 --- a/libkdepim/categoryselectdialog.cpp +++ b/libkdepim/categoryselectdialog.cpp | |||
@@ -25,54 +25,52 @@ | |||
25 | #include <qpushbutton.h> | 25 | #include <qpushbutton.h> |
26 | #include <qheader.h> | 26 | #include <qheader.h> |
27 | #include <qapp.h> | 27 | #include <qapp.h> |
28 | #include <qmessagebox.h> | 28 | #include <qmessagebox.h> |
29 | 29 | ||
30 | 30 | ||
31 | #include "categoryeditdialog.h" | 31 | #include "categoryeditdialog.h" |
32 | #include "categoryselectdialog.h" | 32 | #include "categoryselectdialog.h" |
33 | 33 | ||
34 | #include "kpimprefs.h" | 34 | #include "kpimprefs.h" |
35 | 35 | ||
36 | using namespace KPIM; | 36 | using namespace KPIM; |
37 | 37 | ||
38 | CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent, | 38 | CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent, |
39 | const char* name, | 39 | const char* name, |
40 | bool modal, WFlags fl ) | 40 | bool modal, WFlags fl ) |
41 | : CategorySelectDialog_base( parent, name, true, fl ), | 41 | : CategorySelectDialog_base( parent, name, true, fl ), |
42 | mPrefs( prefs ) | 42 | mPrefs( prefs ) |
43 | { | 43 | { |
44 | mCategories->header()->hide(); | 44 | mCategories->header()->hide(); |
45 | 45 | ||
46 | setCategories(); | 46 | setCategories(); |
47 | 47 | ||
48 | connect(mButtonEdit,SIGNAL(clicked()),this, SLOT(editCategoriesDialog())); | 48 | connect(mButtonEdit,SIGNAL(clicked()),this, SLOT(editCategoriesDialog())); |
49 | if ( qApp->desktop()->height() < 321 ) | ||
50 | setMaximumHeight( QApplication::desktop()->height() - 50 ); | ||
51 | else | ||
52 | setMaximumHeight( QApplication::desktop()->height() - 80 ); | ||
53 | if ( QApplication::desktop()->width() > 460 ) | 49 | if ( QApplication::desktop()->width() > 460 ) |
54 | resize( 260, 360 ); | 50 | resize( 300, 360 ); |
51 | else | ||
52 | showMaximized(); | ||
55 | } | 53 | } |
56 | void CategorySelectDialog::editCategoriesDialog() | 54 | void CategorySelectDialog::editCategoriesDialog() |
57 | { | 55 | { |
58 | KPIM::CategoryEditDialog* ced = new KPIM::CategoryEditDialog(mPrefs,this ); | 56 | KPIM::CategoryEditDialog* ced = new KPIM::CategoryEditDialog(mPrefs,this ); |
59 | 57 | ||
60 | ced->exec(); | 58 | ced->exec(); |
61 | delete ced; | 59 | delete ced; |
62 | setCategories(); | 60 | setCategories(); |
63 | } | 61 | } |
64 | void CategorySelectDialog::setCategories() | 62 | void CategorySelectDialog::setCategories() |
65 | { | 63 | { |
66 | mCategories->clear(); | 64 | mCategories->clear(); |
67 | mCategoryList.clear(); | 65 | mCategoryList.clear(); |
68 | 66 | ||
69 | QStringList::Iterator it; | 67 | QStringList::Iterator it; |
70 | 68 | ||
71 | for (it = mPrefs->mCustomCategories.begin(); | 69 | for (it = mPrefs->mCustomCategories.begin(); |
72 | it != mPrefs->mCustomCategories.end(); ++it ) { | 70 | it != mPrefs->mCustomCategories.end(); ++it ) { |
73 | new QCheckListItem(mCategories,*it,QCheckListItem::CheckBox); | 71 | new QCheckListItem(mCategories,*it,QCheckListItem::CheckBox); |
74 | } | 72 | } |
75 | } | 73 | } |
76 | 74 | ||
77 | CategorySelectDialog::~CategorySelectDialog() | 75 | CategorySelectDialog::~CategorySelectDialog() |
78 | { | 76 | { |