-rw-r--r-- | pwmanager/pwmanager/pwm.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp index d9fbfc9..083e6d1 100644 --- a/pwmanager/pwmanager/pwm.cpp +++ b/pwmanager/pwmanager/pwm.cpp | |||
@@ -1347,201 +1347,203 @@ void PwM::execLauncher_slot() | |||
1347 | else | 1347 | else |
1348 | showStatMsg(i18n("ERROR: Couldn't execute the \"Launcher\"!")); | 1348 | showStatMsg(i18n("ERROR: Couldn't execute the \"Launcher\"!")); |
1349 | } | 1349 | } |
1350 | 1350 | ||
1351 | void PwM::goToURL_slot() | 1351 | void PwM::goToURL_slot() |
1352 | { | 1352 | { |
1353 | PWM_ASSERT(curDoc()); | 1353 | PWM_ASSERT(curDoc()); |
1354 | if (curDoc()->isDeepLocked()) | 1354 | if (curDoc()->isDeepLocked()) |
1355 | return; | 1355 | return; |
1356 | unsigned int curEntryIndex; | 1356 | unsigned int curEntryIndex; |
1357 | if (!view->getCurEntryIndex(&curEntryIndex)) | 1357 | if (!view->getCurEntryIndex(&curEntryIndex)) |
1358 | return; | 1358 | return; |
1359 | bool ret = curDoc()->goToURL(view->getCurrentCategory(), | 1359 | bool ret = curDoc()->goToURL(view->getCurrentCategory(), |
1360 | curEntryIndex); | 1360 | curEntryIndex); |
1361 | if (ret) | 1361 | if (ret) |
1362 | showStatMsg(i18n("started browser with current URL.")); | 1362 | showStatMsg(i18n("started browser with current URL.")); |
1363 | else | 1363 | else |
1364 | showStatMsg(i18n("ERROR: Couldn't start browser! Maybe invalid URL?")); | 1364 | showStatMsg(i18n("ERROR: Couldn't start browser! Maybe invalid URL?")); |
1365 | } | 1365 | } |
1366 | 1366 | ||
1367 | void PwM::copyToClipboard(const QString &s) | 1367 | void PwM::copyToClipboard(const QString &s) |
1368 | { | 1368 | { |
1369 | QClipboard *cb = QApplication::clipboard(); | 1369 | QClipboard *cb = QApplication::clipboard(); |
1370 | #ifndef PWM_EMBEDDED | 1370 | #ifndef PWM_EMBEDDED |
1371 | if (cb->supportsSelection()) | 1371 | if (cb->supportsSelection()) |
1372 | cb->setText(s, QClipboard::Selection); | 1372 | cb->setText(s, QClipboard::Selection); |
1373 | cb->setText(s, QClipboard::Clipboard); | 1373 | cb->setText(s, QClipboard::Clipboard); |
1374 | #else | 1374 | #else |
1375 | cb->setText(s); | 1375 | cb->setText(s); |
1376 | 1376 | ||
1377 | #endif | 1377 | #endif |
1378 | 1378 | ||
1379 | } | 1379 | } |
1380 | 1380 | ||
1381 | 1381 | ||
1382 | void PwM::showStatMsg(const QString &msg) | 1382 | void PwM::showStatMsg(const QString &msg) |
1383 | { | 1383 | { |
1384 | #ifdef DESKTOP_VERSION | 1384 | #ifdef DESKTOP_VERSION |
1385 | statusBar()->message(msg, STATUSBAR_MSG_TIMEOUT * 1000); | 1385 | statusBar()->message(msg, STATUSBAR_MSG_TIMEOUT * 1000); |
1386 | #else | 1386 | #else |
1387 | qDebug("Statusbar : %s",msg.latin1()); | 1387 | qDebug("Statusbar : %s",msg.latin1()); |
1388 | Global::statusMessage(msg); | 1388 | Global::statusMessage(msg); |
1389 | #endif | 1389 | #endif |
1390 | } | 1390 | } |
1391 | 1391 | ||
1392 | void PwM::focusInEvent(QFocusEvent *e) | 1392 | void PwM::focusInEvent(QFocusEvent *e) |
1393 | { | 1393 | { |
1394 | if (e->gotFocus()) { | 1394 | if (e->gotFocus()) { |
1395 | emit gotFocus(this); | 1395 | emit gotFocus(this); |
1396 | } else if (e->lostFocus()) { | 1396 | } else if (e->lostFocus()) { |
1397 | emit lostFocus(this); | 1397 | emit lostFocus(this); |
1398 | } | 1398 | } |
1399 | } | 1399 | } |
1400 | 1400 | ||
1401 | 1401 | ||
1402 | #ifdef PWM_EMBEDDED | 1402 | #ifdef PWM_EMBEDDED |
1403 | 1403 | ||
1404 | void PwM::category_slot() | 1404 | void PwM::category_slot() |
1405 | { | 1405 | { |
1406 | PwMDoc *doc = curDoc(); | 1406 | PwMDoc *doc = curDoc(); |
1407 | PWM_ASSERT(doc); | 1407 | PWM_ASSERT(doc); |
1408 | doc->timer()->getLock(DocTimer::id_autoLockTimer); | 1408 | doc->timer()->getLock(DocTimer::id_autoLockTimer); |
1409 | 1409 | ||
1410 | editCategoryWnd w(doc, this, "editcategory"); | 1410 | editCategoryWnd w(doc, this, "editcategory"); |
1411 | /* | 1411 | /* |
1412 | vector<string> catList; | 1412 | vector<string> catList; |
1413 | doc->getCategoryList(&catList); | 1413 | doc->getCategoryList(&catList); |
1414 | unsigned i, size = catList.size(); | 1414 | unsigned i, size = catList.size(); |
1415 | for (i = 0; i < size; ++i) { | 1415 | for (i = 0; i < size; ++i) { |
1416 | w.addCategory(catList[i].c_str()); | 1416 | w.addCategory(catList[i].c_str()); |
1417 | } | 1417 | } |
1418 | w.setCurrCategory(view->getCurrentCategory()); | 1418 | w.setCurrCategory(view->getCurrentCategory()); |
1419 | if (pw) | 1419 | if (pw) |
1420 | w.pwLineEdit->setText(*pw); | 1420 | w.pwLineEdit->setText(*pw); |
1421 | */ | 1421 | */ |
1422 | w.setCurrCategory(view->getCurrentCategory()); | 1422 | w.setCurrCategory(view->getCurrentCategory()); |
1423 | 1423 | ||
1424 | tryAgain: | 1424 | tryAgain: |
1425 | if (w.exec() == 1) | 1425 | if (w.exec() == 1) |
1426 | { | 1426 | { |
1427 | PwMDataItem d; | 1427 | PwMDataItem d; |
1428 | 1428 | ||
1429 | //US BUG: to initialize all values of curEntr with meaningfulldata, | 1429 | //US BUG: to initialize all values of curEntr with meaningfulldata, |
1430 | // we call clear on it. Reason: Metadata will be uninitialized otherwise. | 1430 | // we call clear on it. Reason: Metadata will be uninitialized otherwise. |
1431 | // another option would be to create a constructor for PwMDataItem | 1431 | // another option would be to create a constructor for PwMDataItem |
1432 | d.clear(true); | 1432 | d.clear(true); |
1433 | /* | 1433 | /* |
1434 | d.desc = w.getDescription().latin1(); | 1434 | d.desc = w.getDescription().latin1(); |
1435 | d.name = w.getUsername().latin1(); | 1435 | d.name = w.getUsername().latin1(); |
1436 | d.pw = w.getPassword().latin1(); | 1436 | d.pw = w.getPassword().latin1(); |
1437 | d.comment = w.getComment().latin1(); | 1437 | d.comment = w.getComment().latin1(); |
1438 | d.url = w.getUrl().latin1(); | 1438 | d.url = w.getUrl().latin1(); |
1439 | d.launcher = w.getLauncher().latin1(); | 1439 | d.launcher = w.getLauncher().latin1(); |
1440 | PwMerror ret = doc->addEntry(w.getCategory(), &d); | 1440 | PwMerror ret = doc->addEntry(w.getCategory(), &d); |
1441 | if (ret == e_entryExists) { | 1441 | if (ret == e_entryExists) { |
1442 | KMessageBox::error(this, | 1442 | KMessageBox::error(this, |
1443 | i18n | 1443 | i18n |
1444 | ("An entry with this \"Description\",\n" | 1444 | ("An entry with this \"Description\",\n" |
1445 | "does already exist.\n" | 1445 | "does already exist.\n" |
1446 | "Please select another description."), | 1446 | "Please select another description."), |
1447 | i18n("entry already exists.")); | 1447 | i18n("entry already exists.")); |
1448 | goto tryAgain; | 1448 | goto tryAgain; |
1449 | } else if (ret == e_maxAllowedEntr) { | 1449 | } else if (ret == e_maxAllowedEntr) { |
1450 | KMessageBox::error(this, i18n("The maximum possible number of\nentries" | 1450 | KMessageBox::error(this, i18n("The maximum possible number of\nentries" |
1451 | "has been reached.\nYou can't add more entries."), | 1451 | "has been reached.\nYou can't add more entries."), |
1452 | i18n("maximum number of entries")); | 1452 | i18n("maximum number of entries")); |
1453 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | 1453 | doc->timer()->putLock(DocTimer::id_autoLockTimer); |
1454 | return; | 1454 | return; |
1455 | } | 1455 | } |
1456 | */ | 1456 | */ |
1457 | } | 1457 | } |
1458 | setVirgin(false); | 1458 | setVirgin(false); |
1459 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | 1459 | doc->timer()->putLock(DocTimer::id_autoLockTimer); |
1460 | } | 1460 | } |
1461 | 1461 | ||
1462 | 1462 | ||
1463 | void PwM::whatsnew_slot() | 1463 | void PwM::whatsnew_slot() |
1464 | { | 1464 | { |
1465 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1465 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1466 | } | 1466 | } |
1467 | 1467 | ||
1468 | void PwM::showLicense_slot() | 1468 | void PwM::showLicense_slot() |
1469 | { | 1469 | { |
1470 | KApplication::showLicence(); | 1470 | KApplication::showLicence(); |
1471 | } | 1471 | } |
1472 | 1472 | ||
1473 | void PwM::faq_slot() | 1473 | void PwM::faq_slot() |
1474 | { | 1474 | { |
1475 | KApplication::showFile( "PWM/Pi FAQ", "kdepim/pwmanager/pwmanagerFAQ.txt" ); | 1475 | KApplication::showFile( "PWM/Pi FAQ", "kdepim/pwmanager/pwmanagerFAQ.txt" ); |
1476 | } | 1476 | } |
1477 | 1477 | ||
1478 | void PwM::syncHowTo_slot() | 1478 | void PwM::syncHowTo_slot() |
1479 | { | 1479 | { |
1480 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1480 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1481 | } | 1481 | } |
1482 | 1482 | ||
1483 | 1483 | ||
1484 | void PwM::createAboutData_slot() | 1484 | void PwM::createAboutData_slot() |
1485 | { | 1485 | { |
1486 | QString version; | 1486 | QString version; |
1487 | #include <../version> | 1487 | #include <../version> |
1488 | ; | 1488 | ; |
1489 | QMessageBox::about( this, "About PwManager/Pi", | 1489 | QMessageBox::about( this, "About PwManager/Pi", |
1490 | "PwManager/Platform-independent\n" | 1490 | "PwManager/Platform-independent\n" |
1491 | "(PWM/Pi) " +version + " - " + | 1491 | "(PWM/Pi) " +version + " - " + |
1492 | #ifdef DESKTOP_VERSION | 1492 | #ifdef DESKTOP_VERSION |
1493 | "Desktop Edition\n" | 1493 | "Desktop Edition\n" |
1494 | #else | 1494 | #else |
1495 | "PDA-Edition\n" | 1495 | "PDA-Edition\n" |
1496 | "for: Zaurus 5500 / 7x0 / 8x0\n" | 1496 | "for: Zaurus 5500 / 7x0 / 8x0\n" |
1497 | #endif | 1497 | #endif |
1498 | 1498 | ||
1499 | "(c) 2004 Ulf Schenk\n" | 1499 | "(c) 2004 Ulf Schenk\n" |
1500 | "(c) 2004 Lutz Rogowski\n" | 1500 | "(c) 2004 Lutz Rogowski\n" |
1501 | "(c) 1997-2004, The KDE PIM Team\n" | 1501 | "(c) 1997-2004, The KDE PIM Team\n" |
1502 | 1502 | ||
1503 | "(c) Michael Buesch - main programming\nand current maintainer\nmbuesch@freenet.de\n" | 1503 | "(c) Michael Buesch - main programming\nand current maintainer\nmbuesch@freenet.de\n" |
1504 | "Matt Scifo - mscifo@o1.com\n" | 1504 | "Matt Scifo - mscifo@o1.com\n" |
1505 | "Elias Probst - elias.probst@gmx.de\n" | 1505 | "Elias Probst - elias.probst@gmx.de\n" |
1506 | "George Staikos - staikos@kde.org\n" | 1506 | "George Staikos - staikos@kde.org\n" |
1507 | "Matthew Palmer - mjp16@uow.edu.au\n" | 1507 | "Matthew Palmer - mjp16@uow.edu.au\n" |
1508 | "Olivier Sessink - gpasman@nl.linux.org\n" | 1508 | "Olivier Sessink - gpasman@nl.linux.org\n" |
1509 | "The libgcrypt developers -\nBlowfish and SHA1 algorithms\nftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/\n" | 1509 | "The libgcrypt developers -\nBlowfish and SHA1 algorithms\nftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/\n" |
1510 | "Troy Engel - tengel@sonic.net\n" | 1510 | "Troy Engel - tengel@sonic.net\n" |
1511 | "Wickey - wickey@gmx.at\n" | 1511 | "Wickey - wickey@gmx.at\n" |
1512 | "Ian MacGregor - original documentation author.\n" | 1512 | "Ian MacGregor - original documentation author.\n" |
1513 | ); | 1513 | ); |
1514 | } | 1514 | } |
1515 | 1515 | ||
1516 | 1516 | ||
1517 | //this are the overwritten callbackmethods from the syncinterface | 1517 | //this are the overwritten callbackmethods from the syncinterface |
1518 | bool PwM::sync(KSyncManager* manager, QString filename, int mode) | 1518 | bool PwM::sync(KSyncManager* manager, QString filename, int mode) |
1519 | { | 1519 | { |
1520 | PWM_ASSERT(curDoc()); | 1520 | PWM_ASSERT(curDoc()); |
1521 | 1521 | ||
1522 | bool ret = curDoc()->sync(manager, filename, mode); | 1522 | bool ret = curDoc()->sync(manager, filename, mode); |
1523 | 1523 | ||
1524 | qDebug("PwM::sync save now: ret=%i", ret); | 1524 | qDebug("PwM::sync save now: ret=%i", ret); |
1525 | 1525 | ||
1526 | if (ret == true) { | 1526 | if (ret == true) { |
1527 | //US BUG: what can we call here to update the view of the current doc? | 1527 | //US BUG: what can we call here to update the view of the current doc? |
1528 | //mViewManager->refreshView(); | 1528 | //mViewManager->refreshView(); |
1529 | 1529 | ||
1530 | //US curDoc()->sync sets the dirtyFlag in case the sync was successfull. | 1530 | //US curDoc()->sync sets the dirtyFlag in case the sync was successfull. |
1531 | save(); | 1531 | save(); |
1532 | } | 1532 | } |
1533 | 1533 | ||
1534 | return ret; | 1534 | return ret; |
1535 | } | 1535 | } |
1536 | 1536 | ||
1537 | void PwM::removeSyncInfo( QString syncProfile) | 1537 | void PwM::removeSyncInfo( QString syncProfile) |
1538 | { | 1538 | { |
1539 | qDebug("PWM::not implemented: removeSyncInfo for profile %s ", syncProfile.latin1()); | 1539 | qDebug("PWM:removeSyncInfo for profile %s ", syncProfile.latin1()); |
1540 | curDoc()->removeSyncInfo( syncProfile ); | ||
1541 | //US curDoc()->removeSyncInfo sets the dirtyFlag. | ||
1540 | } | 1542 | } |
1541 | 1543 | ||
1542 | #endif | 1544 | #endif |
1543 | 1545 | ||
1544 | 1546 | ||
1545 | #ifndef PWM_EMBEDDED | 1547 | #ifndef PWM_EMBEDDED |
1546 | #include "pwm.moc" | 1548 | #include "pwm.moc" |
1547 | #endif | 1549 | #endif |