diff --git a/kmail_part.rc b/kmail_part.rc index 6245b33ef..c42d28441 100644 --- a/kmail_part.rc +++ b/kmail_part.rc @@ -2,7 +2,7 @@ the same menu entries at the same place in KMail and Kontact --> - + &File @@ -14,6 +14,8 @@ + + diff --git a/kmcomposerui.rc b/kmcomposerui.rc index 01ca1e5bf..59ed05434 100644 --- a/kmcomposerui.rc +++ b/kmcomposerui.rc @@ -1,11 +1,13 @@ - + &Message + + diff --git a/kmcomposewin.cpp b/kmcomposewin.cpp index d82743c04..0d9827015 100644 --- a/kmcomposewin.cpp +++ b/kmcomposewin.cpp @@ -99,6 +99,7 @@ #include #include #include +#include #include #include #include @@ -1154,6 +1155,11 @@ void KMComposeWin::setupActions( void ) actionCollection()->addAction( "save_as_file", action ); connect( action, SIGNAL(triggered(bool)), SLOT(slotSaveAsFile()) ); + action = new KAction(i18n("New AddressBook Contact..."),this); + actionCollection()->addAction("kmail_new_addressbook_contact", action ); + connect(action, SIGNAL(triggered(bool)), this, SLOT(slotCreateAddressBookContact())); + + action = new KAction(KIcon("document-open"), i18n("&Insert Text File..."), this); actionCollection()->addAction("insert_file", action ); @@ -3343,3 +3349,9 @@ void KMComposeWin::slotSaveAsFile() } delete dlg; } + +void KMComposeWin::slotCreateAddressBookContact() +{ + Akonadi::ContactEditorDialog *dlg = new Akonadi::ContactEditorDialog( Akonadi::ContactEditorDialog::CreateMode, this ); + dlg->exec(); +} diff --git a/kmcomposewin.h b/kmcomposewin.h index 65ede857c..b3701f3e7 100644 --- a/kmcomposewin.h +++ b/kmcomposewin.h @@ -434,6 +434,7 @@ class KMComposeWin : public KMail::Composer void insertSpecialCharacter(); void charSelected(const QChar& c); void slotSaveAsFile(); + void slotCreateAddressBookContact(); public: // kmcommand // FIXME we need to remove these, but they're pure virtual in Composer. diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index f3aeb9df3..1a7488ade 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -121,6 +121,9 @@ #include #include #include +#include + + #include #include #include @@ -3708,6 +3711,14 @@ void KMMainWidget::setupActions() connect(action, SIGNAL(triggered(bool)), this, SLOT(slotExportData())); } + { + KAction *action = new KAction(i18n("New AddressBook Contact..."),this); + actionCollection()->addAction("kmail_new_addressbook_contact", action ); + connect(action, SIGNAL(triggered(bool)), this, SLOT(slotCreateAddressBookContact())); + + + } + actionCollection()->addAction(KStandardAction::Undo, "kmail_undo", this, SLOT(slotUndo())); KStandardAction::tipOfDay( this, SLOT(slotShowTip()), actionCollection() ); @@ -4684,3 +4695,9 @@ void KMMainWidget::slotExportData() "Please check your installation." ), i18n( "Unable to start backupmail" ) ); } + +void KMMainWidget::slotCreateAddressBookContact() +{ + Akonadi::ContactEditorDialog *dlg = new Akonadi::ContactEditorDialog( Akonadi::ContactEditorDialog::CreateMode, this ); + dlg->exec(); +} diff --git a/kmmainwidget.h b/kmmainwidget.h index 11a6f739c..70710611b 100644 --- a/kmmainwidget.h +++ b/kmmainwidget.h @@ -460,6 +460,7 @@ class KMAIL_EXPORT KMMainWidget : public QWidget void slotShowNotification(); void slotConfigureAutomaticArchiving(); void slotExportData(); + void slotCreateAddressBookContact(); private: void updateHtmlMenuEntry(); diff --git a/kmmainwin.rc b/kmmainwin.rc index 6245b33ef..c42d28441 100644 --- a/kmmainwin.rc +++ b/kmmainwin.rc @@ -2,7 +2,7 @@ the same menu entries at the same place in KMail and Kontact --> - + &File @@ -14,6 +14,8 @@ + +