author | zautrix <zautrix> | 2004-06-29 12:52:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-06-29 12:52:18 (UTC) |
commit | 275e70532bb26ed78ce2d3bebf980dd745368ec2 (patch) (unidiff) | |
tree | c9252a9ec50856c86cc1165007f841c50d5cdc51 /korganizer/filtereditdialog.cpp | |
parent | 7b2b9f2b05809b9577837551ad864d88b9b355ef (diff) | |
download | kdepimpi-275e70532bb26ed78ce2d3bebf980dd745368ec2.zip kdepimpi-275e70532bb26ed78ce2d3bebf980dd745368ec2.tar.gz kdepimpi-275e70532bb26ed78ce2d3bebf980dd745368ec2.tar.bz2 |
Removed the include moc on KO dir
Diffstat (limited to 'korganizer/filtereditdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/filtereditdialog.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/filtereditdialog.cpp b/korganizer/filtereditdialog.cpp index 2943e41..ca09844 100644 --- a/korganizer/filtereditdialog.cpp +++ b/korganizer/filtereditdialog.cpp | |||
@@ -1,139 +1,139 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
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 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qpushbutton.h> | 25 | #include <qpushbutton.h> |
26 | #include <qcombobox.h> | 26 | #include <qcombobox.h> |
27 | #include <qcheckbox.h> | 27 | #include <qcheckbox.h> |
28 | #include <qradiobutton.h> | 28 | #include <qradiobutton.h> |
29 | #include <qlistbox.h> | 29 | #include <qlistbox.h> |
30 | #include <qapplication.h> | 30 | #include <qapplication.h> |
31 | 31 | ||
32 | #include <kdebug.h> | 32 | #include <kdebug.h> |
33 | #include <klocale.h> | 33 | #include <klocale.h> |
34 | #include <klineeditdlg.h> | 34 | #include <klineeditdlg.h> |
35 | #include <kmessagebox.h> | 35 | #include <kmessagebox.h> |
36 | 36 | ||
37 | #include <libkdepim/categoryselectdialog.h> | 37 | #include <libkdepim/categoryselectdialog.h> |
38 | 38 | ||
39 | #include "koprefs.h" | 39 | #include "koprefs.h" |
40 | #include "filteredit_base.h" | 40 | #include "filteredit_base.h" |
41 | 41 | ||
42 | #include "filtereditdialog.h" | 42 | #include "filtereditdialog.h" |
43 | #include "filtereditdialog.moc" | 43 | //#include "filtereditdialog.moc" |
44 | 44 | ||
45 | // TODO: Make dialog work on a copy of the filters objects. | 45 | // TODO: Make dialog work on a copy of the filters objects. |
46 | 46 | ||
47 | class ComboFilterBox: public QComboBox | 47 | class ComboFilterBox: public QComboBox |
48 | { | 48 | { |
49 | public: | 49 | public: |
50 | ComboFilterBox( QWidget *parent=0, const char *name=0) : | 50 | ComboFilterBox( QWidget *parent=0, const char *name=0) : |
51 | QComboBox( parent,name ) { } | 51 | QComboBox( parent,name ) { } |
52 | void popupBox() { popup(); } | 52 | void popupBox() { popup(); } |
53 | 53 | ||
54 | }; | 54 | }; |
55 | 55 | ||
56 | FilterEditDialog::FilterEditDialog(QPtrList<CalFilter> *filters,QWidget *parent, | 56 | FilterEditDialog::FilterEditDialog(QPtrList<CalFilter> *filters,QWidget *parent, |
57 | const char *name) : | 57 | const char *name) : |
58 | KDialogBase(parent,name,true,i18n("Edit Calendar Filters"), | 58 | KDialogBase(parent,name,true,i18n("Edit Calendar Filters"), |
59 | Ok|Apply|Cancel) | 59 | Ok|Apply|Cancel) |
60 | { | 60 | { |
61 | mFilters = filters; | 61 | mFilters = filters; |
62 | 62 | ||
63 | QWidget *mainWidget = new QWidget(this); | 63 | QWidget *mainWidget = new QWidget(this); |
64 | setMainWidget(mainWidget); | 64 | setMainWidget(mainWidget); |
65 | 65 | ||
66 | mSelectionCombo = new ComboFilterBox(mainWidget); | 66 | mSelectionCombo = new ComboFilterBox(mainWidget); |
67 | connect(mSelectionCombo,SIGNAL(activated(int)),SLOT(filterSelected())); | 67 | connect(mSelectionCombo,SIGNAL(activated(int)),SLOT(filterSelected())); |
68 | // mSelectionCombo->setEditable ( true ); | 68 | // mSelectionCombo->setEditable ( true ); |
69 | QPushButton *addButton = new QPushButton(i18n("Add Filter"),mainWidget); | 69 | QPushButton *addButton = new QPushButton(i18n("Add Filter"),mainWidget); |
70 | connect(addButton,SIGNAL(clicked()),SLOT(slotAdd())); | 70 | connect(addButton,SIGNAL(clicked()),SLOT(slotAdd())); |
71 | addButton->setMaximumSize( addButton->sizeHint()); | 71 | addButton->setMaximumSize( addButton->sizeHint()); |
72 | mRemoveButton = new QPushButton( i18n("Remove"), mainWidget ); | 72 | mRemoveButton = new QPushButton( i18n("Remove"), mainWidget ); |
73 | connect( mRemoveButton, SIGNAL( clicked() ), SLOT( slotRemove() ) ); | 73 | connect( mRemoveButton, SIGNAL( clicked() ), SLOT( slotRemove() ) ); |
74 | mRemoveButton->setMaximumSize( mRemoveButton->sizeHint()); | 74 | mRemoveButton->setMaximumSize( mRemoveButton->sizeHint()); |
75 | 75 | ||
76 | QPushButton *upButton = new QPushButton(i18n("Up"),mainWidget); | 76 | QPushButton *upButton = new QPushButton(i18n("Up"),mainWidget); |
77 | upButton->setMaximumSize( upButton->sizeHint()); | 77 | upButton->setMaximumSize( upButton->sizeHint()); |
78 | connect(upButton,SIGNAL(clicked()),SLOT(slotUp())); | 78 | connect(upButton,SIGNAL(clicked()),SLOT(slotUp())); |
79 | 79 | ||
80 | 80 | ||
81 | mEditor = new FilterEdit_base(mainWidget); | 81 | mEditor = new FilterEdit_base(mainWidget); |
82 | 82 | ||
83 | QGridLayout *topLayout = new QGridLayout(mainWidget,2,2); | 83 | QGridLayout *topLayout = new QGridLayout(mainWidget,2,2); |
84 | topLayout->setSpacing(spacingHint()); | 84 | topLayout->setSpacing(spacingHint()); |
85 | topLayout->addWidget(mSelectionCombo,0,0); | 85 | topLayout->addWidget(mSelectionCombo,0,0); |
86 | topLayout->addWidget(upButton,0,1); | 86 | topLayout->addWidget(upButton,0,1); |
87 | topLayout->addWidget(addButton,0,2); | 87 | topLayout->addWidget(addButton,0,2); |
88 | topLayout->addWidget(mRemoveButton,0,3); | 88 | topLayout->addWidget(mRemoveButton,0,3); |
89 | topLayout->addMultiCellWidget(mEditor,1,1,0,3); | 89 | topLayout->addMultiCellWidget(mEditor,1,1,0,3); |
90 | mSelectionCombo->setMaximumWidth ( QApplication::desktop()->width() - | 90 | mSelectionCombo->setMaximumWidth ( QApplication::desktop()->width() - |
91 | addButton->maximumWidth() - | 91 | addButton->maximumWidth() - |
92 | mRemoveButton->maximumWidth() - | 92 | mRemoveButton->maximumWidth() - |
93 | upButton->maximumWidth() - | 93 | upButton->maximumWidth() - |
94 | spacingHint() * 5 ); | 94 | spacingHint() * 5 ); |
95 | connect(mEditor->mCatEditButton,SIGNAL(clicked()), | 95 | connect(mEditor->mCatEditButton,SIGNAL(clicked()), |
96 | SLOT(editCategorySelection())); | 96 | SLOT(editCategorySelection())); |
97 | 97 | ||
98 | // Clicking cancel exits the dialog without saving | 98 | // Clicking cancel exits the dialog without saving |
99 | connect(this,SIGNAL(cancelClicked()),SLOT(reject())); | 99 | connect(this,SIGNAL(cancelClicked()),SLOT(reject())); |
100 | updateFilterList(); | 100 | updateFilterList(); |
101 | } | 101 | } |
102 | 102 | ||
103 | FilterEditDialog::~FilterEditDialog() | 103 | FilterEditDialog::~FilterEditDialog() |
104 | { | 104 | { |
105 | } | 105 | } |
106 | void FilterEditDialog::slotUp() | 106 | void FilterEditDialog::slotUp() |
107 | { | 107 | { |
108 | 108 | ||
109 | if ( mFilters->count() <= 1 ) return; | 109 | if ( mFilters->count() <= 1 ) return; |
110 | if ( mSelectionCombo->currentItem() == 0 ) return; | 110 | if ( mSelectionCombo->currentItem() == 0 ) return; |
111 | int num = mSelectionCombo->currentItem(); | 111 | int num = mSelectionCombo->currentItem(); |
112 | CalFilter* f = new CalFilter( ); | 112 | CalFilter* f = new CalFilter( ); |
113 | *f = *(mFilters->at( num )); | 113 | *f = *(mFilters->at( num )); |
114 | mFilters->remove( num ); | 114 | mFilters->remove( num ); |
115 | mFilters->insert( num-1, f ); | 115 | mFilters->insert( num-1, f ); |
116 | updateFilterList(); | 116 | updateFilterList(); |
117 | mSelectionCombo->setCurrentItem( num-1 ); | 117 | mSelectionCombo->setCurrentItem( num-1 ); |
118 | readFilter(f); | 118 | readFilter(f); |
119 | //qApp->processEvents(); | 119 | //qApp->processEvents(); |
120 | //mSelectionCombo->popupBox(); | 120 | //mSelectionCombo->popupBox(); |
121 | } | 121 | } |
122 | void FilterEditDialog::updateFilterList() | 122 | void FilterEditDialog::updateFilterList() |
123 | { | 123 | { |
124 | mSelectionCombo->clear(); | 124 | mSelectionCombo->clear(); |
125 | 125 | ||
126 | CalFilter *filter = mFilters->first(); | 126 | CalFilter *filter = mFilters->first(); |
127 | 127 | ||
128 | if (!filter) { | 128 | if (!filter) { |
129 | enableButtonOK(false); | 129 | enableButtonOK(false); |
130 | enableButtonApply(false); | 130 | enableButtonApply(false); |
131 | } else { | 131 | } else { |
132 | while(filter) { | 132 | while(filter) { |
133 | mSelectionCombo->insertItem(filter->name()); | 133 | mSelectionCombo->insertItem(filter->name()); |
134 | filter = mFilters->next(); | 134 | filter = mFilters->next(); |
135 | } | 135 | } |
136 | CalFilter *f = mFilters->at(mSelectionCombo->currentItem()); | 136 | CalFilter *f = mFilters->at(mSelectionCombo->currentItem()); |
137 | if (f) readFilter(f); | 137 | if (f) readFilter(f); |
138 | 138 | ||
139 | enableButtonOK(true); | 139 | enableButtonOK(true); |