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/viewconfigurewidget.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'kaddressbook/viewconfigurewidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/viewconfigurewidget.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/kaddressbook/viewconfigurewidget.cpp b/kaddressbook/viewconfigurewidget.cpp index 666e188..047df8c 100644 --- a/kaddressbook/viewconfigurewidget.cpp +++ b/kaddressbook/viewconfigurewidget.cpp | |||
@@ -1,159 +1,160 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
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 | 24 | ||
25 | #ifndef KAB_EMBEDDED | 25 | #ifndef KAB_EMBEDDED |
26 | 26 | ||
27 | #include <qvbox.h> | 27 | #include <q3vbox.h> |
28 | 28 | ||
29 | #include <kapplication.h> | 29 | #include <kapplication.h> |
30 | #include <kconfig.h> | 30 | #include <kconfig.h> |
31 | #include <kdebug.h> | 31 | #include <kdebug.h> |
32 | #include <kiconloader.h> | 32 | #include <kiconloader.h> |
33 | 33 | ||
34 | #include "viewmanager.h" | 34 | #include "viewmanager.h" |
35 | 35 | ||
36 | #endif //KAB_EMBEDDED | 36 | #endif //KAB_EMBEDDED |
37 | 37 | ||
38 | 38 | ||
39 | #include <qlayout.h> | 39 | #include <qlayout.h> |
40 | //Added by qt3to4: | ||
41 | #include <Q3VBoxLayout> | ||
42 | #include <QPixmap> | ||
40 | 43 | ||
41 | #include <kjanuswidget.h> | 44 | #include <kjanuswidget.h> |
42 | #include <kglobal.h> | 45 | #include <kglobal.h> |
43 | #include <klocale.h> | 46 | #include <klocale.h> |
44 | 47 | ||
45 | #include "viewconfigurewidget.h" | 48 | #include "viewconfigurewidget.h" |
46 | #include "viewconfigurefieldspage.h" | 49 | #include "viewconfigurefieldspage.h" |
47 | #include "viewconfigurefilterpage.h" | 50 | #include "viewconfigurefilterpage.h" |
48 | 51 | ||
49 | ViewConfigureWidget::ViewConfigureWidget( KABC::AddressBook *ab, QWidget *parent, | 52 | ViewConfigureWidget::ViewConfigureWidget( KABC::AddressBook *ab, QWidget *parent, |
50 | const char *name ) | 53 | const char *name ) |
51 | : ConfigureWidget( ab, parent, name ) | 54 | : ConfigureWidget( ab, parent, name ) |
52 | { | 55 | { |
53 | QVBoxLayout *topLayout = new QVBoxLayout( this ); | 56 | Q3VBoxLayout *topLayout = new Q3VBoxLayout( this ); |
54 | 57 | ||
55 | mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); | 58 | mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); |
56 | 59 | ||
57 | topLayout->addWidget( mMainWidget ); | 60 | topLayout->addWidget( mMainWidget ); |
58 | 61 | ||
59 | // Add the first page, the attributes | 62 | // Add the first page, the attributes |
60 | QVBox *page = addPage( i18n( "Fields" ), QString::null, | 63 | Q3VBox *page = addPage( i18n( "Fields" ), QString::null, |
61 | KGlobal::iconLoader()->loadIcon( "view_detailed", | 64 | KGlobal::iconLoader()->loadIcon( "view_detailed", |
62 | KIcon::Panel, 16 ) ); | 65 | KIcon::Panel, 16 ) ); |
63 | 66 | ||
64 | 67 | ||
65 | // Add the select fields page | 68 | // Add the select fields page |
66 | mFieldsPage = new ViewConfigureFieldsPage( addressBook(), (QWidget*)page ); | 69 | mFieldsPage = new ViewConfigureFieldsPage( addressBook(), (QWidget*)page ); |
67 | 70 | ||
68 | //US mFieldsPage->setMinimumSize(300,300); | 71 | //US mFieldsPage->setMinimumSize(300,300); |
69 | 72 | ||
70 | // Add the second page, the filter selection | 73 | // Add the second page, the filter selection |
71 | page = addPage( i18n( "Default Filter" ), QString::null, | 74 | page = addPage( i18n( "Default Filter" ), QString::null, |
72 | KGlobal::iconLoader()->loadIcon( "filter", | 75 | KGlobal::iconLoader()->loadIcon( "filter", |
73 | KIcon::Panel, 16 ) ); | 76 | KIcon::Panel, 16 ) ); |
74 | 77 | ||
75 | mFilterPage = new ViewConfigureFilterPage( (QWidget*)page ); | 78 | mFilterPage = new ViewConfigureFilterPage( (QWidget*)page ); |
76 | //qDebug("+++++ViewConfigureWidget::ViewConfigureWidget "); | 79 | //qDebug("+++++ViewConfigureWidget::ViewConfigureWidget "); |
77 | } | 80 | } |
78 | 81 | ||
79 | ViewConfigureWidget::~ViewConfigureWidget() | 82 | ViewConfigureWidget::~ViewConfigureWidget() |
80 | { | 83 | { |
81 | //qDebug("-----ViewConfigureWidget::~ViewConfigureWidget() "); | 84 | //qDebug("-----ViewConfigureWidget::~ViewConfigureWidget() "); |
82 | } | 85 | } |
83 | 86 | ||
84 | void ViewConfigureWidget::restoreSettings( KConfig *config ) | 87 | void ViewConfigureWidget::restoreSettings( KConfig *config ) |
85 | { | 88 | { |
86 | mFieldsPage->restoreSettings( config ); | 89 | mFieldsPage->restoreSettings( config ); |
87 | mFilterPage->restoreSettings( config ); | 90 | mFilterPage->restoreSettings( config ); |
88 | } | 91 | } |
89 | 92 | ||
90 | void ViewConfigureWidget::saveSettings( KConfig *config ) | 93 | void ViewConfigureWidget::saveSettings( KConfig *config ) |
91 | { | 94 | { |
92 | mFieldsPage->saveSettings( config ); | 95 | mFieldsPage->saveSettings( config ); |
93 | mFilterPage->saveSettings( config ); | 96 | mFilterPage->saveSettings( config ); |
94 | } | 97 | } |
95 | 98 | ||
96 | QVBox *ViewConfigureWidget::addPage( const QString &item, const QString &header, | 99 | Q3VBox *ViewConfigureWidget::addPage( const QString &item, const QString &header, |
97 | const QPixmap &pixmap ) | 100 | const QPixmap &pixmap ) |
98 | { | 101 | { |
99 | return mMainWidget->addVBoxPage( item, header, pixmap ); | 102 | return mMainWidget->addVBoxPage( item, header, pixmap ); |
100 | } | 103 | } |
101 | 104 | ||
102 | #include <qframe.h> | 105 | #include <q3frame.h> |
103 | #include <qlabel.h> | 106 | #include <qlabel.h> |
104 | #include <qlayout.h> | 107 | #include <qlayout.h> |
105 | #include <stdlib.h> | 108 | #include <stdlib.h> |
106 | 109 | ||
107 | ViewConfigureDialog::ViewConfigureDialog( ViewConfigureWidget *wdg, const QString &viewName, | 110 | ViewConfigureDialog::ViewConfigureDialog( ViewConfigureWidget *wdg, const QString &viewName, |
108 | QWidget *parent, const char *name ) | 111 | QWidget *parent, const char *name ) |
109 | : KDialogBase( Swallow, i18n( "Modify View: " ) + viewName, Help | Ok | Cancel, | 112 | : KDialogBase( Swallow, i18n( "Modify View: " ) + viewName, Help | Ok | Cancel, |
110 | Ok, parent, name, true, true ), mConfigWidget( wdg ) | 113 | Ok, parent, name, true, true ), mConfigWidget( wdg ) |
111 | { | 114 | { |
112 | //US, I have to change the way, how to connect the ViewConfigureWidget. It looks | 115 | //US, I have to change the way, how to connect the ViewConfigureWidget. It looks |
113 | // like it has changed. | 116 | // like it has changed. |
114 | //QFrame *topFrame = plainPage(); | 117 | //QFrame *topFrame = plainPage(); |
115 | if ( mConfigWidget ) { | 118 | if ( mConfigWidget ) { |
116 | mConfigWidget->reparent(this, QPoint(0,0), true); | 119 | mConfigWidget->reparent(this, QPoint(0,0), true); |
117 | // QVBoxLayout * layout = new QVBoxLayout( this ); | 120 | // QVBoxLayout * layout = new QVBoxLayout( this ); |
118 | //layout->addWidget(mConfigWidget ); | 121 | //layout->addWidget(mConfigWidget ); |
119 | //mConfigWidget->reparent(topFrame, QPoint(1,1), true); | 122 | //mConfigWidget->reparent(topFrame, QPoint(1,1), true); |
120 | 123 | ||
121 | setMainWidget( mConfigWidget ); | 124 | setMainWidget( mConfigWidget ); |
122 | } | 125 | } |
123 | 126 | ||
124 | } | 127 | } |
125 | 128 | ||
126 | ViewConfigureDialog::~ViewConfigureDialog() | 129 | ViewConfigureDialog::~ViewConfigureDialog() |
127 | { | 130 | { |
128 | } | 131 | } |
129 | void ViewConfigureDialog::setWidget( ViewConfigureWidget *wdg ) | 132 | void ViewConfigureDialog::setWidget( ViewConfigureWidget *wdg ) |
130 | { | 133 | { |
131 | mConfigWidget = wdg ; | 134 | mConfigWidget = wdg ; |
132 | setMainWidget( mConfigWidget ); | 135 | setMainWidget( mConfigWidget ); |
133 | 136 | ||
134 | } | 137 | } |
135 | 138 | ||
136 | void ViewConfigureDialog::restoreSettings( KConfig *config ) | 139 | void ViewConfigureDialog::restoreSettings( KConfig *config ) |
137 | { | 140 | { |
138 | mConfigWidget->restoreSettings( config ); | 141 | mConfigWidget->restoreSettings( config ); |
139 | } | 142 | } |
140 | 143 | ||
141 | void ViewConfigureDialog::saveSettings( KConfig *config ) | 144 | void ViewConfigureDialog::saveSettings( KConfig *config ) |
142 | { | 145 | { |
143 | mConfigWidget->saveSettings( config ); | 146 | mConfigWidget->saveSettings( config ); |
144 | } | 147 | } |
145 | 148 | ||
146 | void ViewConfigureDialog::slotHelp() | 149 | void ViewConfigureDialog::slotHelp() |
147 | { | 150 | { |
148 | #ifndef KAB_EMBEDDED | 151 | #ifndef KAB_EMBEDDED |
149 | kapp->invokeHelp( "using-views" ); | 152 | kapp->invokeHelp( "using-views" ); |
150 | #else //KAB_EMBEDDED | 153 | #else //KAB_EMBEDDED |
151 | qDebug("ViewConfigureDialog::slotHelp not yet implemented"); | 154 | qDebug("ViewConfigureDialog::slotHelp not yet implemented"); |
152 | #endif //KAB_EMBEDDED | 155 | #endif //KAB_EMBEDDED |
153 | } | 156 | } |
154 | 157 | ||
155 | #ifndef KAB_EMBEDDED | 158 | #ifndef KAB_EMBEDDED_ |
156 | #include "viewconfigurewidget.moc" | 159 | #include "moc_viewconfigurewidget.cpp" |
157 | #endif //KAB_EMBEDDED | 160 | #endif //KAB_EMBEDDED |
158 | |||
159 | |||