summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-08-21 00:37:31 (UTC)
committer zautrix <zautrix>2004-08-21 00:37:31 (UTC)
commitf7bf415be8c727c887ec01c2d8fb8f1c2f85d096 (patch) (unidiff)
tree7ea53cea72a757bb57bef12ea9e20543f2e7dfa9
parentab07441b413dff6d478e2c3a39b823b4269931c5 (diff)
downloadkdepimpi-f7bf415be8c727c887ec01c2d8fb8f1c2f85d096.zip
kdepimpi-f7bf415be8c727c887ec01c2d8fb8f1c2f85d096.tar.gz
kdepimpi-f7bf415be8c727c887ec01c2d8fb8f1c2f85d096.tar.bz2
Some fixes of the icons
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/kaddressbook/icons22/listview.pngbin365 -> 657 bytes
-rw-r--r--kaddressbook/kabcore.cpp4
2 files changed, 3 insertions, 1 deletions
diff --git a/bin/kdepim/kaddressbook/icons22/listview.png b/bin/kdepim/kaddressbook/icons22/listview.png
index b19d9f8..7de6ba0 100644
--- a/bin/kdepim/kaddressbook/icons22/listview.png
+++ b/bin/kdepim/kaddressbook/icons22/listview.png
Binary files differ
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index cb9b992..f0f08f4 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1123,385 +1123,387 @@ void KABCore::undo()
1123 1123
1124 // Refresh the view 1124 // Refresh the view
1125 mViewManager->refreshView(); 1125 mViewManager->refreshView();
1126} 1126}
1127 1127
1128void KABCore::redo() 1128void KABCore::redo()
1129{ 1129{
1130 RedoStack::instance()->redo(); 1130 RedoStack::instance()->redo();
1131 1131
1132 // Refresh the view 1132 // Refresh the view
1133 mViewManager->refreshView(); 1133 mViewManager->refreshView();
1134} 1134}
1135 1135
1136void KABCore::setJumpButtonBarVisible( bool visible ) 1136void KABCore::setJumpButtonBarVisible( bool visible )
1137{ 1137{
1138 if (mMultipleViewsAtOnce) 1138 if (mMultipleViewsAtOnce)
1139 { 1139 {
1140 if ( visible ) 1140 if ( visible )
1141 mJumpButtonBar->show(); 1141 mJumpButtonBar->show();
1142 else 1142 else
1143 mJumpButtonBar->hide(); 1143 mJumpButtonBar->hide();
1144 } 1144 }
1145 else 1145 else
1146 { 1146 {
1147 // show the jumpbar only if "the details are hidden" == "viewmanager are shown" 1147 // show the jumpbar only if "the details are hidden" == "viewmanager are shown"
1148 if (mViewManager->isVisible()) 1148 if (mViewManager->isVisible())
1149 { 1149 {
1150 if ( visible ) 1150 if ( visible )
1151 mJumpButtonBar->show(); 1151 mJumpButtonBar->show();
1152 else 1152 else
1153 mJumpButtonBar->hide(); 1153 mJumpButtonBar->hide();
1154 } 1154 }
1155 else 1155 else
1156 { 1156 {
1157 mJumpButtonBar->hide(); 1157 mJumpButtonBar->hide();
1158 } 1158 }
1159 } 1159 }
1160} 1160}
1161 1161
1162 1162
1163void KABCore::setDetailsToState() 1163void KABCore::setDetailsToState()
1164{ 1164{
1165 setDetailsVisible( mActionDetails->isChecked() ); 1165 setDetailsVisible( mActionDetails->isChecked() );
1166} 1166}
1167 1167
1168 1168
1169 1169
1170void KABCore::setDetailsVisible( bool visible ) 1170void KABCore::setDetailsVisible( bool visible )
1171{ 1171{
1172 if (visible && mDetails->isHidden()) 1172 if (visible && mDetails->isHidden())
1173 { 1173 {
1174 KABC::Addressee::List addrList = mViewManager->selectedAddressees(); 1174 KABC::Addressee::List addrList = mViewManager->selectedAddressees();
1175 if ( addrList.count() > 0 ) 1175 if ( addrList.count() > 0 )
1176 mDetails->setAddressee( addrList[ 0 ] ); 1176 mDetails->setAddressee( addrList[ 0 ] );
1177 } 1177 }
1178 1178
1179 // mMultipleViewsAtOnce=false: mDetails is always visible. But we switch between 1179 // mMultipleViewsAtOnce=false: mDetails is always visible. But we switch between
1180 // the listview and the detailview. We do that by changing the splitbar size. 1180 // the listview and the detailview. We do that by changing the splitbar size.
1181 if (mMultipleViewsAtOnce) 1181 if (mMultipleViewsAtOnce)
1182 { 1182 {
1183 if ( visible ) 1183 if ( visible )
1184 mDetails->show(); 1184 mDetails->show();
1185 else 1185 else
1186 mDetails->hide(); 1186 mDetails->hide();
1187 } 1187 }
1188 else 1188 else
1189 { 1189 {
1190 if ( visible ) { 1190 if ( visible ) {
1191 mViewManager->hide(); 1191 mViewManager->hide();
1192 mDetails->show(); 1192 mDetails->show();
1193 } 1193 }
1194 else { 1194 else {
1195 mViewManager->show(); 1195 mViewManager->show();
1196 mDetails->hide(); 1196 mDetails->hide();
1197 } 1197 }
1198 setJumpButtonBarVisible( !visible ); 1198 setJumpButtonBarVisible( !visible );
1199 } 1199 }
1200 1200
1201} 1201}
1202 1202
1203void KABCore::extensionChanged( int id ) 1203void KABCore::extensionChanged( int id )
1204{ 1204{
1205 //change the details view only for non desktop systems 1205 //change the details view only for non desktop systems
1206#ifndef DESKTOP_VERSION 1206#ifndef DESKTOP_VERSION
1207 1207
1208 if (id == 0) 1208 if (id == 0)
1209 { 1209 {
1210 //the user disabled the extension. 1210 //the user disabled the extension.
1211 1211
1212 if (mMultipleViewsAtOnce) 1212 if (mMultipleViewsAtOnce)
1213 { // enable detailsview again 1213 { // enable detailsview again
1214 setDetailsVisible( true ); 1214 setDetailsVisible( true );
1215 mActionDetails->setChecked( true ); 1215 mActionDetails->setChecked( true );
1216 } 1216 }
1217 else 1217 else
1218 { //go back to the listview 1218 { //go back to the listview
1219 setDetailsVisible( false ); 1219 setDetailsVisible( false );
1220 mActionDetails->setChecked( false ); 1220 mActionDetails->setChecked( false );
1221 mActionDetails->setEnabled(true); 1221 mActionDetails->setEnabled(true);
1222 } 1222 }
1223 1223
1224 } 1224 }
1225 else 1225 else
1226 { 1226 {
1227 //the user enabled the extension. 1227 //the user enabled the extension.
1228 setDetailsVisible( false ); 1228 setDetailsVisible( false );
1229 mActionDetails->setChecked( false ); 1229 mActionDetails->setChecked( false );
1230 1230
1231 if (!mMultipleViewsAtOnce) 1231 if (!mMultipleViewsAtOnce)
1232 { 1232 {
1233 mActionDetails->setEnabled(false); 1233 mActionDetails->setEnabled(false);
1234 } 1234 }
1235 1235
1236 mExtensionManager->setSelectionChanged(); 1236 mExtensionManager->setSelectionChanged();
1237 1237
1238 } 1238 }
1239 1239
1240#endif// DESKTOP_VERSION 1240#endif// DESKTOP_VERSION
1241 1241
1242} 1242}
1243 1243
1244 1244
1245void KABCore::extensionModified( const KABC::Addressee::List &list ) 1245void KABCore::extensionModified( const KABC::Addressee::List &list )
1246{ 1246{
1247 1247
1248 if ( list.count() != 0 ) { 1248 if ( list.count() != 0 ) {
1249 KABC::Addressee::List::ConstIterator it; 1249 KABC::Addressee::List::ConstIterator it;
1250 for ( it = list.begin(); it != list.end(); ++it ) 1250 for ( it = list.begin(); it != list.end(); ++it )
1251 mAddressBook->insertAddressee( *it ); 1251 mAddressBook->insertAddressee( *it );
1252 if ( list.count() > 1 ) 1252 if ( list.count() > 1 )
1253 setModified(); 1253 setModified();
1254 else 1254 else
1255 setModifiedWOrefresh(); 1255 setModifiedWOrefresh();
1256 } 1256 }
1257 if ( list.count() == 0 ) 1257 if ( list.count() == 0 )
1258 mViewManager->refreshView(); 1258 mViewManager->refreshView();
1259 else 1259 else
1260 mViewManager->refreshView( list[ 0 ].uid() ); 1260 mViewManager->refreshView( list[ 0 ].uid() );
1261 1261
1262 1262
1263 1263
1264} 1264}
1265 1265
1266QString KABCore::getNameByPhone( const QString &phone ) 1266QString KABCore::getNameByPhone( const QString &phone )
1267{ 1267{
1268#ifndef KAB_EMBEDDED 1268#ifndef KAB_EMBEDDED
1269 QRegExp r( "[/*/-/ ]" ); 1269 QRegExp r( "[/*/-/ ]" );
1270 QString localPhone( phone ); 1270 QString localPhone( phone );
1271 1271
1272 bool found = false; 1272 bool found = false;
1273 QString ownerName = ""; 1273 QString ownerName = "";
1274 KABC::AddressBook::Iterator iter; 1274 KABC::AddressBook::Iterator iter;
1275 KABC::PhoneNumber::List::Iterator phoneIter; 1275 KABC::PhoneNumber::List::Iterator phoneIter;
1276 KABC::PhoneNumber::List phoneList; 1276 KABC::PhoneNumber::List phoneList;
1277 for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) { 1277 for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) {
1278 phoneList = (*iter).phoneNumbers(); 1278 phoneList = (*iter).phoneNumbers();
1279 for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() ); 1279 for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() );
1280 ++phoneIter) { 1280 ++phoneIter) {
1281 // Get rid of separator chars so just the numbers are compared. 1281 // Get rid of separator chars so just the numbers are compared.
1282 if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { 1282 if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) {
1283 ownerName = (*iter).formattedName(); 1283 ownerName = (*iter).formattedName();
1284 found = true; 1284 found = true;
1285 } 1285 }
1286 } 1286 }
1287 } 1287 }
1288 1288
1289 return ownerName; 1289 return ownerName;
1290#else //KAB_EMBEDDED 1290#else //KAB_EMBEDDED
1291 qDebug("KABCore::getNameByPhone finsih method"); 1291 qDebug("KABCore::getNameByPhone finsih method");
1292 return ""; 1292 return "";
1293#endif //KAB_EMBEDDED 1293#endif //KAB_EMBEDDED
1294 1294
1295} 1295}
1296 1296
1297void KABCore::openConfigDialog() 1297void KABCore::openConfigDialog()
1298{ 1298{
1299 KABPrefs* kab_prefs = KABPrefs::instance(); 1299 KABPrefs* kab_prefs = KABPrefs::instance();
1300 KPimGlobalPrefs* kpim_prefs = KPimGlobalPrefs::instance(); 1300 KPimGlobalPrefs* kpim_prefs = KPimGlobalPrefs::instance();
1301 1301
1302 KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); 1302 KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true );
1303 KCMKabConfig* kabcfg = new KCMKabConfig( kab_prefs, ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); 1303 KCMKabConfig* kabcfg = new KCMKabConfig( kab_prefs, ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" );
1304 ConfigureDialog->addModule(kabcfg ); 1304 ConfigureDialog->addModule(kabcfg );
1305 KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( kpim_prefs, ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); 1305 KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( kpim_prefs, ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" );
1306 ConfigureDialog->addModule(kdelibcfg ); 1306 ConfigureDialog->addModule(kdelibcfg );
1307 1307
1308 1308
1309 1309
1310 connect( ConfigureDialog, SIGNAL( applyClicked() ), 1310 connect( ConfigureDialog, SIGNAL( applyClicked() ),
1311 this, SLOT( configurationChanged() ) ); 1311 this, SLOT( configurationChanged() ) );
1312 connect( ConfigureDialog, SIGNAL( okClicked() ), 1312 connect( ConfigureDialog, SIGNAL( okClicked() ),
1313 this, SLOT( configurationChanged() ) ); 1313 this, SLOT( configurationChanged() ) );
1314 saveSettings(); 1314 saveSettings();
1315#ifndef DESKTOP_VERSION
1315 ConfigureDialog->showMaximized(); 1316 ConfigureDialog->showMaximized();
1317#endif
1316 if ( ConfigureDialog->exec() ) 1318 if ( ConfigureDialog->exec() )
1317 KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); 1319 KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") );
1318 delete ConfigureDialog; 1320 delete ConfigureDialog;
1319} 1321}
1320 1322
1321void KABCore::openLDAPDialog() 1323void KABCore::openLDAPDialog()
1322{ 1324{
1323#ifndef KAB_EMBEDDED 1325#ifndef KAB_EMBEDDED
1324 if ( !mLdapSearchDialog ) { 1326 if ( !mLdapSearchDialog ) {
1325 mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); 1327 mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this );
1326 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, 1328 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager,
1327 SLOT( refreshView() ) ); 1329 SLOT( refreshView() ) );
1328 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, 1330 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this,
1329 SLOT( setModified() ) ); 1331 SLOT( setModified() ) );
1330 } else 1332 } else
1331 mLdapSearchDialog->restoreSettings(); 1333 mLdapSearchDialog->restoreSettings();
1332 1334
1333 if ( mLdapSearchDialog->isOK() ) 1335 if ( mLdapSearchDialog->isOK() )
1334 mLdapSearchDialog->exec(); 1336 mLdapSearchDialog->exec();
1335#else //KAB_EMBEDDED 1337#else //KAB_EMBEDDED
1336 qDebug("KABCore::openLDAPDialog() finsih method"); 1338 qDebug("KABCore::openLDAPDialog() finsih method");
1337#endif //KAB_EMBEDDED 1339#endif //KAB_EMBEDDED
1338} 1340}
1339 1341
1340void KABCore::print() 1342void KABCore::print()
1341{ 1343{
1342#ifndef KAB_EMBEDDED 1344#ifndef KAB_EMBEDDED
1343 KPrinter printer; 1345 KPrinter printer;
1344 if ( !printer.setup( this ) ) 1346 if ( !printer.setup( this ) )
1345 return; 1347 return;
1346 1348
1347 KABPrinting::PrintingWizard wizard( &printer, mAddressBook, 1349 KABPrinting::PrintingWizard wizard( &printer, mAddressBook,
1348 mViewManager->selectedUids(), this ); 1350 mViewManager->selectedUids(), this );
1349 1351
1350 wizard.exec(); 1352 wizard.exec();
1351#else //KAB_EMBEDDED 1353#else //KAB_EMBEDDED
1352 qDebug("KABCore::print() finsih method"); 1354 qDebug("KABCore::print() finsih method");
1353#endif //KAB_EMBEDDED 1355#endif //KAB_EMBEDDED
1354 1356
1355} 1357}
1356 1358
1357 1359
1358void KABCore::addGUIClient( KXMLGUIClient *client ) 1360void KABCore::addGUIClient( KXMLGUIClient *client )
1359{ 1361{
1360 if ( mGUIClient ) 1362 if ( mGUIClient )
1361 mGUIClient->insertChildClient( client ); 1363 mGUIClient->insertChildClient( client );
1362 else 1364 else
1363 KMessageBox::error( this, "no KXMLGUICLient"); 1365 KMessageBox::error( this, "no KXMLGUICLient");
1364} 1366}
1365 1367
1366 1368
1367void KABCore::configurationChanged() 1369void KABCore::configurationChanged()
1368{ 1370{
1369 mExtensionManager->reconfigure(); 1371 mExtensionManager->reconfigure();
1370} 1372}
1371 1373
1372void KABCore::addressBookChanged() 1374void KABCore::addressBookChanged()
1373{ 1375{
1374/*US 1376/*US
1375 QDictIterator<AddresseeEditorDialog> it( mEditorDict ); 1377 QDictIterator<AddresseeEditorDialog> it( mEditorDict );
1376 while ( it.current() ) { 1378 while ( it.current() ) {
1377 if ( it.current()->dirty() ) { 1379 if ( it.current()->dirty() ) {
1378 QString text = i18n( "Data has been changed externally. Unsaved " 1380 QString text = i18n( "Data has been changed externally. Unsaved "
1379 "changes will be lost." ); 1381 "changes will be lost." );
1380 KMessageBox::information( this, text ); 1382 KMessageBox::information( this, text );
1381 } 1383 }
1382 it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); 1384 it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) );
1383 ++it; 1385 ++it;
1384 } 1386 }
1385*/ 1387*/
1386 if (mEditorDialog) 1388 if (mEditorDialog)
1387 { 1389 {
1388 if (mEditorDialog->dirty()) 1390 if (mEditorDialog->dirty())
1389 { 1391 {
1390 QString text = i18n( "Data has been changed externally. Unsaved " 1392 QString text = i18n( "Data has been changed externally. Unsaved "
1391 "changes will be lost." ); 1393 "changes will be lost." );
1392 KMessageBox::information( this, text ); 1394 KMessageBox::information( this, text );
1393 } 1395 }
1394 QString currentuid = mEditorDialog->addressee().uid(); 1396 QString currentuid = mEditorDialog->addressee().uid();
1395 mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); 1397 mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) );
1396 } 1398 }
1397 mViewManager->refreshView(); 1399 mViewManager->refreshView();
1398// mDetails->refreshView(); 1400// mDetails->refreshView();
1399 1401
1400 1402
1401} 1403}
1402 1404
1403AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, 1405AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
1404 const char *name ) 1406 const char *name )
1405{ 1407{
1406 1408
1407 if ( mEditorDialog == 0 ) { 1409 if ( mEditorDialog == 0 ) {
1408 mEditorDialog = new AddresseeEditorDialog( this, parent, 1410 mEditorDialog = new AddresseeEditorDialog( this, parent,
1409 name ? name : "editorDialog" ); 1411 name ? name : "editorDialog" );
1410 1412
1411 1413
1412 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ), 1414 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ),
1413 SLOT( contactModified( const KABC::Addressee& ) ) ); 1415 SLOT( contactModified( const KABC::Addressee& ) ) );
1414 //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), 1416 //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ),
1415 // SLOT( slotEditorDestroyed( const QString& ) ) ); 1417 // SLOT( slotEditorDestroyed( const QString& ) ) );
1416 } 1418 }
1417 1419
1418 return mEditorDialog; 1420 return mEditorDialog;
1419} 1421}
1420 1422
1421void KABCore::slotEditorDestroyed( const QString &uid ) 1423void KABCore::slotEditorDestroyed( const QString &uid )
1422{ 1424{
1423 //mEditorDict.remove( uid ); 1425 //mEditorDict.remove( uid );
1424} 1426}
1425 1427
1426void KABCore::initGUI() 1428void KABCore::initGUI()
1427{ 1429{
1428#ifndef KAB_EMBEDDED 1430#ifndef KAB_EMBEDDED
1429 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1431 QHBoxLayout *topLayout = new QHBoxLayout( this );
1430 topLayout->setSpacing( KDialogBase::spacingHint() ); 1432 topLayout->setSpacing( KDialogBase::spacingHint() );
1431 1433
1432 mExtensionBarSplitter = new QSplitter( this ); 1434 mExtensionBarSplitter = new QSplitter( this );
1433 mExtensionBarSplitter->setOrientation( Qt::Vertical ); 1435 mExtensionBarSplitter->setOrientation( Qt::Vertical );
1434 1436
1435 mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); 1437 mDetailsSplitter = new QSplitter( mExtensionBarSplitter );
1436 1438
1437 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1439 QVBox *viewSpace = new QVBox( mDetailsSplitter );
1438 mIncSearchWidget = new IncSearchWidget( viewSpace ); 1440 mIncSearchWidget = new IncSearchWidget( viewSpace );
1439 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1441 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1440 SLOT( incrementalSearch( const QString& ) ) ); 1442 SLOT( incrementalSearch( const QString& ) ) );
1441 1443
1442 mViewManager = new ViewManager( this, viewSpace ); 1444 mViewManager = new ViewManager( this, viewSpace );
1443 viewSpace->setStretchFactor( mViewManager, 1 ); 1445 viewSpace->setStretchFactor( mViewManager, 1 );
1444 1446
1445 mDetails = new ViewContainer( mDetailsSplitter ); 1447 mDetails = new ViewContainer( mDetailsSplitter );
1446 1448
1447 mJumpButtonBar = new JumpButtonBar( this, this ); 1449 mJumpButtonBar = new JumpButtonBar( this, this );
1448 1450
1449 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1451 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1450 1452
1451 topLayout->addWidget( mExtensionBarSplitter ); 1453 topLayout->addWidget( mExtensionBarSplitter );
1452 topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); 1454 topLayout->setStretchFactor( mExtensionBarSplitter, 100 );
1453 topLayout->addWidget( mJumpButtonBar ); 1455 topLayout->addWidget( mJumpButtonBar );
1454 topLayout->setStretchFactor( mJumpButtonBar, 1 ); 1456 topLayout->setStretchFactor( mJumpButtonBar, 1 );
1455 1457
1456 mXXPortManager = new XXPortManager( this, this ); 1458 mXXPortManager = new XXPortManager( this, this );
1457 1459
1458#else //KAB_EMBEDDED 1460#else //KAB_EMBEDDED
1459 //US initialize viewMenu before settingup viewmanager. 1461 //US initialize viewMenu before settingup viewmanager.
1460 // Viewmanager needs this menu to plugin submenues. 1462 // Viewmanager needs this menu to plugin submenues.
1461 viewMenu = new QPopupMenu( this ); 1463 viewMenu = new QPopupMenu( this );
1462 settingsMenu = new QPopupMenu( this ); 1464 settingsMenu = new QPopupMenu( this );
1463 //filterMenu = new QPopupMenu( this ); 1465 //filterMenu = new QPopupMenu( this );
1464 ImportMenu = new QPopupMenu( this ); 1466 ImportMenu = new QPopupMenu( this );
1465 ExportMenu = new QPopupMenu( this ); 1467 ExportMenu = new QPopupMenu( this );
1466 1468
1467 changeMenu= new QPopupMenu( this ); 1469 changeMenu= new QPopupMenu( this );
1468 1470
1469//US since we have no splitter for the embedded system, setup 1471//US since we have no splitter for the embedded system, setup
1470// a layout with two frames. One left and one right. 1472// a layout with two frames. One left and one right.
1471 1473
1472 QBoxLayout *topLayout; 1474 QBoxLayout *topLayout;
1473 1475
1474 // = new QHBoxLayout( this ); 1476 // = new QHBoxLayout( this );
1475// QBoxLayout *topLayout = (QBoxLayout*)layout(); 1477// QBoxLayout *topLayout = (QBoxLayout*)layout();
1476 1478
1477// QWidget *mainBox = new QWidget( this ); 1479// QWidget *mainBox = new QWidget( this );
1478// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); 1480// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox);
1479 1481
1480#ifdef DESKTOP_VERSION 1482#ifdef DESKTOP_VERSION
1481 topLayout = new QHBoxLayout( this ); 1483 topLayout = new QHBoxLayout( this );
1482 1484
1483 1485
1484 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1486 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1485 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1487 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1486 1488
1487 topLayout->addWidget(mMiniSplitter ); 1489 topLayout->addWidget(mMiniSplitter );
1488 1490
1489 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); 1491 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter );
1490 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1492 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1491 mViewManager = new ViewManager( this, mExtensionBarSplitter ); 1493 mViewManager = new ViewManager( this, mExtensionBarSplitter );
1492 mDetails = new ViewContainer( mMiniSplitter ); 1494 mDetails = new ViewContainer( mMiniSplitter );
1493 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1495 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1494#else 1496#else
1495 if ( QApplication::desktop()->width() > 480 ) { 1497 if ( QApplication::desktop()->width() > 480 ) {
1496 topLayout = new QHBoxLayout( this ); 1498 topLayout = new QHBoxLayout( this );
1497 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1499 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1498 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1500 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1499 } else { 1501 } else {
1500 1502
1501 topLayout = new QHBoxLayout( this ); 1503 topLayout = new QHBoxLayout( this );
1502 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); 1504 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this);
1503 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1505 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1504 } 1506 }
1505 1507
1506 topLayout->addWidget(mMiniSplitter ); 1508 topLayout->addWidget(mMiniSplitter );
1507 mViewManager = new ViewManager( this, mMiniSplitter ); 1509 mViewManager = new ViewManager( this, mMiniSplitter );
@@ -1681,385 +1683,385 @@ void KABCore::initActions()
1681// you do that through the control center !!! 1683// you do that through the control center !!!
1682 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, 1684 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this,
1683 SLOT( configureResources() ), actionCollection(), 1685 SLOT( configureResources() ), actionCollection(),
1684 "kaddressbook_configure_resources" ); 1686 "kaddressbook_configure_resources" );
1685#endif //KAB_EMBEDDED 1687#endif //KAB_EMBEDDED
1686 1688
1687 if ( mIsPart ) { 1689 if ( mIsPart ) {
1688 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, 1690 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this,
1689 SLOT( openConfigDialog() ), actionCollection(), 1691 SLOT( openConfigDialog() ), actionCollection(),
1690 "kaddressbook_configure" ); 1692 "kaddressbook_configure" );
1691 1693
1692 mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, 1694 mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0,
1693 this, SLOT( configureKeyBindings() ), actionCollection(), 1695 this, SLOT( configureKeyBindings() ), actionCollection(),
1694 "kaddressbook_configure_shortcuts" ); 1696 "kaddressbook_configure_shortcuts" );
1695#ifdef KAB_EMBEDDED 1697#ifdef KAB_EMBEDDED
1696 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); 1698 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() );
1697 mActionConfigureToolbars->setEnabled( false ); 1699 mActionConfigureToolbars->setEnabled( false );
1698#endif //KAB_EMBEDDED 1700#endif //KAB_EMBEDDED
1699 1701
1700 } else { 1702 } else {
1701 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); 1703 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() );
1702 1704
1703 mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); 1705 mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() );
1704 } 1706 }
1705 1707
1706 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, 1708 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0,
1707 actionCollection(), "options_show_jump_bar" ); 1709 actionCollection(), "options_show_jump_bar" );
1708 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); 1710 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) );
1709 1711
1710 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, 1712 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0,
1711 actionCollection(), "options_show_details" ); 1713 actionCollection(), "options_show_details" );
1712 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); 1714 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) );
1713 1715
1714 // misc 1716 // misc
1715 // only enable LDAP lookup if we can handle the protocol 1717 // only enable LDAP lookup if we can handle the protocol
1716#ifndef KAB_EMBEDDED 1718#ifndef KAB_EMBEDDED
1717 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { 1719 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) {
1718 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, 1720 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0,
1719 this, SLOT( openLDAPDialog() ), actionCollection(), 1721 this, SLOT( openLDAPDialog() ), actionCollection(),
1720 "ldap_lookup" ); 1722 "ldap_lookup" );
1721 } 1723 }
1722#else //KAB_EMBEDDED 1724#else //KAB_EMBEDDED
1723 //qDebug("KABCore::initActions() LDAP has to be implemented"); 1725 //qDebug("KABCore::initActions() LDAP has to be implemented");
1724#endif //KAB_EMBEDDED 1726#endif //KAB_EMBEDDED
1725 1727
1726 1728
1727 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, 1729 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this,
1728 SLOT( setWhoAmI() ), actionCollection(), 1730 SLOT( setWhoAmI() ), actionCollection(),
1729 "set_personal" ); 1731 "set_personal" );
1730 1732
1731 1733
1732 1734
1733 1735
1734 mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, 1736 mActionCategories = new KAction( i18n( "Set Categories" ), 0, this,
1735 SLOT( setCategories() ), actionCollection(), 1737 SLOT( setCategories() ), actionCollection(),
1736 "edit_set_categories" ); 1738 "edit_set_categories" );
1737 1739
1738 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, 1740 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this,
1739 SLOT( removeVoice() ), actionCollection(), 1741 SLOT( removeVoice() ), actionCollection(),
1740 "remove_voice" ); 1742 "remove_voice" );
1741 mActionImportOL = new KAction( i18n( "Import from OL..." ), 0, this, 1743 mActionImportOL = new KAction( i18n( "Import from OL..." ), 0, this,
1742 SLOT( importFromOL() ), actionCollection(), 1744 SLOT( importFromOL() ), actionCollection(),
1743 "import_OL" ); 1745 "import_OL" );
1744#ifdef KAB_EMBEDDED 1746#ifdef KAB_EMBEDDED
1745 mActionLicence = new KAction( i18n( "Licence" ), 0, 1747 mActionLicence = new KAction( i18n( "Licence" ), 0,
1746 this, SLOT( showLicence() ), actionCollection(), 1748 this, SLOT( showLicence() ), actionCollection(),
1747 "licence_about_data" ); 1749 "licence_about_data" );
1748 mActionFaq = new KAction( i18n( "Faq" ), 0, 1750 mActionFaq = new KAction( i18n( "Faq" ), 0,
1749 this, SLOT( faq() ), actionCollection(), 1751 this, SLOT( faq() ), actionCollection(),
1750 "faq_about_data" ); 1752 "faq_about_data" );
1751 1753
1752 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, 1754 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0,
1753 this, SLOT( createAboutData() ), actionCollection(), 1755 this, SLOT( createAboutData() ), actionCollection(),
1754 "kaddressbook_about_data" ); 1756 "kaddressbook_about_data" );
1755#endif //KAB_EMBEDDED 1757#endif //KAB_EMBEDDED
1756 1758
1757 clipboardDataChanged(); 1759 clipboardDataChanged();
1758 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 1760 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
1759 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 1761 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
1760} 1762}
1761 1763
1762//US we need this function, to plug all actions into the correct menues. 1764//US we need this function, to plug all actions into the correct menues.
1763// KDE uses a XML format to plug the actions, but we work her without this overhead. 1765// KDE uses a XML format to plug the actions, but we work her without this overhead.
1764void KABCore::addActionsManually() 1766void KABCore::addActionsManually()
1765{ 1767{
1766//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 1768//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
1767 1769
1768#ifdef KAB_EMBEDDED 1770#ifdef KAB_EMBEDDED
1769 QPopupMenu *fileMenu = new QPopupMenu( this ); 1771 QPopupMenu *fileMenu = new QPopupMenu( this );
1770 QPopupMenu *editMenu = new QPopupMenu( this ); 1772 QPopupMenu *editMenu = new QPopupMenu( this );
1771 QPopupMenu *helpMenu = new QPopupMenu( this ); 1773 QPopupMenu *helpMenu = new QPopupMenu( this );
1772 1774
1773 KToolBar* tb = mMainWindow->toolBar(); 1775 KToolBar* tb = mMainWindow->toolBar();
1774 1776
1775#ifdef DESKTOP_VERSION 1777#ifdef DESKTOP_VERSION
1776 QMenuBar* mb = mMainWindow->menuBar(); 1778 QMenuBar* mb = mMainWindow->menuBar();
1777 1779
1778 //US setup menubar. 1780 //US setup menubar.
1779 //Disable the following block if you do not want to have a menubar. 1781 //Disable the following block if you do not want to have a menubar.
1780 mb->insertItem( "&File", fileMenu ); 1782 mb->insertItem( "&File", fileMenu );
1781 mb->insertItem( "&Edit", editMenu ); 1783 mb->insertItem( "&Edit", editMenu );
1782 mb->insertItem( "&View", viewMenu ); 1784 mb->insertItem( "&View", viewMenu );
1783 mb->insertItem( "&Settings", settingsMenu ); 1785 mb->insertItem( "&Settings", settingsMenu );
1784 mb->insertItem( "&Change selected", changeMenu ); 1786 mb->insertItem( "&Change selected", changeMenu );
1785 mb->insertItem( "&Help", helpMenu ); 1787 mb->insertItem( "&Help", helpMenu );
1786 mIncSearchWidget = new IncSearchWidget( tb ); 1788 mIncSearchWidget = new IncSearchWidget( tb );
1787 // tb->insertWidget(-1, 0, mIncSearchWidget); 1789 // tb->insertWidget(-1, 0, mIncSearchWidget);
1788 1790
1789#else 1791#else
1790 //US setup toolbar 1792 //US setup toolbar
1791 QMenuBar *menuBarTB = new QMenuBar( tb ); 1793 QMenuBar *menuBarTB = new QMenuBar( tb );
1792 QPopupMenu *popupBarTB = new QPopupMenu( this ); 1794 QPopupMenu *popupBarTB = new QPopupMenu( this );
1793 menuBarTB->insertItem( "ME", popupBarTB); 1795 menuBarTB->insertItem( "ME", popupBarTB);
1794 tb->insertWidget(-1, 0, menuBarTB); 1796 tb->insertWidget(-1, 0, menuBarTB);
1795 mIncSearchWidget = new IncSearchWidget( tb ); 1797 mIncSearchWidget = new IncSearchWidget( tb );
1796 1798
1797 tb->enableMoving(false); 1799 tb->enableMoving(false);
1798 popupBarTB->insertItem( "&File", fileMenu ); 1800 popupBarTB->insertItem( "&File", fileMenu );
1799 popupBarTB->insertItem( "&Edit", editMenu ); 1801 popupBarTB->insertItem( "&Edit", editMenu );
1800 popupBarTB->insertItem( "&View", viewMenu ); 1802 popupBarTB->insertItem( "&View", viewMenu );
1801 popupBarTB->insertItem( "&Settings", settingsMenu ); 1803 popupBarTB->insertItem( "&Settings", settingsMenu );
1802 mViewManager->getFilterAction()->plug ( popupBarTB); 1804 mViewManager->getFilterAction()->plug ( popupBarTB);
1803 popupBarTB->insertItem( "&Change selected", changeMenu ); 1805 popupBarTB->insertItem( "&Change selected", changeMenu );
1804 popupBarTB->insertItem( "&Help", helpMenu ); 1806 popupBarTB->insertItem( "&Help", helpMenu );
1805 if (QApplication::desktop()->width() > 320 ) { 1807 if (QApplication::desktop()->width() > 320 ) {
1806 // mViewManager->getFilterAction()->plug ( tb); 1808 // mViewManager->getFilterAction()->plug ( tb);
1807 } 1809 }
1808#endif 1810#endif
1809 // mActionQuit->plug ( mMainWindow->toolBar()); 1811 // mActionQuit->plug ( mMainWindow->toolBar());
1810 1812
1811 1813
1812 1814
1813 //US Now connect the actions with the menue entries. 1815 //US Now connect the actions with the menue entries.
1814 mActionPrint->plug( fileMenu ); 1816 mActionPrint->plug( fileMenu );
1815 mActionMail->plug( fileMenu ); 1817 mActionMail->plug( fileMenu );
1816 fileMenu->insertSeparator(); 1818 fileMenu->insertSeparator();
1817 1819
1818 mActionNewContact->plug( fileMenu ); 1820 mActionNewContact->plug( fileMenu );
1819 mActionNewContact->plug( tb ); 1821 mActionNewContact->plug( tb );
1820 1822
1821 mActionEditAddressee->plug( fileMenu ); 1823 mActionEditAddressee->plug( fileMenu );
1822 if ((KGlobal::getDesktopSize() > KGlobal::Small ) || 1824 if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
1823 (!KABPrefs::instance()->mMultipleViewsAtOnce )) 1825 (!KABPrefs::instance()->mMultipleViewsAtOnce ))
1824 mActionEditAddressee->plug( tb ); 1826 mActionEditAddressee->plug( tb );
1825 1827
1826 fileMenu->insertSeparator(); 1828 fileMenu->insertSeparator();
1827 mActionSave->plug( fileMenu ); 1829 mActionSave->plug( fileMenu );
1828 fileMenu->insertItem( "&Import", ImportMenu ); 1830 fileMenu->insertItem( "&Import", ImportMenu );
1829 fileMenu->insertItem( "&Emport", ExportMenu ); 1831 fileMenu->insertItem( "&Emport", ExportMenu );
1830 fileMenu->insertSeparator(); 1832 fileMenu->insertSeparator();
1831 mActionMailVCard->plug( fileMenu ); 1833 mActionMailVCard->plug( fileMenu );
1832#ifndef DESKTOP_VERSION 1834#ifndef DESKTOP_VERSION
1833 if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); 1835 if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu );
1834 if ( Ir::supported() ) mActionBeam->plug(fileMenu ); 1836 if ( Ir::supported() ) mActionBeam->plug(fileMenu );
1835#endif 1837#endif
1836 fileMenu->insertSeparator(); 1838 fileMenu->insertSeparator();
1837 mActionQuit->plug( fileMenu ); 1839 mActionQuit->plug( fileMenu );
1838#ifdef _WIN32_ 1840#ifdef _WIN32_
1839 mActionImportOL->plug( ImportMenu ); 1841 mActionImportOL->plug( ImportMenu );
1840#endif 1842#endif
1841 // edit menu 1843 // edit menu
1842 mActionUndo->plug( editMenu ); 1844 mActionUndo->plug( editMenu );
1843 mActionRedo->plug( editMenu ); 1845 mActionRedo->plug( editMenu );
1844 editMenu->insertSeparator(); 1846 editMenu->insertSeparator();
1845 mActionCut->plug( editMenu ); 1847 mActionCut->plug( editMenu );
1846 mActionCopy->plug( editMenu ); 1848 mActionCopy->plug( editMenu );
1847 mActionPaste->plug( editMenu ); 1849 mActionPaste->plug( editMenu );
1848 mActionDelete->plug( editMenu ); 1850 mActionDelete->plug( editMenu );
1849 editMenu->insertSeparator(); 1851 editMenu->insertSeparator();
1850 mActionSelectAll->plug( editMenu ); 1852 mActionSelectAll->plug( editMenu );
1851 1853
1852 mActionRemoveVoice->plug( changeMenu ); 1854 mActionRemoveVoice->plug( changeMenu );
1853 // settings menu 1855 // settings menu
1854//US special menuentry to configure the addressbook resources. On KDE 1856//US special menuentry to configure the addressbook resources. On KDE
1855// you do that through the control center !!! 1857// you do that through the control center !!!
1856 mActionConfigResources->plug( settingsMenu ); 1858 mActionConfigResources->plug( settingsMenu );
1857 settingsMenu->insertSeparator(); 1859 settingsMenu->insertSeparator();
1858 1860
1859 mActionConfigKAddressbook->plug( settingsMenu ); 1861 mActionConfigKAddressbook->plug( settingsMenu );
1860 1862
1861 if ( mIsPart ) { 1863 if ( mIsPart ) {
1862 mActionConfigShortcuts->plug( settingsMenu ); 1864 mActionConfigShortcuts->plug( settingsMenu );
1863 mActionConfigureToolbars->plug( settingsMenu ); 1865 mActionConfigureToolbars->plug( settingsMenu );
1864 1866
1865 } else { 1867 } else {
1866 mActionKeyBindings->plug( settingsMenu ); 1868 mActionKeyBindings->plug( settingsMenu );
1867 } 1869 }
1868 1870
1869 settingsMenu->insertSeparator(); 1871 settingsMenu->insertSeparator();
1870 1872
1871 mActionJumpBar->plug( settingsMenu ); 1873 mActionJumpBar->plug( settingsMenu );
1872 mActionDetails->plug( settingsMenu ); 1874 mActionDetails->plug( settingsMenu );
1873 if (!KABPrefs::instance()->mMultipleViewsAtOnce ) 1875 if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop )
1874 mActionDetails->plug( tb ); 1876 mActionDetails->plug( tb );
1875 settingsMenu->insertSeparator(); 1877 settingsMenu->insertSeparator();
1876 1878
1877 mActionWhoAmI->plug( settingsMenu ); 1879 mActionWhoAmI->plug( settingsMenu );
1878 mActionCategories->plug( settingsMenu ); 1880 mActionCategories->plug( settingsMenu );
1879 1881
1880 mActionLicence->plug( helpMenu ); 1882 mActionLicence->plug( helpMenu );
1881 mActionFaq->plug( helpMenu ); 1883 mActionFaq->plug( helpMenu );
1882 mActionAboutKAddressbook->plug( helpMenu ); 1884 mActionAboutKAddressbook->plug( helpMenu );
1883 1885
1884 if (KGlobal::getDesktopSize() > KGlobal::Small ) { 1886 if (KGlobal::getDesktopSize() > KGlobal::Small ) {
1885 1887
1886 mActionSave->plug( tb ); 1888 mActionSave->plug( tb );
1887 mViewManager->getFilterAction()->plug ( tb); 1889 mViewManager->getFilterAction()->plug ( tb);
1888 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { 1890 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) {
1889 mActionUndo->plug( tb ); 1891 mActionUndo->plug( tb );
1890 mActionDelete->plug( tb ); 1892 mActionDelete->plug( tb );
1891 mActionRedo->plug( tb ); 1893 mActionRedo->plug( tb );
1892 } 1894 }
1893 } 1895 }
1894 //mActionQuit->plug ( tb ); 1896 //mActionQuit->plug ( tb );
1895 // tb->insertWidget(-1, 0, mIncSearchWidget, 6); 1897 // tb->insertWidget(-1, 0, mIncSearchWidget, 6);
1896 1898
1897 //US link the searchwidget first to this. 1899 //US link the searchwidget first to this.
1898 // The real linkage to the toolbar happens later. 1900 // The real linkage to the toolbar happens later.
1899//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 1901//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
1900//US tb->insertItem( mIncSearchWidget ); 1902//US tb->insertItem( mIncSearchWidget );
1901/*US 1903/*US
1902 mIncSearchWidget = new IncSearchWidget( tb ); 1904 mIncSearchWidget = new IncSearchWidget( tb );
1903 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1905 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1904 SLOT( incrementalSearch( const QString& ) ) ); 1906 SLOT( incrementalSearch( const QString& ) ) );
1905 1907
1906 mJumpButtonBar = new JumpButtonBar( this, this ); 1908 mJumpButtonBar = new JumpButtonBar( this, this );
1907 1909
1908//US topLayout->addWidget( mJumpButtonBar ); 1910//US topLayout->addWidget( mJumpButtonBar );
1909 this->layout()->add( mJumpButtonBar ); 1911 this->layout()->add( mJumpButtonBar );
1910*/ 1912*/
1911 1913
1912#endif //KAB_EMBEDDED 1914#endif //KAB_EMBEDDED
1913} 1915}
1914void KABCore::showLicence() 1916void KABCore::showLicence()
1915{ 1917{
1916 KApplication::showLicence(); 1918 KApplication::showLicence();
1917} 1919}
1918void KABCore::removeVoice() 1920void KABCore::removeVoice()
1919{ 1921{
1920 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) 1922 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No )
1921 return; 1923 return;
1922 KABC::Addressee::List list = mViewManager->selectedAddressees(); 1924 KABC::Addressee::List list = mViewManager->selectedAddressees();
1923 KABC::Addressee::List::Iterator it; 1925 KABC::Addressee::List::Iterator it;
1924 for ( it = list.begin(); it != list.end(); ++it ) { 1926 for ( it = list.begin(); it != list.end(); ++it ) {
1925 PhoneNumber::List phoneNumbers = (*it).phoneNumbers(); 1927 PhoneNumber::List phoneNumbers = (*it).phoneNumbers();
1926 PhoneNumber::List::Iterator phoneIt; 1928 PhoneNumber::List::Iterator phoneIt;
1927 bool found = false; 1929 bool found = false;
1928 for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { 1930 for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) {
1929 if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found 1931 if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found
1930 if ((*phoneIt).type() - PhoneNumber::Voice ) { 1932 if ((*phoneIt).type() - PhoneNumber::Voice ) {
1931 (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice ); 1933 (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice );
1932 (*it).insertPhoneNumber( (*phoneIt) ); 1934 (*it).insertPhoneNumber( (*phoneIt) );
1933 found = true; 1935 found = true;
1934 } 1936 }
1935 } 1937 }
1936 1938
1937 } 1939 }
1938 if ( found ) 1940 if ( found )
1939 contactModified((*it) ); 1941 contactModified((*it) );
1940 } 1942 }
1941} 1943}
1942 1944
1943 1945
1944 1946
1945void KABCore::clipboardDataChanged() 1947void KABCore::clipboardDataChanged()
1946{ 1948{
1947 1949
1948 if ( mReadWrite ) 1950 if ( mReadWrite )
1949 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); 1951 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
1950 1952
1951} 1953}
1952 1954
1953void KABCore::updateActionMenu() 1955void KABCore::updateActionMenu()
1954{ 1956{
1955 UndoStack *undo = UndoStack::instance(); 1957 UndoStack *undo = UndoStack::instance();
1956 RedoStack *redo = RedoStack::instance(); 1958 RedoStack *redo = RedoStack::instance();
1957 1959
1958 if ( undo->isEmpty() ) 1960 if ( undo->isEmpty() )
1959 mActionUndo->setText( i18n( "Undo" ) ); 1961 mActionUndo->setText( i18n( "Undo" ) );
1960 else 1962 else
1961 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); 1963 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
1962 1964
1963 mActionUndo->setEnabled( !undo->isEmpty() ); 1965 mActionUndo->setEnabled( !undo->isEmpty() );
1964 1966
1965 if ( !redo->top() ) 1967 if ( !redo->top() )
1966 mActionRedo->setText( i18n( "Redo" ) ); 1968 mActionRedo->setText( i18n( "Redo" ) );
1967 else 1969 else
1968 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); 1970 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
1969 1971
1970 mActionRedo->setEnabled( !redo->isEmpty() ); 1972 mActionRedo->setEnabled( !redo->isEmpty() );
1971} 1973}
1972 1974
1973void KABCore::configureKeyBindings() 1975void KABCore::configureKeyBindings()
1974{ 1976{
1975#ifndef KAB_EMBEDDED 1977#ifndef KAB_EMBEDDED
1976 KKeyDialog::configure( actionCollection(), true ); 1978 KKeyDialog::configure( actionCollection(), true );
1977#else //KAB_EMBEDDED 1979#else //KAB_EMBEDDED
1978 qDebug("KABCore::configureKeyBindings() not implemented"); 1980 qDebug("KABCore::configureKeyBindings() not implemented");
1979#endif //KAB_EMBEDDED 1981#endif //KAB_EMBEDDED
1980} 1982}
1981 1983
1982#ifdef KAB_EMBEDDED 1984#ifdef KAB_EMBEDDED
1983void KABCore::configureResources() 1985void KABCore::configureResources()
1984{ 1986{
1985 KRES::KCMKResources dlg( this, "" , 0 ); 1987 KRES::KCMKResources dlg( this, "" , 0 );
1986 1988
1987 if ( !dlg.exec() ) 1989 if ( !dlg.exec() )
1988 return; 1990 return;
1989 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 1991 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
1990} 1992}
1991#endif //KAB_EMBEDDED 1993#endif //KAB_EMBEDDED
1992 1994
1993 1995
1994/* this method will be called through the QCop interface from Ko/Pi to select addresses 1996/* this method will be called through the QCop interface from Ko/Pi to select addresses
1995 * for the attendees list of an event. 1997 * for the attendees list of an event.
1996 */ 1998 */
1997void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) 1999void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid)
1998{ 2000{
1999 QStringList nameList; 2001 QStringList nameList;
2000 QStringList emailList; 2002 QStringList emailList;
2001 QStringList uidList; 2003 QStringList uidList;
2002 2004
2003 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 2005 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
2004 uint i=0; 2006 uint i=0;
2005 for (i=0; i < list.count(); i++) 2007 for (i=0; i < list.count(); i++)
2006 { 2008 {
2007 nameList.append(list[i].realName()); 2009 nameList.append(list[i].realName());
2008 emailList.append(list[i].preferredEmail()); 2010 emailList.append(list[i].preferredEmail());
2009 uidList.append(list[i].uid()); 2011 uidList.append(list[i].uid());
2010 } 2012 }
2011 2013
2012 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); 2014 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList);
2013 2015
2014} 2016}
2015 2017
2016/* this method will be called through the QCop interface from other apps to show details of a contact. 2018/* this method will be called through the QCop interface from other apps to show details of a contact.
2017 */ 2019 */
2018void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) 2020void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
2019{ 2021{
2020// qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); 2022// qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1());
2021 2023
2022 QString foundUid = QString::null; 2024 QString foundUid = QString::null;
2023 if (uid.isEmpty()) 2025 if (uid.isEmpty())
2024 { 2026 {
2025 //find the uid of the person first 2027 //find the uid of the person first
2026 Addressee::List namelist; 2028 Addressee::List namelist;
2027 Addressee::List emaillist; 2029 Addressee::List emaillist;
2028 2030
2029 if (!name.isEmpty()) 2031 if (!name.isEmpty())
2030 namelist = mAddressBook->findByName( name ); 2032 namelist = mAddressBook->findByName( name );
2031 2033
2032 if (!email.isEmpty()) 2034 if (!email.isEmpty())
2033 emaillist = mAddressBook->findByEmail( email ); 2035 emaillist = mAddressBook->findByEmail( email );
2034 2036
2035 //check if we have a match in Namelist and Emaillist 2037 //check if we have a match in Namelist and Emaillist
2036 if ((namelist.count() == 0) && (emaillist.count() > 0)) 2038 if ((namelist.count() == 0) && (emaillist.count() > 0))
2037 foundUid == emaillist[0].uid(); 2039 foundUid == emaillist[0].uid();
2038 else if ((namelist.count() > 0) && (emaillist.count() == 0)) 2040 else if ((namelist.count() > 0) && (emaillist.count() == 0))
2039 foundUid == namelist[0].uid(); 2041 foundUid == namelist[0].uid();
2040 else 2042 else
2041 { 2043 {
2042 for (int i = 0; i < namelist.count(); i++) 2044 for (int i = 0; i < namelist.count(); i++)
2043 { 2045 {
2044 for (int j = 0; j < emaillist.count(); j++) 2046 for (int j = 0; j < emaillist.count(); j++)
2045 { 2047 {
2046 if (namelist[i] == emaillist[j]) 2048 if (namelist[i] == emaillist[j])
2047 { 2049 {
2048 foundUid == namelist[i].uid(); 2050 foundUid == namelist[i].uid();
2049 } 2051 }
2050 } 2052 }
2051 } 2053 }
2052 } 2054 }
2053 } 2055 }
2054 else 2056 else
2055 { 2057 {
2056 foundUid = uid; 2058 foundUid = uid;
2057 } 2059 }
2058 2060
2059 if (!foundUid.isEmpty()) 2061 if (!foundUid.isEmpty())
2060 { 2062 {
2061 // raise Ka/Pi if it is in the background 2063 // raise Ka/Pi if it is in the background
2062#ifndef DESKTOP_VERSION 2064#ifndef DESKTOP_VERSION
2063#ifndef KORG_NODCOP 2065#ifndef KORG_NODCOP
2064 QCopEnvelope e("QPE/Application/kapi", "raise()"); 2066 QCopEnvelope e("QPE/Application/kapi", "raise()");
2065#endif 2067#endif