summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2004-11-08 23:57:27 (UTC)
committer zautrix <zautrix>2004-11-08 23:57:27 (UTC)
commit48b2ccf53b1821598c6f18aab57e6e626047c262 (patch) (unidiff)
tree10e4f0123debd92ed06f037dc9212c88a6046bc3 /kaddressbook
parenta102330ef5acb7346aa811378eaf9dbcdeabd4c4 (diff)
downloadkdepimpi-48b2ccf53b1821598c6f18aab57e6e626047c262.zip
kdepimpi-48b2ccf53b1821598c6f18aab57e6e626047c262.tar.gz
kdepimpi-48b2ccf53b1821598c6f18aab57e6e626047c262.tar.bz2
more menu cleanup in kapi
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp29
-rw-r--r--kaddressbook/kabcore.h1
2 files changed, 19 insertions, 11 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index a6fc677..3c97ce9 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -667,28 +667,24 @@ void KABCore::setContactSelected( const QString &uid )
667 if ( mReadWrite ) { 667 if ( mReadWrite ) {
668 mActionCut->setEnabled( selected ); 668 mActionCut->setEnabled( selected );
669 mActionPaste->setEnabled( selected ); 669 mActionPaste->setEnabled( selected );
670 } 670 }
671 671
672 mActionCopy->setEnabled( selected ); 672 mActionCopy->setEnabled( selected );
673 mActionDelete->setEnabled( selected ); 673 mActionDelete->setEnabled( selected );
674 mActionEditAddressee->setEnabled( selected ); 674 mActionEditAddressee->setEnabled( selected );
675 mActionMail->setEnabled( selected ); 675 mActionMail->setEnabled( selected );
676 mActionMailVCard->setEnabled( selected ); 676 mActionMailVCard->setEnabled( selected );
677 //if (mActionBeam) 677 //if (mActionBeam)
678 //mActionBeam->setEnabled( selected ); 678 //mActionBeam->setEnabled( selected );
679
680 if (mActionBeamVCard)
681 mActionBeamVCard->setEnabled( selected );
682
683 mActionWhoAmI->setEnabled( selected ); 679 mActionWhoAmI->setEnabled( selected );
684} 680}
685 681
686void KABCore::sendMail() 682void KABCore::sendMail()
687{ 683{
688 sendMail( mViewManager->selectedEmails().join( ", " ) ); 684 sendMail( mViewManager->selectedEmails().join( ", " ) );
689} 685}
690 686
691void KABCore::sendMail( const QString& emaillist ) 687void KABCore::sendMail( const QString& emaillist )
692{ 688{
693 // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... " 689 // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... "
694 if (emaillist.contains(",") > 0) 690 if (emaillist.contains(",") > 0)
@@ -859,27 +855,33 @@ QString KABCore::getPhoneFile()
859 return "/tmp/phonefile.vcf"; 855 return "/tmp/phonefile.vcf";
860#endif 856#endif
861 857
862} 858}
863void KABCore::writeToPhone( ) 859void KABCore::writeToPhone( )
864{ 860{
865 if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) 861 if ( PhoneAccess::writeToPhone( getPhoneFile() ) )
866 message(i18n("Export to phone finished!")); 862 message(i18n("Export to phone finished!"));
867 else 863 else
868 qDebug(i18n("Error exporting to phone")); 864 qDebug(i18n("Error exporting to phone"));
869} 865}
870void KABCore::beamVCard() 866void KABCore::beamVCard()
871{ 867{
872 QStringList uids = mViewManager->selectedUids(); 868 QStringList uids;
873 if ( !uids.isEmpty() ) 869 XXPortSelectDialog dlg( this, false, this );
870 if ( dlg.exec() )
871 uids = dlg.uids();
872 else
873 return;
874 if ( uids.isEmpty() )
875 return;
874 beamVCard( uids ); 876 beamVCard( uids );
875} 877}
876 878
877 879
878void KABCore::beamVCard(const QStringList& uids) 880void KABCore::beamVCard(const QStringList& uids)
879{ 881{
880 882
881 // LR: we should use the /tmp dir on the Zaurus, 883 // LR: we should use the /tmp dir on the Zaurus,
882 // because: /tmp = RAM, (HOME)/kdepim = flash memory 884 // because: /tmp = RAM, (HOME)/kdepim = flash memory
883 885
884#ifdef DESKTOP_VERSION 886#ifdef DESKTOP_VERSION
885 QString fileName = locateLocal("tmp", "kapibeamfile.vcf"); 887 QString fileName = locateLocal("tmp", "kapibeamfile.vcf");
@@ -1687,24 +1689,25 @@ void KABCore::initGUI()
1687 mXXPortManager = new XXPortManager( this, this ); 1689 mXXPortManager = new XXPortManager( this, this );
1688 1690
1689#else //KAB_EMBEDDED 1691#else //KAB_EMBEDDED
1690 //US initialize viewMenu before settingup viewmanager. 1692 //US initialize viewMenu before settingup viewmanager.
1691 // Viewmanager needs this menu to plugin submenues. 1693 // Viewmanager needs this menu to plugin submenues.
1692 viewMenu = new QPopupMenu( this ); 1694 viewMenu = new QPopupMenu( this );
1693 settingsMenu = new QPopupMenu( this ); 1695 settingsMenu = new QPopupMenu( this );
1694 //filterMenu = new QPopupMenu( this ); 1696 //filterMenu = new QPopupMenu( this );
1695 ImportMenu = new QPopupMenu( this ); 1697 ImportMenu = new QPopupMenu( this );
1696 ExportMenu = new QPopupMenu( this ); 1698 ExportMenu = new QPopupMenu( this );
1697 syncMenu = new QPopupMenu( this ); 1699 syncMenu = new QPopupMenu( this );
1698 changeMenu= new QPopupMenu( this ); 1700 changeMenu= new QPopupMenu( this );
1701 beamMenu= new QPopupMenu( this );
1699 1702
1700//US since we have no splitter for the embedded system, setup 1703//US since we have no splitter for the embedded system, setup
1701// a layout with two frames. One left and one right. 1704// a layout with two frames. One left and one right.
1702 1705
1703 QBoxLayout *topLayout; 1706 QBoxLayout *topLayout;
1704 1707
1705 // = new QHBoxLayout( this ); 1708 // = new QHBoxLayout( this );
1706// QBoxLayout *topLayout = (QBoxLayout*)layout(); 1709// QBoxLayout *topLayout = (QBoxLayout*)layout();
1707 1710
1708// QWidget *mainBox = new QWidget( this ); 1711// QWidget *mainBox = new QWidget( this );
1709// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); 1712// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox);
1710 1713
@@ -1852,25 +1855,25 @@ void KABCore::initActions()
1852 this, SLOT( mailVCard() ), 1855 this, SLOT( mailVCard() ),
1853 actionCollection(), "file_mail_vcard"); 1856 actionCollection(), "file_mail_vcard");
1854 1857
1855 mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this, 1858 mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this,
1856 SLOT( export2phone() ), actionCollection(), 1859 SLOT( export2phone() ), actionCollection(),
1857 "kaddressbook_ex2phone" ); 1860 "kaddressbook_ex2phone" );
1858 1861
1859 mActionBeamVCard = 0; 1862 mActionBeamVCard = 0;
1860 mActionBeam = 0; 1863 mActionBeam = 0;
1861 1864
1862#ifndef DESKTOP_VERSION 1865#ifndef DESKTOP_VERSION
1863 if ( Ir::supported() ) { 1866 if ( Ir::supported() ) {
1864 mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, 1867 mActionBeamVCard = new KAction( i18n( "Beam v&Card(s)..." ), "beam", 0, this,
1865 SLOT( beamVCard() ), actionCollection(), 1868 SLOT( beamVCard() ), actionCollection(),
1866 "kaddressbook_beam_vcard" ); 1869 "kaddressbook_beam_vcard" );
1867 1870
1868 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, 1871 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this,
1869 SLOT( beamMySelf() ), actionCollection(), 1872 SLOT( beamMySelf() ), actionCollection(),
1870 "kaddressbook_beam_myself" ); 1873 "kaddressbook_beam_myself" );
1871 } 1874 }
1872#endif 1875#endif
1873 1876
1874 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, 1877 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0,
1875 this, SLOT( editContact2() ), 1878 this, SLOT( editContact2() ),
1876 actionCollection(), "file_properties" ); 1879 actionCollection(), "file_properties" );
@@ -2094,29 +2097,31 @@ void KABCore::addActionsManually()
2094 mActionNewContact->plug( tb ); 2097 mActionNewContact->plug( tb );
2095 2098
2096 mActionEditAddressee->plug( fileMenu ); 2099 mActionEditAddressee->plug( fileMenu );
2097 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || 2100 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
2098 // (!KABPrefs::instance()->mMultipleViewsAtOnce )) 2101 // (!KABPrefs::instance()->mMultipleViewsAtOnce ))
2099 mActionEditAddressee->plug( tb ); 2102 mActionEditAddressee->plug( tb );
2100 2103
2101 fileMenu->insertSeparator(); 2104 fileMenu->insertSeparator();
2102 mActionSave->plug( fileMenu ); 2105 mActionSave->plug( fileMenu );
2103 fileMenu->insertItem( "&Import", ImportMenu ); 2106 fileMenu->insertItem( "&Import", ImportMenu );
2104 fileMenu->insertItem( "&Export", ExportMenu ); 2107 fileMenu->insertItem( "&Export", ExportMenu );
2105 fileMenu->insertItem( i18n("&Change"), changeMenu ); 2108 fileMenu->insertItem( i18n("&Change"), changeMenu );
2109 fileMenu->insertItem( i18n("&Beam"), beamMenu );
2106 fileMenu->insertSeparator(); 2110 fileMenu->insertSeparator();
2107 mActionMailVCard->plug( fileMenu ); 2111 mActionMailVCard->plug( fileMenu );
2108#ifndef DESKTOP_VERSION 2112#ifndef DESKTOP_VERSION
2109 if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); 2113 if ( Ir::supported() ) mActionBR->plug( beamMenu );
2110 if ( Ir::supported() ) mActionBeam->plug(fileMenu ); 2114 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu );
2115 if ( Ir::supported() ) mActionBeam->plug( beamMenu );
2111#endif 2116#endif
2112 fileMenu->insertSeparator(); 2117 fileMenu->insertSeparator();
2113 mActionQuit->plug( fileMenu ); 2118 mActionQuit->plug( fileMenu );
2114#ifdef _WIN32_ 2119#ifdef _WIN32_
2115 mActionImportOL->plug( ImportMenu ); 2120 mActionImportOL->plug( ImportMenu );
2116#endif 2121#endif
2117 // edit menu 2122 // edit menu
2118 mActionUndo->plug( editMenu ); 2123 mActionUndo->plug( editMenu );
2119 mActionRedo->plug( editMenu ); 2124 mActionRedo->plug( editMenu );
2120 editMenu->insertSeparator(); 2125 editMenu->insertSeparator();
2121 mActionCut->plug( editMenu ); 2126 mActionCut->plug( editMenu );
2122 mActionCopy->plug( editMenu ); 2127 mActionCopy->plug( editMenu );
@@ -2142,25 +2147,27 @@ void KABCore::addActionsManually()
2142 } else { 2147 } else {
2143 //US not implemented yet 2148 //US not implemented yet
2144 //mActionKeyBindings->plug( settingsMenu ); 2149 //mActionKeyBindings->plug( settingsMenu );
2145 } 2150 }
2146 2151
2147 settingsMenu->insertSeparator(); 2152 settingsMenu->insertSeparator();
2148 2153
2149 mActionJumpBar->plug( settingsMenu ); 2154 mActionJumpBar->plug( settingsMenu );
2150 mActionDetails->plug( settingsMenu ); 2155 mActionDetails->plug( settingsMenu );
2151 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) 2156 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop )
2152 mActionDetails->plug( tb ); 2157 mActionDetails->plug( tb );
2153 settingsMenu->insertSeparator(); 2158 settingsMenu->insertSeparator();
2154 mActionBR->plug(settingsMenu ); 2159#ifndef DESKTOP_VERSION
2160 if ( Ir::supported() ) mActionBR->plug(settingsMenu );
2161#endif
2155 settingsMenu->insertSeparator(); 2162 settingsMenu->insertSeparator();
2156 2163
2157 mActionWhoAmI->plug( settingsMenu ); 2164 mActionWhoAmI->plug( settingsMenu );
2158 mActionEditCategories->plug( settingsMenu ); 2165 mActionEditCategories->plug( settingsMenu );
2159 mActionEditCategories->plug( changeMenu ); 2166 mActionEditCategories->plug( changeMenu );
2160 mActionCategories->plug( changeMenu ); 2167 mActionCategories->plug( changeMenu );
2161 mActionManageCategories->plug( changeMenu ); 2168 mActionManageCategories->plug( changeMenu );
2162 2169
2163 mActionCategories->plug( settingsMenu ); 2170 mActionCategories->plug( settingsMenu );
2164 mActionManageCategories->plug( settingsMenu ); 2171 mActionManageCategories->plug( settingsMenu );
2165 2172
2166 2173
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index 88e83f0..c7c12ff 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -463,24 +463,25 @@ class KABCore : public QWidget, public KSyncInterface
463 KAction *mActionFaq; 463 KAction *mActionFaq;
464 KAction *mActionWN; 464 KAction *mActionWN;
465 KAction *mActionSyncHowto; 465 KAction *mActionSyncHowto;
466 KAction *mActionKdeSyncHowto; 466 KAction *mActionKdeSyncHowto;
467 KAction *mActionMultiSyncHowto; 467 KAction *mActionMultiSyncHowto;
468 468
469 KAction *mActionDeleteView; 469 KAction *mActionDeleteView;
470 470
471 QPopupMenu *viewMenu; 471 QPopupMenu *viewMenu;
472 QPopupMenu *filterMenu; 472 QPopupMenu *filterMenu;
473 QPopupMenu *settingsMenu; 473 QPopupMenu *settingsMenu;
474 QPopupMenu *changeMenu; 474 QPopupMenu *changeMenu;
475 QPopupMenu *beamMenu;
475//US QAction *mActionSave; 476//US QAction *mActionSave;
476 QPopupMenu *ImportMenu; 477 QPopupMenu *ImportMenu;
477 QPopupMenu *ExportMenu; 478 QPopupMenu *ExportMenu;
478 //LR additional methods 479 //LR additional methods
479 KAction *mActionRemoveVoice; 480 KAction *mActionRemoveVoice;
480 KAction * mActionImportOL; 481 KAction * mActionImportOL;
481 482
482#ifndef KAB_EMBEDDED 483#ifndef KAB_EMBEDDED
483 KAddressBookService *mAddressBookService; 484 KAddressBookService *mAddressBookService;
484#endif //KAB_EMBEDDED 485#endif //KAB_EMBEDDED
485 486
486 class KABCorePrivate; 487 class KABCorePrivate;