-rw-r--r-- | kaddressbook/kabcore.cpp | 10 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 25891a0..2494aa2 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1614,49 +1614,51 @@ void KABCore::initActions() | |||
1614 | } | 1614 | } |
1615 | #else //KAB_EMBEDDED | 1615 | #else //KAB_EMBEDDED |
1616 | //qDebug("KABCore::initActions() LDAP has to be implemented"); | 1616 | //qDebug("KABCore::initActions() LDAP has to be implemented"); |
1617 | #endif //KAB_EMBEDDED | 1617 | #endif //KAB_EMBEDDED |
1618 | 1618 | ||
1619 | 1619 | ||
1620 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, | 1620 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, |
1621 | SLOT( setWhoAmI() ), actionCollection(), | 1621 | SLOT( setWhoAmI() ), actionCollection(), |
1622 | "set_personal" ); | 1622 | "set_personal" ); |
1623 | 1623 | ||
1624 | 1624 | ||
1625 | 1625 | ||
1626 | 1626 | ||
1627 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, | 1627 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, |
1628 | SLOT( setCategories() ), actionCollection(), | 1628 | SLOT( setCategories() ), actionCollection(), |
1629 | "edit_set_categories" ); | 1629 | "edit_set_categories" ); |
1630 | 1630 | ||
1631 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, | 1631 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, |
1632 | SLOT( removeVoice() ), actionCollection(), | 1632 | SLOT( removeVoice() ), actionCollection(), |
1633 | "remove_voice" ); | 1633 | "remove_voice" ); |
1634 | mActionImportOL = new KAction( i18n( "Import from OL..." ), 0, this, | 1634 | mActionImportOL = new KAction( i18n( "Import from OL..." ), 0, this, |
1635 | SLOT( importFromOL() ), actionCollection(), | 1635 | SLOT( importFromOL() ), actionCollection(), |
1636 | "import_OL" ); | 1636 | "import_OL" ); |
1637 | #ifdef KAB_EMBEDDED | 1637 | #ifdef KAB_EMBEDDED |
1638 | 1638 | mActionLicence = new KAction( i18n( "Licence" ), "licence", 0, | |
1639 | this, SLOT( showLicence() ), actionCollection(), | ||
1640 | "licence_about_data" ); | ||
1639 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, | 1641 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, |
1640 | this, SLOT( createAboutData() ), actionCollection(), | 1642 | this, SLOT( createAboutData() ), actionCollection(), |
1641 | "kaddressbook_about_data" ); | 1643 | "kaddressbook_about_data" ); |
1642 | #endif //KAB_EMBEDDED | 1644 | #endif //KAB_EMBEDDED |
1643 | 1645 | ||
1644 | clipboardDataChanged(); | 1646 | clipboardDataChanged(); |
1645 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1647 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1646 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1648 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1647 | } | 1649 | } |
1648 | 1650 | ||
1649 | //US we need this function, to plug all actions into the correct menues. | 1651 | //US we need this function, to plug all actions into the correct menues. |
1650 | // KDE uses a XML format to plug the actions, but we work her without this overhead. | 1652 | // KDE uses a XML format to plug the actions, but we work her without this overhead. |
1651 | void KABCore::addActionsManually() | 1653 | void KABCore::addActionsManually() |
1652 | { | 1654 | { |
1653 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 1655 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
1654 | 1656 | ||
1655 | #ifdef KAB_EMBEDDED | 1657 | #ifdef KAB_EMBEDDED |
1656 | QPopupMenu *fileMenu = new QPopupMenu( this ); | 1658 | QPopupMenu *fileMenu = new QPopupMenu( this ); |
1657 | QPopupMenu *editMenu = new QPopupMenu( this ); | 1659 | QPopupMenu *editMenu = new QPopupMenu( this ); |
1658 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 1660 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
1659 | 1661 | ||
1660 | KToolBar* tb = mMainWindow->toolBar(); | 1662 | KToolBar* tb = mMainWindow->toolBar(); |
1661 | 1663 | ||
1662 | #ifdef DESKTOP_VERSION | 1664 | #ifdef DESKTOP_VERSION |
@@ -1738,81 +1740,85 @@ void KABCore::addActionsManually() | |||
1738 | // you do that through the control center !!! | 1740 | // you do that through the control center !!! |
1739 | mActionConfigResources->plug( settingsMenu ); | 1741 | mActionConfigResources->plug( settingsMenu ); |
1740 | settingsMenu->insertSeparator(); | 1742 | settingsMenu->insertSeparator(); |
1741 | 1743 | ||
1742 | mActionConfigKAddressbook->plug( settingsMenu ); | 1744 | mActionConfigKAddressbook->plug( settingsMenu ); |
1743 | 1745 | ||
1744 | if ( mIsPart ) { | 1746 | if ( mIsPart ) { |
1745 | mActionConfigShortcuts->plug( settingsMenu ); | 1747 | mActionConfigShortcuts->plug( settingsMenu ); |
1746 | mActionConfigureToolbars->plug( settingsMenu ); | 1748 | mActionConfigureToolbars->plug( settingsMenu ); |
1747 | 1749 | ||
1748 | } else { | 1750 | } else { |
1749 | mActionKeyBindings->plug( settingsMenu ); | 1751 | mActionKeyBindings->plug( settingsMenu ); |
1750 | } | 1752 | } |
1751 | 1753 | ||
1752 | settingsMenu->insertSeparator(); | 1754 | settingsMenu->insertSeparator(); |
1753 | 1755 | ||
1754 | mActionJumpBar->plug( settingsMenu ); | 1756 | mActionJumpBar->plug( settingsMenu ); |
1755 | mActionDetails->plug( settingsMenu ); | 1757 | mActionDetails->plug( settingsMenu ); |
1756 | settingsMenu->insertSeparator(); | 1758 | settingsMenu->insertSeparator(); |
1757 | 1759 | ||
1758 | mActionWhoAmI->plug( settingsMenu ); | 1760 | mActionWhoAmI->plug( settingsMenu ); |
1759 | mActionCategories->plug( settingsMenu ); | 1761 | mActionCategories->plug( settingsMenu ); |
1760 | 1762 | ||
1761 | mActionAboutKAddressbook->plug( helpMenu ); | 1763 | mActionAboutKAddressbook->plug( helpMenu ); |
1762 | 1764 | mActionLicence->plug( helpMenu ); | |
1763 | 1765 | ||
1764 | if (QApplication::desktop()->width() > 320 ) { | 1766 | if (QApplication::desktop()->width() > 320 ) { |
1765 | 1767 | ||
1766 | mActionEditAddressee->plug( tb ); | 1768 | mActionEditAddressee->plug( tb ); |
1767 | mActionSave->plug( tb ); | 1769 | mActionSave->plug( tb ); |
1768 | mViewManager->getFilterAction()->plug ( tb); | 1770 | mViewManager->getFilterAction()->plug ( tb); |
1769 | if (QApplication::desktop()->width() > 480 ) { | 1771 | if (QApplication::desktop()->width() > 480 ) { |
1770 | mActionUndo->plug( tb ); | 1772 | mActionUndo->plug( tb ); |
1771 | mActionDelete->plug( tb ); | 1773 | mActionDelete->plug( tb ); |
1772 | mActionRedo->plug( tb ); | 1774 | mActionRedo->plug( tb ); |
1773 | } | 1775 | } |
1774 | } | 1776 | } |
1775 | //mActionQuit->plug ( tb ); | 1777 | //mActionQuit->plug ( tb ); |
1776 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); | 1778 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); |
1777 | 1779 | ||
1778 | //US link the searchwidget first to this. | 1780 | //US link the searchwidget first to this. |
1779 | // The real linkage to the toolbar happens later. | 1781 | // The real linkage to the toolbar happens later. |
1780 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); | 1782 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); |
1781 | //US tb->insertItem( mIncSearchWidget ); | 1783 | //US tb->insertItem( mIncSearchWidget ); |
1782 | /*US | 1784 | /*US |
1783 | mIncSearchWidget = new IncSearchWidget( tb ); | 1785 | mIncSearchWidget = new IncSearchWidget( tb ); |
1784 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 1786 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
1785 | SLOT( incrementalSearch( const QString& ) ) ); | 1787 | SLOT( incrementalSearch( const QString& ) ) ); |
1786 | 1788 | ||
1787 | mJumpButtonBar = new JumpButtonBar( this, this ); | 1789 | mJumpButtonBar = new JumpButtonBar( this, this ); |
1788 | 1790 | ||
1789 | //US topLayout->addWidget( mJumpButtonBar ); | 1791 | //US topLayout->addWidget( mJumpButtonBar ); |
1790 | this->layout()->add( mJumpButtonBar ); | 1792 | this->layout()->add( mJumpButtonBar ); |
1791 | */ | 1793 | */ |
1792 | 1794 | ||
1793 | #endif //KAB_EMBEDDED | 1795 | #endif //KAB_EMBEDDED |
1794 | } | 1796 | } |
1797 | void KABCore::showLicence() | ||
1798 | { | ||
1799 | KApplication::showLicence(); | ||
1800 | } | ||
1795 | void KABCore::removeVoice() | 1801 | void KABCore::removeVoice() |
1796 | { | 1802 | { |
1797 | 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 ) | 1803 | 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 ) |
1798 | return; | 1804 | return; |
1799 | KABC::Addressee::List list = mViewManager->selectedAddressees(); | 1805 | KABC::Addressee::List list = mViewManager->selectedAddressees(); |
1800 | KABC::Addressee::List::Iterator it; | 1806 | KABC::Addressee::List::Iterator it; |
1801 | for ( it = list.begin(); it != list.end(); ++it ) { | 1807 | for ( it = list.begin(); it != list.end(); ++it ) { |
1802 | PhoneNumber::List phoneNumbers = (*it).phoneNumbers(); | 1808 | PhoneNumber::List phoneNumbers = (*it).phoneNumbers(); |
1803 | PhoneNumber::List::Iterator phoneIt; | 1809 | PhoneNumber::List::Iterator phoneIt; |
1804 | bool found = false; | 1810 | bool found = false; |
1805 | for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { | 1811 | for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { |
1806 | if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found | 1812 | if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found |
1807 | if ((*phoneIt).type() - PhoneNumber::Voice ) { | 1813 | if ((*phoneIt).type() - PhoneNumber::Voice ) { |
1808 | (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice ); | 1814 | (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice ); |
1809 | (*it).insertPhoneNumber( (*phoneIt) ); | 1815 | (*it).insertPhoneNumber( (*phoneIt) ); |
1810 | found = true; | 1816 | found = true; |
1811 | } | 1817 | } |
1812 | } | 1818 | } |
1813 | 1819 | ||
1814 | } | 1820 | } |
1815 | if ( found ) | 1821 | if ( found ) |
1816 | contactModified((*it) ); | 1822 | contactModified((*it) ); |
1817 | } | 1823 | } |
1818 | } | 1824 | } |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index be39148..6bbdfd4 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -121,48 +121,49 @@ class KABCore : public QWidget | |||
121 | QStringList selectedUIDs() const; | 121 | QStringList selectedUIDs() const; |
122 | 122 | ||
123 | /** | 123 | /** |
124 | Displays the ResourceSelectDialog and returns the selected | 124 | Displays the ResourceSelectDialog and returns the selected |
125 | resource or a null pointer if no resource was selected by | 125 | resource or a null pointer if no resource was selected by |
126 | the user. | 126 | the user. |
127 | */ | 127 | */ |
128 | KABC::Resource *requestResource( QWidget *parent ); | 128 | KABC::Resource *requestResource( QWidget *parent ); |
129 | 129 | ||
130 | #ifndef KAB_EMBEDDED | 130 | #ifndef KAB_EMBEDDED |
131 | static KAboutData *createAboutData(); | 131 | static KAboutData *createAboutData(); |
132 | #endif //KAB_EMBEDDED | 132 | #endif //KAB_EMBEDDED |
133 | 133 | ||
134 | #ifdef KAB_EMBEDDED | 134 | #ifdef KAB_EMBEDDED |
135 | inline QPopupMenu* getImportMenu() { return ImportMenu;} | 135 | inline QPopupMenu* getImportMenu() { return ImportMenu;} |
136 | inline QPopupMenu* getExportMenu() { return ExportMenu;} | 136 | inline QPopupMenu* getExportMenu() { return ExportMenu;} |
137 | #endif //KAB_EMBEDDED | 137 | #endif //KAB_EMBEDDED |
138 | 138 | ||
139 | public slots: | 139 | public slots: |
140 | #ifdef KAB_EMBEDDED | 140 | #ifdef KAB_EMBEDDED |
141 | void createAboutData(); | 141 | void createAboutData(); |
142 | #endif //KAB_EMBEDDED | 142 | #endif //KAB_EMBEDDED |
143 | 143 | ||
144 | void statusMessage(QString, int time = 0 ); | 144 | void statusMessage(QString, int time = 0 ); |
145 | void showLicence(); | ||
145 | /** | 146 | /** |
146 | Is called whenever a contact is selected in the view. | 147 | Is called whenever a contact is selected in the view. |
147 | */ | 148 | */ |
148 | void setContactSelected( const QString &uid ); | 149 | void setContactSelected( const QString &uid ); |
149 | 150 | ||
150 | /** | 151 | /** |
151 | Opens the preferred mail composer with all selected contacts as | 152 | Opens the preferred mail composer with all selected contacts as |
152 | arguments. | 153 | arguments. |
153 | */ | 154 | */ |
154 | void sendMail(); | 155 | void sendMail(); |
155 | 156 | ||
156 | /** | 157 | /** |
157 | Opens the preferred mail composer with the given contacts as | 158 | Opens the preferred mail composer with the given contacts as |
158 | arguments. | 159 | arguments. |
159 | */ | 160 | */ |
160 | void sendMail( const QString& email ); | 161 | void sendMail( const QString& email ); |
161 | 162 | ||
162 | 163 | ||
163 | void mailVCard(); | 164 | void mailVCard(); |
164 | void mailVCard(const QStringList& uids); | 165 | void mailVCard(const QStringList& uids); |
165 | 166 | ||
166 | /** | 167 | /** |
167 | Beams the "WhoAmI contact. | 168 | Beams the "WhoAmI contact. |
168 | */ | 169 | */ |
@@ -386,48 +387,49 @@ class KABCore : public QWidget | |||
386 | KAction *mActionBeamVCard; | 387 | KAction *mActionBeamVCard; |
387 | 388 | ||
388 | KAction *mActionQuit; | 389 | KAction *mActionQuit; |
389 | 390 | ||
390 | //US edit menu | 391 | //US edit menu |
391 | KAction *mActionCopy; | 392 | KAction *mActionCopy; |
392 | KAction *mActionCut; | 393 | KAction *mActionCut; |
393 | KAction *mActionPaste; | 394 | KAction *mActionPaste; |
394 | KAction *mActionSelectAll; | 395 | KAction *mActionSelectAll; |
395 | KAction *mActionUndo; | 396 | KAction *mActionUndo; |
396 | KAction *mActionRedo; | 397 | KAction *mActionRedo; |
397 | KAction *mActionDelete; | 398 | KAction *mActionDelete; |
398 | 399 | ||
399 | //US settings menu | 400 | //US settings menu |
400 | KAction *mActionConfigResources; | 401 | KAction *mActionConfigResources; |
401 | KAction *mActionConfigKAddressbook; | 402 | KAction *mActionConfigKAddressbook; |
402 | KAction *mActionConfigShortcuts; | 403 | KAction *mActionConfigShortcuts; |
403 | KAction *mActionConfigureToolbars; | 404 | KAction *mActionConfigureToolbars; |
404 | KAction *mActionKeyBindings; | 405 | KAction *mActionKeyBindings; |
405 | KToggleAction *mActionJumpBar; | 406 | KToggleAction *mActionJumpBar; |
406 | KToggleAction *mActionDetails; | 407 | KToggleAction *mActionDetails; |
407 | KAction *mActionWhoAmI; | 408 | KAction *mActionWhoAmI; |
408 | KAction *mActionCategories; | 409 | KAction *mActionCategories; |
409 | KAction *mActionAboutKAddressbook; | 410 | KAction *mActionAboutKAddressbook; |
411 | KAction *mActionLicence; | ||
410 | 412 | ||
411 | KAction *mActionDeleteView; | 413 | KAction *mActionDeleteView; |
412 | 414 | ||
413 | QPopupMenu *viewMenu; | 415 | QPopupMenu *viewMenu; |
414 | QPopupMenu *filterMenu; | 416 | QPopupMenu *filterMenu; |
415 | QPopupMenu *settingsMenu; | 417 | QPopupMenu *settingsMenu; |
416 | QPopupMenu *changeMenu; | 418 | QPopupMenu *changeMenu; |
417 | 419 | ||
418 | //US QAction *mActionSave; | 420 | //US QAction *mActionSave; |
419 | QPopupMenu *ImportMenu; | 421 | QPopupMenu *ImportMenu; |
420 | QPopupMenu *ExportMenu; | 422 | QPopupMenu *ExportMenu; |
421 | //LR additional methods | 423 | //LR additional methods |
422 | KAction *mActionRemoveVoice; | 424 | KAction *mActionRemoveVoice; |
423 | KAction * mActionImportOL; | 425 | KAction * mActionImportOL; |
424 | 426 | ||
425 | #ifndef KAB_EMBEDDED | 427 | #ifndef KAB_EMBEDDED |
426 | KAddressBookService *mAddressBookService; | 428 | KAddressBookService *mAddressBookService; |
427 | #endif //KAB_EMBEDDED | 429 | #endif //KAB_EMBEDDED |
428 | 430 | ||
429 | class KABCorePrivate; | 431 | class KABCorePrivate; |
430 | KABCorePrivate *d; | 432 | KABCorePrivate *d; |
431 | 433 | ||
432 | #ifdef KAB_EMBEDDED | 434 | #ifdef KAB_EMBEDDED |
433 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient | 435 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient |