summaryrefslogtreecommitdiffabout
path: root/kaddressbook/details
Unidiff
Diffstat (limited to 'kaddressbook/details') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/details/detailsviewcontainer.cpp3
-rw-r--r--kaddressbook/details/look_html.cpp3
2 files changed, 3 insertions, 3 deletions
diff --git a/kaddressbook/details/detailsviewcontainer.cpp b/kaddressbook/details/detailsviewcontainer.cpp
index a42499f..ceffc77 100644
--- a/kaddressbook/details/detailsviewcontainer.cpp
+++ b/kaddressbook/details/detailsviewcontainer.cpp
@@ -71,99 +71,96 @@ ViewContainer::ViewContainer( QWidget *parent, const char* name )
71 71
72#if 1 72#if 1
73 // Hide detailed view selection combo box, because we currently have 73 // Hide detailed view selection combo box, because we currently have
74 // only one. Reenable it when there are more detailed views. 74 // only one. Reenable it when there are more detailed views.
75 label->hide(); 75 label->hide();
76 mStyleCombo->hide(); 76 mStyleCombo->hide();
77 frameRuler->hide(); 77 frameRuler->hide();
78#endif 78#endif
79} 79}
80 80
81KABBasicLook *ViewContainer::currentLook() 81KABBasicLook *ViewContainer::currentLook()
82{ 82{
83 return mCurrentLook; 83 return mCurrentLook;
84} 84}
85 85
86void ViewContainer::registerLooks() 86void ViewContainer::registerLooks()
87{ 87{
88 mLookFactories.append( new KABHtmlViewFactory( mDetailsStack ) ); 88 mLookFactories.append( new KABHtmlViewFactory( mDetailsStack ) );
89// mLookFactories.append( new KABDetailedViewFactory( mDetailsStack ) ); 89// mLookFactories.append( new KABDetailedViewFactory( mDetailsStack ) );
90 mStyleCombo->clear(); 90 mStyleCombo->clear();
91 91
92 for ( uint i = 0; i < mLookFactories.count(); ++i ) 92 for ( uint i = 0; i < mLookFactories.count(); ++i )
93 mStyleCombo->insertItem( mLookFactories.at( i )->description() ); 93 mStyleCombo->insertItem( mLookFactories.at( i )->description() );
94 94
95 if ( !mLookFactories.isEmpty() ) 95 if ( !mLookFactories.isEmpty() )
96 slotStyleSelected( 0 ); 96 slotStyleSelected( 0 );
97} 97}
98 98
99void ViewContainer::slotStyleSelected( int index ) 99void ViewContainer::slotStyleSelected( int index )
100{ 100{
101#ifndef KAB_EMBEDDED 101#ifndef KAB_EMBEDDED
102 KConfig *config = kapp->config(); 102 KConfig *config = kapp->config();
103#else //KAB_EMBEDDED 103#else //KAB_EMBEDDED
104 //US I hope I got the same config object as above expected. 104 //US I hope I got the same config object as above expected.
105 KConfig *config = KABPrefs::instance()->getConfig(); 105 KConfig *config = KABPrefs::instance()->getConfig();
106#endif //KAB_EMBEDDED 106#endif //KAB_EMBEDDED
107 KABC::Addressee addr; 107 KABC::Addressee addr;
108 108
109 if ( index >= 0 && index < mStyleCombo->count() ) { 109 if ( index >= 0 && index < mStyleCombo->count() ) {
110 if ( mCurrentLook != 0 ) { 110 if ( mCurrentLook != 0 ) {
111 mCurrentLook->saveSettings( config ); 111 mCurrentLook->saveSettings( config );
112 addr = mCurrentLook->addressee(); 112 addr = mCurrentLook->addressee();
113 113
114 delete mCurrentLook; 114 delete mCurrentLook;
115 mCurrentLook = 0; 115 mCurrentLook = 0;
116 } 116 }
117 117
118 KABLookFactory *factory = mLookFactories.at( index ); 118 KABLookFactory *factory = mLookFactories.at( index );
119 kdDebug(5720) << "ViewContainer::slotStyleSelected: "
120 << "creating look "
121 << factory->description() << endl;
122 119
123 mCurrentLook = factory->create(); 120 mCurrentLook = factory->create();
124 mDetailsStack->raiseWidget( mCurrentLook ); 121 mDetailsStack->raiseWidget( mCurrentLook );
125 122
126 connect( mCurrentLook, SIGNAL( sendEmail( const QString& ) ), this, 123 connect( mCurrentLook, SIGNAL( sendEmail( const QString& ) ), this,
127 SIGNAL( sendEmail( const QString& ) ) ); 124 SIGNAL( sendEmail( const QString& ) ) );
128 connect( mCurrentLook, SIGNAL( browse( const QString& ) ), this, 125 connect( mCurrentLook, SIGNAL( browse( const QString& ) ), this,
129 SIGNAL( browse( const QString& ) ) ); 126 SIGNAL( browse( const QString& ) ) );
130 } 127 }
131 128
132 mCurrentLook->restoreSettings( config ); 129 mCurrentLook->restoreSettings( config );
133 mCurrentLook->setAddressee( addr ); 130 mCurrentLook->setAddressee( addr );
134} 131}
135void ViewContainer::refreshView() 132void ViewContainer::refreshView()
136{ 133{
137 if ( mCurrentLook ) { 134 if ( mCurrentLook ) {
138 mCurrentLook->setAddressee( mCurrentAddressee ); 135 mCurrentLook->setAddressee( mCurrentAddressee );
139 } 136 }
140} 137}
141 138
142void ViewContainer::setAddressee( const KABC::Addressee& addressee ) 139void ViewContainer::setAddressee( const KABC::Addressee& addressee )
143{ 140{
144 if ( mCurrentLook != 0 ) { 141 if ( mCurrentLook != 0 ) {
145 if ( addressee == mCurrentAddressee ) 142 if ( addressee == mCurrentAddressee )
146 return; 143 return;
147 else { 144 else {
148 mCurrentAddressee = addressee; 145 mCurrentAddressee = addressee;
149 mCurrentLook->setAddressee( mCurrentAddressee ); 146 mCurrentLook->setAddressee( mCurrentAddressee );
150 } 147 }
151 } 148 }
152} 149}
153 150
154KABC::Addressee ViewContainer::addressee() 151KABC::Addressee ViewContainer::addressee()
155{ 152{
156 static KABC::Addressee empty; // do not use! 153 static KABC::Addressee empty; // do not use!
157 154
158 if ( !mCurrentLook ) 155 if ( !mCurrentLook )
159 return empty; 156 return empty;
160 else 157 else
161 return mCurrentLook->addressee(); 158 return mCurrentLook->addressee();
162} 159}
163 160
164void ViewContainer::setReadOnly( bool state ) 161void ViewContainer::setReadOnly( bool state )
165{ 162{
166 if ( mCurrentLook ) 163 if ( mCurrentLook )
167 mCurrentLook->setReadOnly( state ); 164 mCurrentLook->setReadOnly( state );
168} 165}
169 166
diff --git a/kaddressbook/details/look_html.cpp b/kaddressbook/details/look_html.cpp
index 63364a7..64987b8 100644
--- a/kaddressbook/details/look_html.cpp
+++ b/kaddressbook/details/look_html.cpp
@@ -1,45 +1,48 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@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 <addresseeview.h> 24#include <addresseeview.h>
25 25
26#include "look_html.h" 26#include "look_html.h"
27#include <qscrollview.h> 27#include <qscrollview.h>
28#include "kabprefs.h"
28KABHtmlView::KABHtmlView( QWidget *parent, const char *name ) 29KABHtmlView::KABHtmlView( QWidget *parent, const char *name )
29 : KABBasicLook( parent, name ) 30 : KABBasicLook( parent, name )
30{ 31{
31 mView = new KPIM::AddresseeView( this ); 32 mView = new KPIM::AddresseeView( this );
33 mView->setFont( KABPrefs::instance()->mDetailsFont );
32} 34}
33 35
34KABHtmlView::~KABHtmlView() 36KABHtmlView::~KABHtmlView()
35{ 37{
36} 38}
37 39
38void KABHtmlView::setAddressee( const KABC::Addressee &addr ) 40void KABHtmlView::setAddressee( const KABC::Addressee &addr )
39{ 41{
42 mView->setFont( KABPrefs::instance()->mDetailsFont );
40 mView->setAddressee( addr ); 43 mView->setAddressee( addr );
41} 44}
42 45
43#ifndef KAB_EMBEDDED 46#ifndef KAB_EMBEDDED
44#include "look_html.moc" 47#include "look_html.moc"
45#endif //KAB_EMBEDDED 48#endif //KAB_EMBEDDED