author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/viewconfigurefilterpage.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'kaddressbook/viewconfigurefilterpage.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/viewconfigurefilterpage.cpp | 15 |
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 | |||
@@ -18,66 +18,69 @@ | |||
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 | ||
43 | ViewConfigureFilterPage::ViewConfigureFilterPage( QWidget *parent, | 46 | ViewConfigureFilterPage::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 ); |
@@ -123,15 +126,15 @@ void ViewConfigureFilterPage::restoreSettings( KConfig *config ) | |||
123 | 126 | ||
124 | void ViewConfigureFilterPage::saveSettings( KConfig *config ) | 127 | void 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 | ||
130 | void ViewConfigureFilterPage::buttonClicked( int id ) | 133 | void 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 |