-rw-r--r-- | kaddressbook/kabcore.cpp | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index c4382d6..4c1d5da 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1462,769 +1462,769 @@ void KABCore::print() | |||
1462 | KPrinter printer; | 1462 | KPrinter printer; |
1463 | if ( !printer.setup( this ) ) | 1463 | if ( !printer.setup( this ) ) |
1464 | return; | 1464 | return; |
1465 | 1465 | ||
1466 | KABPrinting::PrintingWizard wizard( &printer, mAddressBook, | 1466 | KABPrinting::PrintingWizard wizard( &printer, mAddressBook, |
1467 | mViewManager->selectedUids(), this ); | 1467 | mViewManager->selectedUids(), this ); |
1468 | 1468 | ||
1469 | wizard.exec(); | 1469 | wizard.exec(); |
1470 | #else //KAB_EMBEDDED | 1470 | #else //KAB_EMBEDDED |
1471 | qDebug("KABCore::print() finsih method"); | 1471 | qDebug("KABCore::print() finsih method"); |
1472 | #endif //KAB_EMBEDDED | 1472 | #endif //KAB_EMBEDDED |
1473 | 1473 | ||
1474 | } | 1474 | } |
1475 | 1475 | ||
1476 | 1476 | ||
1477 | void KABCore::addGUIClient( KXMLGUIClient *client ) | 1477 | void KABCore::addGUIClient( KXMLGUIClient *client ) |
1478 | { | 1478 | { |
1479 | if ( mGUIClient ) | 1479 | if ( mGUIClient ) |
1480 | mGUIClient->insertChildClient( client ); | 1480 | mGUIClient->insertChildClient( client ); |
1481 | else | 1481 | else |
1482 | KMessageBox::error( this, "no KXMLGUICLient"); | 1482 | KMessageBox::error( this, "no KXMLGUICLient"); |
1483 | } | 1483 | } |
1484 | 1484 | ||
1485 | 1485 | ||
1486 | void KABCore::configurationChanged() | 1486 | void KABCore::configurationChanged() |
1487 | { | 1487 | { |
1488 | mExtensionManager->reconfigure(); | 1488 | mExtensionManager->reconfigure(); |
1489 | } | 1489 | } |
1490 | 1490 | ||
1491 | void KABCore::addressBookChanged() | 1491 | void KABCore::addressBookChanged() |
1492 | { | 1492 | { |
1493 | /*US | 1493 | /*US |
1494 | QDictIterator<AddresseeEditorDialog> it( mEditorDict ); | 1494 | QDictIterator<AddresseeEditorDialog> it( mEditorDict ); |
1495 | while ( it.current() ) { | 1495 | while ( it.current() ) { |
1496 | if ( it.current()->dirty() ) { | 1496 | if ( it.current()->dirty() ) { |
1497 | QString text = i18n( "Data has been changed externally. Unsaved " | 1497 | QString text = i18n( "Data has been changed externally. Unsaved " |
1498 | "changes will be lost." ); | 1498 | "changes will be lost." ); |
1499 | KMessageBox::information( this, text ); | 1499 | KMessageBox::information( this, text ); |
1500 | } | 1500 | } |
1501 | it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); | 1501 | it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); |
1502 | ++it; | 1502 | ++it; |
1503 | } | 1503 | } |
1504 | */ | 1504 | */ |
1505 | if (mEditorDialog) | 1505 | if (mEditorDialog) |
1506 | { | 1506 | { |
1507 | if (mEditorDialog->dirty()) | 1507 | if (mEditorDialog->dirty()) |
1508 | { | 1508 | { |
1509 | QString text = i18n( "Data has been changed externally. Unsaved " | 1509 | QString text = i18n( "Data has been changed externally. Unsaved " |
1510 | "changes will be lost." ); | 1510 | "changes will be lost." ); |
1511 | KMessageBox::information( this, text ); | 1511 | KMessageBox::information( this, text ); |
1512 | } | 1512 | } |
1513 | QString currentuid = mEditorDialog->addressee().uid(); | 1513 | QString currentuid = mEditorDialog->addressee().uid(); |
1514 | mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); | 1514 | mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); |
1515 | } | 1515 | } |
1516 | mViewManager->refreshView(); | 1516 | mViewManager->refreshView(); |
1517 | // mDetails->refreshView(); | 1517 | // mDetails->refreshView(); |
1518 | 1518 | ||
1519 | 1519 | ||
1520 | } | 1520 | } |
1521 | 1521 | ||
1522 | AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, | 1522 | AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, |
1523 | const char *name ) | 1523 | const char *name ) |
1524 | { | 1524 | { |
1525 | 1525 | ||
1526 | if ( mEditorDialog == 0 ) { | 1526 | if ( mEditorDialog == 0 ) { |
1527 | mEditorDialog = new AddresseeEditorDialog( this, parent, | 1527 | mEditorDialog = new AddresseeEditorDialog( this, parent, |
1528 | name ? name : "editorDialog" ); | 1528 | name ? name : "editorDialog" ); |
1529 | 1529 | ||
1530 | 1530 | ||
1531 | connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ), | 1531 | connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ), |
1532 | SLOT( contactModified( const KABC::Addressee& ) ) ); | 1532 | SLOT( contactModified( const KABC::Addressee& ) ) ); |
1533 | //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), | 1533 | //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), |
1534 | // SLOT( slotEditorDestroyed( const QString& ) ) ; | 1534 | // SLOT( slotEditorDestroyed( const QString& ) ) ; |
1535 | } | 1535 | } |
1536 | 1536 | ||
1537 | return mEditorDialog; | 1537 | return mEditorDialog; |
1538 | } | 1538 | } |
1539 | 1539 | ||
1540 | void KABCore::slotEditorDestroyed( const QString &uid ) | 1540 | void KABCore::slotEditorDestroyed( const QString &uid ) |
1541 | { | 1541 | { |
1542 | //mEditorDict.remove( uid ); | 1542 | //mEditorDict.remove( uid ); |
1543 | } | 1543 | } |
1544 | 1544 | ||
1545 | void KABCore::initGUI() | 1545 | void KABCore::initGUI() |
1546 | { | 1546 | { |
1547 | #ifndef KAB_EMBEDDED | 1547 | #ifndef KAB_EMBEDDED |
1548 | QHBoxLayout *topLayout = new QHBoxLayout( this ); | 1548 | QHBoxLayout *topLayout = new QHBoxLayout( this ); |
1549 | topLayout->setSpacing( KDialogBase::spacingHint() ); | 1549 | topLayout->setSpacing( KDialogBase::spacingHint() ); |
1550 | 1550 | ||
1551 | mExtensionBarSplitter = new QSplitter( this ); | 1551 | mExtensionBarSplitter = new QSplitter( this ); |
1552 | mExtensionBarSplitter->setOrientation( Qt::Vertical ); | 1552 | mExtensionBarSplitter->setOrientation( Qt::Vertical ); |
1553 | 1553 | ||
1554 | mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); | 1554 | mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); |
1555 | 1555 | ||
1556 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); | 1556 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); |
1557 | mIncSearchWidget = new IncSearchWidget( viewSpace ); | 1557 | mIncSearchWidget = new IncSearchWidget( viewSpace ); |
1558 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 1558 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
1559 | SLOT( incrementalSearch( const QString& ) ) ); | 1559 | SLOT( incrementalSearch( const QString& ) ) ); |
1560 | 1560 | ||
1561 | mViewManager = new ViewManager( this, viewSpace ); | 1561 | mViewManager = new ViewManager( this, viewSpace ); |
1562 | viewSpace->setStretchFactor( mViewManager, 1 ); | 1562 | viewSpace->setStretchFactor( mViewManager, 1 ); |
1563 | 1563 | ||
1564 | mDetails = new ViewContainer( mDetailsSplitter ); | 1564 | mDetails = new ViewContainer( mDetailsSplitter ); |
1565 | 1565 | ||
1566 | mJumpButtonBar = new JumpButtonBar( this, this ); | 1566 | mJumpButtonBar = new JumpButtonBar( this, this ); |
1567 | 1567 | ||
1568 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); | 1568 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); |
1569 | 1569 | ||
1570 | topLayout->addWidget( mExtensionBarSplitter ); | 1570 | topLayout->addWidget( mExtensionBarSplitter ); |
1571 | topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); | 1571 | topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); |
1572 | topLayout->addWidget( mJumpButtonBar ); | 1572 | topLayout->addWidget( mJumpButtonBar ); |
1573 | topLayout->setStretchFactor( mJumpButtonBar, 1 ); | 1573 | topLayout->setStretchFactor( mJumpButtonBar, 1 ); |
1574 | 1574 | ||
1575 | mXXPortManager = new XXPortManager( this, this ); | 1575 | mXXPortManager = new XXPortManager( this, this ); |
1576 | 1576 | ||
1577 | #else //KAB_EMBEDDED | 1577 | #else //KAB_EMBEDDED |
1578 | //US initialize viewMenu before settingup viewmanager. | 1578 | //US initialize viewMenu before settingup viewmanager. |
1579 | // Viewmanager needs this menu to plugin submenues. | 1579 | // Viewmanager needs this menu to plugin submenues. |
1580 | viewMenu = new QPopupMenu( this ); | 1580 | viewMenu = new QPopupMenu( this ); |
1581 | settingsMenu = new QPopupMenu( this ); | 1581 | settingsMenu = new QPopupMenu( this ); |
1582 | //filterMenu = new QPopupMenu( this ); | 1582 | //filterMenu = new QPopupMenu( this ); |
1583 | ImportMenu = new QPopupMenu( this ); | 1583 | ImportMenu = new QPopupMenu( this ); |
1584 | ExportMenu = new QPopupMenu( this ); | 1584 | ExportMenu = new QPopupMenu( this ); |
1585 | syncMenu = new QPopupMenu( this ); | 1585 | syncMenu = new QPopupMenu( this ); |
1586 | changeMenu= new QPopupMenu( this ); | 1586 | changeMenu= new QPopupMenu( this ); |
1587 | 1587 | ||
1588 | //US since we have no splitter for the embedded system, setup | 1588 | //US since we have no splitter for the embedded system, setup |
1589 | // a layout with two frames. One left and one right. | 1589 | // a layout with two frames. One left and one right. |
1590 | 1590 | ||
1591 | QBoxLayout *topLayout; | 1591 | QBoxLayout *topLayout; |
1592 | 1592 | ||
1593 | // = new QHBoxLayout( this ); | 1593 | // = new QHBoxLayout( this ); |
1594 | // QBoxLayout *topLayout = (QBoxLayout*)layout(); | 1594 | // QBoxLayout *topLayout = (QBoxLayout*)layout(); |
1595 | 1595 | ||
1596 | // QWidget *mainBox = new QWidget( this ); | 1596 | // QWidget *mainBox = new QWidget( this ); |
1597 | // QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); | 1597 | // QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); |
1598 | 1598 | ||
1599 | #ifdef DESKTOP_VERSION | 1599 | #ifdef DESKTOP_VERSION |
1600 | topLayout = new QHBoxLayout( this ); | 1600 | topLayout = new QHBoxLayout( this ); |
1601 | 1601 | ||
1602 | 1602 | ||
1603 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); | 1603 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); |
1604 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 1604 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
1605 | 1605 | ||
1606 | topLayout->addWidget(mMiniSplitter ); | 1606 | topLayout->addWidget(mMiniSplitter ); |
1607 | 1607 | ||
1608 | mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); | 1608 | mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); |
1609 | mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | 1609 | mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); |
1610 | mViewManager = new ViewManager( this, mExtensionBarSplitter ); | 1610 | mViewManager = new ViewManager( this, mExtensionBarSplitter ); |
1611 | mDetails = new ViewContainer( mMiniSplitter ); | 1611 | mDetails = new ViewContainer( mMiniSplitter ); |
1612 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); | 1612 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); |
1613 | #else | 1613 | #else |
1614 | if ( QApplication::desktop()->width() > 480 ) { | 1614 | if ( QApplication::desktop()->width() > 480 ) { |
1615 | topLayout = new QHBoxLayout( this ); | 1615 | topLayout = new QHBoxLayout( this ); |
1616 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); | 1616 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); |
1617 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 1617 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
1618 | } else { | 1618 | } else { |
1619 | 1619 | ||
1620 | topLayout = new QHBoxLayout( this ); | 1620 | topLayout = new QHBoxLayout( this ); |
1621 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); | 1621 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); |
1622 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | 1622 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); |
1623 | } | 1623 | } |
1624 | 1624 | ||
1625 | topLayout->addWidget(mMiniSplitter ); | 1625 | topLayout->addWidget(mMiniSplitter ); |
1626 | mViewManager = new ViewManager( this, mMiniSplitter ); | 1626 | mViewManager = new ViewManager( this, mMiniSplitter ); |
1627 | mDetails = new ViewContainer( mMiniSplitter ); | 1627 | mDetails = new ViewContainer( mMiniSplitter ); |
1628 | 1628 | ||
1629 | 1629 | ||
1630 | mExtensionManager = new ExtensionManager( this, mMiniSplitter ); | 1630 | mExtensionManager = new ExtensionManager( this, mMiniSplitter ); |
1631 | #endif | 1631 | #endif |
1632 | //eh->hide(); | 1632 | //eh->hide(); |
1633 | // topLayout->addWidget(mExtensionManager ); | 1633 | // topLayout->addWidget(mExtensionManager ); |
1634 | 1634 | ||
1635 | 1635 | ||
1636 | /*US | 1636 | /*US |
1637 | #ifndef KAB_NOSPLITTER | 1637 | #ifndef KAB_NOSPLITTER |
1638 | QHBoxLayout *topLayout = new QHBoxLayout( this ); | 1638 | QHBoxLayout *topLayout = new QHBoxLayout( this ); |
1639 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); | 1639 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); |
1640 | topLayout->setSpacing( 10 ); | 1640 | topLayout->setSpacing( 10 ); |
1641 | 1641 | ||
1642 | mDetailsSplitter = new QSplitter( this ); | 1642 | mDetailsSplitter = new QSplitter( this ); |
1643 | 1643 | ||
1644 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); | 1644 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); |
1645 | 1645 | ||
1646 | mViewManager = new ViewManager( this, viewSpace ); | 1646 | mViewManager = new ViewManager( this, viewSpace ); |
1647 | viewSpace->setStretchFactor( mViewManager, 1 ); | 1647 | viewSpace->setStretchFactor( mViewManager, 1 ); |
1648 | 1648 | ||
1649 | mDetails = new ViewContainer( mDetailsSplitter ); | 1649 | mDetails = new ViewContainer( mDetailsSplitter ); |
1650 | 1650 | ||
1651 | topLayout->addWidget( mDetailsSplitter ); | 1651 | topLayout->addWidget( mDetailsSplitter ); |
1652 | topLayout->setStretchFactor( mDetailsSplitter, 100 ); | 1652 | topLayout->setStretchFactor( mDetailsSplitter, 100 ); |
1653 | #else //KAB_NOSPLITTER | 1653 | #else //KAB_NOSPLITTER |
1654 | QHBoxLayout *topLayout = new QHBoxLayout( this ); | 1654 | QHBoxLayout *topLayout = new QHBoxLayout( this ); |
1655 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); | 1655 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); |
1656 | topLayout->setSpacing( 10 ); | 1656 | topLayout->setSpacing( 10 ); |
1657 | 1657 | ||
1658 | // mDetailsSplitter = new QSplitter( this ); | 1658 | // mDetailsSplitter = new QSplitter( this ); |
1659 | 1659 | ||
1660 | QVBox *viewSpace = new QVBox( this ); | 1660 | QVBox *viewSpace = new QVBox( this ); |
1661 | 1661 | ||
1662 | mViewManager = new ViewManager( this, viewSpace ); | 1662 | mViewManager = new ViewManager( this, viewSpace ); |
1663 | viewSpace->setStretchFactor( mViewManager, 1 ); | 1663 | viewSpace->setStretchFactor( mViewManager, 1 ); |
1664 | 1664 | ||
1665 | mDetails = new ViewContainer( this ); | 1665 | mDetails = new ViewContainer( this ); |
1666 | 1666 | ||
1667 | topLayout->addWidget( viewSpace ); | 1667 | topLayout->addWidget( viewSpace ); |
1668 | // topLayout->setStretchFactor( mDetailsSplitter, 100 ); | 1668 | // topLayout->setStretchFactor( mDetailsSplitter, 100 ); |
1669 | topLayout->addWidget( mDetails ); | 1669 | topLayout->addWidget( mDetails ); |
1670 | #endif //KAB_NOSPLITTER | 1670 | #endif //KAB_NOSPLITTER |
1671 | */ | 1671 | */ |
1672 | 1672 | ||
1673 | syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); | 1673 | syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); |
1674 | syncManager->setBlockSave(false); | 1674 | syncManager->setBlockSave(false); |
1675 | 1675 | ||
1676 | connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 1676 | connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
1677 | connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 1677 | connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
1678 | syncManager->setDefaultFileName( sentSyncFile()); | 1678 | syncManager->setDefaultFileName( sentSyncFile()); |
1679 | //connect(syncManager , SIGNAL( ), this, SLOT( ) ); | 1679 | //connect(syncManager , SIGNAL( ), this, SLOT( ) ); |
1680 | 1680 | ||
1681 | #endif //KAB_EMBEDDED | 1681 | #endif //KAB_EMBEDDED |
1682 | initActions(); | 1682 | initActions(); |
1683 | 1683 | ||
1684 | #ifdef KAB_EMBEDDED | 1684 | #ifdef KAB_EMBEDDED |
1685 | addActionsManually(); | 1685 | addActionsManually(); |
1686 | //US make sure the export and import menues are initialized before creating the xxPortManager. | 1686 | //US make sure the export and import menues are initialized before creating the xxPortManager. |
1687 | mXXPortManager = new XXPortManager( this, this ); | 1687 | mXXPortManager = new XXPortManager( this, this ); |
1688 | 1688 | ||
1689 | // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() ); | 1689 | // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() ); |
1690 | //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget); | 1690 | //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget); |
1691 | // mActionQuit->plug ( mMainWindow->toolBar()); | 1691 | // mActionQuit->plug ( mMainWindow->toolBar()); |
1692 | //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() ); | 1692 | //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() ); |
1693 | //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget); | 1693 | //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget); |
1694 | // mIncSearchWidget->hide(); | 1694 | // mIncSearchWidget->hide(); |
1695 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 1695 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
1696 | SLOT( incrementalSearch( const QString& ) ) ); | 1696 | SLOT( incrementalSearch( const QString& ) ) ); |
1697 | connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) ); | 1697 | connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) ); |
1698 | connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) ); | 1698 | connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) ); |
1699 | 1699 | ||
1700 | mJumpButtonBar = new JumpButtonBar( this, this ); | 1700 | mJumpButtonBar = new JumpButtonBar( this, this ); |
1701 | 1701 | ||
1702 | topLayout->addWidget( mJumpButtonBar ); | 1702 | topLayout->addWidget( mJumpButtonBar ); |
1703 | //US topLayout->setStretchFactor( mJumpButtonBar, 10 ); | 1703 | //US topLayout->setStretchFactor( mJumpButtonBar, 10 ); |
1704 | 1704 | ||
1705 | // mMainWindow->getIconToolBar()->raise(); | 1705 | // mMainWindow->getIconToolBar()->raise(); |
1706 | 1706 | ||
1707 | #endif //KAB_EMBEDDED | 1707 | #endif //KAB_EMBEDDED |
1708 | 1708 | ||
1709 | } | 1709 | } |
1710 | void KABCore::initActions() | 1710 | void KABCore::initActions() |
1711 | { | 1711 | { |
1712 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 1712 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
1713 | 1713 | ||
1714 | #ifndef KAB_EMBEDDED | 1714 | #ifndef KAB_EMBEDDED |
1715 | connect( QApplication::clipboard(), SIGNAL( dataChanged() ), | 1715 | connect( QApplication::clipboard(), SIGNAL( dataChanged() ), |
1716 | SLOT( clipboardDataChanged() ) ); | 1716 | SLOT( clipboardDataChanged() ) ); |
1717 | #endif //KAB_EMBEDDED | 1717 | #endif //KAB_EMBEDDED |
1718 | 1718 | ||
1719 | // file menu | 1719 | // file menu |
1720 | if ( mIsPart ) { | 1720 | if ( mIsPart ) { |
1721 | mActionMail = new KAction( i18n( "&Mail" ), "mail_generic", 0, this, | 1721 | mActionMail = new KAction( i18n( "&Mail" ), "mail_generic", 0, this, |
1722 | SLOT( sendMail() ), actionCollection(), | 1722 | SLOT( sendMail() ), actionCollection(), |
1723 | "kaddressbook_mail" ); | 1723 | "kaddressbook_mail" ); |
1724 | mActionPrint = new KAction( i18n( "&Print" ), "fileprint", CTRL + Key_P, this, | 1724 | mActionPrint = new KAction( i18n( "&Print" ), "fileprint", CTRL + Key_P, this, |
1725 | SLOT( print() ), actionCollection(), "kaddressbook_print" ); | 1725 | SLOT( print() ), actionCollection(), "kaddressbook_print" ); |
1726 | 1726 | ||
1727 | } else { | 1727 | } else { |
1728 | mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); | 1728 | mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); |
1729 | mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); | 1729 | mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); |
1730 | } | 1730 | } |
1731 | 1731 | ||
1732 | 1732 | ||
1733 | mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, | 1733 | mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, |
1734 | SLOT( save() ), actionCollection(), "file_sync" ); | 1734 | SLOT( save() ), actionCollection(), "file_sync" ); |
1735 | 1735 | ||
1736 | mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, | 1736 | mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, |
1737 | SLOT( newContact() ), actionCollection(), "file_new_contact" ); | 1737 | SLOT( newContact() ), actionCollection(), "file_new_contact" ); |
1738 | 1738 | ||
1739 | mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, | 1739 | mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, |
1740 | this, SLOT( mailVCard() ), | 1740 | this, SLOT( mailVCard() ), |
1741 | actionCollection(), "file_mail_vcard"); | 1741 | actionCollection(), "file_mail_vcard"); |
1742 | 1742 | ||
1743 | mActionExport2phone = new KAction( i18n( "Selected to phone" ), "ex2phone", 0, this, | 1743 | mActionExport2phone = new KAction( i18n( "Selected to phone" ), "ex2phone", 0, this, |
1744 | SLOT( export2phone() ), actionCollection(), | 1744 | SLOT( export2phone() ), actionCollection(), |
1745 | "kaddressbook_ex2phone" ); | 1745 | "kaddressbook_ex2phone" ); |
1746 | 1746 | ||
1747 | mActionBeamVCard = 0; | 1747 | mActionBeamVCard = 0; |
1748 | mActionBeam = 0; | 1748 | mActionBeam = 0; |
1749 | 1749 | ||
1750 | #ifndef DESKTOP_VERSION | 1750 | #ifndef DESKTOP_VERSION |
1751 | if ( Ir::supported() ) { | 1751 | if ( Ir::supported() ) { |
1752 | mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, | 1752 | mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, |
1753 | SLOT( beamVCard() ), actionCollection(), | 1753 | SLOT( beamVCard() ), actionCollection(), |
1754 | "kaddressbook_beam_vcard" ); | 1754 | "kaddressbook_beam_vcard" ); |
1755 | 1755 | ||
1756 | mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, | 1756 | mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, |
1757 | SLOT( beamMySelf() ), actionCollection(), | 1757 | SLOT( beamMySelf() ), actionCollection(), |
1758 | "kaddressbook_beam_myself" ); | 1758 | "kaddressbook_beam_myself" ); |
1759 | } | 1759 | } |
1760 | #endif | 1760 | #endif |
1761 | 1761 | ||
1762 | mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, | 1762 | mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, |
1763 | this, SLOT( editContact2() ), | 1763 | this, SLOT( editContact2() ), |
1764 | actionCollection(), "file_properties" ); | 1764 | actionCollection(), "file_properties" ); |
1765 | 1765 | ||
1766 | #ifdef KAB_EMBEDDED | 1766 | #ifdef KAB_EMBEDDED |
1767 | // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); | 1767 | // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); |
1768 | mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, | 1768 | mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, |
1769 | mMainWindow, SLOT( exit() ), | 1769 | mMainWindow, SLOT( exit() ), |
1770 | actionCollection(), "quit" ); | 1770 | actionCollection(), "quit" ); |
1771 | #endif //KAB_EMBEDDED | 1771 | #endif //KAB_EMBEDDED |
1772 | 1772 | ||
1773 | // edit menu | 1773 | // edit menu |
1774 | if ( mIsPart ) { | 1774 | if ( mIsPart ) { |
1775 | mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, | 1775 | mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, |
1776 | SLOT( copyContacts() ), actionCollection(), | 1776 | SLOT( copyContacts() ), actionCollection(), |
1777 | "kaddressbook_copy" ); | 1777 | "kaddressbook_copy" ); |
1778 | mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, | 1778 | mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, |
1779 | SLOT( cutContacts() ), actionCollection(), | 1779 | SLOT( cutContacts() ), actionCollection(), |
1780 | "kaddressbook_cut" ); | 1780 | "kaddressbook_cut" ); |
1781 | mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, | 1781 | mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, |
1782 | SLOT( pasteContacts() ), actionCollection(), | 1782 | SLOT( pasteContacts() ), actionCollection(), |
1783 | "kaddressbook_paste" ); | 1783 | "kaddressbook_paste" ); |
1784 | mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, | 1784 | mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, |
1785 | SLOT( selectAllContacts() ), actionCollection(), | 1785 | SLOT( selectAllContacts() ), actionCollection(), |
1786 | "kaddressbook_select_all" ); | 1786 | "kaddressbook_select_all" ); |
1787 | mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, | 1787 | mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, |
1788 | SLOT( undo() ), actionCollection(), | 1788 | SLOT( undo() ), actionCollection(), |
1789 | "kaddressbook_undo" ); | 1789 | "kaddressbook_undo" ); |
1790 | mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, | 1790 | mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, |
1791 | this, SLOT( redo() ), actionCollection(), | 1791 | this, SLOT( redo() ), actionCollection(), |
1792 | "kaddressbook_redo" ); | 1792 | "kaddressbook_redo" ); |
1793 | } else { | 1793 | } else { |
1794 | mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); | 1794 | mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); |
1795 | mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); | 1795 | mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); |
1796 | mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); | 1796 | mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); |
1797 | mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); | 1797 | mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); |
1798 | mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); | 1798 | mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); |
1799 | mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); | 1799 | mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); |
1800 | } | 1800 | } |
1801 | 1801 | ||
1802 | mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", | 1802 | mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", |
1803 | Key_Delete, this, SLOT( deleteContacts() ), | 1803 | Key_Delete, this, SLOT( deleteContacts() ), |
1804 | actionCollection(), "edit_delete" ); | 1804 | actionCollection(), "edit_delete" ); |
1805 | 1805 | ||
1806 | mActionUndo->setEnabled( false ); | 1806 | mActionUndo->setEnabled( false ); |
1807 | mActionRedo->setEnabled( false ); | 1807 | mActionRedo->setEnabled( false ); |
1808 | 1808 | ||
1809 | // settings menu | 1809 | // settings menu |
1810 | #ifdef KAB_EMBEDDED | 1810 | #ifdef KAB_EMBEDDED |
1811 | //US special menuentry to configure the addressbook resources. On KDE | 1811 | //US special menuentry to configure the addressbook resources. On KDE |
1812 | // you do that through the control center !!! | 1812 | // you do that through the control center !!! |
1813 | mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, | 1813 | mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, |
1814 | SLOT( configureResources() ), actionCollection(), | 1814 | SLOT( configureResources() ), actionCollection(), |
1815 | "kaddressbook_configure_resources" ); | 1815 | "kaddressbook_configure_resources" ); |
1816 | #endif //KAB_EMBEDDED | 1816 | #endif //KAB_EMBEDDED |
1817 | 1817 | ||
1818 | if ( mIsPart ) { | 1818 | if ( mIsPart ) { |
1819 | mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, | 1819 | mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, |
1820 | SLOT( openConfigDialog() ), actionCollection(), | 1820 | SLOT( openConfigDialog() ), actionCollection(), |
1821 | "kaddressbook_configure" ); | 1821 | "kaddressbook_configure" ); |
1822 | 1822 | ||
1823 | mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, | 1823 | mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, |
1824 | this, SLOT( configureKeyBindings() ), actionCollection(), | 1824 | this, SLOT( configureKeyBindings() ), actionCollection(), |
1825 | "kaddressbook_configure_shortcuts" ); | 1825 | "kaddressbook_configure_shortcuts" ); |
1826 | #ifdef KAB_EMBEDDED | 1826 | #ifdef KAB_EMBEDDED |
1827 | mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); | 1827 | mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); |
1828 | mActionConfigureToolbars->setEnabled( false ); | 1828 | mActionConfigureToolbars->setEnabled( false ); |
1829 | #endif //KAB_EMBEDDED | 1829 | #endif //KAB_EMBEDDED |
1830 | 1830 | ||
1831 | } else { | 1831 | } else { |
1832 | mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); | 1832 | mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); |
1833 | 1833 | ||
1834 | mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); | 1834 | mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); |
1835 | } | 1835 | } |
1836 | 1836 | ||
1837 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, | 1837 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, |
1838 | actionCollection(), "options_show_jump_bar" ); | 1838 | actionCollection(), "options_show_jump_bar" ); |
1839 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); | 1839 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); |
1840 | 1840 | ||
1841 | mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, | 1841 | mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, |
1842 | actionCollection(), "options_show_details" ); | 1842 | actionCollection(), "options_show_details" ); |
1843 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); | 1843 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); |
1844 | 1844 | ||
1845 | 1845 | ||
1846 | mActionBR = new KToggleAction( i18n( "Beam receice enabled" ), "beam", 0, this, | 1846 | mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, |
1847 | SLOT( toggleBeamReceive() ), actionCollection(), | 1847 | SLOT( toggleBeamReceive() ), actionCollection(), |
1848 | "kaddressbook_beam_rec" ); | 1848 | "kaddressbook_beam_rec" ); |
1849 | 1849 | ||
1850 | 1850 | ||
1851 | // misc | 1851 | // misc |
1852 | // only enable LDAP lookup if we can handle the protocol | 1852 | // only enable LDAP lookup if we can handle the protocol |
1853 | #ifndef KAB_EMBEDDED | 1853 | #ifndef KAB_EMBEDDED |
1854 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { | 1854 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { |
1855 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, | 1855 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, |
1856 | this, SLOT( openLDAPDialog() ), actionCollection(), | 1856 | this, SLOT( openLDAPDialog() ), actionCollection(), |
1857 | "ldap_lookup" ); | 1857 | "ldap_lookup" ); |
1858 | } | 1858 | } |
1859 | #else //KAB_EMBEDDED | 1859 | #else //KAB_EMBEDDED |
1860 | //qDebug("KABCore::initActions() LDAP has to be implemented"); | 1860 | //qDebug("KABCore::initActions() LDAP has to be implemented"); |
1861 | #endif //KAB_EMBEDDED | 1861 | #endif //KAB_EMBEDDED |
1862 | 1862 | ||
1863 | 1863 | ||
1864 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, | 1864 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, |
1865 | SLOT( setWhoAmI() ), actionCollection(), | 1865 | SLOT( setWhoAmI() ), actionCollection(), |
1866 | "set_personal" ); | 1866 | "set_personal" ); |
1867 | 1867 | ||
1868 | 1868 | ||
1869 | 1869 | ||
1870 | 1870 | ||
1871 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, | 1871 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, |
1872 | SLOT( setCategories() ), actionCollection(), | 1872 | SLOT( setCategories() ), actionCollection(), |
1873 | "edit_set_categories" ); | 1873 | "edit_set_categories" ); |
1874 | 1874 | ||
1875 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, | 1875 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, |
1876 | SLOT( removeVoice() ), actionCollection(), | 1876 | SLOT( removeVoice() ), actionCollection(), |
1877 | "remove_voice" ); | 1877 | "remove_voice" ); |
1878 | mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, | 1878 | mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, |
1879 | SLOT( importFromOL() ), actionCollection(), | 1879 | SLOT( importFromOL() ), actionCollection(), |
1880 | "import_OL" ); | 1880 | "import_OL" ); |
1881 | #ifdef KAB_EMBEDDED | 1881 | #ifdef KAB_EMBEDDED |
1882 | mActionLicence = new KAction( i18n( "Licence" ), 0, | 1882 | mActionLicence = new KAction( i18n( "Licence" ), 0, |
1883 | this, SLOT( showLicence() ), actionCollection(), | 1883 | this, SLOT( showLicence() ), actionCollection(), |
1884 | "licence_about_data" ); | 1884 | "licence_about_data" ); |
1885 | mActionFaq = new KAction( i18n( "Faq" ), 0, | 1885 | mActionFaq = new KAction( i18n( "Faq" ), 0, |
1886 | this, SLOT( faq() ), actionCollection(), | 1886 | this, SLOT( faq() ), actionCollection(), |
1887 | "faq_about_data" ); | 1887 | "faq_about_data" ); |
1888 | mActionWN = new KAction( i18n( "What's New?" ), 0, | 1888 | mActionWN = new KAction( i18n( "What's New?" ), 0, |
1889 | this, SLOT( whatsnew() ), actionCollection(), | 1889 | this, SLOT( whatsnew() ), actionCollection(), |
1890 | "wn" ); | 1890 | "wn" ); |
1891 | mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, | 1891 | mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, |
1892 | this, SLOT( synchowto() ), actionCollection(), | 1892 | this, SLOT( synchowto() ), actionCollection(), |
1893 | "sync" ); | 1893 | "sync" ); |
1894 | 1894 | ||
1895 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, | 1895 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, |
1896 | this, SLOT( createAboutData() ), actionCollection(), | 1896 | this, SLOT( createAboutData() ), actionCollection(), |
1897 | "kaddressbook_about_data" ); | 1897 | "kaddressbook_about_data" ); |
1898 | #endif //KAB_EMBEDDED | 1898 | #endif //KAB_EMBEDDED |
1899 | 1899 | ||
1900 | clipboardDataChanged(); | 1900 | clipboardDataChanged(); |
1901 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1901 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1902 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1902 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1903 | } | 1903 | } |
1904 | 1904 | ||
1905 | //US we need this function, to plug all actions into the correct menues. | 1905 | //US we need this function, to plug all actions into the correct menues. |
1906 | // KDE uses a XML format to plug the actions, but we work her without this overhead. | 1906 | // KDE uses a XML format to plug the actions, but we work her without this overhead. |
1907 | void KABCore::addActionsManually() | 1907 | void KABCore::addActionsManually() |
1908 | { | 1908 | { |
1909 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 1909 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
1910 | 1910 | ||
1911 | #ifdef KAB_EMBEDDED | 1911 | #ifdef KAB_EMBEDDED |
1912 | QPopupMenu *fileMenu = new QPopupMenu( this ); | 1912 | QPopupMenu *fileMenu = new QPopupMenu( this ); |
1913 | QPopupMenu *editMenu = new QPopupMenu( this ); | 1913 | QPopupMenu *editMenu = new QPopupMenu( this ); |
1914 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 1914 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
1915 | 1915 | ||
1916 | KToolBar* tb = mMainWindow->toolBar(); | 1916 | KToolBar* tb = mMainWindow->toolBar(); |
1917 | 1917 | ||
1918 | #ifdef DESKTOP_VERSION | 1918 | #ifdef DESKTOP_VERSION |
1919 | QMenuBar* mb = mMainWindow->menuBar(); | 1919 | QMenuBar* mb = mMainWindow->menuBar(); |
1920 | 1920 | ||
1921 | //US setup menubar. | 1921 | //US setup menubar. |
1922 | //Disable the following block if you do not want to have a menubar. | 1922 | //Disable the following block if you do not want to have a menubar. |
1923 | mb->insertItem( "&File", fileMenu ); | 1923 | mb->insertItem( "&File", fileMenu ); |
1924 | mb->insertItem( "&Edit", editMenu ); | 1924 | mb->insertItem( "&Edit", editMenu ); |
1925 | mb->insertItem( "&View", viewMenu ); | 1925 | mb->insertItem( "&View", viewMenu ); |
1926 | mb->insertItem( "&Settings", settingsMenu ); | 1926 | mb->insertItem( "&Settings", settingsMenu ); |
1927 | mb->insertItem( i18n("Synchronize"), syncMenu ); | 1927 | mb->insertItem( i18n("Synchronize"), syncMenu ); |
1928 | mb->insertItem( "&Change selected", changeMenu ); | 1928 | mb->insertItem( "&Change selected", changeMenu ); |
1929 | mb->insertItem( "&Help", helpMenu ); | 1929 | mb->insertItem( "&Help", helpMenu ); |
1930 | mIncSearchWidget = new IncSearchWidget( tb ); | 1930 | mIncSearchWidget = new IncSearchWidget( tb ); |
1931 | // tb->insertWidget(-1, 0, mIncSearchWidget); | 1931 | // tb->insertWidget(-1, 0, mIncSearchWidget); |
1932 | 1932 | ||
1933 | #else | 1933 | #else |
1934 | //US setup toolbar | 1934 | //US setup toolbar |
1935 | QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); | 1935 | QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); |
1936 | QPopupMenu *popupBarTB = new QPopupMenu( this ); | 1936 | QPopupMenu *popupBarTB = new QPopupMenu( this ); |
1937 | menuBarTB->insertItem( "ME", popupBarTB); | 1937 | menuBarTB->insertItem( "ME", popupBarTB); |
1938 | tb->insertWidget(-1, 0, menuBarTB); | 1938 | tb->insertWidget(-1, 0, menuBarTB); |
1939 | mIncSearchWidget = new IncSearchWidget( tb ); | 1939 | mIncSearchWidget = new IncSearchWidget( tb ); |
1940 | 1940 | ||
1941 | tb->enableMoving(false); | 1941 | tb->enableMoving(false); |
1942 | popupBarTB->insertItem( "&File", fileMenu ); | 1942 | popupBarTB->insertItem( "&File", fileMenu ); |
1943 | popupBarTB->insertItem( "&Edit", editMenu ); | 1943 | popupBarTB->insertItem( "&Edit", editMenu ); |
1944 | popupBarTB->insertItem( "&View", viewMenu ); | 1944 | popupBarTB->insertItem( "&View", viewMenu ); |
1945 | popupBarTB->insertItem( "&Settings", settingsMenu ); | 1945 | popupBarTB->insertItem( "&Settings", settingsMenu ); |
1946 | popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); | 1946 | popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); |
1947 | mViewManager->getFilterAction()->plug ( popupBarTB); | 1947 | mViewManager->getFilterAction()->plug ( popupBarTB); |
1948 | popupBarTB->insertItem( "&Change selected", changeMenu ); | 1948 | popupBarTB->insertItem( "&Change selected", changeMenu ); |
1949 | popupBarTB->insertItem( "&Help", helpMenu ); | 1949 | popupBarTB->insertItem( "&Help", helpMenu ); |
1950 | if (QApplication::desktop()->width() > 320 ) { | 1950 | if (QApplication::desktop()->width() > 320 ) { |
1951 | // mViewManager->getFilterAction()->plug ( tb); | 1951 | // mViewManager->getFilterAction()->plug ( tb); |
1952 | } | 1952 | } |
1953 | #endif | 1953 | #endif |
1954 | // mActionQuit->plug ( mMainWindow->toolBar()); | 1954 | // mActionQuit->plug ( mMainWindow->toolBar()); |
1955 | 1955 | ||
1956 | 1956 | ||
1957 | 1957 | ||
1958 | //US Now connect the actions with the menue entries. | 1958 | //US Now connect the actions with the menue entries. |
1959 | mActionPrint->plug( fileMenu ); | 1959 | mActionPrint->plug( fileMenu ); |
1960 | mActionMail->plug( fileMenu ); | 1960 | mActionMail->plug( fileMenu ); |
1961 | fileMenu->insertSeparator(); | 1961 | fileMenu->insertSeparator(); |
1962 | 1962 | ||
1963 | mActionNewContact->plug( fileMenu ); | 1963 | mActionNewContact->plug( fileMenu ); |
1964 | mActionNewContact->plug( tb ); | 1964 | mActionNewContact->plug( tb ); |
1965 | 1965 | ||
1966 | mActionEditAddressee->plug( fileMenu ); | 1966 | mActionEditAddressee->plug( fileMenu ); |
1967 | if ((KGlobal::getDesktopSize() > KGlobal::Small ) || | 1967 | if ((KGlobal::getDesktopSize() > KGlobal::Small ) || |
1968 | (!KABPrefs::instance()->mMultipleViewsAtOnce )) | 1968 | (!KABPrefs::instance()->mMultipleViewsAtOnce )) |
1969 | mActionEditAddressee->plug( tb ); | 1969 | mActionEditAddressee->plug( tb ); |
1970 | 1970 | ||
1971 | fileMenu->insertSeparator(); | 1971 | fileMenu->insertSeparator(); |
1972 | mActionSave->plug( fileMenu ); | 1972 | mActionSave->plug( fileMenu ); |
1973 | fileMenu->insertItem( "&Import", ImportMenu ); | 1973 | fileMenu->insertItem( "&Import", ImportMenu ); |
1974 | fileMenu->insertItem( "&Export", ExportMenu ); | 1974 | fileMenu->insertItem( "&Export", ExportMenu ); |
1975 | fileMenu->insertSeparator(); | 1975 | fileMenu->insertSeparator(); |
1976 | mActionMailVCard->plug( fileMenu ); | 1976 | mActionMailVCard->plug( fileMenu ); |
1977 | #ifndef DESKTOP_VERSION | 1977 | #ifndef DESKTOP_VERSION |
1978 | if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); | 1978 | if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); |
1979 | if ( Ir::supported() ) mActionBeam->plug(fileMenu ); | 1979 | if ( Ir::supported() ) mActionBeam->plug(fileMenu ); |
1980 | #endif | 1980 | #endif |
1981 | fileMenu->insertSeparator(); | 1981 | fileMenu->insertSeparator(); |
1982 | mActionQuit->plug( fileMenu ); | 1982 | mActionQuit->plug( fileMenu ); |
1983 | #ifdef _WIN32_ | 1983 | #ifdef _WIN32_ |
1984 | mActionImportOL->plug( ImportMenu ); | 1984 | mActionImportOL->plug( ImportMenu ); |
1985 | #endif | 1985 | #endif |
1986 | // edit menu | 1986 | // edit menu |
1987 | mActionUndo->plug( editMenu ); | 1987 | mActionUndo->plug( editMenu ); |
1988 | mActionRedo->plug( editMenu ); | 1988 | mActionRedo->plug( editMenu ); |
1989 | editMenu->insertSeparator(); | 1989 | editMenu->insertSeparator(); |
1990 | mActionCut->plug( editMenu ); | 1990 | mActionCut->plug( editMenu ); |
1991 | mActionCopy->plug( editMenu ); | 1991 | mActionCopy->plug( editMenu ); |
1992 | mActionPaste->plug( editMenu ); | 1992 | mActionPaste->plug( editMenu ); |
1993 | mActionDelete->plug( editMenu ); | 1993 | mActionDelete->plug( editMenu ); |
1994 | editMenu->insertSeparator(); | 1994 | editMenu->insertSeparator(); |
1995 | mActionSelectAll->plug( editMenu ); | 1995 | mActionSelectAll->plug( editMenu ); |
1996 | 1996 | ||
1997 | mActionRemoveVoice->plug( changeMenu ); | 1997 | mActionRemoveVoice->plug( changeMenu ); |
1998 | // settings menu | 1998 | // settings menu |
1999 | //US special menuentry to configure the addressbook resources. On KDE | 1999 | //US special menuentry to configure the addressbook resources. On KDE |
2000 | // you do that through the control center !!! | 2000 | // you do that through the control center !!! |
2001 | mActionConfigResources->plug( settingsMenu ); | 2001 | mActionConfigResources->plug( settingsMenu ); |
2002 | settingsMenu->insertSeparator(); | 2002 | settingsMenu->insertSeparator(); |
2003 | 2003 | ||
2004 | mActionConfigKAddressbook->plug( settingsMenu ); | 2004 | mActionConfigKAddressbook->plug( settingsMenu ); |
2005 | 2005 | ||
2006 | if ( mIsPart ) { | 2006 | if ( mIsPart ) { |
2007 | mActionConfigShortcuts->plug( settingsMenu ); | 2007 | mActionConfigShortcuts->plug( settingsMenu ); |
2008 | mActionConfigureToolbars->plug( settingsMenu ); | 2008 | mActionConfigureToolbars->plug( settingsMenu ); |
2009 | 2009 | ||
2010 | } else { | 2010 | } else { |
2011 | mActionKeyBindings->plug( settingsMenu ); | 2011 | mActionKeyBindings->plug( settingsMenu ); |
2012 | } | 2012 | } |
2013 | 2013 | ||
2014 | settingsMenu->insertSeparator(); | 2014 | settingsMenu->insertSeparator(); |
2015 | 2015 | ||
2016 | mActionJumpBar->plug( settingsMenu ); | 2016 | mActionJumpBar->plug( settingsMenu ); |
2017 | mActionDetails->plug( settingsMenu ); | 2017 | mActionDetails->plug( settingsMenu ); |
2018 | if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) | 2018 | if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) |
2019 | mActionDetails->plug( tb ); | 2019 | mActionDetails->plug( tb ); |
2020 | settingsMenu->insertSeparator(); | 2020 | settingsMenu->insertSeparator(); |
2021 | mActionBR->plug(settingsMenu ); | 2021 | mActionBR->plug(settingsMenu ); |
2022 | settingsMenu->insertSeparator(); | 2022 | settingsMenu->insertSeparator(); |
2023 | 2023 | ||
2024 | mActionWhoAmI->plug( settingsMenu ); | 2024 | mActionWhoAmI->plug( settingsMenu ); |
2025 | mActionCategories->plug( settingsMenu ); | 2025 | mActionCategories->plug( settingsMenu ); |
2026 | 2026 | ||
2027 | 2027 | ||
2028 | mActionWN->plug( helpMenu ); | 2028 | mActionWN->plug( helpMenu ); |
2029 | mActionSyncHowto->plug( helpMenu ); | 2029 | mActionSyncHowto->plug( helpMenu ); |
2030 | mActionLicence->plug( helpMenu ); | 2030 | mActionLicence->plug( helpMenu ); |
2031 | mActionFaq->plug( helpMenu ); | 2031 | mActionFaq->plug( helpMenu ); |
2032 | mActionAboutKAddressbook->plug( helpMenu ); | 2032 | mActionAboutKAddressbook->plug( helpMenu ); |
2033 | 2033 | ||
2034 | if (KGlobal::getDesktopSize() > KGlobal::Small ) { | 2034 | if (KGlobal::getDesktopSize() > KGlobal::Small ) { |
2035 | 2035 | ||
2036 | mActionSave->plug( tb ); | 2036 | mActionSave->plug( tb ); |
2037 | mViewManager->getFilterAction()->plug ( tb); | 2037 | mViewManager->getFilterAction()->plug ( tb); |
2038 | if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { | 2038 | if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { |
2039 | mActionUndo->plug( tb ); | 2039 | mActionUndo->plug( tb ); |
2040 | mActionDelete->plug( tb ); | 2040 | mActionDelete->plug( tb ); |
2041 | mActionRedo->plug( tb ); | 2041 | mActionRedo->plug( tb ); |
2042 | } | 2042 | } |
2043 | } | 2043 | } |
2044 | //mActionQuit->plug ( tb ); | 2044 | //mActionQuit->plug ( tb ); |
2045 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); | 2045 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); |
2046 | 2046 | ||
2047 | //US link the searchwidget first to this. | 2047 | //US link the searchwidget first to this. |
2048 | // The real linkage to the toolbar happens later. | 2048 | // The real linkage to the toolbar happens later. |
2049 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); | 2049 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); |
2050 | //US tb->insertItem( mIncSearchWidget ); | 2050 | //US tb->insertItem( mIncSearchWidget ); |
2051 | /*US | 2051 | /*US |
2052 | mIncSearchWidget = new IncSearchWidget( tb ); | 2052 | mIncSearchWidget = new IncSearchWidget( tb ); |
2053 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 2053 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
2054 | SLOT( incrementalSearch( const QString& ) ) ); | 2054 | SLOT( incrementalSearch( const QString& ) ) ); |
2055 | 2055 | ||
2056 | mJumpButtonBar = new JumpButtonBar( this, this ); | 2056 | mJumpButtonBar = new JumpButtonBar( this, this ); |
2057 | 2057 | ||
2058 | //US topLayout->addWidget( mJumpButtonBar ); | 2058 | //US topLayout->addWidget( mJumpButtonBar ); |
2059 | this->layout()->add( mJumpButtonBar ); | 2059 | this->layout()->add( mJumpButtonBar ); |
2060 | */ | 2060 | */ |
2061 | 2061 | ||
2062 | #endif //KAB_EMBEDDED | 2062 | #endif //KAB_EMBEDDED |
2063 | 2063 | ||
2064 | mActionExport2phone->plug( ExportMenu ); | 2064 | mActionExport2phone->plug( ExportMenu ); |
2065 | connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); | 2065 | connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); |
2066 | syncManager->fillSyncMenu(); | 2066 | syncManager->fillSyncMenu(); |
2067 | 2067 | ||
2068 | } | 2068 | } |
2069 | void KABCore::showLicence() | 2069 | void KABCore::showLicence() |
2070 | { | 2070 | { |
2071 | KApplication::showLicence(); | 2071 | KApplication::showLicence(); |
2072 | } | 2072 | } |
2073 | void KABCore::removeVoice() | 2073 | void KABCore::removeVoice() |
2074 | { | 2074 | { |
2075 | 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 ) | 2075 | 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 ) |
2076 | return; | 2076 | return; |
2077 | KABC::Addressee::List list = mViewManager->selectedAddressees(); | 2077 | KABC::Addressee::List list = mViewManager->selectedAddressees(); |
2078 | KABC::Addressee::List::Iterator it; | 2078 | KABC::Addressee::List::Iterator it; |
2079 | for ( it = list.begin(); it != list.end(); ++it ) { | 2079 | for ( it = list.begin(); it != list.end(); ++it ) { |
2080 | 2080 | ||
2081 | if ( (*it).removeVoice() ) | 2081 | if ( (*it).removeVoice() ) |
2082 | contactModified((*it) ); | 2082 | contactModified((*it) ); |
2083 | } | 2083 | } |
2084 | } | 2084 | } |
2085 | 2085 | ||
2086 | 2086 | ||
2087 | 2087 | ||
2088 | void KABCore::clipboardDataChanged() | 2088 | void KABCore::clipboardDataChanged() |
2089 | { | 2089 | { |
2090 | 2090 | ||
2091 | if ( mReadWrite ) | 2091 | if ( mReadWrite ) |
2092 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); | 2092 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); |
2093 | 2093 | ||
2094 | } | 2094 | } |
2095 | 2095 | ||
2096 | void KABCore::updateActionMenu() | 2096 | void KABCore::updateActionMenu() |
2097 | { | 2097 | { |
2098 | UndoStack *undo = UndoStack::instance(); | 2098 | UndoStack *undo = UndoStack::instance(); |
2099 | RedoStack *redo = RedoStack::instance(); | 2099 | RedoStack *redo = RedoStack::instance(); |
2100 | 2100 | ||
2101 | if ( undo->isEmpty() ) | 2101 | if ( undo->isEmpty() ) |
2102 | mActionUndo->setText( i18n( "Undo" ) ); | 2102 | mActionUndo->setText( i18n( "Undo" ) ); |
2103 | else | 2103 | else |
2104 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); | 2104 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); |
2105 | 2105 | ||
2106 | mActionUndo->setEnabled( !undo->isEmpty() ); | 2106 | mActionUndo->setEnabled( !undo->isEmpty() ); |
2107 | 2107 | ||
2108 | if ( !redo->top() ) | 2108 | if ( !redo->top() ) |
2109 | mActionRedo->setText( i18n( "Redo" ) ); | 2109 | mActionRedo->setText( i18n( "Redo" ) ); |
2110 | else | 2110 | else |
2111 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); | 2111 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); |
2112 | 2112 | ||
2113 | mActionRedo->setEnabled( !redo->isEmpty() ); | 2113 | mActionRedo->setEnabled( !redo->isEmpty() ); |
2114 | } | 2114 | } |
2115 | 2115 | ||
2116 | void KABCore::configureKeyBindings() | 2116 | void KABCore::configureKeyBindings() |
2117 | { | 2117 | { |
2118 | #ifndef KAB_EMBEDDED | 2118 | #ifndef KAB_EMBEDDED |
2119 | KKeyDialog::configure( actionCollection(), true ); | 2119 | KKeyDialog::configure( actionCollection(), true ); |
2120 | #else //KAB_EMBEDDED | 2120 | #else //KAB_EMBEDDED |
2121 | qDebug("KABCore::configureKeyBindings() not implemented"); | 2121 | qDebug("KABCore::configureKeyBindings() not implemented"); |
2122 | #endif //KAB_EMBEDDED | 2122 | #endif //KAB_EMBEDDED |
2123 | } | 2123 | } |
2124 | 2124 | ||
2125 | #ifdef KAB_EMBEDDED | 2125 | #ifdef KAB_EMBEDDED |
2126 | void KABCore::configureResources() | 2126 | void KABCore::configureResources() |
2127 | { | 2127 | { |
2128 | KRES::KCMKResources dlg( this, "" , 0 ); | 2128 | KRES::KCMKResources dlg( this, "" , 0 ); |
2129 | 2129 | ||
2130 | if ( !dlg.exec() ) | 2130 | if ( !dlg.exec() ) |
2131 | return; | 2131 | return; |
2132 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); | 2132 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); |
2133 | } | 2133 | } |
2134 | #endif //KAB_EMBEDDED | 2134 | #endif //KAB_EMBEDDED |
2135 | 2135 | ||
2136 | 2136 | ||
2137 | /* this method will be called through the QCop interface from Ko/Pi to select addresses | 2137 | /* this method will be called through the QCop interface from Ko/Pi to select addresses |
2138 | * for the attendees list of an event. | 2138 | * for the attendees list of an event. |
2139 | */ | 2139 | */ |
2140 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) | 2140 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) |
2141 | { | 2141 | { |
2142 | QStringList nameList; | 2142 | QStringList nameList; |
2143 | QStringList emailList; | 2143 | QStringList emailList; |
2144 | QStringList uidList; | 2144 | QStringList uidList; |
2145 | 2145 | ||
2146 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); | 2146 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); |
2147 | uint i=0; | 2147 | uint i=0; |
2148 | for (i=0; i < list.count(); i++) | 2148 | for (i=0; i < list.count(); i++) |
2149 | { | 2149 | { |
2150 | nameList.append(list[i].realName()); | 2150 | nameList.append(list[i].realName()); |
2151 | emailList.append(list[i].preferredEmail()); | 2151 | emailList.append(list[i].preferredEmail()); |
2152 | uidList.append(list[i].uid()); | 2152 | uidList.append(list[i].uid()); |
2153 | } | 2153 | } |
2154 | 2154 | ||
2155 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); | 2155 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); |
2156 | 2156 | ||
2157 | } | 2157 | } |
2158 | 2158 | ||
2159 | /* this method will be called through the QCop interface from Ko/Pi to select birthdays | 2159 | /* this method will be called through the QCop interface from Ko/Pi to select birthdays |
2160 | * to put them into the calendar. | 2160 | * to put them into the calendar. |
2161 | */ | 2161 | */ |
2162 | void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) | 2162 | void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) |
2163 | { | 2163 | { |
2164 | // qDebug("KABCore::requestForBirthdayList"); | 2164 | // qDebug("KABCore::requestForBirthdayList"); |
2165 | QStringList birthdayList; | 2165 | QStringList birthdayList; |
2166 | QStringList anniversaryList; | 2166 | QStringList anniversaryList; |
2167 | QStringList realNameList; | 2167 | QStringList realNameList; |
2168 | QStringList preferredEmailList; | 2168 | QStringList preferredEmailList; |
2169 | QStringList assembledNameList; | 2169 | QStringList assembledNameList; |
2170 | QStringList uidList; | 2170 | QStringList uidList; |
2171 | 2171 | ||
2172 | KABC::AddressBook::Iterator it; | 2172 | KABC::AddressBook::Iterator it; |
2173 | 2173 | ||
2174 | int count = 0; | 2174 | int count = 0; |
2175 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2175 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2176 | ++count; | 2176 | ++count; |
2177 | } | 2177 | } |
2178 | QProgressBar bar(count,0 ); | 2178 | QProgressBar bar(count,0 ); |
2179 | int w = 300; | 2179 | int w = 300; |
2180 | if ( QApplication::desktop()->width() < 320 ) | 2180 | if ( QApplication::desktop()->width() < 320 ) |
2181 | w = 220; | 2181 | w = 220; |
2182 | int h = bar.sizeHint().height() ; | 2182 | int h = bar.sizeHint().height() ; |
2183 | int dw = QApplication::desktop()->width(); | 2183 | int dw = QApplication::desktop()->width(); |
2184 | int dh = QApplication::desktop()->height(); | 2184 | int dh = QApplication::desktop()->height(); |
2185 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2185 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2186 | bar.show(); | 2186 | bar.show(); |
2187 | bar.setCaption (i18n("Collecting birthdays - close to abort!") ); | 2187 | bar.setCaption (i18n("Collecting birthdays - close to abort!") ); |
2188 | qApp->processEvents(); | 2188 | qApp->processEvents(); |
2189 | 2189 | ||
2190 | QDate bday; | 2190 | QDate bday; |
2191 | QString anni; | 2191 | QString anni; |
2192 | QString formattedbday; | 2192 | QString formattedbday; |
2193 | 2193 | ||
2194 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) | 2194 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) |
2195 | { | 2195 | { |
2196 | if ( ! bar.isVisible() ) | 2196 | if ( ! bar.isVisible() ) |
2197 | return; | 2197 | return; |
2198 | bar.setProgress( count++ ); | 2198 | bar.setProgress( count++ ); |
2199 | qApp->processEvents(); | 2199 | qApp->processEvents(); |
2200 | bday = (*it).birthday().date(); | 2200 | bday = (*it).birthday().date(); |
2201 | anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); | 2201 | anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); |
2202 | 2202 | ||
2203 | if ( bday.isValid() || !anni.isEmpty()) | 2203 | if ( bday.isValid() || !anni.isEmpty()) |
2204 | { | 2204 | { |
2205 | if (bday.isValid()) | 2205 | if (bday.isValid()) |
2206 | formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); | 2206 | formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); |
2207 | else | 2207 | else |
2208 | formattedbday = "NOTVALID"; | 2208 | formattedbday = "NOTVALID"; |
2209 | if (anni.isEmpty()) | 2209 | if (anni.isEmpty()) |
2210 | anni = "INVALID"; | 2210 | anni = "INVALID"; |
2211 | 2211 | ||
2212 | birthdayList.append(formattedbday); | 2212 | birthdayList.append(formattedbday); |
2213 | anniversaryList.append(anni); //should be ISODate | 2213 | anniversaryList.append(anni); //should be ISODate |
2214 | realNameList.append((*it).realName()); | 2214 | realNameList.append((*it).realName()); |
2215 | preferredEmailList.append((*it).preferredEmail()); | 2215 | preferredEmailList.append((*it).preferredEmail()); |
2216 | assembledNameList.append((*it).assembledName()); | 2216 | assembledNameList.append((*it).assembledName()); |
2217 | uidList.append((*it).uid()); | 2217 | uidList.append((*it).uid()); |
2218 | 2218 | ||
2219 | qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() ); | 2219 | qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() ); |
2220 | } | 2220 | } |
2221 | } | 2221 | } |
2222 | 2222 | ||
2223 | bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); | 2223 | bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); |
2224 | 2224 | ||
2225 | } | 2225 | } |
2226 | 2226 | ||
2227 | /* this method will be called through the QCop interface from other apps to show details of a contact. | 2227 | /* this method will be called through the QCop interface from other apps to show details of a contact. |
2228 | */ | 2228 | */ |
2229 | void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) | 2229 | void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) |
2230 | { | 2230 | { |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index e3dad94..fbfcd20 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -427,769 +427,769 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
427 | qDebug("newCountdown "); | 427 | qDebug("newCountdown "); |
428 | 428 | ||
429 | } | 429 | } |
430 | QString msg ; | 430 | QString msg ; |
431 | QString allmsg = cmsg; | 431 | QString allmsg = cmsg; |
432 | while ( allmsg.length() > 0 ) { | 432 | while ( allmsg.length() > 0 ) { |
433 | int nextC = allmsg.find( "-", 1 ); | 433 | int nextC = allmsg.find( "-", 1 ); |
434 | if ( nextC == -1 ) { | 434 | if ( nextC == -1 ) { |
435 | msg = allmsg; | 435 | msg = allmsg; |
436 | allmsg = ""; | 436 | allmsg = ""; |
437 | } else{ | 437 | } else{ |
438 | msg = allmsg.left( nextC ); | 438 | msg = allmsg.left( nextC ); |
439 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 439 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
440 | } | 440 | } |
441 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 441 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
442 | if ( msg == "-newEvent" ) { | 442 | if ( msg == "-newEvent" ) { |
443 | mView->newEvent(); | 443 | mView->newEvent(); |
444 | } | 444 | } |
445 | if ( msg == "-newTodo" ) { | 445 | if ( msg == "-newTodo" ) { |
446 | mView->newTodo(); | 446 | mView->newTodo(); |
447 | 447 | ||
448 | } | 448 | } |
449 | if ( msg == "-showWN" ) { | 449 | if ( msg == "-showWN" ) { |
450 | mView->viewManager()->showWhatsNextView(); | 450 | mView->viewManager()->showWhatsNextView(); |
451 | } | 451 | } |
452 | if ( msg == "-showTodo" ) { | 452 | if ( msg == "-showTodo" ) { |
453 | mView->viewManager()->showTodoView(); | 453 | mView->viewManager()->showTodoView(); |
454 | } | 454 | } |
455 | if ( msg == "-showList" ) { | 455 | if ( msg == "-showList" ) { |
456 | mView->viewManager()->showListView(); | 456 | mView->viewManager()->showListView(); |
457 | } | 457 | } |
458 | else if ( msg == "-showDay" ) { | 458 | else if ( msg == "-showDay" ) { |
459 | mView->viewManager()->showDayView(); | 459 | mView->viewManager()->showDayView(); |
460 | } | 460 | } |
461 | else if ( msg == "-showWWeek" ) { | 461 | else if ( msg == "-showWWeek" ) { |
462 | mView->viewManager()->showWorkWeekView(); | 462 | mView->viewManager()->showWorkWeekView(); |
463 | } | 463 | } |
464 | else if ( msg == "-ringSync" ) { | 464 | else if ( msg == "-ringSync" ) { |
465 | mSyncManager->multiSync( false ); | 465 | mSyncManager->multiSync( false ); |
466 | } | 466 | } |
467 | else if ( msg == "-showWeek" ) { | 467 | else if ( msg == "-showWeek" ) { |
468 | mView->viewManager()->showWeekView(); | 468 | mView->viewManager()->showWeekView(); |
469 | } | 469 | } |
470 | else if ( msg == "-showTodo" ) { | 470 | else if ( msg == "-showTodo" ) { |
471 | mView->viewManager()->showTodoView(); | 471 | mView->viewManager()->showTodoView(); |
472 | } | 472 | } |
473 | else if ( msg == "-showJournal" ) { | 473 | else if ( msg == "-showJournal" ) { |
474 | mView->dateNavigator()->selectDates( 1 ); | 474 | mView->dateNavigator()->selectDates( 1 ); |
475 | mView->dateNavigator()->selectToday(); | 475 | mView->dateNavigator()->selectToday(); |
476 | mView->viewManager()->showJournalView(); | 476 | mView->viewManager()->showJournalView(); |
477 | } | 477 | } |
478 | else if ( msg == "-showKO" ) { | 478 | else if ( msg == "-showKO" ) { |
479 | mView->viewManager()->showNextXView(); | 479 | mView->viewManager()->showNextXView(); |
480 | } | 480 | } |
481 | else if ( msg == "-showWNext" || msg == "nextView()" ) { | 481 | else if ( msg == "-showWNext" || msg == "nextView()" ) { |
482 | mView->viewManager()->showWhatsNextView(); | 482 | mView->viewManager()->showWhatsNextView(); |
483 | } | 483 | } |
484 | else if ( msg == "-showNextXView" ) { | 484 | else if ( msg == "-showNextXView" ) { |
485 | mView->viewManager()->showNextXView(); | 485 | mView->viewManager()->showNextXView(); |
486 | } | 486 | } |
487 | 487 | ||
488 | 488 | ||
489 | } | 489 | } |
490 | 490 | ||
491 | showMaximized(); | 491 | showMaximized(); |
492 | raise(); | 492 | raise(); |
493 | } | 493 | } |
494 | 494 | ||
495 | QPixmap MainWindow::loadPixmap( QString name ) | 495 | QPixmap MainWindow::loadPixmap( QString name ) |
496 | { | 496 | { |
497 | return SmallIcon( name ); | 497 | return SmallIcon( name ); |
498 | 498 | ||
499 | } | 499 | } |
500 | void MainWindow::initActions() | 500 | void MainWindow::initActions() |
501 | { | 501 | { |
502 | //KOPrefs::instance()->mShowFullMenu | 502 | //KOPrefs::instance()->mShowFullMenu |
503 | iconToolBar->clear(); | 503 | iconToolBar->clear(); |
504 | KOPrefs *p = KOPrefs::instance(); | 504 | KOPrefs *p = KOPrefs::instance(); |
505 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 505 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
506 | 506 | ||
507 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 507 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
508 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 508 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
509 | QPopupMenu *importMenu = new QPopupMenu( this ); | 509 | QPopupMenu *importMenu = new QPopupMenu( this ); |
510 | selectFilterMenu = new QPopupMenu( this ); | 510 | selectFilterMenu = new QPopupMenu( this ); |
511 | selectFilterMenu->setCheckable( true ); | 511 | selectFilterMenu->setCheckable( true ); |
512 | syncMenu = new QPopupMenu( this ); | 512 | syncMenu = new QPopupMenu( this ); |
513 | configureAgendaMenu = new QPopupMenu( this ); | 513 | configureAgendaMenu = new QPopupMenu( this ); |
514 | configureToolBarMenu = new QPopupMenu( this ); | 514 | configureToolBarMenu = new QPopupMenu( this ); |
515 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 515 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
516 | if ( KOPrefs::instance()->mShowFullMenu ) { | 516 | if ( KOPrefs::instance()->mShowFullMenu ) { |
517 | QMenuBar *menuBar1; | 517 | QMenuBar *menuBar1; |
518 | menuBar1 = menuBar(); | 518 | menuBar1 = menuBar(); |
519 | menuBar1->insertItem( i18n("File"), importMenu ); | 519 | menuBar1->insertItem( i18n("File"), importMenu ); |
520 | menuBar1->insertItem( i18n("View"), viewMenu ); | 520 | menuBar1->insertItem( i18n("View"), viewMenu ); |
521 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 521 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
522 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 522 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
523 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 523 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
524 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 524 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
525 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 525 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
526 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 526 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
527 | } else { | 527 | } else { |
528 | QPEMenuBar *menuBar1; | 528 | QPEMenuBar *menuBar1; |
529 | menuBar1 = new QPEMenuBar( iconToolBar ); | 529 | menuBar1 = new QPEMenuBar( iconToolBar ); |
530 | QPopupMenu *menuBar = new QPopupMenu( this ); | 530 | QPopupMenu *menuBar = new QPopupMenu( this ); |
531 | menuBar1->insertItem( i18n("ME"), menuBar); | 531 | menuBar1->insertItem( i18n("ME"), menuBar); |
532 | menuBar->insertItem( i18n("File"), importMenu ); | 532 | menuBar->insertItem( i18n("File"), importMenu ); |
533 | menuBar->insertItem( i18n("View"), viewMenu ); | 533 | menuBar->insertItem( i18n("View"), viewMenu ); |
534 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 534 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
535 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 535 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
536 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 536 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
537 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 537 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
538 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 538 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
539 | menuBar->insertItem( i18n("Help"), helpMenu ); | 539 | menuBar->insertItem( i18n("Help"), helpMenu ); |
540 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 540 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
541 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 541 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
542 | } | 542 | } |
543 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 543 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
544 | connect ( selectFilterMenu, SIGNAL( aboutToShow () ), this, SLOT (fillFilterMenu() ) ); | 544 | connect ( selectFilterMenu, SIGNAL( aboutToShow () ), this, SLOT (fillFilterMenu() ) ); |
545 | 545 | ||
546 | // ****************** | 546 | // ****************** |
547 | QAction *action; | 547 | QAction *action; |
548 | QIconSet icon; | 548 | QIconSet icon; |
549 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 549 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
550 | configureToolBarMenu->setCheckable( true ); | 550 | configureToolBarMenu->setCheckable( true ); |
551 | 551 | ||
552 | QString pathString = ""; | 552 | QString pathString = ""; |
553 | if ( !p->mToolBarMiniIcons ) { | 553 | if ( !p->mToolBarMiniIcons ) { |
554 | if ( QApplication::desktop()->width() < 480 ) | 554 | if ( QApplication::desktop()->width() < 480 ) |
555 | pathString += "icons16/"; | 555 | pathString += "icons16/"; |
556 | } else | 556 | } else |
557 | pathString += "iconsmini/"; | 557 | pathString += "iconsmini/"; |
558 | configureAgendaMenu->setCheckable( true ); | 558 | configureAgendaMenu->setCheckable( true ); |
559 | configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 ); | 559 | configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 ); |
560 | configureAgendaMenu->insertSeparator(); | 560 | configureAgendaMenu->insertSeparator(); |
561 | configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); | 561 | configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); |
562 | configureAgendaMenu->insertItem(i18n("Small"), 6 ); | 562 | configureAgendaMenu->insertItem(i18n("Small"), 6 ); |
563 | configureAgendaMenu->insertItem(i18n("Medium"), 8 ); | 563 | configureAgendaMenu->insertItem(i18n("Medium"), 8 ); |
564 | configureAgendaMenu->insertItem(i18n("Normal"), 10 ); | 564 | configureAgendaMenu->insertItem(i18n("Normal"), 10 ); |
565 | configureAgendaMenu->insertItem(i18n("Large"), 12 ); | 565 | configureAgendaMenu->insertItem(i18n("Large"), 12 ); |
566 | configureAgendaMenu->insertItem(i18n("Big"), 14 ); | 566 | configureAgendaMenu->insertItem(i18n("Big"), 14 ); |
567 | configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); | 567 | configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); |
568 | configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); | 568 | configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); |
569 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 569 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
570 | 570 | ||
571 | icon = loadPixmap( pathString + "configure" ); | 571 | icon = loadPixmap( pathString + "configure" ); |
572 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 572 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
573 | action->addTo( actionMenu ); | 573 | action->addTo( actionMenu ); |
574 | connect( action, SIGNAL( activated() ), | 574 | connect( action, SIGNAL( activated() ), |
575 | mView, SLOT( edit_options() ) ); | 575 | mView, SLOT( edit_options() ) ); |
576 | actionMenu->insertSeparator(); | 576 | actionMenu->insertSeparator(); |
577 | icon = loadPixmap( pathString + "newevent" ); | 577 | icon = loadPixmap( pathString + "newevent" ); |
578 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 578 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
579 | configureToolBarMenu->insertSeparator(); | 579 | configureToolBarMenu->insertSeparator(); |
580 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 580 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
581 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 581 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
582 | ne_action->addTo( actionMenu ); | 582 | ne_action->addTo( actionMenu ); |
583 | connect( ne_action, SIGNAL( activated() ), | 583 | connect( ne_action, SIGNAL( activated() ), |
584 | mView, SLOT( newEvent() ) ); | 584 | mView, SLOT( newEvent() ) ); |
585 | icon = loadPixmap( pathString + "newtodo" ); | 585 | icon = loadPixmap( pathString + "newtodo" ); |
586 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 586 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
587 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 587 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
588 | nt_action->addTo( actionMenu ); | 588 | nt_action->addTo( actionMenu ); |
589 | connect( nt_action, SIGNAL( activated() ), | 589 | connect( nt_action, SIGNAL( activated() ), |
590 | mView, SLOT( newTodo() ) ); | 590 | mView, SLOT( newTodo() ) ); |
591 | icon = loadPixmap( pathString + "navi" ); | 591 | icon = loadPixmap( pathString + "navi" ); |
592 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 592 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
593 | action->addTo( viewMenu ); | 593 | action->addTo( viewMenu ); |
594 | connect( action, SIGNAL( activated() ), | 594 | connect( action, SIGNAL( activated() ), |
595 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 595 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
596 | icon = loadPixmap( pathString + "filter" ); | 596 | icon = loadPixmap( pathString + "filter" ); |
597 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 597 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
598 | action->addTo( viewMenu ); | 598 | action->addTo( viewMenu ); |
599 | connect( action, SIGNAL( activated() ), | 599 | connect( action, SIGNAL( activated() ), |
600 | mView, SLOT( toggleFilter() ) ); | 600 | mView, SLOT( toggleFilter() ) ); |
601 | 601 | ||
602 | 602 | ||
603 | viewMenu->insertSeparator(); | 603 | viewMenu->insertSeparator(); |
604 | icon = loadPixmap( pathString + "picker" ); | 604 | icon = loadPixmap( pathString + "picker" ); |
605 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 605 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
606 | action->addTo( viewMenu ); | 606 | action->addTo( viewMenu ); |
607 | connect( action, SIGNAL( activated() ), | 607 | connect( action, SIGNAL( activated() ), |
608 | mView, SLOT( showDatePicker() ) ); | 608 | mView, SLOT( showDatePicker() ) ); |
609 | action->addTo( iconToolBar ); | 609 | action->addTo( iconToolBar ); |
610 | viewMenu->insertSeparator(); | 610 | viewMenu->insertSeparator(); |
611 | icon = loadPixmap( pathString + "list" ); | 611 | icon = loadPixmap( pathString + "list" ); |
612 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 612 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
613 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 613 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
614 | showlist_action->addTo( viewMenu ); | 614 | showlist_action->addTo( viewMenu ); |
615 | connect( showlist_action, SIGNAL( activated() ), | 615 | connect( showlist_action, SIGNAL( activated() ), |
616 | mView->viewManager(), SLOT( showListView() ) ); | 616 | mView->viewManager(), SLOT( showListView() ) ); |
617 | 617 | ||
618 | 618 | ||
619 | icon = loadPixmap( pathString + "day" ); | 619 | icon = loadPixmap( pathString + "day" ); |
620 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 620 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
621 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 621 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
622 | day1_action->addTo( viewMenu ); | 622 | day1_action->addTo( viewMenu ); |
623 | // action->addTo( toolBar ); | 623 | // action->addTo( toolBar ); |
624 | connect( day1_action, SIGNAL( activated() ), | 624 | connect( day1_action, SIGNAL( activated() ), |
625 | mView->viewManager(), SLOT( showDayView() ) ); | 625 | mView->viewManager(), SLOT( showDayView() ) ); |
626 | 626 | ||
627 | icon = loadPixmap( pathString + "workweek" ); | 627 | icon = loadPixmap( pathString + "workweek" ); |
628 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 628 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
629 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 629 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
630 | day5_action->addTo( viewMenu ); | 630 | day5_action->addTo( viewMenu ); |
631 | connect( day5_action, SIGNAL( activated() ), | 631 | connect( day5_action, SIGNAL( activated() ), |
632 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 632 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
633 | 633 | ||
634 | icon = loadPixmap( pathString + "week" ); | 634 | icon = loadPixmap( pathString + "week" ); |
635 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 635 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
636 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 636 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
637 | day7_action->addTo( viewMenu ); | 637 | day7_action->addTo( viewMenu ); |
638 | connect( day7_action, SIGNAL( activated() ), | 638 | connect( day7_action, SIGNAL( activated() ), |
639 | mView->viewManager(), SLOT( showWeekView() ) ); | 639 | mView->viewManager(), SLOT( showWeekView() ) ); |
640 | 640 | ||
641 | icon = loadPixmap( pathString + "month" ); | 641 | icon = loadPixmap( pathString + "month" ); |
642 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 642 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
643 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 643 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
644 | month_action->addTo( viewMenu ); | 644 | month_action->addTo( viewMenu ); |
645 | connect( month_action, SIGNAL( activated() ), | 645 | connect( month_action, SIGNAL( activated() ), |
646 | mView->viewManager(), SLOT( showMonthView() ) ); | 646 | mView->viewManager(), SLOT( showMonthView() ) ); |
647 | 647 | ||
648 | icon = loadPixmap( pathString + "todo" ); | 648 | icon = loadPixmap( pathString + "todo" ); |
649 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 649 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
650 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 650 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
651 | todoview_action->addTo( viewMenu ); | 651 | todoview_action->addTo( viewMenu ); |
652 | connect( todoview_action, SIGNAL( activated() ), | 652 | connect( todoview_action, SIGNAL( activated() ), |
653 | mView->viewManager(), SLOT( showTodoView() ) ); | 653 | mView->viewManager(), SLOT( showTodoView() ) ); |
654 | 654 | ||
655 | icon = loadPixmap( pathString + "journal" ); | 655 | icon = loadPixmap( pathString + "journal" ); |
656 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 656 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
657 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 657 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
658 | viewjournal_action->addTo( viewMenu ); | 658 | viewjournal_action->addTo( viewMenu ); |
659 | connect( viewjournal_action, SIGNAL( activated() ), | 659 | connect( viewjournal_action, SIGNAL( activated() ), |
660 | mView->viewManager(), SLOT( showJournalView() ) ); | 660 | mView->viewManager(), SLOT( showJournalView() ) ); |
661 | 661 | ||
662 | icon = loadPixmap( pathString + "xdays" ); | 662 | icon = loadPixmap( pathString + "xdays" ); |
663 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); | 663 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); |
664 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 664 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
665 | xdays_action->addTo( viewMenu ); | 665 | xdays_action->addTo( viewMenu ); |
666 | connect( xdays_action, SIGNAL( activated() ), | 666 | connect( xdays_action, SIGNAL( activated() ), |
667 | mView->viewManager(), SLOT( showNextXView() ) ); | 667 | mView->viewManager(), SLOT( showNextXView() ) ); |
668 | 668 | ||
669 | icon = loadPixmap( pathString + "whatsnext" ); | 669 | icon = loadPixmap( pathString + "whatsnext" ); |
670 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); | 670 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); |
671 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 671 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
672 | whatsnext_action->addTo( viewMenu ); | 672 | whatsnext_action->addTo( viewMenu ); |
673 | connect( whatsnext_action, SIGNAL( activated() ), | 673 | connect( whatsnext_action, SIGNAL( activated() ), |
674 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 674 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
675 | 675 | ||
676 | #if 0 | 676 | #if 0 |
677 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 677 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
678 | action->addTo( viewMenu ); | 678 | action->addTo( viewMenu ); |
679 | connect( action, SIGNAL( activated() ), | 679 | connect( action, SIGNAL( activated() ), |
680 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 680 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
681 | #endif | 681 | #endif |
682 | 682 | ||
683 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 683 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
684 | this ); | 684 | this ); |
685 | mNewSubTodoAction->addTo( actionMenu ); | 685 | mNewSubTodoAction->addTo( actionMenu ); |
686 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 686 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
687 | mView, SLOT( newSubTodo() ) ); | 687 | mView, SLOT( newSubTodo() ) ); |
688 | 688 | ||
689 | actionMenu->insertSeparator(); | 689 | actionMenu->insertSeparator(); |
690 | 690 | ||
691 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 691 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
692 | mShowAction->addTo( actionMenu ); | 692 | mShowAction->addTo( actionMenu ); |
693 | connect( mShowAction, SIGNAL( activated() ), | 693 | connect( mShowAction, SIGNAL( activated() ), |
694 | mView, SLOT( showIncidence() ) ); | 694 | mView, SLOT( showIncidence() ) ); |
695 | 695 | ||
696 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 696 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
697 | mEditAction->addTo( actionMenu ); | 697 | mEditAction->addTo( actionMenu ); |
698 | connect( mEditAction, SIGNAL( activated() ), | 698 | connect( mEditAction, SIGNAL( activated() ), |
699 | mView, SLOT( editIncidence() ) ); | 699 | mView, SLOT( editIncidence() ) ); |
700 | 700 | ||
701 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 701 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
702 | mDeleteAction->addTo( actionMenu ); | 702 | mDeleteAction->addTo( actionMenu ); |
703 | connect( mDeleteAction, SIGNAL( activated() ), | 703 | connect( mDeleteAction, SIGNAL( activated() ), |
704 | mView, SLOT( deleteIncidence() ) ); | 704 | mView, SLOT( deleteIncidence() ) ); |
705 | 705 | ||
706 | 706 | ||
707 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 707 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
708 | mCloneAction->addTo( actionMenu ); | 708 | mCloneAction->addTo( actionMenu ); |
709 | connect( mCloneAction, SIGNAL( activated() ), | 709 | connect( mCloneAction, SIGNAL( activated() ), |
710 | mView, SLOT( cloneIncidence() ) ); | 710 | mView, SLOT( cloneIncidence() ) ); |
711 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 711 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
712 | mMoveAction->addTo( actionMenu ); | 712 | mMoveAction->addTo( actionMenu ); |
713 | connect( mMoveAction, SIGNAL( activated() ), | 713 | connect( mMoveAction, SIGNAL( activated() ), |
714 | mView, SLOT( moveIncidence() ) ); | 714 | mView, SLOT( moveIncidence() ) ); |
715 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 715 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
716 | mBeamAction->addTo( actionMenu ); | 716 | mBeamAction->addTo( actionMenu ); |
717 | connect( mBeamAction, SIGNAL( activated() ), | 717 | connect( mBeamAction, SIGNAL( activated() ), |
718 | mView, SLOT( beamIncidence() ) ); | 718 | mView, SLOT( beamIncidence() ) ); |
719 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 719 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
720 | mCancelAction->addTo( actionMenu ); | 720 | mCancelAction->addTo( actionMenu ); |
721 | connect( mCancelAction, SIGNAL( activated() ), | 721 | connect( mCancelAction, SIGNAL( activated() ), |
722 | mView, SLOT( toggleCancelIncidence() ) ); | 722 | mView, SLOT( toggleCancelIncidence() ) ); |
723 | 723 | ||
724 | actionMenu->insertSeparator(); | 724 | actionMenu->insertSeparator(); |
725 | 725 | ||
726 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 726 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
727 | this ); | 727 | this ); |
728 | action->addTo( actionMenu ); | 728 | action->addTo( actionMenu ); |
729 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 729 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
730 | 730 | ||
731 | icon = loadPixmap( pathString + "search" ); | 731 | icon = loadPixmap( pathString + "search" ); |
732 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 732 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
733 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); | 733 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); |
734 | search_action->addTo( actionMenu ); | 734 | search_action->addTo( actionMenu ); |
735 | connect( search_action, SIGNAL( activated() ), | 735 | connect( search_action, SIGNAL( activated() ), |
736 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 736 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
737 | 737 | ||
738 | icon = loadPixmap( pathString + "today" ); | 738 | icon = loadPixmap( pathString + "today" ); |
739 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 739 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
740 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 740 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
741 | today_action->addTo( actionMenu ); | 741 | today_action->addTo( actionMenu ); |
742 | connect( today_action, SIGNAL( activated() ), | 742 | connect( today_action, SIGNAL( activated() ), |
743 | mView, SLOT( goToday() ) ); | 743 | mView, SLOT( goToday() ) ); |
744 | 744 | ||
745 | if ( KOPrefs::instance()->mShowFullMenu ) { | 745 | if ( KOPrefs::instance()->mShowFullMenu ) { |
746 | actionMenu->insertSeparator(); | 746 | actionMenu->insertSeparator(); |
747 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 747 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
748 | 748 | ||
749 | } | 749 | } |
750 | // actionMenu->insertSeparator(); | 750 | // actionMenu->insertSeparator(); |
751 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 751 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
752 | this ); | 752 | this ); |
753 | action->addTo( importMenu ); | 753 | action->addTo( importMenu ); |
754 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 754 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
755 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 755 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
756 | this ); | 756 | this ); |
757 | action->addTo( importMenu ); | 757 | action->addTo( importMenu ); |
758 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 758 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
759 | importMenu->insertSeparator(); | 759 | importMenu->insertSeparator(); |
760 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 760 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
761 | this ); | 761 | this ); |
762 | action->addTo( importMenu ); | 762 | action->addTo( importMenu ); |
763 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 763 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
764 | #ifndef DESKTOP_VERSION | 764 | #ifndef DESKTOP_VERSION |
765 | importMenu->insertSeparator(); | 765 | importMenu->insertSeparator(); |
766 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 766 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
767 | this ); | 767 | this ); |
768 | action->addTo( importMenu ); | 768 | action->addTo( importMenu ); |
769 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 769 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
770 | #else | 770 | #else |
771 | #ifdef _WIN32_ | 771 | #ifdef _WIN32_ |
772 | importMenu->insertSeparator(); | 772 | importMenu->insertSeparator(); |
773 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 773 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
774 | this ); | 774 | this ); |
775 | action->addTo( importMenu ); | 775 | action->addTo( importMenu ); |
776 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 776 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
777 | #endif | 777 | #endif |
778 | #endif | 778 | #endif |
779 | 779 | ||
780 | importMenu->insertSeparator(); | 780 | importMenu->insertSeparator(); |
781 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 781 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
782 | this ); | 782 | this ); |
783 | action->addTo( importMenu ); | 783 | action->addTo( importMenu ); |
784 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 784 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
785 | 785 | ||
786 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 786 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
787 | this ); | 787 | this ); |
788 | action->addTo( importMenu ); | 788 | action->addTo( importMenu ); |
789 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 789 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
790 | 790 | ||
791 | importMenu->insertSeparator(); | 791 | importMenu->insertSeparator(); |
792 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 792 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
793 | this ); | 793 | this ); |
794 | action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 794 | action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); |
795 | 795 | ||
796 | 796 | ||
797 | //LR | 797 | //LR |
798 | QPopupMenu *ex2phone = new QPopupMenu( this ); | 798 | QPopupMenu *ex2phone = new QPopupMenu( this ); |
799 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 799 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
800 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 800 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
801 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); | 801 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); |
802 | importMenu->insertItem( i18n("Export to phone"), ex2phone ); | 802 | importMenu->insertItem( i18n("Export to phone"), ex2phone ); |
803 | 803 | ||
804 | importMenu->insertSeparator(); | 804 | importMenu->insertSeparator(); |
805 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 805 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
806 | this ); | 806 | this ); |
807 | action->addTo( importMenu ); | 807 | action->addTo( importMenu ); |
808 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 808 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
809 | #ifndef DESKTOP_VERSION | 809 | #ifndef DESKTOP_VERSION |
810 | importMenu->insertSeparator(); | 810 | importMenu->insertSeparator(); |
811 | brAction = new QAction( "beam toggle", i18n("Beam receice enabled"), 0, | 811 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, |
812 | this ); | 812 | this ); |
813 | brAction->addTo( importMenu ); | 813 | brAction->addTo( importMenu ); |
814 | brAction->setToggleAction (true ) ; | 814 | brAction->setToggleAction (true ) ; |
815 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); | 815 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); |
816 | 816 | ||
817 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 817 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
818 | this ); | 818 | this ); |
819 | action->addTo( importMenu ); | 819 | action->addTo( importMenu ); |
820 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 820 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
821 | 821 | ||
822 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 822 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
823 | this ); | 823 | this ); |
824 | action->addTo( importMenu ); | 824 | action->addTo( importMenu ); |
825 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 825 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
826 | #else | 826 | #else |
827 | importMenu->insertSeparator(); | 827 | importMenu->insertSeparator(); |
828 | icon = loadPixmap( pathString + "print" ); | 828 | icon = loadPixmap( pathString + "print" ); |
829 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 829 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
830 | action->addTo( importMenu ); | 830 | action->addTo( importMenu ); |
831 | connect( action, SIGNAL( activated() ), | 831 | connect( action, SIGNAL( activated() ), |
832 | this, SLOT( printCal() ) ); | 832 | this, SLOT( printCal() ) ); |
833 | 833 | ||
834 | icon = loadPixmap( pathString + "print" ); | 834 | icon = loadPixmap( pathString + "print" ); |
835 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 835 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
836 | action->addTo( importMenu ); | 836 | action->addTo( importMenu ); |
837 | connect( action, SIGNAL( activated() ), | 837 | connect( action, SIGNAL( activated() ), |
838 | this, SLOT( printSel() ) ); | 838 | this, SLOT( printSel() ) ); |
839 | #endif | 839 | #endif |
840 | importMenu->insertSeparator(); | 840 | importMenu->insertSeparator(); |
841 | action = new QAction( "beam all", i18n("Save"), 0, | 841 | action = new QAction( "beam all", i18n("Save"), 0, |
842 | this ); | 842 | this ); |
843 | action->addTo( importMenu ); | 843 | action->addTo( importMenu ); |
844 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 844 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
845 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 845 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
846 | this ); | 846 | this ); |
847 | action->addTo( importMenu ); | 847 | action->addTo( importMenu ); |
848 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 848 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
849 | 849 | ||
850 | //menuBar->insertItem( "Configure",configureMenu ); | 850 | //menuBar->insertItem( "Configure",configureMenu ); |
851 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 851 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
852 | icon = loadPixmap( "korganizer/korganizer" ); | 852 | icon = loadPixmap( "korganizer/korganizer" ); |
853 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 853 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
854 | action->addTo( helpMenu ); | 854 | action->addTo( helpMenu ); |
855 | connect( action, SIGNAL( activated() ), | 855 | connect( action, SIGNAL( activated() ), |
856 | SLOT( keyBindings() ) ); | 856 | SLOT( keyBindings() ) ); |
857 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 857 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
858 | action->addTo( helpMenu ); | 858 | action->addTo( helpMenu ); |
859 | connect( action, SIGNAL( activated() ), | 859 | connect( action, SIGNAL( activated() ), |
860 | SLOT( features() ) ); | 860 | SLOT( features() ) ); |
861 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 861 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
862 | action->addTo( helpMenu ); | 862 | action->addTo( helpMenu ); |
863 | connect( action, SIGNAL( activated() ), | 863 | connect( action, SIGNAL( activated() ), |
864 | SLOT( aboutAutoSaving() ) ); | 864 | SLOT( aboutAutoSaving() ) ); |
865 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 865 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
866 | action->addTo( helpMenu ); | 866 | action->addTo( helpMenu ); |
867 | connect( action, SIGNAL( activated() ), | 867 | connect( action, SIGNAL( activated() ), |
868 | SLOT( aboutKnownBugs() ) ); | 868 | SLOT( aboutKnownBugs() ) ); |
869 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 869 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
870 | action->addTo( helpMenu ); | 870 | action->addTo( helpMenu ); |
871 | connect( action, SIGNAL( activated() ), | 871 | connect( action, SIGNAL( activated() ), |
872 | SLOT( usertrans() ) ); | 872 | SLOT( usertrans() ) ); |
873 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 873 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
874 | action->addTo( helpMenu ); | 874 | action->addTo( helpMenu ); |
875 | connect( action, SIGNAL( activated() ), | 875 | connect( action, SIGNAL( activated() ), |
876 | SLOT( synchowto() ) ); | 876 | SLOT( synchowto() ) ); |
877 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 877 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
878 | action->addTo( helpMenu ); | 878 | action->addTo( helpMenu ); |
879 | connect( action, SIGNAL( activated() ), | 879 | connect( action, SIGNAL( activated() ), |
880 | SLOT( whatsNew() ) ); | 880 | SLOT( whatsNew() ) ); |
881 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 881 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
882 | action->addTo( helpMenu ); | 882 | action->addTo( helpMenu ); |
883 | connect( action, SIGNAL( activated() ), | 883 | connect( action, SIGNAL( activated() ), |
884 | SLOT( faq() ) ); | 884 | SLOT( faq() ) ); |
885 | 885 | ||
886 | 886 | ||
887 | action = new QAction( "about", i18n("About..."), 0, this ); | 887 | action = new QAction( "about", i18n("About..."), 0, this ); |
888 | action->addTo( helpMenu ); | 888 | action->addTo( helpMenu ); |
889 | connect( action, SIGNAL( activated() ), | 889 | connect( action, SIGNAL( activated() ), |
890 | SLOT( about() ) ); | 890 | SLOT( about() ) ); |
891 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 891 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
892 | action->addTo( helpMenu ); | 892 | action->addTo( helpMenu ); |
893 | connect( action, SIGNAL( activated() ), | 893 | connect( action, SIGNAL( activated() ), |
894 | SLOT( licence() ) ); | 894 | SLOT( licence() ) ); |
895 | //menuBar->insertSeparator(); | 895 | //menuBar->insertSeparator(); |
896 | 896 | ||
897 | // ****************************************************** | 897 | // ****************************************************** |
898 | // menubar icons | 898 | // menubar icons |
899 | 899 | ||
900 | 900 | ||
901 | iconToolBar->setHorizontalStretchable (true ); | 901 | iconToolBar->setHorizontalStretchable (true ); |
902 | //menuBar->insertItem( iconToolBar ); | 902 | //menuBar->insertItem( iconToolBar ); |
903 | //xdays_action | 903 | //xdays_action |
904 | if (p-> mShowIconNewEvent) | 904 | if (p-> mShowIconNewEvent) |
905 | ne_action->addTo( iconToolBar ); | 905 | ne_action->addTo( iconToolBar ); |
906 | if (p->mShowIconNewTodo ) | 906 | if (p->mShowIconNewTodo ) |
907 | nt_action->addTo( iconToolBar ); | 907 | nt_action->addTo( iconToolBar ); |
908 | if (p-> mShowIconSearch) | 908 | if (p-> mShowIconSearch) |
909 | search_action->addTo( iconToolBar ); | 909 | search_action->addTo( iconToolBar ); |
910 | if (p-> mShowIconNext) | 910 | if (p-> mShowIconNext) |
911 | whatsnext_action->addTo( iconToolBar ); | 911 | whatsnext_action->addTo( iconToolBar ); |
912 | if (p-> mShowIconNextDays) | 912 | if (p-> mShowIconNextDays) |
913 | xdays_action->addTo( iconToolBar ); | 913 | xdays_action->addTo( iconToolBar ); |
914 | if (p-> mShowIconList) | 914 | if (p-> mShowIconList) |
915 | showlist_action->addTo( iconToolBar ); | 915 | showlist_action->addTo( iconToolBar ); |
916 | if (p-> mShowIconDay1) | 916 | if (p-> mShowIconDay1) |
917 | day1_action->addTo( iconToolBar ); | 917 | day1_action->addTo( iconToolBar ); |
918 | if (p-> mShowIconDay5) | 918 | if (p-> mShowIconDay5) |
919 | day5_action->addTo( iconToolBar ); | 919 | day5_action->addTo( iconToolBar ); |
920 | if (p-> mShowIconDay7) | 920 | if (p-> mShowIconDay7) |
921 | day7_action->addTo( iconToolBar ); | 921 | day7_action->addTo( iconToolBar ); |
922 | if (p-> mShowIconMonth) | 922 | if (p-> mShowIconMonth) |
923 | month_action->addTo( iconToolBar ); | 923 | month_action->addTo( iconToolBar ); |
924 | if (p-> mShowIconTodoview) | 924 | if (p-> mShowIconTodoview) |
925 | todoview_action->addTo( iconToolBar ); | 925 | todoview_action->addTo( iconToolBar ); |
926 | if (p-> mShowIconJournal) | 926 | if (p-> mShowIconJournal) |
927 | viewjournal_action->addTo( iconToolBar ); | 927 | viewjournal_action->addTo( iconToolBar ); |
928 | icon = loadPixmap( pathString + "2leftarrowB" ); | 928 | icon = loadPixmap( pathString + "2leftarrowB" ); |
929 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); | 929 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); |
930 | if (p-> mShowIconBackFast) { | 930 | if (p-> mShowIconBackFast) { |
931 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 931 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
932 | connect( action, SIGNAL( activated() ), | 932 | connect( action, SIGNAL( activated() ), |
933 | mView, SLOT( goPreviousMonth() ) ); | 933 | mView, SLOT( goPreviousMonth() ) ); |
934 | action->addTo( iconToolBar ); | 934 | action->addTo( iconToolBar ); |
935 | } | 935 | } |
936 | icon = loadPixmap( pathString + "1leftarrowB" ); | 936 | icon = loadPixmap( pathString + "1leftarrowB" ); |
937 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); | 937 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); |
938 | if (p-> mShowIconBack) { | 938 | if (p-> mShowIconBack) { |
939 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 939 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
940 | connect( action, SIGNAL( activated() ), | 940 | connect( action, SIGNAL( activated() ), |
941 | mView, SLOT( goPrevious() ) ); | 941 | mView, SLOT( goPrevious() ) ); |
942 | action->addTo( iconToolBar ); | 942 | action->addTo( iconToolBar ); |
943 | } | 943 | } |
944 | if (p-> mShowIconToday) | 944 | if (p-> mShowIconToday) |
945 | today_action->addTo( iconToolBar ); | 945 | today_action->addTo( iconToolBar ); |
946 | icon = loadPixmap( pathString + "1rightarrowB" ); | 946 | icon = loadPixmap( pathString + "1rightarrowB" ); |
947 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 947 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
948 | if (p-> mShowIconForward) { | 948 | if (p-> mShowIconForward) { |
949 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 949 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
950 | connect( action, SIGNAL( activated() ), | 950 | connect( action, SIGNAL( activated() ), |
951 | mView, SLOT( goNext() ) ); | 951 | mView, SLOT( goNext() ) ); |
952 | action->addTo( iconToolBar ); | 952 | action->addTo( iconToolBar ); |
953 | } | 953 | } |
954 | icon = loadPixmap( pathString + "2rightarrowB" ); | 954 | icon = loadPixmap( pathString + "2rightarrowB" ); |
955 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 955 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
956 | if (p-> mShowIconForwardFast) { | 956 | if (p-> mShowIconForwardFast) { |
957 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 957 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
958 | connect( action, SIGNAL( activated() ), | 958 | connect( action, SIGNAL( activated() ), |
959 | mView, SLOT( goNextMonth() ) ); | 959 | mView, SLOT( goNextMonth() ) ); |
960 | action->addTo( iconToolBar ); | 960 | action->addTo( iconToolBar ); |
961 | } | 961 | } |
962 | 962 | ||
963 | 963 | ||
964 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); | 964 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); |
965 | 965 | ||
966 | if (p-> mShowIconNewEvent) | 966 | if (p-> mShowIconNewEvent) |
967 | configureToolBarMenu->setItemChecked( 10, true ); | 967 | configureToolBarMenu->setItemChecked( 10, true ); |
968 | if (p->mShowIconNewTodo ) | 968 | if (p->mShowIconNewTodo ) |
969 | configureToolBarMenu->setItemChecked( 20, true ); | 969 | configureToolBarMenu->setItemChecked( 20, true ); |
970 | if (p-> mShowIconSearch) | 970 | if (p-> mShowIconSearch) |
971 | configureToolBarMenu->setItemChecked( 120, true ); | 971 | configureToolBarMenu->setItemChecked( 120, true ); |
972 | if (p-> mShowIconList) | 972 | if (p-> mShowIconList) |
973 | configureToolBarMenu->setItemChecked( 30, true ); | 973 | configureToolBarMenu->setItemChecked( 30, true ); |
974 | if (p-> mShowIconDay1) | 974 | if (p-> mShowIconDay1) |
975 | configureToolBarMenu->setItemChecked( 40, true ); | 975 | configureToolBarMenu->setItemChecked( 40, true ); |
976 | if (p-> mShowIconDay5) | 976 | if (p-> mShowIconDay5) |
977 | configureToolBarMenu->setItemChecked( 50, true ); | 977 | configureToolBarMenu->setItemChecked( 50, true ); |
978 | if (p-> mShowIconDay7) | 978 | if (p-> mShowIconDay7) |
979 | configureToolBarMenu->setItemChecked( 60, true ); | 979 | configureToolBarMenu->setItemChecked( 60, true ); |
980 | if (p-> mShowIconMonth) | 980 | if (p-> mShowIconMonth) |
981 | configureToolBarMenu->setItemChecked( 70, true ); | 981 | configureToolBarMenu->setItemChecked( 70, true ); |
982 | if (p-> mShowIconTodoview) | 982 | if (p-> mShowIconTodoview) |
983 | configureToolBarMenu->setItemChecked( 80, true ); | 983 | configureToolBarMenu->setItemChecked( 80, true ); |
984 | if (p-> mShowIconBackFast) | 984 | if (p-> mShowIconBackFast) |
985 | configureToolBarMenu->setItemChecked( 200, true ); | 985 | configureToolBarMenu->setItemChecked( 200, true ); |
986 | if (p-> mShowIconBack) | 986 | if (p-> mShowIconBack) |
987 | configureToolBarMenu->setItemChecked( 210, true ); | 987 | configureToolBarMenu->setItemChecked( 210, true ); |
988 | if (p-> mShowIconToday) | 988 | if (p-> mShowIconToday) |
989 | configureToolBarMenu->setItemChecked( 130, true ); | 989 | configureToolBarMenu->setItemChecked( 130, true ); |
990 | if (p-> mShowIconForward) | 990 | if (p-> mShowIconForward) |
991 | configureToolBarMenu->setItemChecked( 220, true ); | 991 | configureToolBarMenu->setItemChecked( 220, true ); |
992 | if (p-> mShowIconForwardFast) | 992 | if (p-> mShowIconForwardFast) |
993 | configureToolBarMenu->setItemChecked( 230, true ); | 993 | configureToolBarMenu->setItemChecked( 230, true ); |
994 | if (p-> mShowIconNextDays) | 994 | if (p-> mShowIconNextDays) |
995 | configureToolBarMenu->setItemChecked( 100, true ); | 995 | configureToolBarMenu->setItemChecked( 100, true ); |
996 | if (p-> mShowIconNext) | 996 | if (p-> mShowIconNext) |
997 | configureToolBarMenu->setItemChecked( 110, true ); | 997 | configureToolBarMenu->setItemChecked( 110, true ); |
998 | if (p-> mShowIconJournal) | 998 | if (p-> mShowIconJournal) |
999 | configureToolBarMenu->setItemChecked( 90, true ); | 999 | configureToolBarMenu->setItemChecked( 90, true ); |
1000 | if (p-> mShowIconWhatsThis) | 1000 | if (p-> mShowIconWhatsThis) |
1001 | configureToolBarMenu->setItemChecked( 300, true ); | 1001 | configureToolBarMenu->setItemChecked( 300, true ); |
1002 | 1002 | ||
1003 | QLabel* dummy = new QLabel( iconToolBar ); | 1003 | QLabel* dummy = new QLabel( iconToolBar ); |
1004 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 1004 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
1005 | if (!p-> mShowIconStretch) | 1005 | if (!p-> mShowIconStretch) |
1006 | iconToolBar->setStretchableWidget ( dummy ) ; | 1006 | iconToolBar->setStretchableWidget ( dummy ) ; |
1007 | else | 1007 | else |
1008 | configureToolBarMenu->setItemChecked( 5, true ); | 1008 | configureToolBarMenu->setItemChecked( 5, true ); |
1009 | if (p-> mShowIconWhatsThis) | 1009 | if (p-> mShowIconWhatsThis) |
1010 | QWhatsThis::whatsThisButton ( iconToolBar ); | 1010 | QWhatsThis::whatsThisButton ( iconToolBar ); |
1011 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 1011 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
1012 | configureAgenda( p->mHourSize ); | 1012 | configureAgenda( p->mHourSize ); |
1013 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 1013 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | void MainWindow::exportToPhone( int mode ) | 1016 | void MainWindow::exportToPhone( int mode ) |
1017 | { | 1017 | { |
1018 | 1018 | ||
1019 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1019 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1020 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1020 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1021 | KOex2phonePrefs ex2phone; | 1021 | KOex2phonePrefs ex2phone; |
1022 | 1022 | ||
1023 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 1023 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1024 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 1024 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1025 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1025 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1026 | if ( mode == 1 ) | 1026 | if ( mode == 1 ) |
1027 | ex2phone.setCaption(i18n("Export complete calendar")); | 1027 | ex2phone.setCaption(i18n("Export complete calendar")); |
1028 | if ( mode == 2 ) | 1028 | if ( mode == 2 ) |
1029 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1029 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1030 | 1030 | ||
1031 | if ( !ex2phone.exec() ) { | 1031 | if ( !ex2phone.exec() ) { |
1032 | return; | 1032 | return; |
1033 | } | 1033 | } |
1034 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1034 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
1035 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1035 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1036 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1036 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1037 | 1037 | ||
1038 | int inFuture = 0; | 1038 | int inFuture = 0; |
1039 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1039 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1040 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1040 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1041 | QPtrList<Incidence> delSel; | 1041 | QPtrList<Incidence> delSel; |
1042 | if ( mode == 1 ) | 1042 | if ( mode == 1 ) |
1043 | delSel = mCalendar->rawIncidences(); | 1043 | delSel = mCalendar->rawIncidences(); |
1044 | if ( mode == 2 ) | 1044 | if ( mode == 2 ) |
1045 | delSel = mCalendar->incidences(); | 1045 | delSel = mCalendar->incidences(); |
1046 | CalendarLocal* cal = new CalendarLocal(); | 1046 | CalendarLocal* cal = new CalendarLocal(); |
1047 | cal->setLocalTime(); | 1047 | cal->setLocalTime(); |
1048 | Incidence *incidence = delSel.first(); | 1048 | Incidence *incidence = delSel.first(); |
1049 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1049 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1050 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1050 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1051 | while ( incidence ) { | 1051 | while ( incidence ) { |
1052 | if ( incidence->type() != "Journal" ) { | 1052 | if ( incidence->type() != "Journal" ) { |
1053 | bool add = true; | 1053 | bool add = true; |
1054 | if ( inFuture ) { | 1054 | if ( inFuture ) { |
1055 | QDateTime dt; | 1055 | QDateTime dt; |
1056 | if ( incidence->type() == "Todo" ) { | 1056 | if ( incidence->type() == "Todo" ) { |
1057 | Todo * t = (Todo*)incidence; | 1057 | Todo * t = (Todo*)incidence; |
1058 | if ( t->hasDueDate() ) | 1058 | if ( t->hasDueDate() ) |
1059 | dt = t->dtDue(); | 1059 | dt = t->dtDue(); |
1060 | else | 1060 | else |
1061 | dt = cur.addSecs( 62 ); | 1061 | dt = cur.addSecs( 62 ); |
1062 | } | 1062 | } |
1063 | else { | 1063 | else { |
1064 | bool ok; | 1064 | bool ok; |
1065 | dt = incidence->getNextOccurence( cur, &ok ); | 1065 | dt = incidence->getNextOccurence( cur, &ok ); |
1066 | if ( !ok ) | 1066 | if ( !ok ) |
1067 | dt = cur.addSecs( -62 ); | 1067 | dt = cur.addSecs( -62 ); |
1068 | } | 1068 | } |
1069 | if ( dt < cur || dt > end ) { | 1069 | if ( dt < cur || dt > end ) { |
1070 | add = false; | 1070 | add = false; |
1071 | } | 1071 | } |
1072 | } | 1072 | } |
1073 | if ( add ) { | 1073 | if ( add ) { |
1074 | Incidence *in = incidence->clone(); | 1074 | Incidence *in = incidence->clone(); |
1075 | cal->addIncidence( in ); | 1075 | cal->addIncidence( in ); |
1076 | } | 1076 | } |
1077 | } | 1077 | } |
1078 | incidence = delSel.next(); | 1078 | incidence = delSel.next(); |
1079 | } | 1079 | } |
1080 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 1080 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
1081 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 1081 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
1082 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1082 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1083 | 1083 | ||
1084 | setCaption( i18n("Writing to phone...")); | 1084 | setCaption( i18n("Writing to phone...")); |
1085 | if ( PhoneFormat::writeToPhone( cal ) ) | 1085 | if ( PhoneFormat::writeToPhone( cal ) ) |
1086 | setCaption( i18n("Export to phone successful!")); | 1086 | setCaption( i18n("Export to phone successful!")); |
1087 | else | 1087 | else |
1088 | setCaption( i18n("Error exporting to phone!")); | 1088 | setCaption( i18n("Error exporting to phone!")); |
1089 | delete cal; | 1089 | delete cal; |
1090 | } | 1090 | } |
1091 | 1091 | ||
1092 | 1092 | ||
1093 | void MainWindow::setDefaultPreferences() | 1093 | void MainWindow::setDefaultPreferences() |
1094 | { | 1094 | { |
1095 | KOPrefs *p = KOPrefs::instance(); | 1095 | KOPrefs *p = KOPrefs::instance(); |
1096 | 1096 | ||
1097 | p->mCompactDialogs = true; | 1097 | p->mCompactDialogs = true; |
1098 | p->mConfirm = true; | 1098 | p->mConfirm = true; |
1099 | // p->mEnableQuickTodo = false; | 1099 | // p->mEnableQuickTodo = false; |
1100 | 1100 | ||
1101 | } | 1101 | } |
1102 | 1102 | ||
1103 | QString MainWindow::resourcePath() | 1103 | QString MainWindow::resourcePath() |
1104 | { | 1104 | { |
1105 | return KGlobal::iconLoader()->iconPath(); | 1105 | return KGlobal::iconLoader()->iconPath(); |
1106 | } | 1106 | } |
1107 | 1107 | ||
1108 | void MainWindow::displayText( QString text ,QString cap ) | 1108 | void MainWindow::displayText( QString text ,QString cap ) |
1109 | { | 1109 | { |
1110 | QDialog dia( this, "name", true ); ; | 1110 | QDialog dia( this, "name", true ); ; |
1111 | dia.setCaption( cap ); | 1111 | dia.setCaption( cap ); |
1112 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1112 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1113 | lay->setSpacing( 3 ); | 1113 | lay->setSpacing( 3 ); |
1114 | lay->setMargin( 3 ); | 1114 | lay->setMargin( 3 ); |
1115 | QTextBrowser tb ( &dia ); | 1115 | QTextBrowser tb ( &dia ); |
1116 | lay->addWidget( &tb ); | 1116 | lay->addWidget( &tb ); |
1117 | tb.setText( text ); | 1117 | tb.setText( text ); |
1118 | #ifdef DESKTOP_VERSION | 1118 | #ifdef DESKTOP_VERSION |
1119 | dia.resize( 640, 480); | 1119 | dia.resize( 640, 480); |
1120 | #else | 1120 | #else |
1121 | dia.showMaximized(); | 1121 | dia.showMaximized(); |
1122 | #endif | 1122 | #endif |
1123 | dia.exec(); | 1123 | dia.exec(); |
1124 | } | 1124 | } |
1125 | void MainWindow::displayFile( QString fn, QString cap ) | 1125 | void MainWindow::displayFile( QString fn, QString cap ) |
1126 | { | 1126 | { |
1127 | QString fileName = resourcePath() + fn; | 1127 | QString fileName = resourcePath() + fn; |
1128 | QString text; | 1128 | QString text; |
1129 | QFile file( fileName ); | 1129 | QFile file( fileName ); |
1130 | if (!file.open( IO_ReadOnly ) ) { | 1130 | if (!file.open( IO_ReadOnly ) ) { |
1131 | return ; | 1131 | return ; |
1132 | 1132 | ||
1133 | } | 1133 | } |
1134 | QTextStream ts( &file ); | 1134 | QTextStream ts( &file ); |
1135 | text = ts.read(); | 1135 | text = ts.read(); |
1136 | file.close(); | 1136 | file.close(); |
1137 | displayText( text, cap); | 1137 | displayText( text, cap); |
1138 | } | 1138 | } |
1139 | void MainWindow::features() | 1139 | void MainWindow::features() |
1140 | { | 1140 | { |
1141 | 1141 | ||
1142 | displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") ); | 1142 | displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") ); |
1143 | } | 1143 | } |
1144 | 1144 | ||
1145 | void MainWindow::usertrans() | 1145 | void MainWindow::usertrans() |
1146 | { | 1146 | { |
1147 | 1147 | ||
1148 | displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") ); | 1148 | displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") ); |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | void MainWindow::synchowto() | 1151 | void MainWindow::synchowto() |
1152 | { | 1152 | { |
1153 | 1153 | ||
1154 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1154 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1155 | } | 1155 | } |
1156 | void MainWindow::faq() | 1156 | void MainWindow::faq() |
1157 | { | 1157 | { |
1158 | displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); | 1158 | displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); |
1159 | 1159 | ||
1160 | } | 1160 | } |
1161 | void MainWindow::whatsNew() | 1161 | void MainWindow::whatsNew() |
1162 | { | 1162 | { |
1163 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1163 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1164 | 1164 | ||
1165 | } | 1165 | } |
1166 | void MainWindow::licence() | 1166 | void MainWindow::licence() |
1167 | { | 1167 | { |
1168 | KApplication::showLicence(); | 1168 | KApplication::showLicence(); |
1169 | 1169 | ||
1170 | } | 1170 | } |
1171 | void MainWindow::about() | 1171 | void MainWindow::about() |
1172 | { | 1172 | { |
1173 | QString version; | 1173 | QString version; |
1174 | #include <../version> | 1174 | #include <../version> |
1175 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1175 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1176 | i18n("KOrganizer/Platform-independent\n") + | 1176 | i18n("KOrganizer/Platform-independent\n") + |
1177 | "(KO/Pi) " + version + " - " + | 1177 | "(KO/Pi) " + version + " - " + |
1178 | 1178 | ||
1179 | #ifdef DESKTOP_VERSION | 1179 | #ifdef DESKTOP_VERSION |
1180 | i18n("Desktop Edition\n") + | 1180 | i18n("Desktop Edition\n") + |
1181 | #else | 1181 | #else |
1182 | i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + | 1182 | i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + |
1183 | #endif | 1183 | #endif |
1184 | i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); | 1184 | i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); |
1185 | } | 1185 | } |
1186 | void MainWindow::keyBindings() | 1186 | void MainWindow::keyBindings() |
1187 | { | 1187 | { |
1188 | QString cap = i18n("Key bindings KOrganizer/Pi"); | 1188 | QString cap = i18n("Key bindings KOrganizer/Pi"); |
1189 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1189 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1190 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1190 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1191 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1191 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1192 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1192 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1193 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ | 1193 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ |
1194 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1194 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1195 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1195 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |