author | zautrix <zautrix> | 2004-08-21 00:37:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-21 00:37:31 (UTC) |
commit | f7bf415be8c727c887ec01c2d8fb8f1c2f85d096 (patch) (unidiff) | |
tree | 7ea53cea72a757bb57bef12ea9e20543f2e7dfa9 | |
parent | ab07441b413dff6d478e2c3a39b823b4269931c5 (diff) | |
download | kdepimpi-f7bf415be8c727c887ec01c2d8fb8f1c2f85d096.zip kdepimpi-f7bf415be8c727c887ec01c2d8fb8f1c2f85d096.tar.gz kdepimpi-f7bf415be8c727c887ec01c2d8fb8f1c2f85d096.tar.bz2 |
Some fixes of the icons
-rw-r--r-- | bin/kdepim/kaddressbook/icons22/listview.png | bin | 365 -> 657 bytes | |||
-rw-r--r-- | kaddressbook/kabcore.cpp | 4 |
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 | |||
@@ -1187,257 +1187,259 @@ void KABCore::setDetailsVisible( bool visible ) | |||
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 | ||
1203 | void KABCore::extensionChanged( int id ) | 1203 | void 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 | ||
1245 | void KABCore::extensionModified( const KABC::Addressee::List &list ) | 1245 | void 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 | ||
1266 | QString KABCore::getNameByPhone( const QString &phone ) | 1266 | QString 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 | ||
1297 | void KABCore::openConfigDialog() | 1297 | void 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 | ||
1321 | void KABCore::openLDAPDialog() | 1323 | void 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 | ||
1340 | void KABCore::print() | 1342 | void 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 | ||
1358 | void KABCore::addGUIClient( KXMLGUIClient *client ) | 1360 | void 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 | ||
1367 | void KABCore::configurationChanged() | 1369 | void KABCore::configurationChanged() |
1368 | { | 1370 | { |
1369 | mExtensionManager->reconfigure(); | 1371 | mExtensionManager->reconfigure(); |
1370 | } | 1372 | } |
1371 | 1373 | ||
1372 | void KABCore::addressBookChanged() | 1374 | void 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 | ||
1403 | AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, | 1405 | AddresseeEditorDialog *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 | ||
1421 | void KABCore::slotEditorDestroyed( const QString &uid ) | 1423 | void KABCore::slotEditorDestroyed( const QString &uid ) |
1422 | { | 1424 | { |
1423 | //mEditorDict.remove( uid ); | 1425 | //mEditorDict.remove( uid ); |
1424 | } | 1426 | } |
1425 | 1427 | ||
1426 | void KABCore::initGUI() | 1428 | void 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 ); |
@@ -1745,257 +1747,257 @@ void KABCore::initActions() | |||
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. |
1764 | void KABCore::addActionsManually() | 1766 | void 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 | } |
1914 | void KABCore::showLicence() | 1916 | void KABCore::showLicence() |
1915 | { | 1917 | { |
1916 | KApplication::showLicence(); | 1918 | KApplication::showLicence(); |
1917 | } | 1919 | } |
1918 | void KABCore::removeVoice() | 1920 | void 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 | ||
1945 | void KABCore::clipboardDataChanged() | 1947 | void 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 | ||
1953 | void KABCore::updateActionMenu() | 1955 | void 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 | ||
1973 | void KABCore::configureKeyBindings() | 1975 | void 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 |
1983 | void KABCore::configureResources() | 1985 | void 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 | */ |
1997 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) | 1999 | void 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; |