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/details | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | kaddressbook/details/detailsviewcontainer.cpp | 19 | ||||
-rw-r--r-- | kaddressbook/details/detailsviewcontainer.h | 8 | ||||
-rw-r--r-- | kaddressbook/details/look_basic.cpp | 6 | ||||
-rw-r--r-- | kaddressbook/details/look_basic.h | 4 | ||||
-rw-r--r-- | kaddressbook/details/look_details.cpp | 12 | ||||
-rw-r--r-- | kaddressbook/details/look_details.h | 4 | ||||
-rw-r--r-- | kaddressbook/details/look_html.cpp | 6 |
7 files changed, 31 insertions, 28 deletions
diff --git a/kaddressbook/details/detailsviewcontainer.cpp b/kaddressbook/details/detailsviewcontainer.cpp index cee5886..4a86aca 100644 --- a/kaddressbook/details/detailsviewcontainer.cpp +++ b/kaddressbook/details/detailsviewcontainer.cpp | |||
@@ -17,20 +17,23 @@ | |||
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 <qcombobox.h> | 24 | #include <qcombobox.h> |
25 | #include <qframe.h> | 25 | #include <q3frame.h> |
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qwidgetstack.h> | 28 | #include <q3widgetstack.h> |
29 | //Added by qt3to4: | ||
30 | #include <Q3HBoxLayout> | ||
31 | #include <Q3VBoxLayout> | ||
29 | 32 | ||
30 | #include <kapplication.h> | 33 | #include <kapplication.h> |
31 | #include <kdebug.h> | 34 | #include <kdebug.h> |
32 | #include <kdialog.h> | 35 | #include <kdialog.h> |
33 | 36 | ||
34 | #include "look_basic.h" | 37 | #include "look_basic.h" |
35 | //#include "look_details.h" | 38 | //#include "look_details.h" |
36 | #include "look_html.h" | 39 | #include "look_html.h" |
@@ -40,36 +43,36 @@ | |||
40 | #endif //KAB_EMBEDDED | 43 | #endif //KAB_EMBEDDED |
41 | 44 | ||
42 | 45 | ||
43 | #include "detailsviewcontainer.h" | 46 | #include "detailsviewcontainer.h" |
44 | 47 | ||
45 | ViewContainer::ViewContainer( QWidget *parent, const char* name ) | 48 | ViewContainer::ViewContainer( QWidget *parent, const char* name ) |
46 | : QWidget( parent, name ), mCurrentLook( 0 ) | 49 | : QWidget( parent, name ), mCurrentLook( 0 ) |
47 | { | 50 | { |
48 | QBoxLayout *topLayout = new QVBoxLayout( this ); | 51 | Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); |
49 | //topLayout->setMargin( KDialog::marginHint() ); | 52 | //topLayout->setMargin( KDialog::marginHint() ); |
50 | //topLayout->setSpacing( KDialog::spacingHint() ); | 53 | //topLayout->setSpacing( KDialog::spacingHint() ); |
51 | topLayout->setMargin( 0 ); | 54 | topLayout->setMargin( 0 ); |
52 | topLayout->setSpacing( 0 ); | 55 | topLayout->setSpacing( 0 ); |
53 | 56 | ||
54 | QBoxLayout *styleLayout = new QHBoxLayout( topLayout ); | 57 | Q3BoxLayout *styleLayout = new Q3HBoxLayout( topLayout ); |
55 | 58 | ||
56 | QLabel *label = new QLabel( i18n("Style:"), this ); | 59 | QLabel *label = new QLabel( i18n("Style:"), this ); |
57 | styleLayout->addWidget( label ); | 60 | styleLayout->addWidget( label ); |
58 | 61 | ||
59 | mStyleCombo = new QComboBox( this ); | 62 | mStyleCombo = new QComboBox( this ); |
60 | styleLayout->addWidget( mStyleCombo ); | 63 | styleLayout->addWidget( mStyleCombo ); |
61 | 64 | ||
62 | QFrame *frameRuler = new QFrame( this ); | 65 | Q3Frame *frameRuler = new Q3Frame( this ); |
63 | //US frameRuler->setFrameShape( QFrame::HLine ); | 66 | //US frameRuler->setFrameShape( QFrame::HLine ); |
64 | //US frameRuler->setFrameShadow( QFrame::Sunken ); | 67 | //US frameRuler->setFrameShadow( QFrame::Sunken ); |
65 | //US topLayout->addWidget( frameRuler ); | 68 | //US topLayout->addWidget( frameRuler ); |
66 | 69 | ||
67 | mDetailsStack = new QWidgetStack( this ); | 70 | mDetailsStack = new Q3WidgetStack( this ); |
68 | topLayout->addWidget( mDetailsStack, 1 ); | 71 | topLayout->addWidget( mDetailsStack, 1 ); |
69 | 72 | ||
70 | registerLooks(); | 73 | registerLooks(); |
71 | 74 | ||
72 | #if 1 | 75 | #if 1 |
73 | // Hide detailed view selection combo box, because we currently have | 76 | // Hide detailed view selection combo box, because we currently have |
74 | // only one. Reenable it when there are more detailed views. | 77 | // only one. Reenable it when there are more detailed views. |
75 | label->hide(); | 78 | label->hide(); |
@@ -154,11 +157,11 @@ KABC::Addressee ViewContainer::addressee() | |||
154 | } | 157 | } |
155 | 158 | ||
156 | void ViewContainer::setReadOnly( bool state ) | 159 | void ViewContainer::setReadOnly( bool state ) |
157 | { | 160 | { |
158 | if ( mCurrentLook ) | 161 | if ( mCurrentLook ) |
159 | mCurrentLook->setReadOnly( state ); | 162 | mCurrentLook->setReadOnly( state ); |
160 | } | 163 | } |
161 | 164 | ||
162 | #ifndef KAB_EMBEDDED | 165 | #ifndef KAB_EMBEDDED_ |
163 | #include "detailsviewcontainer.moc" | 166 | #include "moc_detailsviewcontainer.cpp" |
164 | #endif //KAB_EMBEDDED | 167 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/details/detailsviewcontainer.h b/kaddressbook/details/detailsviewcontainer.h index 9684736..f310a30 100644 --- a/kaddressbook/details/detailsviewcontainer.h +++ b/kaddressbook/details/detailsviewcontainer.h | |||
@@ -19,22 +19,22 @@ | |||
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 DETAILSVIEWCONTAINER_H | 24 | #ifndef DETAILSVIEWCONTAINER_H |
25 | #define DETAILSVIEWCONTAINER_H | 25 | #define DETAILSVIEWCONTAINER_H |
26 | 26 | ||
27 | #include <qptrlist.h> | 27 | #include <q3ptrlist.h> |
28 | 28 | ||
29 | #include "look_basic.h" | 29 | #include "look_basic.h" |
30 | 30 | ||
31 | class QComboBox; | 31 | class QComboBox; |
32 | class QWidgetStack; | 32 | class Q3WidgetStack; |
33 | 33 | ||
34 | class ViewContainer : public QWidget | 34 | class ViewContainer : public QWidget |
35 | { | 35 | { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | 37 | ||
38 | public: | 38 | public: |
39 | ViewContainer( QWidget *parent = 0, const char* name = 0 ); | 39 | ViewContainer( QWidget *parent = 0, const char* name = 0 ); |
40 | 40 | ||
@@ -89,15 +89,15 @@ class ViewContainer : public QWidget | |||
89 | /** | 89 | /** |
90 | Register the available looks. | 90 | Register the available looks. |
91 | */ | 91 | */ |
92 | void registerLooks(); | 92 | void registerLooks(); |
93 | 93 | ||
94 | private: | 94 | private: |
95 | KABC::Addressee mCurrentAddressee; | 95 | KABC::Addressee mCurrentAddressee; |
96 | KABBasicLook *mCurrentLook; | 96 | KABBasicLook *mCurrentLook; |
97 | QPtrList<KABLookFactory> mLookFactories; | 97 | Q3PtrList<KABLookFactory> mLookFactories; |
98 | 98 | ||
99 | QComboBox *mStyleCombo; | 99 | QComboBox *mStyleCombo; |
100 | QWidgetStack *mDetailsStack; | 100 | Q3WidgetStack *mDetailsStack; |
101 | }; | 101 | }; |
102 | 102 | ||
103 | #endif | 103 | #endif |
diff --git a/kaddressbook/details/look_basic.cpp b/kaddressbook/details/look_basic.cpp index 0245686..48cc42a 100644 --- a/kaddressbook/details/look_basic.cpp +++ b/kaddressbook/details/look_basic.cpp | |||
@@ -21,17 +21,17 @@ | |||
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 <kdebug.h> | 24 | #include <kdebug.h> |
25 | 25 | ||
26 | #include "look_basic.h" | 26 | #include "look_basic.h" |
27 | 27 | ||
28 | KABBasicLook::KABBasicLook( QWidget *parent, const char *name ) | 28 | KABBasicLook::KABBasicLook( QWidget *parent, const char *name ) |
29 | : QVBox( parent, name ), mReadOnly( false ) | 29 | : Q3VBox( parent, name ), mReadOnly( false ) |
30 | { | 30 | { |
31 | } | 31 | } |
32 | 32 | ||
33 | void KABBasicLook::setReadOnly( bool state ) | 33 | void KABBasicLook::setReadOnly( bool state ) |
34 | { | 34 | { |
35 | mReadOnly = state; | 35 | mReadOnly = state; |
36 | } | 36 | } |
37 | 37 | ||
@@ -65,11 +65,11 @@ void KABBasicLook::saveSettings( KConfig* ) | |||
65 | KABLookFactory::KABLookFactory( QWidget *parent, const char *name ) | 65 | KABLookFactory::KABLookFactory( QWidget *parent, const char *name ) |
66 | : mParent( parent ), mName( name ) | 66 | : mParent( parent ), mName( name ) |
67 | { | 67 | { |
68 | } | 68 | } |
69 | 69 | ||
70 | KABLookFactory::~KABLookFactory() | 70 | KABLookFactory::~KABLookFactory() |
71 | { | 71 | { |
72 | } | 72 | } |
73 | #ifndef KAB_EMBEDDED | 73 | #ifndef KAB_EMBEDDED_ |
74 | #include "look_basic.moc" | 74 | #include "moc_look_basic.cpp" |
75 | #endif //KAB_EMBEDDED | 75 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/details/look_basic.h b/kaddressbook/details/look_basic.h index a65c99c..a70e7f7 100644 --- a/kaddressbook/details/look_basic.h +++ b/kaddressbook/details/look_basic.h | |||
@@ -20,33 +20,33 @@ | |||
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 LOOK_KABBASIC_H | 24 | #ifndef LOOK_KABBASIC_H |
25 | #define LOOK_KABBASIC_H | 25 | #define LOOK_KABBASIC_H |
26 | 26 | ||
27 | #include <kabc/addressbook.h> | 27 | #include <kabc/addressbook.h> |
28 | #include <qvbox.h> | 28 | #include <q3vbox.h> |
29 | 29 | ||
30 | class KConfig; | 30 | class KConfig; |
31 | 31 | ||
32 | /** | 32 | /** |
33 | This is a pure virtual base class that defines the | 33 | This is a pure virtual base class that defines the |
34 | interface for how to display and change entries of | 34 | interface for how to display and change entries of |
35 | the KDE addressbook. | 35 | the KDE addressbook. |
36 | 36 | ||
37 | This basic widget does not show anything in its client space. | 37 | This basic widget does not show anything in its client space. |
38 | Derive it and implement its look and how the user may edit the | 38 | Derive it and implement its look and how the user may edit the |
39 | entry. | 39 | entry. |
40 | 40 | ||
41 | The paintEvent() has to paint the whole widget, since repaint() | 41 | The paintEvent() has to paint the whole widget, since repaint() |
42 | calls will not delete the widgets background. | 42 | calls will not delete the widgets background. |
43 | */ | 43 | */ |
44 | class KABBasicLook : public QVBox | 44 | class KABBasicLook : public Q3VBox |
45 | { | 45 | { |
46 | Q_OBJECT | 46 | Q_OBJECT |
47 | 47 | ||
48 | public: | 48 | public: |
49 | /** | 49 | /** |
50 | The constructor. | 50 | The constructor. |
51 | */ | 51 | */ |
52 | KABBasicLook( QWidget *parent = 0, const char *name = 0 ); | 52 | KABBasicLook( QWidget *parent = 0, const char *name = 0 ); |
diff --git a/kaddressbook/details/look_details.cpp b/kaddressbook/details/look_details.cpp index 11d06e9..2c3a79d 100644 --- a/kaddressbook/details/look_details.cpp +++ b/kaddressbook/details/look_details.cpp | |||
@@ -184,20 +184,20 @@ void KABDetailedView::mouseMoveEvent( QMouseEvent *e ) | |||
184 | setCursor( PointingHandCursor ); | 184 | setCursor( PointingHandCursor ); |
185 | else if( cursor().shape() != ArrowCursor ) | 185 | else if( cursor().shape() != ArrowCursor ) |
186 | setCursor(ArrowCursor); | 186 | setCursor(ArrowCursor); |
187 | } | 187 | } |
188 | } | 188 | } |
189 | 189 | ||
190 | void KABDetailedView::mousePressEvent( QMouseEvent *e ) | 190 | void KABDetailedView::mousePressEvent( QMouseEvent *e ) |
191 | { | 191 | { |
192 | QPopupMenu menu( this ); | 192 | Q3PopupMenu menu( this ); |
193 | QPopupMenu *menuBG = new QPopupMenu( &menu ); | 193 | Q3PopupMenu *menuBG = new Q3PopupMenu( &menu ); |
194 | mMenuBorderedBG = new QPopupMenu( &menu ); | 194 | mMenuBorderedBG = new Q3PopupMenu( &menu ); |
195 | mMenuTiledBG = new QPopupMenu( &menu ); | 195 | mMenuTiledBG = new Q3PopupMenu( &menu ); |
196 | 196 | ||
197 | menu.insertItem( i18n( "Select Background" ), menuBG ); | 197 | menu.insertItem( i18n( "Select Background" ), menuBG ); |
198 | menuBG->insertItem( i18n( "Bordered Backgrounds" ), mMenuBorderedBG ); | 198 | menuBG->insertItem( i18n( "Bordered Backgrounds" ), mMenuBorderedBG ); |
199 | menuBG->insertItem( i18n( "Tiled Backgrounds" ), mMenuTiledBG ); | 199 | menuBG->insertItem( i18n( "Tiled Backgrounds" ), mMenuTiledBG ); |
200 | menu.insertSeparator(); | 200 | menu.insertSeparator(); |
201 | 201 | ||
202 | QPoint point = e->pos() - QPoint( mGrid, mGrid ); | 202 | QPoint point = e->pos() - QPoint( mGrid, mGrid ); |
203 | int rc; | 203 | int rc; |
@@ -409,11 +409,11 @@ void KABDetailedView::restoreSettings( KConfig *config ) | |||
409 | 409 | ||
410 | mPainter->setHeaderFont( QFont( gfont, gpointsize + 4, QFont::Bold, true ) ); | 410 | mPainter->setHeaderFont( QFont( gfont, gpointsize + 4, QFont::Bold, true ) ); |
411 | mPainter->setHeadLineFont( QFont( gfont, gpointsize + 2, QFont::Bold, true ) ); | 411 | mPainter->setHeadLineFont( QFont( gfont, gpointsize + 2, QFont::Bold, true ) ); |
412 | mPainter->setBodyFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); | 412 | mPainter->setBodyFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); |
413 | mPainter->setFixedFont( QFont( ffont, fpointsize, QFont::Normal, false ) ); | 413 | mPainter->setFixedFont( QFont( ffont, fpointsize, QFont::Normal, false ) ); |
414 | mPainter->setCommentFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); | 414 | mPainter->setCommentFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); |
415 | } | 415 | } |
416 | 416 | ||
417 | #ifndef KAB_EMBEDDED | 417 | #ifndef KAB_EMBEDDED_ |
418 | #include "look_details.moc" | 418 | #include "moc_look_details.cpp" |
419 | #endif //KAB_EMBEDDED | 419 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/details/look_details.h b/kaddressbook/details/look_details.h index e8d50a9..b59d3a7 100644 --- a/kaddressbook/details/look_details.h +++ b/kaddressbook/details/look_details.h | |||
@@ -125,18 +125,18 @@ class KABDetailedView : public KABBasicLook | |||
125 | KToggleAction *mActionShowEmails; | 125 | KToggleAction *mActionShowEmails; |
126 | KToggleAction *mActionShowPhones; | 126 | KToggleAction *mActionShowPhones; |
127 | KToggleAction *mActionShowURLs; | 127 | KToggleAction *mActionShowURLs; |
128 | 128 | ||
129 | const int mGrid; | 129 | const int mGrid; |
130 | QStringList mBorders; | 130 | QStringList mBorders; |
131 | QStringList mTiles; | 131 | QStringList mTiles; |
132 | 132 | ||
133 | QPopupMenu *mMenuBorderedBG; | 133 | Q3PopupMenu *mMenuBorderedBG; |
134 | QPopupMenu *mMenuTiledBG; | 134 | Q3PopupMenu *mMenuTiledBG; |
135 | 135 | ||
136 | static const QString mBorderedBGDir; | 136 | static const QString mBorderedBGDir; |
137 | static const QString mTiledBGDir; | 137 | static const QString mTiledBGDir; |
138 | }; | 138 | }; |
139 | 139 | ||
140 | class KABDetailedViewFactory : public KABLookFactory | 140 | class KABDetailedViewFactory : public KABLookFactory |
141 | { | 141 | { |
142 | public: | 142 | public: |
diff --git a/kaddressbook/details/look_html.cpp b/kaddressbook/details/look_html.cpp index bb30650..4ec1c7d 100644 --- a/kaddressbook/details/look_html.cpp +++ b/kaddressbook/details/look_html.cpp | |||
@@ -19,17 +19,17 @@ | |||
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 <addresseeview.h> | 24 | #include <addresseeview.h> |
25 | 25 | ||
26 | #include "look_html.h" | 26 | #include "look_html.h" |
27 | #include <qscrollview.h> | 27 | #include <q3scrollview.h> |
28 | #include "kabprefs.h" | 28 | #include "kabprefs.h" |
29 | #include <kabc/addresseeview.h> | 29 | #include <kabc/addresseeview.h> |
30 | KABHtmlView::KABHtmlView( QWidget *parent, const char *name ) | 30 | KABHtmlView::KABHtmlView( QWidget *parent, const char *name ) |
31 | : KABBasicLook( parent, name ) | 31 | : KABBasicLook( parent, name ) |
32 | { | 32 | { |
33 | mView = new KABC::AddresseeView( this ); | 33 | mView = new KABC::AddresseeView( this ); |
34 | mView->setFont( KABPrefs::instance()->mDetailsFont ); | 34 | mView->setFont( KABPrefs::instance()->mDetailsFont ); |
35 | connect(this, SIGNAL(printMyView()), | 35 | connect(this, SIGNAL(printMyView()), |
@@ -46,11 +46,11 @@ void KABHtmlView::printMe() | |||
46 | } | 46 | } |
47 | 47 | ||
48 | void KABHtmlView::setAddressee( const KABC::Addressee &addr ) | 48 | void KABHtmlView::setAddressee( const KABC::Addressee &addr ) |
49 | { | 49 | { |
50 | mView->setFont( KABPrefs::instance()->mDetailsFont ); | 50 | mView->setFont( KABPrefs::instance()->mDetailsFont ); |
51 | mView->setAddressee( addr ); | 51 | mView->setAddressee( addr ); |
52 | } | 52 | } |
53 | 53 | ||
54 | #ifndef KAB_EMBEDDED | 54 | #ifndef KAB_EMBEDDED_ |
55 | #include "look_html.moc" | 55 | #include "moc_look_html.cpp" |
56 | #endif //KAB_EMBEDDED | 56 | #endif //KAB_EMBEDDED |