summaryrefslogtreecommitdiffabout
path: root/kaddressbook/viewconfigurefilterpage.cpp
Unidiff
Diffstat (limited to 'kaddressbook/viewconfigurefilterpage.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/viewconfigurefilterpage.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/kaddressbook/viewconfigurefilterpage.cpp b/kaddressbook/viewconfigurefilterpage.cpp
index b085a5e..cdb778b 100644
--- a/kaddressbook/viewconfigurefilterpage.cpp
+++ b/kaddressbook/viewconfigurefilterpage.cpp
@@ -6,90 +6,93 @@
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#ifndef KAB_EMBEDDED 24#ifndef KAB_EMBEDDED
25#include <kcombobox.h> 25#include <kcombobox.h>
26#else //KAB_EMBEDDED 26#else //KAB_EMBEDDED
27#include <qcombobox.h> 27#include <qcombobox.h>
28#endif //KAB_EMBEDDED 28#endif //KAB_EMBEDDED
29 29
30#include <qbuttongroup.h> 30#include <q3buttongroup.h>
31#include <qlabel.h> 31#include <qlabel.h>
32#include <qlayout.h> 32#include <qlayout.h>
33#include <qradiobutton.h> 33#include <qradiobutton.h>
34//Added by qt3to4:
35#include <Q3HBoxLayout>
36#include <Q3VBoxLayout>
34 37
35#include <kconfig.h> 38#include <kconfig.h>
36#include <kdialog.h> 39#include <kdialog.h>
37#include <klocale.h> 40#include <klocale.h>
38 41
39#include "filter.h" 42#include "filter.h"
40 43
41#include "viewconfigurefilterpage.h" 44#include "viewconfigurefilterpage.h"
42 45
43ViewConfigureFilterPage::ViewConfigureFilterPage( QWidget *parent, 46ViewConfigureFilterPage::ViewConfigureFilterPage( QWidget *parent,
44 const char *name ) 47 const char *name )
45 : QWidget( parent, name ) 48 : QWidget( parent, name )
46{ 49{
47 QBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); 50 Q3BoxLayout *topLayout = new Q3VBoxLayout( this, 0, KDialog::spacingHint() );
48 51
49 mFilterGroup = new QButtonGroup(); 52 mFilterGroup = new Q3ButtonGroup();
50 connect( mFilterGroup, SIGNAL( clicked( int ) ), SLOT( buttonClicked( int ) ) ); 53 connect( mFilterGroup, SIGNAL( clicked( int ) ), SLOT( buttonClicked( int ) ) );
51 54
52 QLabel *label = new QLabel( i18n( "The default filter will be activated whenever" 55 QLabel *label = new QLabel( i18n( "The default filter will be activated whenever"
53 " this view is displayed. This feature allows you to configure views that only" 56 " this view is displayed. This feature allows you to configure views that only"
54 " interact with certain types of information based on the filter. Once the view" 57 " interact with certain types of information based on the filter. Once the view"
55 " is activated, the filter can be changed at anytime." ), this ); 58 " is activated, the filter can be changed at anytime." ), this );
56 label->setAlignment( Qt::AlignLeft | Qt::AlignTop | Qt::WordBreak ); 59 label->setAlignment( Qt::AlignLeft | Qt::AlignTop | Qt::WordBreak );
57 topLayout->addWidget( label ); 60 topLayout->addWidget( label );
58 61
59 QWidget *spacer = new QWidget( this ); 62 QWidget *spacer = new QWidget( this );
60 spacer->setMinimumHeight( 5 ); 63 spacer->setMinimumHeight( 5 );
61 topLayout->addWidget( spacer ); 64 topLayout->addWidget( spacer );
62 65
63 QRadioButton *button = new QRadioButton( i18n( "No default filter" ), this ); 66 QRadioButton *button = new QRadioButton( i18n( "No default filter" ), this );
64 mFilterGroup->insert( button ); 67 mFilterGroup->insert( button );
65 topLayout->addWidget( button ); 68 topLayout->addWidget( button );
66 69
67 button = new QRadioButton( i18n( "Use last active filter" ), this ); 70 button = new QRadioButton( i18n( "Use last active filter" ), this );
68 mFilterGroup->insert( button ); 71 mFilterGroup->insert( button );
69 topLayout->addWidget( button ); 72 topLayout->addWidget( button );
70 73
71 QBoxLayout *comboLayout = new QHBoxLayout(); 74 Q3BoxLayout *comboLayout = new Q3HBoxLayout();
72 topLayout->addLayout( comboLayout ); 75 topLayout->addLayout( comboLayout );
73 button = new QRadioButton( i18n( "Use filter:" ), this ); 76 button = new QRadioButton( i18n( "Use filter:" ), this );
74 mFilterGroup->insert( button ); 77 mFilterGroup->insert( button );
75 comboLayout->addWidget( button ); 78 comboLayout->addWidget( button );
76 79
77#ifndef KAB_EMBEDDED 80#ifndef KAB_EMBEDDED
78 mFilterCombo = new KComboBox( this ); 81 mFilterCombo = new KComboBox( this );
79#else //KAB_EMBEDDED 82#else //KAB_EMBEDDED
80 mFilterCombo = new QComboBox( this ); 83 mFilterCombo = new QComboBox( this );
81#endif //KAB_EMBEDDED 84#endif //KAB_EMBEDDED
82 85
83 comboLayout->addWidget( mFilterCombo ); 86 comboLayout->addWidget( mFilterCombo );
84} 87}
85 88
86ViewConfigureFilterPage::~ViewConfigureFilterPage() 89ViewConfigureFilterPage::~ViewConfigureFilterPage()
87{ 90{
88 delete mFilterGroup; 91 delete mFilterGroup;
89} 92}
90 93
91void ViewConfigureFilterPage::restoreSettings( KConfig *config ) 94void ViewConfigureFilterPage::restoreSettings( KConfig *config )
92{ 95{
93 mFilterCombo->clear(); 96 mFilterCombo->clear();
94 97
95//US I had to adjust the whole method in order to work with QComboBoxes 98//US I had to adjust the whole method in order to work with QComboBoxes
@@ -111,27 +114,27 @@ void ViewConfigureFilterPage::restoreSettings( KConfig *config )
111 { 114 {
112 mFilterCombo->insertItem( (*it).name(), 0); 115 mFilterCombo->insertItem( (*it).name(), 0);
113 } 116 }
114 else 117 else
115 { 118 {
116 mFilterCombo->insertItem( (*it).name() ); 119 mFilterCombo->insertItem( (*it).name() );
117 } 120 }
118 121
119 } 122 }
120 123
121 124
122} 125}
123 126
124void ViewConfigureFilterPage::saveSettings( KConfig *config ) 127void ViewConfigureFilterPage::saveSettings( KConfig *config )
125{ 128{
126 config->writeEntry( "DefaultFilterName", mFilterCombo->currentText() ); 129 config->writeEntry( "DefaultFilterName", mFilterCombo->currentText() );
127 config->writeEntry( "DefaultFilterType", mFilterGroup->id( mFilterGroup->selected() ) ); 130 config->writeEntry( "DefaultFilterType", mFilterGroup->id( mFilterGroup->selected() ) );
128} 131}
129 132
130void ViewConfigureFilterPage::buttonClicked( int id ) 133void ViewConfigureFilterPage::buttonClicked( int id )
131{ 134{
132 mFilterCombo->setEnabled( id == 2 ); 135 mFilterCombo->setEnabled( id == 2 );
133} 136}
134 137
135#ifndef KAB_EMBEDDED 138#ifndef KAB_EMBEDDED_
136#include "viewconfigurefilterpage.moc" 139#include "moc_viewconfigurefilterpage.cpp"
137#endif //KAB_EMBEDDED 140#endif //KAB_EMBEDDED