summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2004-06-29 11:59:46 (UTC)
committer zautrix <zautrix>2004-06-29 11:59:46 (UTC)
commitda43dbdc6c82453228f34766fc74585615cba938 (patch) (unidiff)
tree16576932cea08bf117b2d0320b0d5f66ee8ad093 /kaddressbook
parent627489ea2669d3997676bc3cee0f5d0d0c16c4d4 (diff)
downloadkdepimpi-da43dbdc6c82453228f34766fc74585615cba938.zip
kdepimpi-da43dbdc6c82453228f34766fc74585615cba938.tar.gz
kdepimpi-da43dbdc6c82453228f34766fc74585615cba938.tar.bz2
New lib ical.Some minor changes as well.
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp46
-rw-r--r--kaddressbook/kabcore.h2
-rw-r--r--kaddressbook/kaddressbookmain.cpp19
-rw-r--r--kaddressbook/kaddressbookmain.h4
-rw-r--r--kaddressbook/mainembedded.cpp8
5 files changed, 41 insertions, 38 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 3e578bc..70ab6b7 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -65,262 +65,272 @@
65 65
66#include "KDGanttMinimizeSplitter.h" 66#include "KDGanttMinimizeSplitter.h"
67#include "kaddressbookmain.h" 67#include "kaddressbookmain.h"
68#include "kactioncollection.h" 68#include "kactioncollection.h"
69#include <qapp.h> 69#include <qapp.h>
70#include <qmenubar.h> 70#include <qmenubar.h>
71//#include <qtoolbar.h> 71//#include <qtoolbar.h>
72#include <qmessagebox.h> 72#include <qmessagebox.h>
73#include <kdebug.h> 73#include <kdebug.h>
74#include <kiconloader.h> // needed for SmallIcon 74#include <kiconloader.h> // needed for SmallIcon
75#include <kresources/kcmkresources.h> 75#include <kresources/kcmkresources.h>
76#include <ktoolbar.h> 76#include <ktoolbar.h>
77 77
78#include <kcmkabconfig.h> 78#include <kcmkabconfig.h>
79 79
80//US#include <qpe/resource.h> // needed for Resource::loadPixmap 80//US#include <qpe/resource.h> // needed for Resource::loadPixmap
81//#include <qlabel.h> 81//#include <qlabel.h>
82#endif // KAB_EMBEDDED 82#endif // KAB_EMBEDDED
83#include <kcmkabconfig.h> 83#include <kcmkabconfig.h>
84 84
85 85
86#include <kresources/selectdialog.h> 86#include <kresources/selectdialog.h>
87#include <kmessagebox.h> 87#include <kmessagebox.h>
88 88
89#include <picture.h> 89#include <picture.h>
90#include <resource.h> 90#include <resource.h>
91 91
92//US#include <qsplitter.h> 92//US#include <qsplitter.h>
93#include <qvbox.h> 93#include <qvbox.h>
94#include <qlayout.h> 94#include <qlayout.h>
95#include <qclipboard.h> 95#include <qclipboard.h>
96 96
97#include <libkdepim/categoryselectdialog.h> 97#include <libkdepim/categoryselectdialog.h>
98 98
99#include "addresseeutil.h" 99#include "addresseeutil.h"
100#include "undocmds.h" 100#include "undocmds.h"
101#include "addresseeeditordialog.h" 101#include "addresseeeditordialog.h"
102#include "viewmanager.h" 102#include "viewmanager.h"
103#include "details/detailsviewcontainer.h" 103#include "details/detailsviewcontainer.h"
104#include "kabprefs.h" 104#include "kabprefs.h"
105#include "xxportmanager.h" 105#include "xxportmanager.h"
106#include "incsearchwidget.h" 106#include "incsearchwidget.h"
107#include "jumpbuttonbar.h" 107#include "jumpbuttonbar.h"
108#include "extensionmanager.h" 108#include "extensionmanager.h"
109#include "addresseeconfig.h" 109#include "addresseeconfig.h"
110#include <kcmultidialog.h> 110#include <kcmultidialog.h>
111 111
112 112
113#ifdef KAB_EMBEDDED 113#ifdef KAB_EMBEDDED
114KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) 114KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name )
115 : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), 115 : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ),
116 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ 116 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/
117 mReadWrite( readWrite ), mModified( false ), mMainWindow(client) 117 mReadWrite( readWrite ), mModified( false ), mMainWindow(client)
118#else //KAB_EMBEDDED 118#else //KAB_EMBEDDED
119KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) 119KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name )
120 : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), 120 : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ),
121 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), 121 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ),
122 mReadWrite( readWrite ), mModified( false ) 122 mReadWrite( readWrite ), mModified( false )
123#endif //KAB_EMBEDDED 123#endif //KAB_EMBEDDED
124{ 124{
125#ifdef KAB_EMBEDDED 125#ifdef KAB_EMBEDDED
126 //US we define here our own global actioncollection. 126 //US we define here our own global actioncollection.
127 //mActionCollection = new KActionCollection(this); 127 //mActionCollection = new KActionCollection(this);
128#endif //KAB_EMBEDDED 128#endif //KAB_EMBEDDED
129 129 mExtensionBarSplitter = 0;
130 mIsPart = !parent->inherits( "KAddressBookMain" ); 130 mIsPart = !parent->inherits( "KAddressBookMain" );
131 131
132 mAddressBook = KABC::StdAddressBook::self(); 132 mAddressBook = KABC::StdAddressBook::self();
133 KABC::StdAddressBook::setAutomaticSave( true ); 133 KABC::StdAddressBook::setAutomaticSave( true );
134 134
135#ifndef KAB_EMBEDDED 135#ifndef KAB_EMBEDDED
136 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); 136 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler );
137#endif //KAB_EMBEDDED 137#endif //KAB_EMBEDDED
138 138
139 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), 139 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ),
140 SLOT( addressBookChanged() ) ); 140 SLOT( addressBookChanged() ) );
141 141
142 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, 142 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization,
143 "X-Department", "KADDRESSBOOK" ); 143 "X-Department", "KADDRESSBOOK" );
144 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, 144 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization,
145 "X-Profession", "KADDRESSBOOK" ); 145 "X-Profession", "KADDRESSBOOK" );
146 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, 146 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization,
147 "X-AssistantsName", "KADDRESSBOOK" ); 147 "X-AssistantsName", "KADDRESSBOOK" );
148 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, 148 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization,
149 "X-ManagersName", "KADDRESSBOOK" ); 149 "X-ManagersName", "KADDRESSBOOK" );
150 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, 150 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal,
151 "X-SpousesName", "KADDRESSBOOK" ); 151 "X-SpousesName", "KADDRESSBOOK" );
152 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, 152 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal,
153 "X-Office", "KADDRESSBOOK" ); 153 "X-Office", "KADDRESSBOOK" );
154 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, 154 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal,
155 "X-IMAddress", "KADDRESSBOOK" ); 155 "X-IMAddress", "KADDRESSBOOK" );
156 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, 156 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal,
157 "X-Anniversary", "KADDRESSBOOK" ); 157 "X-Anniversary", "KADDRESSBOOK" );
158 158
159 initGUI(); 159 initGUI();
160 160
161 mIncSearchWidget->setFocus(); 161 mIncSearchWidget->setFocus();
162 162
163 163
164 connect( mViewManager, SIGNAL( selected( const QString& ) ), 164 connect( mViewManager, SIGNAL( selected( const QString& ) ),
165 SLOT( setContactSelected( const QString& ) ) ); 165 SLOT( setContactSelected( const QString& ) ) );
166 connect( mViewManager, SIGNAL( executed( const QString& ) ), 166 connect( mViewManager, SIGNAL( executed( const QString& ) ),
167 SLOT( editContact( const QString& ) ) ); 167 SLOT( editContact( const QString& ) ) );
168 connect( mViewManager, SIGNAL( deleteRequest( ) ), 168 connect( mViewManager, SIGNAL( deleteRequest( ) ),
169 SLOT( deleteContacts( ) ) ); 169 SLOT( deleteContacts( ) ) );
170 connect( mViewManager, SIGNAL( modified() ), 170 connect( mViewManager, SIGNAL( modified() ),
171 SLOT( setModified() ) ); 171 SLOT( setModified() ) );
172 172
173 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); 173 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) );
174 174
175 connect( mXXPortManager, SIGNAL( modified() ), 175 connect( mXXPortManager, SIGNAL( modified() ),
176 SLOT( setModified() ) ); 176 SLOT( setModified() ) );
177 177
178 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), 178 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ),
179 SLOT( incrementalSearch( const QString& ) ) ); 179 SLOT( incrementalSearch( const QString& ) ) );
180 connect( mIncSearchWidget, SIGNAL( fieldChanged() ), 180 connect( mIncSearchWidget, SIGNAL( fieldChanged() ),
181 mJumpButtonBar, SLOT( recreateButtons() ) ); 181 mJumpButtonBar, SLOT( recreateButtons() ) );
182 182
183#ifndef KAB_EMBEDDED 183#ifndef KAB_EMBEDDED
184 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), 184 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
185 mXXPortManager, SLOT( importVCard( const KURL& ) ) ); 185 mXXPortManager, SLOT( importVCard( const KURL& ) ) );
186 186
187 connect( mDetails, SIGNAL( sendEmail( const QString& ) ), 187 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
188 SLOT( sendMail( const QString& ) ) ); 188 SLOT( sendMail( const QString& ) ) );
189 connect( mDetails, SIGNAL( browse( const QString& ) ), 189 connect( mDetails, SIGNAL( browse( const QString& ) ),
190 SLOT( browse( const QString& ) ) ); 190 SLOT( browse( const QString& ) ) );
191 191
192 mAddressBookService = new KAddressBookService( this ); 192 mAddressBookService = new KAddressBookService( this );
193 193
194#endif //KAB_EMBEDDED 194#endif //KAB_EMBEDDED
195 195
196 setModified( false ); 196 setModified( false );
197} 197}
198 198
199KABCore::~KABCore() 199KABCore::~KABCore()
200{ 200{
201 // save(); 201 // save();
202 //saveSettings(); 202 //saveSettings();
203 //KABPrefs::instance()->writeConfig(); 203 //KABPrefs::instance()->writeConfig();
204 delete AddresseeConfig::instance(); 204 delete AddresseeConfig::instance();
205 mAddressBook = 0; 205 mAddressBook = 0;
206 KABC::StdAddressBook::close(); 206 KABC::StdAddressBook::close();
207 207
208#ifdef KAB_EMBEDDED 208#ifdef KAB_EMBEDDED
209 //US we define here our own global actioncollection. 209 //US we define here our own global actioncollection.
210 // delete mActionCollection; 210 // delete mActionCollection;
211#endif //KAB_EMBEDDED 211#endif //KAB_EMBEDDED
212 212
213} 213}
214 214
215void KABCore::restoreSettings() 215void KABCore::restoreSettings()
216{ 216{
217 bool state = KABPrefs::instance()->mJumpButtonBarVisible; 217 bool state = KABPrefs::instance()->mJumpButtonBarVisible;
218 218
219 mActionJumpBar->setChecked( state ); 219 mActionJumpBar->setChecked( state );
220 setJumpButtonBarVisible( state ); 220 setJumpButtonBarVisible( state );
221 221
222 state = KABPrefs::instance()->mDetailsPageVisible; 222 state = KABPrefs::instance()->mDetailsPageVisible;
223 223
224 mActionDetails->setChecked( state ); 224 mActionDetails->setChecked( state );
225 setDetailsVisible( state ); 225 setDetailsVisible( state );
226 QValueList<int> splitterSize = KABPrefs::instance()->mExtensionsSplitter; 226 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter;
227 if ( splitterSize.count() == 0 ) { 227 if ( splitterSize.count() == 0 ) {
228 splitterSize.append( width() / 2 ); 228 splitterSize.append( width() / 2 );
229 splitterSize.append( width() / 2 ); 229 splitterSize.append( width() / 2 );
230 } 230 }
231 mMiniSplitter->setSizes( splitterSize ); 231 mMiniSplitter->setSizes( splitterSize );
232 if ( mExtensionBarSplitter ) {
233 splitterSize = KABPrefs::instance()->mExtensionsSplitter;
234 if ( splitterSize.count() == 0 ) {
235 splitterSize.append( width() / 2 );
236 splitterSize.append( width() / 2 );
237 }
238 mExtensionBarSplitter->setSizes( splitterSize );
239
240 }
232#ifndef KAB_EMBEDDED 241#ifndef KAB_EMBEDDED
233 QValueList<int> splitterSize = KABPrefs::instance()->mExtensionsSplitter; 242 QValueList<int> splitterSize = KABPrefs::instance()->mExtensionsSplitter;
234 if ( splitterSize.count() == 0 ) { 243 if ( splitterSize.count() == 0 ) {
235 splitterSize.append( width() / 2 ); 244 splitterSize.append( width() / 2 );
236 splitterSize.append( width() / 2 ); 245 splitterSize.append( width() / 2 );
237 } 246 }
238 mExtensionBarSplitter->setSizes( splitterSize ); 247 mExtensionBarSplitter->setSizes( splitterSize );
239 248
240 splitterSize = KABPrefs::instance()->mDetailsSplitter; 249 splitterSize = KABPrefs::instance()->mDetailsSplitter;
241 if ( splitterSize.count() == 0 ) { 250 if ( splitterSize.count() == 0 ) {
242 splitterSize.append( height() / 2 ); 251 splitterSize.append( height() / 2 );
243 splitterSize.append( height() / 2 ); 252 splitterSize.append( height() / 2 );
244 } 253 }
245 mDetailsSplitter->setSizes( splitterSize ); 254 mDetailsSplitter->setSizes( splitterSize );
246 255
247 mExtensionManager->restoreSettings(); 256 mExtensionManager->restoreSettings();
248 257
249#endif //KAB_EMBEDDED 258#endif //KAB_EMBEDDED
250 259
251 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); 260 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField );
252 261
253 mViewManager->restoreSettings(); 262 mViewManager->restoreSettings();
254 mExtensionManager->restoreSettings(); 263 mExtensionManager->restoreSettings();
255} 264}
256 265
257void KABCore::saveSettings() 266void KABCore::saveSettings()
258{ 267{
259 KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); 268 KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked();
260 KABPrefs::instance()->mExtensionsSplitter = mMiniSplitter->sizes(); 269 if ( mExtensionBarSplitter )
270 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
261 KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); 271 KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked();
262 272 KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes();
263#ifndef KAB_EMBEDDED 273#ifndef KAB_EMBEDDED
264 274
265 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); 275 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
266 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); 276 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes();
267#endif //KAB_EMBEDDED 277#endif //KAB_EMBEDDED
268 mExtensionManager->saveSettings(); 278 mExtensionManager->saveSettings();
269 mViewManager->saveSettings(); 279 mViewManager->saveSettings();
270 280
271 KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); 281 KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem();
272 282
273} 283}
274 284
275KABC::AddressBook *KABCore::addressBook() const 285KABC::AddressBook *KABCore::addressBook() const
276{ 286{
277 return mAddressBook; 287 return mAddressBook;
278} 288}
279 289
280KConfig *KABCore::config() 290KConfig *KABCore::config()
281{ 291{
282#ifndef KAB_EMBEDDED 292#ifndef KAB_EMBEDDED
283 return KABPrefs::instance()->config(); 293 return KABPrefs::instance()->config();
284#else //KAB_EMBEDDED 294#else //KAB_EMBEDDED
285 return KABPrefs::instance()->getConfig(); 295 return KABPrefs::instance()->getConfig();
286#endif //KAB_EMBEDDED 296#endif //KAB_EMBEDDED
287} 297}
288 298
289KActionCollection *KABCore::actionCollection() const 299KActionCollection *KABCore::actionCollection() const
290{ 300{
291 return mGUIClient->actionCollection(); 301 return mGUIClient->actionCollection();
292} 302}
293 303
294KABC::Field *KABCore::currentSearchField() const 304KABC::Field *KABCore::currentSearchField() const
295{ 305{
296 if (mIncSearchWidget) 306 if (mIncSearchWidget)
297 return mIncSearchWidget->currentField(); 307 return mIncSearchWidget->currentField();
298 else 308 else
299 return 0; 309 return 0;
300} 310}
301 311
302QStringList KABCore::selectedUIDs() const 312QStringList KABCore::selectedUIDs() const
303{ 313{
304 return mViewManager->selectedUids(); 314 return mViewManager->selectedUids();
305} 315}
306 316
307KABC::Resource *KABCore::requestResource( QWidget *parent ) 317KABC::Resource *KABCore::requestResource( QWidget *parent )
308{ 318{
309 QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); 319 QPtrList<KABC::Resource> kabcResources = addressBook()->resources();
310 320
311 QPtrList<KRES::Resource> kresResources; 321 QPtrList<KRES::Resource> kresResources;
312 QPtrListIterator<KABC::Resource> resIt( kabcResources ); 322 QPtrListIterator<KABC::Resource> resIt( kabcResources );
313 KABC::Resource *resource; 323 KABC::Resource *resource;
314 while ( ( resource = resIt.current() ) != 0 ) { 324 while ( ( resource = resIt.current() ) != 0 ) {
315 ++resIt; 325 ++resIt;
316 if ( !resource->readOnly() ) { 326 if ( !resource->readOnly() ) {
317 KRES::Resource *res = static_cast<KRES::Resource*>( resource ); 327 KRES::Resource *res = static_cast<KRES::Resource*>( resource );
318 if ( res ) 328 if ( res )
319 kresResources.append( res ); 329 kresResources.append( res );
320 } 330 }
321 } 331 }
322 332
323 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); 333 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent );
324 return static_cast<KABC::Resource*>( res ); 334 return static_cast<KABC::Resource*>( res );
325} 335}
326 336
@@ -1082,147 +1092,161 @@ AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
1082 connect( dialog, SIGNAL( editorDestroyed( const QString& ) ), 1092 connect( dialog, SIGNAL( editorDestroyed( const QString& ) ),
1083 SLOT( slotEditorDestroyed( const QString& ) ) ); 1093 SLOT( slotEditorDestroyed( const QString& ) ) );
1084 1094
1085 return dialog; 1095 return dialog;
1086} 1096}
1087 1097
1088void KABCore::slotEditorDestroyed( const QString &uid ) 1098void KABCore::slotEditorDestroyed( const QString &uid )
1089{ 1099{
1090 mEditorDict.remove( uid ); 1100 mEditorDict.remove( uid );
1091} 1101}
1092 1102
1093void KABCore::initGUI() 1103void KABCore::initGUI()
1094{ 1104{
1095#ifndef KAB_EMBEDDED 1105#ifndef KAB_EMBEDDED
1096 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1106 QHBoxLayout *topLayout = new QHBoxLayout( this );
1097 topLayout->setSpacing( KDialogBase::spacingHint() ); 1107 topLayout->setSpacing( KDialogBase::spacingHint() );
1098 1108
1099 mExtensionBarSplitter = new QSplitter( this ); 1109 mExtensionBarSplitter = new QSplitter( this );
1100 mExtensionBarSplitter->setOrientation( Qt::Vertical ); 1110 mExtensionBarSplitter->setOrientation( Qt::Vertical );
1101 1111
1102 mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); 1112 mDetailsSplitter = new QSplitter( mExtensionBarSplitter );
1103 1113
1104 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1114 QVBox *viewSpace = new QVBox( mDetailsSplitter );
1105 mIncSearchWidget = new IncSearchWidget( viewSpace ); 1115 mIncSearchWidget = new IncSearchWidget( viewSpace );
1106 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1116 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1107 SLOT( incrementalSearch( const QString& ) ) ); 1117 SLOT( incrementalSearch( const QString& ) ) );
1108 1118
1109 mViewManager = new ViewManager( this, viewSpace ); 1119 mViewManager = new ViewManager( this, viewSpace );
1110 viewSpace->setStretchFactor( mViewManager, 1 ); 1120 viewSpace->setStretchFactor( mViewManager, 1 );
1111 1121
1112 mDetails = new ViewContainer( mDetailsSplitter ); 1122 mDetails = new ViewContainer( mDetailsSplitter );
1113 1123
1114 mJumpButtonBar = new JumpButtonBar( this, this ); 1124 mJumpButtonBar = new JumpButtonBar( this, this );
1115 1125
1116 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1126 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1117 1127
1118 topLayout->addWidget( mExtensionBarSplitter ); 1128 topLayout->addWidget( mExtensionBarSplitter );
1119 topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); 1129 topLayout->setStretchFactor( mExtensionBarSplitter, 100 );
1120 topLayout->addWidget( mJumpButtonBar ); 1130 topLayout->addWidget( mJumpButtonBar );
1121 topLayout->setStretchFactor( mJumpButtonBar, 1 ); 1131 topLayout->setStretchFactor( mJumpButtonBar, 1 );
1122 1132
1123 mXXPortManager = new XXPortManager( this, this ); 1133 mXXPortManager = new XXPortManager( this, this );
1124 1134
1125#else //KAB_EMBEDDED 1135#else //KAB_EMBEDDED
1126 //US initialize viewMenu before settingup viewmanager. 1136 //US initialize viewMenu before settingup viewmanager.
1127 // Viewmanager needs this menu to plugin submenues. 1137 // Viewmanager needs this menu to plugin submenues.
1128 viewMenu = new QPopupMenu( this ); 1138 viewMenu = new QPopupMenu( this );
1129 settingsMenu = new QPopupMenu( this ); 1139 settingsMenu = new QPopupMenu( this );
1130 //filterMenu = new QPopupMenu( this ); 1140 //filterMenu = new QPopupMenu( this );
1131 ImportMenu = new QPopupMenu( this ); 1141 ImportMenu = new QPopupMenu( this );
1132 ExportMenu = new QPopupMenu( this ); 1142 ExportMenu = new QPopupMenu( this );
1133 1143
1134 1144
1135//US since we have no splitter for the embedded system, setup 1145//US since we have no splitter for the embedded system, setup
1136// a layout with two frames. One left and one right. 1146// a layout with two frames. One left and one right.
1137 1147
1138 QBoxLayout *topLayout; 1148 QBoxLayout *topLayout;
1139 1149
1140 // = new QHBoxLayout( this ); 1150 // = new QHBoxLayout( this );
1141// QBoxLayout *topLayout = (QBoxLayout*)layout(); 1151// QBoxLayout *topLayout = (QBoxLayout*)layout();
1142 1152
1143// QWidget *mainBox = new QWidget( this ); 1153// QWidget *mainBox = new QWidget( this );
1144// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); 1154// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox);
1145 1155
1146 1156#ifdef DESKTOP_VERSION
1157 topLayout = new QHBoxLayout( this );
1158
1159
1160 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1161 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1162
1163 topLayout->addWidget(mMiniSplitter );
1164
1165 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter );
1166 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1167 mViewManager = new ViewManager( this, mExtensionBarSplitter );
1168 mDetails = new ViewContainer( mMiniSplitter );
1169 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1170#else
1147 if ( QApplication::desktop()->width() > 480 ) { 1171 if ( QApplication::desktop()->width() > 480 ) {
1148 topLayout = new QHBoxLayout( this ); 1172 topLayout = new QHBoxLayout( this );
1149 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1173 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1150 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1174 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1151 } else { 1175 } else {
1152 1176
1153 topLayout = new QVBoxLayout( this ); 1177 topLayout = new QVBoxLayout( this );
1154 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); 1178 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this);
1155 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1179 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1156 } 1180 }
1157 1181
1158 topLayout->addWidget(mMiniSplitter ); 1182 topLayout->addWidget(mMiniSplitter );
1159 mViewManager = new ViewManager( this, mMiniSplitter ); 1183 mViewManager = new ViewManager( this, mMiniSplitter );
1160 mDetails = new ViewContainer( mMiniSplitter ); 1184 mDetails = new ViewContainer( mMiniSplitter );
1161 1185
1162 1186
1163 mExtensionManager = new ExtensionManager( this, mMiniSplitter ); 1187 mExtensionManager = new ExtensionManager( this, mMiniSplitter );
1164 1188#endif
1165 //eh->hide(); 1189 //eh->hide();
1166 // topLayout->addWidget(mExtensionManager ); 1190 // topLayout->addWidget(mExtensionManager );
1167 1191
1168 1192
1169/*US 1193/*US
1170#ifndef KAB_NOSPLITTER 1194#ifndef KAB_NOSPLITTER
1171 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1195 QHBoxLayout *topLayout = new QHBoxLayout( this );
1172//US topLayout->setSpacing( KDialogBase::spacingHint() ); 1196//US topLayout->setSpacing( KDialogBase::spacingHint() );
1173 topLayout->setSpacing( 10 ); 1197 topLayout->setSpacing( 10 );
1174 1198
1175 mDetailsSplitter = new QSplitter( this ); 1199 mDetailsSplitter = new QSplitter( this );
1176 1200
1177 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1201 QVBox *viewSpace = new QVBox( mDetailsSplitter );
1178 1202
1179 mViewManager = new ViewManager( this, viewSpace ); 1203 mViewManager = new ViewManager( this, viewSpace );
1180 viewSpace->setStretchFactor( mViewManager, 1 ); 1204 viewSpace->setStretchFactor( mViewManager, 1 );
1181 1205
1182 mDetails = new ViewContainer( mDetailsSplitter ); 1206 mDetails = new ViewContainer( mDetailsSplitter );
1183 1207
1184 topLayout->addWidget( mDetailsSplitter ); 1208 topLayout->addWidget( mDetailsSplitter );
1185 topLayout->setStretchFactor( mDetailsSplitter, 100 ); 1209 topLayout->setStretchFactor( mDetailsSplitter, 100 );
1186#else //KAB_NOSPLITTER 1210#else //KAB_NOSPLITTER
1187 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1211 QHBoxLayout *topLayout = new QHBoxLayout( this );
1188//US topLayout->setSpacing( KDialogBase::spacingHint() ); 1212//US topLayout->setSpacing( KDialogBase::spacingHint() );
1189 topLayout->setSpacing( 10 ); 1213 topLayout->setSpacing( 10 );
1190 1214
1191// mDetailsSplitter = new QSplitter( this ); 1215// mDetailsSplitter = new QSplitter( this );
1192 1216
1193 QVBox *viewSpace = new QVBox( this ); 1217 QVBox *viewSpace = new QVBox( this );
1194 1218
1195 mViewManager = new ViewManager( this, viewSpace ); 1219 mViewManager = new ViewManager( this, viewSpace );
1196 viewSpace->setStretchFactor( mViewManager, 1 ); 1220 viewSpace->setStretchFactor( mViewManager, 1 );
1197 1221
1198 mDetails = new ViewContainer( this ); 1222 mDetails = new ViewContainer( this );
1199 1223
1200 topLayout->addWidget( viewSpace ); 1224 topLayout->addWidget( viewSpace );
1201// topLayout->setStretchFactor( mDetailsSplitter, 100 ); 1225// topLayout->setStretchFactor( mDetailsSplitter, 100 );
1202 topLayout->addWidget( mDetails ); 1226 topLayout->addWidget( mDetails );
1203#endif //KAB_NOSPLITTER 1227#endif //KAB_NOSPLITTER
1204*/ 1228*/
1205 1229
1206 1230
1207#endif //KAB_EMBEDDED 1231#endif //KAB_EMBEDDED
1208 initActions(); 1232 initActions();
1209 1233
1210#ifdef KAB_EMBEDDED 1234#ifdef KAB_EMBEDDED
1211 addActionsManually(); 1235 addActionsManually();
1212 //US make sure the export and import menues are initialized before creating the xxPortManager. 1236 //US make sure the export and import menues are initialized before creating the xxPortManager.
1213 mXXPortManager = new XXPortManager( this, this ); 1237 mXXPortManager = new XXPortManager( this, this );
1214 1238
1215 // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() ); 1239 // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() );
1216 //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget); 1240 //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget);
1217 // mActionQuit->plug ( mMainWindow->toolBar()); 1241 // mActionQuit->plug ( mMainWindow->toolBar());
1218 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() ); 1242 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() );
1219 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget); 1243 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget);
1220 // mIncSearchWidget->hide(); 1244 // mIncSearchWidget->hide();
1221 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1245 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1222 SLOT( incrementalSearch( const QString& ) ) ); 1246 SLOT( incrementalSearch( const QString& ) ) );
1223 1247
1224 1248
1225 mJumpButtonBar = new JumpButtonBar( this, this ); 1249 mJumpButtonBar = new JumpButtonBar( this, this );
1226 1250
1227 topLayout->addWidget( mJumpButtonBar ); 1251 topLayout->addWidget( mJumpButtonBar );
1228//US topLayout->setStretchFactor( mJumpButtonBar, 10 ); 1252//US topLayout->setStretchFactor( mJumpButtonBar, 10 );
@@ -1425,137 +1449,141 @@ void KABCore::addActionsManually()
1425 } 1449 }
1426#endif 1450#endif
1427 // mActionQuit->plug ( mMainWindow->toolBar()); 1451 // mActionQuit->plug ( mMainWindow->toolBar());
1428 1452
1429 1453
1430 1454
1431 //US Now connect the actions with the menue entries. 1455 //US Now connect the actions with the menue entries.
1432 mActionPrint->plug( fileMenu ); 1456 mActionPrint->plug( fileMenu );
1433 mActionMail->plug( fileMenu ); 1457 mActionMail->plug( fileMenu );
1434 fileMenu->insertSeparator(); 1458 fileMenu->insertSeparator();
1435 1459
1436 mActionNewContact->plug( fileMenu ); 1460 mActionNewContact->plug( fileMenu );
1437 mActionNewContact->plug( tb ); 1461 mActionNewContact->plug( tb );
1438 1462
1439 mActionEditAddressee->plug( fileMenu ); 1463 mActionEditAddressee->plug( fileMenu );
1440 fileMenu->insertSeparator(); 1464 fileMenu->insertSeparator();
1441 mActionSave->plug( fileMenu ); 1465 mActionSave->plug( fileMenu );
1442 fileMenu->insertItem( "&Import", ImportMenu ); 1466 fileMenu->insertItem( "&Import", ImportMenu );
1443 fileMenu->insertItem( "&Emport", ExportMenu ); 1467 fileMenu->insertItem( "&Emport", ExportMenu );
1444 fileMenu->insertSeparator(); 1468 fileMenu->insertSeparator();
1445 mActionMailVCard->plug( fileMenu ); 1469 mActionMailVCard->plug( fileMenu );
1446 fileMenu->insertSeparator(); 1470 fileMenu->insertSeparator();
1447 mActionQuit->plug( fileMenu ); 1471 mActionQuit->plug( fileMenu );
1448 1472
1449 1473
1450 // edit menu 1474 // edit menu
1451 mActionUndo->plug( editMenu ); 1475 mActionUndo->plug( editMenu );
1452 mActionRedo->plug( editMenu ); 1476 mActionRedo->plug( editMenu );
1453 editMenu->insertSeparator(); 1477 editMenu->insertSeparator();
1454 mActionCut->plug( editMenu ); 1478 mActionCut->plug( editMenu );
1455 mActionCopy->plug( editMenu ); 1479 mActionCopy->plug( editMenu );
1456 mActionPaste->plug( editMenu ); 1480 mActionPaste->plug( editMenu );
1457 mActionDelete->plug( editMenu ); 1481 mActionDelete->plug( editMenu );
1458 editMenu->insertSeparator(); 1482 editMenu->insertSeparator();
1459 mActionSelectAll->plug( editMenu ); 1483 mActionSelectAll->plug( editMenu );
1460 1484
1461 1485
1462 // settings menu 1486 // settings menu
1463//US special menuentry to configure the addressbook resources. On KDE 1487//US special menuentry to configure the addressbook resources. On KDE
1464// you do that through the control center !!! 1488// you do that through the control center !!!
1465 mActionConfigResources->plug( settingsMenu ); 1489 mActionConfigResources->plug( settingsMenu );
1466 settingsMenu->insertSeparator(); 1490 settingsMenu->insertSeparator();
1467 1491
1468 mActionConfigKAddressbook->plug( settingsMenu ); 1492 mActionConfigKAddressbook->plug( settingsMenu );
1469 1493
1470 if ( mIsPart ) { 1494 if ( mIsPart ) {
1471 mActionConfigShortcuts->plug( settingsMenu ); 1495 mActionConfigShortcuts->plug( settingsMenu );
1472 mActionConfigureToolbars->plug( settingsMenu ); 1496 mActionConfigureToolbars->plug( settingsMenu );
1473 1497
1474 } else { 1498 } else {
1475 mActionKeyBindings->plug( settingsMenu ); 1499 mActionKeyBindings->plug( settingsMenu );
1476 } 1500 }
1477 1501
1478 settingsMenu->insertSeparator(); 1502 settingsMenu->insertSeparator();
1479 1503
1480 mActionJumpBar->plug( settingsMenu ); 1504 mActionJumpBar->plug( settingsMenu );
1481 mActionDetails->plug( settingsMenu ); 1505 mActionDetails->plug( settingsMenu );
1482 settingsMenu->insertSeparator(); 1506 settingsMenu->insertSeparator();
1483 1507
1484 mActionWhoAmI->plug( settingsMenu ); 1508 mActionWhoAmI->plug( settingsMenu );
1485 mActionCategories->plug( settingsMenu ); 1509 mActionCategories->plug( settingsMenu );
1486 1510
1487 mActionAboutKAddressbook->plug( helpMenu ); 1511 mActionAboutKAddressbook->plug( helpMenu );
1488 1512
1513
1489 if (QApplication::desktop()->width() > 320 ) { 1514 if (QApplication::desktop()->width() > 320 ) {
1490 1515
1491 mActionEditAddressee->plug( tb ); 1516 mActionEditAddressee->plug( tb );
1492 mActionSave->plug( tb ); 1517 mActionSave->plug( tb );
1493 mViewManager->getFilterAction()->plug ( tb); 1518 mViewManager->getFilterAction()->plug ( tb);
1494 if (QApplication::desktop()->width() > 480 ) 1519 if (QApplication::desktop()->width() > 480 ) {
1495 mActionDelete->plug( tb ); 1520 mActionUndo->plug( tb );
1521 mActionDelete->plug( tb );
1522 mActionRedo->plug( tb );
1523 }
1496 } 1524 }
1497 mActionQuit->plug ( tb ); 1525 //mActionQuit->plug ( tb );
1498 // tb->insertWidget(-1, 0, mIncSearchWidget, 6); 1526 // tb->insertWidget(-1, 0, mIncSearchWidget, 6);
1499 1527
1500 //US link the searchwidget first to this. 1528 //US link the searchwidget first to this.
1501 // The real linkage to the toolbar happens later. 1529 // The real linkage to the toolbar happens later.
1502//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 1530//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
1503//US tb->insertItem( mIncSearchWidget ); 1531//US tb->insertItem( mIncSearchWidget );
1504/*US 1532/*US
1505 mIncSearchWidget = new IncSearchWidget( tb ); 1533 mIncSearchWidget = new IncSearchWidget( tb );
1506 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1534 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1507 SLOT( incrementalSearch( const QString& ) ) ); 1535 SLOT( incrementalSearch( const QString& ) ) );
1508 1536
1509 mJumpButtonBar = new JumpButtonBar( this, this ); 1537 mJumpButtonBar = new JumpButtonBar( this, this );
1510 1538
1511//US topLayout->addWidget( mJumpButtonBar ); 1539//US topLayout->addWidget( mJumpButtonBar );
1512 this->layout()->add( mJumpButtonBar ); 1540 this->layout()->add( mJumpButtonBar );
1513*/ 1541*/
1514 1542
1515#endif //KAB_EMBEDDED 1543#endif //KAB_EMBEDDED
1516} 1544}
1517 1545
1518 1546
1519 1547
1520void KABCore::clipboardDataChanged() 1548void KABCore::clipboardDataChanged()
1521{ 1549{
1522 1550
1523 if ( mReadWrite ) 1551 if ( mReadWrite )
1524 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); 1552 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
1525 1553
1526} 1554}
1527 1555
1528void KABCore::updateActionMenu() 1556void KABCore::updateActionMenu()
1529{ 1557{
1530 UndoStack *undo = UndoStack::instance(); 1558 UndoStack *undo = UndoStack::instance();
1531 RedoStack *redo = RedoStack::instance(); 1559 RedoStack *redo = RedoStack::instance();
1532 1560
1533 if ( undo->isEmpty() ) 1561 if ( undo->isEmpty() )
1534 mActionUndo->setText( i18n( "Undo" ) ); 1562 mActionUndo->setText( i18n( "Undo" ) );
1535 else 1563 else
1536 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); 1564 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
1537 1565
1538 mActionUndo->setEnabled( !undo->isEmpty() ); 1566 mActionUndo->setEnabled( !undo->isEmpty() );
1539 1567
1540 if ( !redo->top() ) 1568 if ( !redo->top() )
1541 mActionRedo->setText( i18n( "Redo" ) ); 1569 mActionRedo->setText( i18n( "Redo" ) );
1542 else 1570 else
1543 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); 1571 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
1544 1572
1545 mActionRedo->setEnabled( !redo->isEmpty() ); 1573 mActionRedo->setEnabled( !redo->isEmpty() );
1546} 1574}
1547 1575
1548void KABCore::configureKeyBindings() 1576void KABCore::configureKeyBindings()
1549{ 1577{
1550#ifndef KAB_EMBEDDED 1578#ifndef KAB_EMBEDDED
1551 KKeyDialog::configure( actionCollection(), true ); 1579 KKeyDialog::configure( actionCollection(), true );
1552#else //KAB_EMBEDDED 1580#else //KAB_EMBEDDED
1553 qDebug("KABCore::configureKeyBindings() not implemented"); 1581 qDebug("KABCore::configureKeyBindings() not implemented");
1554#endif //KAB_EMBEDDED 1582#endif //KAB_EMBEDDED
1555} 1583}
1556 1584
1557#ifdef KAB_EMBEDDED 1585#ifdef KAB_EMBEDDED
1558void KABCore::configureResources() 1586void KABCore::configureResources()
1559{ 1587{
1560 KRES::KCMKResources dlg( this, "" , 0 ); 1588 KRES::KCMKResources dlg( this, "" , 0 );
1561 1589
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index edf98c2..b84ec22 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -283,129 +283,129 @@ class KABCore : public QWidget
283 283
284 /** 284 /**
285 Shows the edit dialog for the given uid. If the uid is QString::null, 285 Shows the edit dialog for the given uid. If the uid is QString::null,
286 the method will try to find a selected addressee in the view. 286 the method will try to find a selected addressee in the view.
287 */ 287 */
288 void editContact( const QString &uid /*US = QString::null*/ ); 288 void editContact( const QString &uid /*US = QString::null*/ );
289//US added a second method without defaultparameter 289//US added a second method without defaultparameter
290 void editContact2(); 290 void editContact2();
291 291
292 /** 292 /**
293 Launches the configuration dialog. 293 Launches the configuration dialog.
294 */ 294 */
295 void openConfigDialog(); 295 void openConfigDialog();
296 296
297 /** 297 /**
298 Launches the ldap search dialog. 298 Launches the ldap search dialog.
299 */ 299 */
300 void openLDAPDialog(); 300 void openLDAPDialog();
301 301
302 /** 302 /**
303 Creates a KAddressBookPrinter, which will display the print 303 Creates a KAddressBookPrinter, which will display the print
304 dialog and do the printing. 304 dialog and do the printing.
305 */ 305 */
306 void print(); 306 void print();
307 307
308 /** 308 /**
309 Registers a new GUI client, so plugins can register its actions. 309 Registers a new GUI client, so plugins can register its actions.
310 */ 310 */
311 void addGUIClient( KXMLGUIClient *client ); 311 void addGUIClient( KXMLGUIClient *client );
312 312
313 signals: 313 signals:
314 void contactSelected( const QString &name ); 314 void contactSelected( const QString &name );
315 void contactSelected( const QPixmap &pixmap ); 315 void contactSelected( const QPixmap &pixmap );
316 public slots: 316 public slots:
317 void setDetailsVisible( bool visible ); 317 void setDetailsVisible( bool visible );
318 void setDetailsToState(); 318 void setDetailsToState();
319 private slots: 319 private slots:
320 void setJumpButtonBarVisible( bool visible ); 320 void setJumpButtonBarVisible( bool visible );
321 321
322 void extensionModified( const KABC::Addressee::List &list ); 322 void extensionModified( const KABC::Addressee::List &list );
323 void clipboardDataChanged(); 323 void clipboardDataChanged();
324 void updateActionMenu(); 324 void updateActionMenu();
325 void configureKeyBindings(); 325 void configureKeyBindings();
326#ifdef KAB_EMBEDDED 326#ifdef KAB_EMBEDDED
327 void configureResources(); 327 void configureResources();
328#endif //KAB_EMBEDDED 328#endif //KAB_EMBEDDED
329 329
330 void slotEditorDestroyed( const QString &uid ); 330 void slotEditorDestroyed( const QString &uid );
331 void configurationChanged(); 331 void configurationChanged();
332 void addressBookChanged(); 332 void addressBookChanged();
333 333
334 private: 334 private:
335 void initGUI(); 335 void initGUI();
336 void initActions(); 336 void initActions();
337 337
338 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, 338 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent,
339 const char *name = 0 ); 339 const char *name = 0 );
340 340
341 KXMLGUIClient *mGUIClient; 341 KXMLGUIClient *mGUIClient;
342 342
343 KABC::AddressBook *mAddressBook; 343 KABC::AddressBook *mAddressBook;
344 344
345 ViewManager *mViewManager; 345 ViewManager *mViewManager;
346 // QSplitter *mDetailsSplitter; 346 // QSplitter *mDetailsSplitter;
347 //QSplitter *mExtensionBarSplitter; 347 KDGanttMinimizeSplitter *mExtensionBarSplitter;
348 ViewContainer *mDetails; 348 ViewContainer *mDetails;
349 KDGanttMinimizeSplitter* mMiniSplitter; 349 KDGanttMinimizeSplitter* mMiniSplitter;
350 XXPortManager *mXXPortManager; 350 XXPortManager *mXXPortManager;
351 JumpButtonBar *mJumpButtonBar; 351 JumpButtonBar *mJumpButtonBar;
352 IncSearchWidget *mIncSearchWidget; 352 IncSearchWidget *mIncSearchWidget;
353 ExtensionManager *mExtensionManager; 353 ExtensionManager *mExtensionManager;
354 354
355 KCMultiDialog *mConfigureDialog; 355 KCMultiDialog *mConfigureDialog;
356 356
357#ifndef KAB_EMBEDDED 357#ifndef KAB_EMBEDDED
358 358
359 KCMultiDialog *mConfigureDialog; 359 KCMultiDialog *mConfigureDialog;
360 LDAPSearchDialog *mLdapSearchDialog; 360 LDAPSearchDialog *mLdapSearchDialog;
361#endif //KAB_EMBEDDED 361#endif //KAB_EMBEDDED
362 QDict<AddresseeEditorDialog> mEditorDict; 362 QDict<AddresseeEditorDialog> mEditorDict;
363 363
364 bool mReadWrite; 364 bool mReadWrite;
365 bool mModified; 365 bool mModified;
366 bool mIsPart; 366 bool mIsPart;
367 367
368 //US file menu 368 //US file menu
369 KAction *mActionMail; 369 KAction *mActionMail;
370 KAction* mActionPrint; 370 KAction* mActionPrint;
371 KAction* mActionNewContact; 371 KAction* mActionNewContact;
372 KAction *mActionSave; 372 KAction *mActionSave;
373 KAction *mActionEditAddressee; 373 KAction *mActionEditAddressee;
374 KAction *mActionMailVCard; 374 KAction *mActionMailVCard;
375 KAction *mActionQuit; 375 KAction *mActionQuit;
376 376
377 //US edit menu 377 //US edit menu
378 KAction *mActionCopy; 378 KAction *mActionCopy;
379 KAction *mActionCut; 379 KAction *mActionCut;
380 KAction *mActionPaste; 380 KAction *mActionPaste;
381 KAction *mActionSelectAll; 381 KAction *mActionSelectAll;
382 KAction *mActionUndo; 382 KAction *mActionUndo;
383 KAction *mActionRedo; 383 KAction *mActionRedo;
384 KAction *mActionDelete; 384 KAction *mActionDelete;
385 385
386 //US settings menu 386 //US settings menu
387 KAction *mActionConfigResources; 387 KAction *mActionConfigResources;
388 KAction *mActionConfigKAddressbook; 388 KAction *mActionConfigKAddressbook;
389 KAction *mActionConfigShortcuts; 389 KAction *mActionConfigShortcuts;
390 KAction *mActionConfigureToolbars; 390 KAction *mActionConfigureToolbars;
391 KAction *mActionKeyBindings; 391 KAction *mActionKeyBindings;
392 KToggleAction *mActionJumpBar; 392 KToggleAction *mActionJumpBar;
393 KToggleAction *mActionDetails; 393 KToggleAction *mActionDetails;
394 KAction *mActionWhoAmI; 394 KAction *mActionWhoAmI;
395 KAction *mActionCategories; 395 KAction *mActionCategories;
396 KAction *mActionAboutKAddressbook; 396 KAction *mActionAboutKAddressbook;
397 397
398 KAction *mActionDeleteView; 398 KAction *mActionDeleteView;
399 399
400 QPopupMenu *viewMenu; 400 QPopupMenu *viewMenu;
401 QPopupMenu *filterMenu; 401 QPopupMenu *filterMenu;
402 QPopupMenu *settingsMenu; 402 QPopupMenu *settingsMenu;
403 403
404//US QAction *mActionSave; 404//US QAction *mActionSave;
405 QPopupMenu *ImportMenu; 405 QPopupMenu *ImportMenu;
406 QPopupMenu *ExportMenu; 406 QPopupMenu *ExportMenu;
407 407
408#ifndef KAB_EMBEDDED 408#ifndef KAB_EMBEDDED
409 KAddressBookService *mAddressBookService; 409 KAddressBookService *mAddressBookService;
410#endif //KAB_EMBEDDED 410#endif //KAB_EMBEDDED
411 411
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp
index 92c32ca..8ebb93a 100644
--- a/kaddressbook/kaddressbookmain.cpp
+++ b/kaddressbook/kaddressbookmain.cpp
@@ -31,146 +31,129 @@
31#include <kedittoolbar.h> 31#include <kedittoolbar.h>
32#include <kkeydialog.h> 32#include <kkeydialog.h>
33#include <kmessagebox.h> 33#include <kmessagebox.h>
34#include <kstatusbar.h> 34#include <kstatusbar.h>
35#endif //KAB_EMBEDDED 35#endif //KAB_EMBEDDED
36#include <klocale.h> 36#include <klocale.h>
37 37
38#include "kabcore.h" 38#include "kabcore.h"
39#include "kaddressbookmain.h" 39#include "kaddressbookmain.h"
40#include "kactioncollection.h" 40#include "kactioncollection.h"
41 41
42#ifdef KAB_EMBEDDED 42#ifdef KAB_EMBEDDED
43KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "adrressbook" ) 43KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "adrressbook" )
44#else //KAB_EMBEDDED 44#else //KAB_EMBEDDED
45//MOC_SKIP_BEGIN 45//MOC_SKIP_BEGIN
46KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 ) 46KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 )
47//MOC_SKIP_END 47//MOC_SKIP_END
48#endif //KAB_EMBEDDED 48#endif //KAB_EMBEDDED
49{ 49{
50 50
51 setIcon(SmallIcon( "ka24" ) ); 51 setIcon(SmallIcon( "ka24" ) );
52#if 0 52#if 0
53 //US for embedded systems, create the toolbar before we initiate KABCore. 53 //US for embedded systems, create the toolbar before we initiate KABCore.
54 // KABCore will fill the toolbar with menues and icons 54 // KABCore will fill the toolbar with menues and icons
55 QMainWindow::ToolBarDock tbd; 55 QMainWindow::ToolBarDock tbd;
56 tbd = Top; 56 tbd = Top;
57 iconToolBar = new QToolBar( this ); 57 iconToolBar = new QToolBar( this );
58 addToolBar (iconToolBar , tbd ); 58 addToolBar (iconToolBar , tbd );
59 iconToolBar->setHorizontalStretchable(true); 59 iconToolBar->setHorizontalStretchable(true);
60//US iconToolBar->setWidth(300); 60//US iconToolBar->setWidth(300);
61#endif // 0 61#endif // 0
62 62
63 mCore = new KABCore( this, true, this ); 63 mCore = new KABCore( this, true, this );
64 64
65#ifdef KAB_EMBEDDED 65#ifdef KAB_EMBEDDED
66 setCaption( i18n( "KAddressbook/Pi" ) ); 66 setCaption( i18n( "KAddressbook/Pi" ) );
67#else //KAB_EMBEDDED 67#else //KAB_EMBEDDED
68 setCaption( i18n( "Address Book Browser" ) ); 68 setCaption( i18n( "Address Book Browser" ) );
69#endif //KAB_EMBEDDED 69#endif //KAB_EMBEDDED
70 70
71 //mCore->restoreSettings(); 71 //mCore->restoreSettings();
72 72
73 initActions(); 73 initActions();
74 74
75 setCentralWidget( mCore ); 75 setCentralWidget( mCore );
76 76
77//US statusBar()->show(); 77//US statusBar()->show();
78 78
79#ifndef KAB_EMBEDDED 79#ifndef KAB_EMBEDDED
80 setStandardToolBarMenuEnabled(true); 80 setStandardToolBarMenuEnabled(true);
81 81
82 createGUI( "kaddressbookui.rc", false ); 82 createGUI( "kaddressbookui.rc", false );
83 83
84 84
85#endif //KAB_EMBEDDED 85#endif //KAB_EMBEDDED
86 setAutoSaveSettings(); 86 setAutoSaveSettings();
87 qApp->processEvents(); 87 qApp->processEvents();
88 mCore->restoreSettings(); 88 mCore->restoreSettings();
89} 89}
90 90
91KAddressBookMain::~KAddressBookMain() 91KAddressBookMain::~KAddressBookMain()
92{ 92{
93 // mCore->saveSettings(); 93 // mCore->saveSettings();
94} 94}
95#ifndef DESKTOP_VERSION 95
96void KAddressBookMain::show ()
97{
98 static bool block = false;
99 if( block ) {
100 QWidget::show();
101 return;
102 } else {
103 block = true ;
104 QWidget::showFullScreen();
105 }
106 int min = 20;
107 if ( QApplication::desktop()->width() > 320 )
108 min += 20;
109 setGeometry( 0,0,QApplication::desktop()->width(), QApplication::desktop()->height() - min );
110 block = false;
111}
112#endif
113void KAddressBookMain::showMinimized () 96void KAddressBookMain::showMinimized ()
114{ 97{
115 QWidget::showMinimized () ; 98 QWidget::showMinimized () ;
116} 99}
117void KAddressBookMain::addEmail( QString addr ) 100void KAddressBookMain::addEmail( QString addr )
118{ 101{
119 mCore->addEmail( addr ); 102 mCore->addEmail( addr );
120} 103}
121 104
122#ifndef KAB_EMBEDDED 105#ifndef KAB_EMBEDDED
123ASYNC KAddressBookMain::showContactEditor( QString uid ) 106ASYNC KAddressBookMain::showContactEditor( QString uid )
124{ 107{
125 mCore->editContact( uid ); 108 mCore->editContact( uid );
126} 109}
127#endif //KAB_EMBEDDED 110#endif //KAB_EMBEDDED
128void KAddressBookMain::newContact() 111void KAddressBookMain::newContact()
129{ 112{
130 mCore->newContact(); 113 mCore->newContact();
131} 114}
132 115
133QString KAddressBookMain::getNameByPhone( QString phone ) 116QString KAddressBookMain::getNameByPhone( QString phone )
134{ 117{
135 return mCore->getNameByPhone( phone ); 118 return mCore->getNameByPhone( phone );
136} 119}
137 120
138void KAddressBookMain::save() 121void KAddressBookMain::save()
139{ 122{
140 mCore->save(); 123 mCore->save();
141} 124}
142 125
143void KAddressBookMain::exit() 126void KAddressBookMain::exit()
144{ 127{
145 close( ); 128 close( );
146} 129}
147 130
148void KAddressBookMain::saveProperties( KConfig* ) 131void KAddressBookMain::saveProperties( KConfig* )
149{ 132{
150} 133}
151 134
152void KAddressBookMain::readProperties( KConfig* ) 135void KAddressBookMain::readProperties( KConfig* )
153{ 136{
154} 137}
155 138
156void KAddressBookMain::initActions() 139void KAddressBookMain::initActions()
157{ 140{
158#ifndef KAB_EMBEDDED 141#ifndef KAB_EMBEDDED
159 KStdAction::quit( this, SLOT( close() ), actionCollection() ); 142 KStdAction::quit( this, SLOT( close() ), actionCollection() );
160 KStdAction::configureToolbars( this, SLOT( configureToolbars() ), actionCollection() ); 143 KStdAction::configureToolbars( this, SLOT( configureToolbars() ), actionCollection() );
161#else //KAB_EMBEDDED 144#else //KAB_EMBEDDED
162 //US: transfered the setup of the actions into KABCore 145 //US: transfered the setup of the actions into KABCore
163#endif //KAB_EMBEDDED 146#endif //KAB_EMBEDDED
164 147
165 148
166} 149}
167 150
168//US new method to setup menues and toolbars on embedded systems 151//US new method to setup menues and toolbars on embedded systems
169#ifdef KAB_EMBEDDED 152#ifdef KAB_EMBEDDED
170/* 153/*
171QToolBar * KAddressBookMain::getIconToolBar() 154QToolBar * KAddressBookMain::getIconToolBar()
172{ 155{
173 return iconToolBar; 156 return iconToolBar;
174} 157}
175*/ 158*/
176 159
diff --git a/kaddressbook/kaddressbookmain.h b/kaddressbook/kaddressbookmain.h
index 81ae09c..cf6f899 100644
--- a/kaddressbook/kaddressbookmain.h
+++ b/kaddressbook/kaddressbookmain.h
@@ -9,118 +9,114 @@
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 KADDRESSBOOKMAIN_H 24#ifndef KADDRESSBOOKMAIN_H
25#define KADDRESSBOOKMAIN_H 25#define KADDRESSBOOKMAIN_H
26 26
27#include <qptrlist.h> 27#include <qptrlist.h>
28 28
29#ifdef KAB_EMBEDDED 29#ifdef KAB_EMBEDDED
30class QToolBar; 30class QToolBar;
31#include <qaction.h> 31#include <qaction.h>
32//#include <qmainwindow.h> 32//#include <qmainwindow.h>
33#include <kmainwindow.h> 33#include <kmainwindow.h>
34#else //KAB_EMBEDDED 34#else //KAB_EMBEDDED
35#include <kaction.h> 35#include <kaction.h>
36#include <kapplication.h> 36#include <kapplication.h>
37#include <kmainwindow.h> 37#include <kmainwindow.h>
38#include "kaddressbookiface.h" 38#include "kaddressbookiface.h"
39#endif //KAB_EMBEDDED 39#endif //KAB_EMBEDDED
40 40
41class KABCore; 41class KABCore;
42class KConfig; 42class KConfig;
43 43
44/** 44/**
45 This class serves as the main window for KAddressBook. It handles the 45 This class serves as the main window for KAddressBook. It handles the
46 menus, toolbars, and status bars. 46 menus, toolbars, and status bars.
47 47
48 @short Main window class 48 @short Main window class
49 @author Don Sanders <dsanders@kde.org> 49 @author Don Sanders <dsanders@kde.org>
50 @version 0.1 50 @version 0.1
51 */ 51 */
52#ifdef KAB_EMBEDDED 52#ifdef KAB_EMBEDDED
53class KAddressBookMain : public KMainWindow 53class KAddressBookMain : public KMainWindow
54#else //KAB_EMBEDDED 54#else //KAB_EMBEDDED
55//MOC_SKIP_BEGIN 55//MOC_SKIP_BEGIN
56class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface 56class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface
57//MOC_SKIP_END 57//MOC_SKIP_END
58#endif //KAB_EMBEDDED 58#endif //KAB_EMBEDDED
59{ 59{
60 Q_OBJECT 60 Q_OBJECT
61 61
62 public: 62 public:
63 KAddressBookMain(); 63 KAddressBookMain();
64 virtual ~KAddressBookMain(); 64 virtual ~KAddressBookMain();
65 65
66#ifdef KAB_EMBEDDED 66#ifdef KAB_EMBEDDED
67// QPEToolBar * getIconToolBar(); 67// QPEToolBar * getIconToolBar();
68 // QToolBar * getIconToolBar(); 68 // QToolBar * getIconToolBar();
69#endif //KAB_EMBEDDED 69#endif //KAB_EMBEDDED
70 70
71 71
72 public slots: 72 public slots:
73#ifndef DESKTOP_VERSION
74 void show();
75#endif
76
77 void showMinimized () ; 73 void showMinimized () ;
78 virtual void addEmail( QString addr ); 74 virtual void addEmail( QString addr );
79#ifndef KAB_EMBEDDED 75#ifndef KAB_EMBEDDED
80//MOC_SKIP_BEGIN 76//MOC_SKIP_BEGIN
81 virtual ASYNC showContactEditor( QString uid ); 77 virtual ASYNC showContactEditor( QString uid );
82//MOC_SKIP_END 78//MOC_SKIP_END
83#endif //KAB_EMBEDDED 79#endif //KAB_EMBEDDED
84 virtual void newContact(); 80 virtual void newContact();
85 virtual QString getNameByPhone( QString phone ); 81 virtual QString getNameByPhone( QString phone );
86 virtual void save(); 82 virtual void save();
87 virtual void exit(); 83 virtual void exit();
88 84
89 protected: 85 protected:
90 void initActions(); 86 void initActions();
91#ifdef KAB_EMBEDDED 87#ifdef KAB_EMBEDDED
92 //US new method to setup menues and toolbars on embedded systems 88 //US new method to setup menues and toolbars on embedded systems
93 void createGUI(); 89 void createGUI();
94#endif //KAB_EMBEDDED 90#endif //KAB_EMBEDDED
95 91
96 /** 92 /**
97 This function is called when it is time for the app to save its 93 This function is called when it is time for the app to save its
98 properties for session management purposes. 94 properties for session management purposes.
99 */ 95 */
100 void saveProperties( KConfig* ); 96 void saveProperties( KConfig* );
101 97
102 /** 98 /**
103 This function is called when this app is restored. The KConfig 99 This function is called when this app is restored. The KConfig
104 object points to the session management config file that was saved 100 object points to the session management config file that was saved
105 with @ref saveProperties 101 with @ref saveProperties
106 */ 102 */
107 void readProperties( KConfig* ); 103 void readProperties( KConfig* );
108 104
109 void closeEvent( QCloseEvent* ce ); 105 void closeEvent( QCloseEvent* ce );
110 106
111 protected slots: 107 protected slots:
112 void configureToolbars(); 108 void configureToolbars();
113 void configureKeys(); 109 void configureKeys();
114 110
115 void slotNewToolbarConfig(); 111 void slotNewToolbarConfig();
116 112
117 private: 113 private:
118 KABCore *mCore; 114 KABCore *mCore;
119 115
120#ifdef KAB_EMBEDDED 116#ifdef KAB_EMBEDDED
121 // QToolBar *iconToolBar; 117 // QToolBar *iconToolBar;
122#endif //KAB_EMBEDDED 118#endif //KAB_EMBEDDED
123 119
124}; 120};
125 121
126#endif 122#endif
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index ffa37a5..3f6f69d 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -7,134 +7,130 @@
7#include <qwindowsstyle.h> 7#include <qwindowsstyle.h>
8#include <qplatinumstyle.h> 8#include <qplatinumstyle.h>
9#include <qmainwindow.h> 9#include <qmainwindow.h>
10#endif 10#endif
11 11
12#include <kstandarddirs.h> 12#include <kstandarddirs.h>
13#include <kglobal.h> 13#include <kglobal.h>
14#include <stdio.h> 14#include <stdio.h>
15#include <qdir.h> 15#include <qdir.h>
16#include "kaddressbookmain.h" 16#include "kaddressbookmain.h"
17 17
18int main( int argc, char **argv ) 18int main( int argc, char **argv )
19{ 19{
20#ifndef DESKTOP_VERSION 20#ifndef DESKTOP_VERSION
21 QPEApplication a( argc, argv ); 21 QPEApplication a( argc, argv );
22 a.setKeepRunning (); 22 a.setKeepRunning ();
23#else 23#else
24 QApplication a( argc, argv ); 24 QApplication a( argc, argv );
25 QApplication::setStyle( new QPlatinumStyle ()); 25 QApplication::setStyle( new QPlatinumStyle ());
26#endif 26#endif
27 27
28 bool exitHelp = false; 28 bool exitHelp = false;
29 if ( argc > 1 ) { 29 if ( argc > 1 ) {
30 QString command = argv[1]; 30 QString command = argv[1];
31 if ( command == "-help" ){ 31 if ( command == "-help" ){
32 printf("KA/E command line commands:\n"); 32 printf("KA/E command line commands:\n");
33 printf(" no command: Start KA/E in usual way\n"); 33 printf(" no command: Start KA/E in usual way\n");
34 printf(" -help: This output\n"); 34 printf(" -help: This output\n");
35 printf(" KA/E is exiting now. Bye!\n"); 35 printf(" KA/E is exiting now. Bye!\n");
36 exitHelp = true; 36 exitHelp = true;
37 } 37 }
38 } 38 }
39 if ( ! exitHelp ) { 39 if ( ! exitHelp ) {
40 40
41 KGlobal::setAppName( "kaddressbook" ); 41 KGlobal::setAppName( "kaddressbook" );
42#ifndef DESKTOP_VERSION 42#ifndef DESKTOP_VERSION
43 KStandardDirs::setAppDir( Global::applicationFileName( "kaddressbook", "" ) ); 43 KStandardDirs::setAppDir( Global::applicationFileName( "kaddressbook", "" ) );
44 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); 44 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
45#else 45#else
46 QString fileName ; 46 QString fileName ;
47#ifndef _WIN32_ 47#ifndef _WIN32_
48 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons16/"; 48 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons16/";
49#else 49#else
50 fileName = qApp->applicationDirPath () + "\\kdepim\\kaddressbook\\icons16\\"; 50 fileName = qApp->applicationDirPath () + "\\kdepim\\kaddressbook\\icons16\\";
51#endif 51#endif
52 KGlobal::iconLoader()->setIconPath(fileName); 52 KGlobal::iconLoader()->setIconPath(fileName);
53 QString appdir = QDir::homeDirPath(); 53 QString appdir = QDir::homeDirPath();
54 if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) 54 if ( appdir.right(1) == "\\" || appdir.right(1) == "/" )
55 appdir += "kaddressbook"; 55 appdir += "kaddressbook";
56 else 56 else
57 appdir += "/kaddressbook"; 57 appdir += "/kaddressbook";
58 KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); 58 KStandardDirs::setAppDir( QDir::convertSeparators( appdir ));
59 // qDebug(" %s ",KStandardDirs::appDir().latin1() ); 59 // qDebug(" %s ",KStandardDirs::appDir().latin1() );
60#endif // desktop 60#endif // desktop
61 QDir app_dir; 61 QDir app_dir;
62 if ( !app_dir.exists(KStandardDirs::appDir()) ) 62 if ( !app_dir.exists(KStandardDirs::appDir()) )
63 app_dir.mkdir (KStandardDirs::appDir()); 63 app_dir.mkdir (KStandardDirs::appDir());
64 64
65 KAddressBookMain* m = new KAddressBookMain(); 65 KAddressBookMain* m = new KAddressBookMain();
66//US MainWindow m; 66//US MainWindow m;
67//US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); 67//US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
68 68
69#ifndef DESKTOP_VERSION 69#ifndef DESKTOP_VERSION
70 a.showMainWidget(m ); 70 a.showMainWidget(m );
71 m->showFullScreen(); 71 m->showMaximized();
72 int min = 20; 72
73 if ( QApplication::desktop()->width() > 320 )
74 min += 20;
75 m->setGeometry( 0,0,QApplication::desktop()->width(), QApplication::desktop()->height() - min );
76
77#else 73#else
78 a.setMainWidget(m ); 74 a.setMainWidget(m );
79 m->show(); 75 m->show();
80 //m->resize( 640, 480 ); 76 //m->resize( 640, 480 );
81#endif 77#endif
82 a.exec(); 78 a.exec();
83 79
84 } 80 }
85 qDebug("KA: Bye! "); 81 qDebug("KA: Bye! ");
86} 82}
87 83
88/* 84/*
89#include <stdlib.h> 85#include <stdlib.h>
90 86
91#include <qstring.h> 87#include <qstring.h>
92 88
93#include <kabc/stdaddressbook.h> 89#include <kabc/stdaddressbook.h>
94#include <kaboutdata.h> 90#include <kaboutdata.h>
95#include <kcmdlineargs.h> 91#include <kcmdlineargs.h>
96#include <kcrash.h> 92#include <kcrash.h>
97#include <kdebug.h> 93#include <kdebug.h>
98#include <klocale.h> 94#include <klocale.h>
99#include <kstartupinfo.h> 95#include <kstartupinfo.h>
100#include <kuniqueapplication.h> 96#include <kuniqueapplication.h>
101#include <kwin.h> 97#include <kwin.h>
102 98
103#include "kaddressbookmain.h" 99#include "kaddressbookmain.h"
104#include "kabcore.h" 100#include "kabcore.h"
105 101
106extern "C" { 102extern "C" {
107 103
108void crashHandler( int ) 104void crashHandler( int )
109{ 105{
110 KABC::StdAddressBook::handleCrash(); 106 KABC::StdAddressBook::handleCrash();
111 ::exit( 0 ); 107 ::exit( 0 );
112} 108}
113 109
114} 110}
115 111
116class KAddressBookApp : public KUniqueApplication { 112class KAddressBookApp : public KUniqueApplication {
117 public: 113 public:
118 KAddressBookApp() : mMainWin( 0 ) {} 114 KAddressBookApp() : mMainWin( 0 ) {}
119 ~KAddressBookApp() {} 115 ~KAddressBookApp() {}
120 116
121 int newInstance(); 117 int newInstance();
122 118
123 private: 119 private:
124 KAddressBookMain *mMainWin; 120 KAddressBookMain *mMainWin;
125}; 121};
126 122
127int KAddressBookApp::newInstance() 123int KAddressBookApp::newInstance()
128{ 124{
129 if ( isRestored() ) { 125 if ( isRestored() ) {
130 // There can only be one main window 126 // There can only be one main window
131 if ( KMainWindow::canBeRestored( 1 ) ) { 127 if ( KMainWindow::canBeRestored( 1 ) ) {
132 mMainWin = new KAddressBookMain; 128 mMainWin = new KAddressBookMain;
133 mMainWin->show(); 129 mMainWin->show();
134 mMainWin->restore( 1 ); 130 mMainWin->restore( 1 );
135 } 131 }
136 } else { 132 } else {
137 KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); 133 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
138 134
139 QCString addrStr = args->getOption( "addr" ); 135 QCString addrStr = args->getOption( "addr" );
140 QCString uidStr = args->getOption( "uid" ); 136 QCString uidStr = args->getOption( "uid" );