summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-07 23:33:23 (UTC)
committer zautrix <zautrix>2004-09-07 23:33:23 (UTC)
commit199025628054eef739a261437a51a98f5218ab0f (patch) (unidiff)
tree75ec5c537ee789dbd3e1a87a2e7db9b29d44c626
parent2676646d4744ccceab1063dc02d772a26a203c61 (diff)
downloadkdepimpi-199025628054eef739a261437a51a98f5218ab0f.zip
kdepimpi-199025628054eef739a261437a51a98f5218ab0f.tar.gz
kdepimpi-199025628054eef739a261437a51a98f5218ab0f.tar.bz2
Fixed default settings
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp7
-rw-r--r--kmicromail/composemail.cpp8
-rw-r--r--libkdepim/externalapphandler.cpp3
-rw-r--r--libkdepim/kpimglobalprefs.cpp4
4 files changed, 15 insertions, 7 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 6522ccc..5cd9649 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1916,224 +1916,227 @@ void KABCore::addActionsManually()
1916 } 1916 }
1917 } 1917 }
1918 //mActionQuit->plug ( tb ); 1918 //mActionQuit->plug ( tb );
1919 // tb->insertWidget(-1, 0, mIncSearchWidget, 6); 1919 // tb->insertWidget(-1, 0, mIncSearchWidget, 6);
1920 1920
1921 //US link the searchwidget first to this. 1921 //US link the searchwidget first to this.
1922 // The real linkage to the toolbar happens later. 1922 // The real linkage to the toolbar happens later.
1923//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 1923//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
1924//US tb->insertItem( mIncSearchWidget ); 1924//US tb->insertItem( mIncSearchWidget );
1925/*US 1925/*US
1926 mIncSearchWidget = new IncSearchWidget( tb ); 1926 mIncSearchWidget = new IncSearchWidget( tb );
1927 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1927 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1928 SLOT( incrementalSearch( const QString& ) ) ); 1928 SLOT( incrementalSearch( const QString& ) ) );
1929 1929
1930 mJumpButtonBar = new JumpButtonBar( this, this ); 1930 mJumpButtonBar = new JumpButtonBar( this, this );
1931 1931
1932//US topLayout->addWidget( mJumpButtonBar ); 1932//US topLayout->addWidget( mJumpButtonBar );
1933 this->layout()->add( mJumpButtonBar ); 1933 this->layout()->add( mJumpButtonBar );
1934*/ 1934*/
1935 1935
1936#endif //KAB_EMBEDDED 1936#endif //KAB_EMBEDDED
1937} 1937}
1938void KABCore::showLicence() 1938void KABCore::showLicence()
1939{ 1939{
1940 KApplication::showLicence(); 1940 KApplication::showLicence();
1941} 1941}
1942void KABCore::removeVoice() 1942void KABCore::removeVoice()
1943{ 1943{
1944 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 ) 1944 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 )
1945 return; 1945 return;
1946 KABC::Addressee::List list = mViewManager->selectedAddressees(); 1946 KABC::Addressee::List list = mViewManager->selectedAddressees();
1947 KABC::Addressee::List::Iterator it; 1947 KABC::Addressee::List::Iterator it;
1948 for ( it = list.begin(); it != list.end(); ++it ) { 1948 for ( it = list.begin(); it != list.end(); ++it ) {
1949 PhoneNumber::List phoneNumbers = (*it).phoneNumbers(); 1949 PhoneNumber::List phoneNumbers = (*it).phoneNumbers();
1950 PhoneNumber::List::Iterator phoneIt; 1950 PhoneNumber::List::Iterator phoneIt;
1951 bool found = false; 1951 bool found = false;
1952 for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { 1952 for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) {
1953 if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found 1953 if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found
1954 if ((*phoneIt).type() - PhoneNumber::Voice ) { 1954 if ((*phoneIt).type() - PhoneNumber::Voice ) {
1955 (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice ); 1955 (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice );
1956 (*it).insertPhoneNumber( (*phoneIt) ); 1956 (*it).insertPhoneNumber( (*phoneIt) );
1957 found = true; 1957 found = true;
1958 } 1958 }
1959 } 1959 }
1960 1960
1961 } 1961 }
1962 if ( found ) 1962 if ( found )
1963 contactModified((*it) ); 1963 contactModified((*it) );
1964 } 1964 }
1965} 1965}
1966 1966
1967 1967
1968 1968
1969void KABCore::clipboardDataChanged() 1969void KABCore::clipboardDataChanged()
1970{ 1970{
1971 1971
1972 if ( mReadWrite ) 1972 if ( mReadWrite )
1973 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); 1973 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
1974 1974
1975} 1975}
1976 1976
1977void KABCore::updateActionMenu() 1977void KABCore::updateActionMenu()
1978{ 1978{
1979 UndoStack *undo = UndoStack::instance(); 1979 UndoStack *undo = UndoStack::instance();
1980 RedoStack *redo = RedoStack::instance(); 1980 RedoStack *redo = RedoStack::instance();
1981 1981
1982 if ( undo->isEmpty() ) 1982 if ( undo->isEmpty() )
1983 mActionUndo->setText( i18n( "Undo" ) ); 1983 mActionUndo->setText( i18n( "Undo" ) );
1984 else 1984 else
1985 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); 1985 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
1986 1986
1987 mActionUndo->setEnabled( !undo->isEmpty() ); 1987 mActionUndo->setEnabled( !undo->isEmpty() );
1988 1988
1989 if ( !redo->top() ) 1989 if ( !redo->top() )
1990 mActionRedo->setText( i18n( "Redo" ) ); 1990 mActionRedo->setText( i18n( "Redo" ) );
1991 else 1991 else
1992 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); 1992 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
1993 1993
1994 mActionRedo->setEnabled( !redo->isEmpty() ); 1994 mActionRedo->setEnabled( !redo->isEmpty() );
1995} 1995}
1996 1996
1997void KABCore::configureKeyBindings() 1997void KABCore::configureKeyBindings()
1998{ 1998{
1999#ifndef KAB_EMBEDDED 1999#ifndef KAB_EMBEDDED
2000 KKeyDialog::configure( actionCollection(), true ); 2000 KKeyDialog::configure( actionCollection(), true );
2001#else //KAB_EMBEDDED 2001#else //KAB_EMBEDDED
2002 qDebug("KABCore::configureKeyBindings() not implemented"); 2002 qDebug("KABCore::configureKeyBindings() not implemented");
2003#endif //KAB_EMBEDDED 2003#endif //KAB_EMBEDDED
2004} 2004}
2005 2005
2006#ifdef KAB_EMBEDDED 2006#ifdef KAB_EMBEDDED
2007void KABCore::configureResources() 2007void KABCore::configureResources()
2008{ 2008{
2009 KRES::KCMKResources dlg( this, "" , 0 ); 2009 KRES::KCMKResources dlg( this, "" , 0 );
2010 2010
2011 if ( !dlg.exec() ) 2011 if ( !dlg.exec() )
2012 return; 2012 return;
2013 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 2013 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
2014} 2014}
2015#endif //KAB_EMBEDDED 2015#endif //KAB_EMBEDDED
2016 2016
2017 2017
2018/* this method will be called through the QCop interface from Ko/Pi to select addresses 2018/* this method will be called through the QCop interface from Ko/Pi to select addresses
2019 * for the attendees list of an event. 2019 * for the attendees list of an event.
2020 */ 2020 */
2021void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) 2021void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid)
2022{ 2022{
2023 QStringList nameList; 2023 QStringList nameList;
2024 QStringList emailList; 2024 QStringList emailList;
2025 QStringList uidList; 2025 QStringList uidList;
2026 2026
2027 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 2027 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
2028 uint i=0; 2028 uint i=0;
2029 for (i=0; i < list.count(); i++) 2029 for (i=0; i < list.count(); i++)
2030 { 2030 {
2031 nameList.append(list[i].realName()); 2031 nameList.append(list[i].realName());
2032 emailList.append(list[i].preferredEmail()); 2032 emailList.append(list[i].preferredEmail());
2033 uidList.append(list[i].uid()); 2033 uidList.append(list[i].uid());
2034 } 2034 }
2035 2035
2036 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); 2036 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList);
2037 2037
2038} 2038}
2039 2039
2040/* this method will be called through the QCop interface from other apps to show details of a contact. 2040/* this method will be called through the QCop interface from other apps to show details of a contact.
2041 */ 2041 */
2042void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) 2042void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
2043{ 2043{
2044 //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); 2044 qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1());
2045 2045
2046 QString foundUid = QString::null; 2046 QString foundUid = QString::null;
2047 if ( ! uid.isEmpty() ) { 2047 if ( ! uid.isEmpty() ) {
2048 Addressee adrr = mAddressBook->findByUid( uid ); 2048 Addressee adrr = mAddressBook->findByUid( uid );
2049 if ( !adrr.isEmpty() ) { 2049 if ( !adrr.isEmpty() ) {
2050 foundUid = uid; 2050 foundUid = uid;
2051 }
2051 if ( email == "sendbacklist" ) { 2052 if ( email == "sendbacklist" ) {
2053 qDebug("ssssssssssssssssssssssend ");
2052 QStringList nameList; 2054 QStringList nameList;
2053 QStringList emailList; 2055 QStringList emailList;
2054 QStringList uidList; 2056 QStringList uidList;
2055 nameList.append(adrr.realName()); 2057 nameList.append(adrr.realName());
2056 emailList = adrr.emails(); 2058 emailList = adrr.emails();
2057 uidList.append( adrr.preferredEmail()); 2059 uidList.append( adrr.preferredEmail());
2058 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); 2060 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
2061 return;
2059 } 2062 }
2060 } 2063
2061 } 2064 }
2062 2065
2063 if ( email == "sendback" ) 2066 if ( email == "sendback" )
2064 return; 2067 return;
2065 if (foundUid.isEmpty()) 2068 if (foundUid.isEmpty())
2066 { 2069 {
2067 //find the uid of the person first 2070 //find the uid of the person first
2068 Addressee::List namelist; 2071 Addressee::List namelist;
2069 Addressee::List emaillist; 2072 Addressee::List emaillist;
2070 2073
2071 if (!name.isEmpty()) 2074 if (!name.isEmpty())
2072 namelist = mAddressBook->findByName( name ); 2075 namelist = mAddressBook->findByName( name );
2073 2076
2074 if (!email.isEmpty()) 2077 if (!email.isEmpty())
2075 emaillist = mAddressBook->findByEmail( email ); 2078 emaillist = mAddressBook->findByEmail( email );
2076 qDebug("count %d %d ", namelist.count(),emaillist.count() ); 2079 qDebug("count %d %d ", namelist.count(),emaillist.count() );
2077 //check if we have a match in Namelist and Emaillist 2080 //check if we have a match in Namelist and Emaillist
2078 if ((namelist.count() == 0) && (emaillist.count() > 0)) { 2081 if ((namelist.count() == 0) && (emaillist.count() > 0)) {
2079 foundUid = emaillist[0].uid(); 2082 foundUid = emaillist[0].uid();
2080 } 2083 }
2081 else if ((namelist.count() > 0) && (emaillist.count() == 0)) 2084 else if ((namelist.count() > 0) && (emaillist.count() == 0))
2082 foundUid = namelist[0].uid(); 2085 foundUid = namelist[0].uid();
2083 else 2086 else
2084 { 2087 {
2085 for (int i = 0; i < namelist.count(); i++) 2088 for (int i = 0; i < namelist.count(); i++)
2086 { 2089 {
2087 for (int j = 0; j < emaillist.count(); j++) 2090 for (int j = 0; j < emaillist.count(); j++)
2088 { 2091 {
2089 if (namelist[i] == emaillist[j]) 2092 if (namelist[i] == emaillist[j])
2090 { 2093 {
2091 foundUid = namelist[i].uid(); 2094 foundUid = namelist[i].uid();
2092 } 2095 }
2093 } 2096 }
2094 } 2097 }
2095 } 2098 }
2096 } 2099 }
2097 else 2100 else
2098 { 2101 {
2099 foundUid = uid; 2102 foundUid = uid;
2100 } 2103 }
2101 2104
2102 if (!foundUid.isEmpty()) 2105 if (!foundUid.isEmpty())
2103 { 2106 {
2104 2107
2105 // raise Ka/Pi if it is in the background 2108 // raise Ka/Pi if it is in the background
2106#ifndef DESKTOP_VERSION 2109#ifndef DESKTOP_VERSION
2107#ifndef KORG_NODCOP 2110#ifndef KORG_NODCOP
2108 //QCopEnvelope e("QPE/Application/kapi", "raise()"); 2111 //QCopEnvelope e("QPE/Application/kapi", "raise()");
2109#endif 2112#endif
2110#endif 2113#endif
2111 2114
2112 mMainWindow->showMaximized(); 2115 mMainWindow->showMaximized();
2113 mMainWindow-> raise(); 2116 mMainWindow-> raise();
2114 2117
2115 mViewManager->setSelected( "", false); 2118 mViewManager->setSelected( "", false);
2116 mViewManager->refreshView( "" ); 2119 mViewManager->refreshView( "" );
2117 mViewManager->setSelected( foundUid, true ); 2120 mViewManager->setSelected( foundUid, true );
2118 mViewManager->refreshView( foundUid ); 2121 mViewManager->refreshView( foundUid );
2119 2122
2120 if ( !mMultipleViewsAtOnce ) 2123 if ( !mMultipleViewsAtOnce )
2121 { 2124 {
2122 setDetailsVisible( true ); 2125 setDetailsVisible( true );
2123 mActionDetails->setChecked(true); 2126 mActionDetails->setChecked(true);
2124 } 2127 }
2125 } 2128 }
2126} 2129}
2127 2130
2128 2131
2129void KABCore::faq() 2132void KABCore::faq()
2130{ 2133{
2131 KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); 2134 KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" );
2132} 2135}
2133 2136
2134 2137
2135 2138
2136 2139
2137#ifndef KAB_EMBEDDED 2140#ifndef KAB_EMBEDDED
2138#include "kabcore.moc" 2141#include "kabcore.moc"
2139#endif //KAB_EMBEDDED 2142#endif //KAB_EMBEDDED
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index 5f446fa..f7604ad 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -1,181 +1,187 @@
1// CHANGED 2004-08-06 Lutz Rogowski 1// CHANGED 2004-08-06 Lutz Rogowski
2 2
3#include "composemail.h" 3#include "composemail.h"
4 4
5#include <libmailwrapper/smtpwrapper.h> 5#include <libmailwrapper/smtpwrapper.h>
6#include <libmailwrapper/storemail.h> 6#include <libmailwrapper/storemail.h>
7#include <libmailwrapper/abstractmail.h> 7#include <libmailwrapper/abstractmail.h>
8#include <libmailwrapper/mailtypes.h> 8#include <libmailwrapper/mailtypes.h>
9 9
10/* OPIE */ 10/* OPIE */
11//#include <opie2/ofiledialog.h> 11//#include <opie2/ofiledialog.h>
12//#include <opie2/odebug.h> 12//#include <opie2/odebug.h>
13#include <kfiledialog.h> 13#include <kfiledialog.h>
14//#include <qpe/resource.h> 14//#include <qpe/resource.h>
15#include <qpe/config.h> 15#include <qpe/config.h>
16#include <qpe/global.h> 16#include <qpe/global.h>
17//#include <qpe/contact.h> 17//#include <qpe/contact.h>
18 18
19 19
20#include <qcombobox.h> 20#include <qcombobox.h>
21#include <qcheckbox.h> 21#include <qcheckbox.h>
22#include <qtimer.h> 22#include <qtimer.h>
23#include <qmessagebox.h> 23#include <qmessagebox.h>
24#include <qpushbutton.h> 24#include <qpushbutton.h>
25#include <qmultilineedit.h> 25#include <qmultilineedit.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qtabwidget.h> 27#include <qtabwidget.h>
28#include <qlistview.h> 28#include <qlistview.h>
29#include <kabc/addresseedialog.h> 29#include <kabc/addresseedialog.h>
30#include <kabc/stdaddressbook.h> 30#include <kabc/stdaddressbook.h>
31#include <kabc/addressee.h> 31#include <kabc/addressee.h>
32#ifdef DESKTOP_VERSION 32#ifdef DESKTOP_VERSION
33#include <kabc/addresseedialog.h> 33#include <kabc/addresseedialog.h>
34#else //DESKTOP_VERSION 34#else //DESKTOP_VERSION
35#include <libkdepim/externalapphandler.h> 35#include <libkdepim/externalapphandler.h>
36#endif //DESKTOP_VERSION 36#endif //DESKTOP_VERSION
37 37
38 38
39//using namespace Opie::Core; 39//using namespace Opie::Core;
40//using namespace Opie::Ui; 40//using namespace Opie::Ui;
41ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 41ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
42 : ComposeMailUI( parent, name, modal, flags ) 42 : ComposeMailUI( parent, name, modal, flags )
43{ 43{
44 44
45 mPickLineEdit = 0; 45 mPickLineEdit = 0;
46 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), 46 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
47 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); 47 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
48 settings = s; 48 settings = s;
49 m_replyid = ""; 49 m_replyid = "";
50 KConfig config( locateLocal("config", "kabcrc") ); 50 KConfig config( locateLocal("config", "kabcrc") );
51 config.setGroup( "General" ); 51 config.setGroup( "General" );
52 QString whoami_uid = config.readEntry( "WhoAmI" ); 52 QString whoami_uid = config.readEntry( "WhoAmI" );
53 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); 53 if ( whoami_uid.isEmpty() ) {
54 QMessageBox::information( 0, tr( "Hint" ),
55 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
56 tr( "Ok" ) );
57
58 } else
59 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid);
54#ifdef DESKTOP_VERSION 60#ifdef DESKTOP_VERSION
55 KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); 61 KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( );
56 QStringList mails = con.emails(); 62 QStringList mails = con.emails();
57 QString defmail = con.preferredEmail(); 63 QString defmail = con.preferredEmail();
58 if ( mails.count() == 0) 64 if ( mails.count() == 0)
59 QMessageBox::information( 0, tr( "Hint" ), 65 QMessageBox::information( 0, tr( "Hint" ),
60 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), 66 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
61 tr( "Ok" ) ); 67 tr( "Ok" ) );
62 if (defmail.length()!=0) { 68 if (defmail.length()!=0) {
63 fromBox->insertItem(defmail); 69 fromBox->insertItem(defmail);
64 } 70 }
65 QStringList::ConstIterator sit = mails.begin(); 71 QStringList::ConstIterator sit = mails.begin();
66 for (;sit!=mails.end();++sit) { 72 for (;sit!=mails.end();++sit) {
67 if ( (*sit)==defmail) 73 if ( (*sit)==defmail)
68 continue; 74 continue;
69 fromBox->insertItem((*sit)); 75 fromBox->insertItem((*sit));
70 } 76 }
71 senderNameEdit->setText(con.formattedName()); 77 senderNameEdit->setText(con.formattedName());
72#endif 78#endif
73 Config cfg( "mail" ); 79 Config cfg( "mail" );
74 cfg.setGroup( "Compose" ); 80 cfg.setGroup( "Compose" );
75 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); 81 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) );
76 82
77 attList->addColumn( tr( "Name" ) ); 83 attList->addColumn( tr( "Name" ) );
78 attList->addColumn( tr( "Size" ) ); 84 attList->addColumn( tr( "Size" ) );
79 85
80 QList<Account> accounts = settings->getAccounts(); 86 QList<Account> accounts = settings->getAccounts();
81 87
82 Account *it; 88 Account *it;
83 for ( it = accounts.first(); it; it = accounts.next() ) { 89 for ( it = accounts.first(); it; it = accounts.next() ) {
84 if ( it->getType()==MAILLIB::A_SMTP ) { 90 if ( it->getType()==MAILLIB::A_SMTP ) {
85 SMTPaccount *smtp = static_cast<SMTPaccount *>(it); 91 SMTPaccount *smtp = static_cast<SMTPaccount *>(it);
86 smtpAccountBox->insertItem( smtp->getAccountName() ); 92 smtpAccountBox->insertItem( smtp->getAccountName() );
87 smtpAccounts.append( smtp ); 93 smtpAccounts.append( smtp );
88 } 94 }
89 } 95 }
90 if ( smtpAccounts.count() > 0 ) { 96 if ( smtpAccounts.count() > 0 ) {
91 fillValues( smtpAccountBox->currentItem() ); 97 fillValues( smtpAccountBox->currentItem() );
92 } else { 98 } else {
93 QMessageBox::information( 0, tr( "Problem" ), 99 QMessageBox::information( 0, tr( "Problem" ),
94 tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ), 100 tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ),
95 tr( "Ok" ) ); 101 tr( "Ok" ) );
96 return; 102 return;
97 } 103 }
98 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); 104 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) );
99 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); 105 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) );
100 connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); 106 connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) );
101 connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); 107 connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) );
102 connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); 108 connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) );
103 connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); 109 connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) );
104 connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); 110 connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) );
105 connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); 111 connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) );
106 mMail = 0; 112 mMail = 0;
107 warnAttach = true; 113 warnAttach = true;
108 114
109} 115}
110 116
111 117
112 118
113void ComposeMail::saveAsDraft() 119void ComposeMail::saveAsDraft()
114{ 120{
115 121
116 Opie::Core::OSmartPointer<Mail> mail= new Mail(); 122 Opie::Core::OSmartPointer<Mail> mail= new Mail();
117 mail->setMail(fromBox->currentText()); 123 mail->setMail(fromBox->currentText());
118 mail->setTo( toLine->text() ); 124 mail->setTo( toLine->text() );
119 mail->setName(senderNameEdit->text()); 125 mail->setName(senderNameEdit->text());
120 mail->setCC( ccLine->text() ); 126 mail->setCC( ccLine->text() );
121 mail->setBCC( bccLine->text() ); 127 mail->setBCC( bccLine->text() );
122 mail->setReply( replyLine->text() ); 128 mail->setReply( replyLine->text() );
123 mail->setSubject( subjectLine->text() ); 129 mail->setSubject( subjectLine->text() );
124 if (!m_replyid.isEmpty()) { 130 if (!m_replyid.isEmpty()) {
125 QStringList ids; 131 QStringList ids;
126 ids.append(m_replyid); 132 ids.append(m_replyid);
127 mail->setInreply(ids); 133 mail->setInreply(ids);
128 } 134 }
129 QString txt = message->text(); 135 QString txt = message->text();
130 if ( !sigMultiLine->text().isEmpty() ) { 136 if ( !sigMultiLine->text().isEmpty() ) {
131 txt.append( "\n--\n" ); 137 txt.append( "\n--\n" );
132 txt.append( sigMultiLine->text() ); 138 txt.append( sigMultiLine->text() );
133 } 139 }
134 mail->setMessage( txt ); 140 mail->setMessage( txt );
135 141
136 /* only use the default drafts folder name! */ 142 /* only use the default drafts folder name! */
137 Storemail wrapper(AbstractMail::draftFolder()); 143 Storemail wrapper(AbstractMail::draftFolder());
138 wrapper.storeMail(mail); 144 wrapper.storeMail(mail);
139 145
140 AttachViewItem *it = (AttachViewItem *) attList->firstChild(); 146 AttachViewItem *it = (AttachViewItem *) attList->firstChild();
141 /* attachments we will ignore! */ 147 /* attachments we will ignore! */
142 if ( it != 0 ) { 148 if ( it != 0 ) {
143 if ( warnAttach ) 149 if ( warnAttach )
144 QMessageBox::warning(0,tr("Store message"), 150 QMessageBox::warning(0,tr("Store message"),
145 tr("<center>Attachments will not be stored in \"Draft\" folder</center>")); 151 tr("<center>Attachments will not be stored in \"Draft\" folder</center>"));
146 warnAttach = false; 152 warnAttach = false;
147 } 153 }
148 setStatus( tr("Mail saved as draft!") ); 154 setStatus( tr("Mail saved as draft!") );
149} 155}
150void ComposeMail::clearStatus() 156void ComposeMail::clearStatus()
151{ 157{
152 topLevelWidget()->setCaption( tr("Compose mail") ); 158 topLevelWidget()->setCaption( tr("Compose mail") );
153} 159}
154void ComposeMail::setStatus( QString status ) 160void ComposeMail::setStatus( QString status )
155{ 161{
156 topLevelWidget()->setCaption( status ); 162 topLevelWidget()->setCaption( status );
157 QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ; 163 QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ;
158} 164}
159void ComposeMail::pickAddress( ) 165void ComposeMail::pickAddress( )
160{ 166{
161 167
162 QLineEdit *line = mPickLineEdit; 168 QLineEdit *line = mPickLineEdit;
163 if ( line == 0 ) 169 if ( line == 0 )
164 return; 170 return;
165#ifdef DESKTOP_VERSION 171#ifdef DESKTOP_VERSION
166 //qDebug(" ComposeMail::pickAddress "); 172 //qDebug(" ComposeMail::pickAddress ");
167 QString names ;//= AddressPicker::getNames(); 173 QString names ;//= AddressPicker::getNames();
168 174
169 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 175 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
170 uint i=0; 176 uint i=0;
171 for (i=0; i < list.count(); i++) { 177 for (i=0; i < list.count(); i++) {
172 if ( !list[i].preferredEmail().isEmpty()) { 178 if ( !list[i].preferredEmail().isEmpty()) {
173 if ( ! names.isEmpty() ) 179 if ( ! names.isEmpty() )
174 names+= ","; 180 names+= ",";
175 names+= "\""+list[i].realName() +"\"<" +list[i].preferredEmail() +">"; 181 names+= "\""+list[i].realName() +"\"<" +list[i].preferredEmail() +">";
176 182
177 } 183 }
178 } 184 }
179 185
180 186
181 if ( line->text().isEmpty() ) { 187 if ( line->text().isEmpty() ) {
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index 6100097..5ba32b6 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -225,327 +225,326 @@ bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& da
225 if (res == false) 225 if (res == false)
226 { 226 {
227 QDataStream stream( data, IO_ReadOnly ); 227 QDataStream stream( data, IO_ReadOnly );
228 228
229// qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() ); 229// qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() );
230 230
231 //we are in the source and get an answer from the target 231 //we are in the source and get an answer from the target
232 if ((_targetMessage + _targetMessageParameters) == cmsg.data()) 232 if ((_targetMessage + _targetMessageParameters) == cmsg.data())
233 { 233 {
234 QMap<QString,QString> adrMap; 234 QMap<QString,QString> adrMap;
235 QString uid; 235 QString uid;
236 236
237 stream >> uid >> adrMap; 237 stream >> uid >> adrMap;
238 238
239 emit receivedMessageFromTarget(uid, adrMap); 239 emit receivedMessageFromTarget(uid, adrMap);
240 240
241 241
242 return true; 242 return true;
243 } 243 }
244 } 244 }
245 245
246 return false; 246 return false;
247} 247}
248 248
249 249
250/********************************************************************************* 250/*********************************************************************************
251 * 251 *
252 ********************************************************************************/ 252 ********************************************************************************/
253 253
254 254
255QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) 255QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
256 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage) 256 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage)
257{ 257{
258 //targetMessage returns later two parameters: uid, and three lists 258 //targetMessage returns later two parameters: uid, and three lists
259 _targetMessageParameters = "(QString,QStringList,QStringList,QStringList)"; 259 _targetMessageParameters = "(QString,QStringList,QStringList,QStringList)";
260} 260}
261 261
262/*********************************************************************************/ 262/*********************************************************************************/
263bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3) 263bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
264{ 264{
265#ifndef DESKTOP_VERSION 265#ifndef DESKTOP_VERSION
266 //targetMessage passes two parameters: uid, map 266 //targetMessage passes two parameters: uid, map
267 QString targetMessage = _targetMessage + _targetMessageParameters; 267 QString targetMessage = _targetMessage + _targetMessageParameters;
268 268
269 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1()); 269 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1());
270 qDebug("passing uid(%s) and list1, list2, list3 as parameter to QCopEnvelope", uid.latin1()); 270 qDebug("passing uid(%s) and list1, list2, list3 as parameter to QCopEnvelope", uid.latin1());
271 271
272 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); 272 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1());
273 //US we need no names in the To field. The emailadresses are enough 273 //US we need no names in the To field. The emailadresses are enough
274 274
275 e << uid << list1 << list2 << list3; 275 e << uid << list1 << list2 << list3;
276 276
277 qApp->processEvents(); 277 qApp->processEvents();
278 278
279 return true; 279 return true;
280 280
281#else 281#else
282 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 282 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
283 return false; 283 return false;
284#endif 284#endif
285 285
286} 286}
287 287
288 288
289/*********************************************************************************/ 289/*********************************************************************************/
290bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 290bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
291{ 291{
292 bool res = QCopTransferItem::appMessage( cmsg, data ); 292 bool res = QCopTransferItem::appMessage( cmsg, data );
293 293
294 if (res == false) 294 if (res == false)
295 { 295 {
296 QDataStream stream( data, IO_ReadOnly ); 296 QDataStream stream( data, IO_ReadOnly );
297 297
298// qDebug("QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 298// qDebug("QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
299 299
300 //we are in the source and get an answer from the target 300 //we are in the source and get an answer from the target
301 if ((_targetMessage + _targetMessageParameters) == cmsg.data()) 301 if ((_targetMessage + _targetMessageParameters) == cmsg.data())
302 { 302 {
303 QStringList list1; 303 QStringList list1;
304 QStringList list2; 304 QStringList list2;
305 QStringList list3; 305 QStringList list3;
306 QString uid; 306 QString uid;
307 307
308 stream >> uid >> list1 >> list2 >> list3; 308 stream >> uid >> list1 >> list2 >> list3;
309 emit receivedMessageFromTarget(uid, list1, list2, list3); 309 emit receivedMessageFromTarget(uid, list1, list2, list3);
310 310
311 311
312 return true; 312 return true;
313 } 313 }
314 } 314 }
315 315
316 return false; 316 return false;
317} 317}
318 318
319 319
320 320
321/********************************************************************************* 321/*********************************************************************************
322 * 322 *
323 ********************************************************************************/ 323 ********************************************************************************/
324 324
325 325
326ExternalAppHandler *ExternalAppHandler::sInstance = 0; 326ExternalAppHandler *ExternalAppHandler::sInstance = 0;
327static KStaticDeleter<ExternalAppHandler> staticDeleter; 327static KStaticDeleter<ExternalAppHandler> staticDeleter;
328 328
329ExternalAppHandler::ExternalAppHandler() 329ExternalAppHandler::ExternalAppHandler()
330{ 330{
331 mDefaultItems.setAutoDelete(true); 331 mDefaultItems.setAutoDelete(true);
332 332
333 mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList"); 333 mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList");
334 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&))); 334 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&)));
335 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); 335 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)));
336 336
337//US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList"); 337//US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList");
338//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&))); 338//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&)));
339//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); 339//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)));
340 340
341 mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", ""); 341 mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", "");
342 connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); 342 connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)));
343} 343}
344 344
345ExternalAppHandler::~ExternalAppHandler() 345ExternalAppHandler::~ExternalAppHandler()
346{ 346{
347} 347}
348 348
349void ExternalAppHandler::loadConfig() 349void ExternalAppHandler::loadConfig()
350{ 350{
351 351
352 mDefaultItems.clear(); 352 mDefaultItems.clear();
353
354 mEmailAppAvailable = UNDEFINED; 353 mEmailAppAvailable = UNDEFINED;
355 mPhoneAppAvailable = UNDEFINED; 354 mPhoneAppAvailable = UNDEFINED;
356 mFaxAppAvailable = UNDEFINED; 355 mFaxAppAvailable = UNDEFINED;
357 mSMSAppAvailable = UNDEFINED; 356 mSMSAppAvailable = UNDEFINED;
358 mPagerAppAvailable = UNDEFINED; 357 mPagerAppAvailable = UNDEFINED;
359 358
360 359
361 QString opiepath = QString::fromLatin1( getenv("OPIEDIR") ); 360 QString opiepath = QString::fromLatin1( getenv("OPIEDIR") );
362 QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") ); 361 QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") );
363 362
364 if (opiepath.isEmpty()) 363 if (opiepath.isEmpty())
365 opiepath = qtopiapath; 364 opiepath = qtopiapath;
366 365
367 //mailclients 366 //mailclients
368 QString mailmsg1 = "writeMail(QString,QString)"; 367 QString mailmsg1 = "writeMail(QString,QString)";
369 QString mailmsg2 = "writeMail(QMap(QString,QString))"; 368 QString mailmsg2 = "writeMail(QMap(QString,QString))";
370 369
371 QString undefined = ""; 370 QString undefined = "";
372 371
373 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC, "No email client installed", undefined, undefined, undefined, undefined, undefined); 372 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC, "No email client installed", undefined, undefined, undefined, undefined, undefined);
374 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OTHER_EMC, "Userdefined email client", undefined, undefined, undefined, undefined, undefined); 373 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OTHER_EMC, "Userdefined email client", undefined, undefined, undefined, undefined, undefined);
375 374
376 if (( QFile::exists( qtopiapath + "/bin/ompi" )) || 375 if (( QFile::exists( qtopiapath + "/bin/ompi" )) ||
377 ( QFile::exists( opiepath + "/bin/ompi" ))) 376 ( QFile::exists( opiepath + "/bin/ompi" )))
378 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OMPI_EMC, "OM/Pi email client", "QPE/Application/ompi", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 377 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OMPI_EMC, "OM/Pi email client", "QPE/Application/ompi", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
379 378
380 if ( QFile::exists( qtopiapath + "/bin/qtmail" )) 379 if ( QFile::exists( qtopiapath + "/bin/qtmail" ))
381 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::QTOPIA_EMC, "Qtopia email client", "QPE/Application/qtmail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 380 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::QTOPIA_EMC, "Qtopia email client", "QPE/Application/qtmail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
382 381
383 if ( QFile::exists( opiepath + "/bin/opiemail" )) 382 if ( QFile::exists( opiepath + "/bin/opiemail" ))
384 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_EMC, "Opie email client", "QPE/Application/opiemail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 383 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_EMC, "Opie email client", "QPE/Application/opiemail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
385 384
386 385
387 386
388 //phoneclients 387 //phoneclients
389 388
390 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC, "No phone client installed", undefined, undefined, undefined, undefined, undefined); 389 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC, "No phone client installed", undefined, undefined, undefined, undefined, undefined);
391 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::OTHER_PHC, "Other phone client", undefined, undefined, undefined, undefined, undefined); 390 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::OTHER_PHC, "Other phone client", undefined, undefined, undefined, undefined, undefined);
392 if (( QFile::exists( qtopiapath + "/bin/kppi" )) || 391 if (( QFile::exists( qtopiapath + "/bin/kppi" )) ||
393 ( QFile::exists( opiepath + "/bin/kppi" ))) 392 ( QFile::exists( opiepath + "/bin/kppi" )))
394 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::KPPI_PHC, "KP/Pi phone client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined); 393 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::KPPI_PHC, "KP/Pi phone client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined);
395 394
396 //faxclients 395 //faxclients
397 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC, "No fax client installed", undefined, undefined, undefined, undefined, undefined); 396 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC, "No fax client installed", undefined, undefined, undefined, undefined, undefined);
398 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::OTHER_FAC, "Other fax client", undefined, undefined, undefined, undefined, undefined); 397 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::OTHER_FAC, "Other fax client", undefined, undefined, undefined, undefined, undefined);
399 398
400 //smsclients 399 //smsclients
401 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC, "No sms client installed", undefined, undefined, undefined, undefined, undefined); 400 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC, "No sms client installed", undefined, undefined, undefined, undefined, undefined);
402 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::OTHER_SMC, "Other sms client", undefined, undefined, undefined, undefined, undefined); 401 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::OTHER_SMC, "Other sms client", undefined, undefined, undefined, undefined, undefined);
403 402
404 //pagerclients 403 //pagerclients
405 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC, "No pager client installed", undefined, undefined, undefined, undefined, undefined); 404 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC, "No pager client installed", undefined, undefined, undefined, undefined, undefined);
406 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::OTHER_PAC, "Other pager client", undefined, undefined, undefined, undefined, undefined); 405 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::OTHER_PAC, "Other pager client", undefined, undefined, undefined, undefined, undefined);
407 406
408} 407}
409 408
410ExternalAppHandler *ExternalAppHandler::instance() 409ExternalAppHandler *ExternalAppHandler::instance()
411{ 410{
412 if ( !sInstance ) { 411 if ( !sInstance ) {
413 sInstance = staticDeleter.setObject( new ExternalAppHandler() ); 412 sInstance = staticDeleter.setObject( new ExternalAppHandler() );
414 sInstance->loadConfig(); 413 sInstance->loadConfig();
415 } 414 }
416 415
417 return sInstance; 416 return sInstance;
418} 417}
419 418
420void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameter, const QString& message2, const QString& parameter2) 419void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameter, const QString& message2, const QString& parameter2)
421{ 420{
422 DefaultAppItem* dai = new DefaultAppItem(type, id, label, channel, message, parameter, message2, parameter2); 421 DefaultAppItem* dai = new DefaultAppItem(type, id, label, channel, message, parameter, message2, parameter2);
423 422 // qDebug("%d %d %s %s ", type, id, label.latin1(), channel.latin1() );
424 mDefaultItems.append(dai); 423 mDefaultItems.append(dai);
425} 424}
426 425
427 426
428QList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) 427QList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type)
429{ 428{
430 QList<DefaultAppItem> list; 429 QList<DefaultAppItem> list;
431 430
432 DefaultAppItem* dai; 431 DefaultAppItem* dai;
433 432
434 for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) 433 for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() )
435 { 434 {
436 if (dai->_type == type) 435 if (dai->_type == type)
437 list.append(dai); 436 list.append(dai);
438 } 437 }
439 438
440 return list; 439 return list;
441} 440}
442 441
443DefaultAppItem* ExternalAppHandler::getDefaultItem(Types type, int clientid) 442DefaultAppItem* ExternalAppHandler::getDefaultItem(Types type, int clientid)
444{ 443{
445 DefaultAppItem* dai; 444 DefaultAppItem* dai;
446 445
447 for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) 446 for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() )
448 { 447 {
449 if (dai->_type == type && dai->_id == clientid) 448 if (dai->_type == type && dai->_id == clientid)
450 return dai; 449 return dai;
451 } 450 }
452 451
453 return 0; 452 return 0;
454} 453}
455 454
456bool ExternalAppHandler::isEmailAppAvailable() 455bool ExternalAppHandler::isEmailAppAvailable()
457{ 456{
458#ifndef DESKTOP_VERSION 457#ifndef DESKTOP_VERSION
459 if (mEmailAppAvailable == UNDEFINED) 458 if (mEmailAppAvailable == UNDEFINED)
460 { 459 {
461 int client = KPimGlobalPrefs::instance()->mEmailClient; 460 int client = KPimGlobalPrefs::instance()->mEmailClient;
462 if (client == KPimGlobalPrefs::NONE_EMC) 461 if (client == KPimGlobalPrefs::NONE_EMC)
463 mEmailAppAvailable = UNAVAILABLE; 462 mEmailAppAvailable = UNAVAILABLE;
464 else 463 else
465 mEmailAppAvailable = AVAILABLE; 464 mEmailAppAvailable = AVAILABLE;
466 } 465 }
467 return (mEmailAppAvailable == AVAILABLE); 466 return (mEmailAppAvailable == AVAILABLE);
468 467
469#else //DESKTOP_VERSION 468#else //DESKTOP_VERSION
470 return false; 469 return false;
471#endif //DESKTOP_VERSION 470#endif //DESKTOP_VERSION
472} 471}
473 472
474bool ExternalAppHandler::isSMSAppAvailable() 473bool ExternalAppHandler::isSMSAppAvailable()
475{ 474{
476#ifndef DESKTOP_VERSION 475#ifndef DESKTOP_VERSION
477 if (mSMSAppAvailable == UNDEFINED) 476 if (mSMSAppAvailable == UNDEFINED)
478 { 477 {
479 int client = KPimGlobalPrefs::instance()->mSMSClient; 478 int client = KPimGlobalPrefs::instance()->mSMSClient;
480 if (client == KPimGlobalPrefs::NONE_SMC) 479 if (client == KPimGlobalPrefs::NONE_SMC)
481 mSMSAppAvailable = UNAVAILABLE; 480 mSMSAppAvailable = UNAVAILABLE;
482 else 481 else
483 mSMSAppAvailable = AVAILABLE; 482 mSMSAppAvailable = AVAILABLE;
484 } 483 }
485 484
486 return (mSMSAppAvailable == AVAILABLE); 485 return (mSMSAppAvailable == AVAILABLE);
487#else //DESKTOP_VERSION 486#else //DESKTOP_VERSION
488 return false; 487 return false;
489#endif //DESKTOP_VERSION 488#endif //DESKTOP_VERSION
490} 489}
491 490
492bool ExternalAppHandler::isPhoneAppAvailable() 491bool ExternalAppHandler::isPhoneAppAvailable()
493{ 492{
494#ifndef DESKTOP_VERSION 493#ifndef DESKTOP_VERSION
495 if (mPhoneAppAvailable == UNDEFINED) 494 if (mPhoneAppAvailable == UNDEFINED)
496 { 495 {
497 int client = KPimGlobalPrefs::instance()->mPhoneClient; 496 int client = KPimGlobalPrefs::instance()->mPhoneClient;
498 if (client == KPimGlobalPrefs::NONE_PHC) 497 if (client == KPimGlobalPrefs::NONE_PHC)
499 mPhoneAppAvailable = UNAVAILABLE; 498 mPhoneAppAvailable = UNAVAILABLE;
500 else 499 else
501 mPhoneAppAvailable = AVAILABLE; 500 mPhoneAppAvailable = AVAILABLE;
502 } 501 }
503 502
504 return (mPhoneAppAvailable == AVAILABLE); 503 return (mPhoneAppAvailable == AVAILABLE);
505#else //DESKTOP_VERSION 504#else //DESKTOP_VERSION
506 return false; 505 return false;
507#endif //DESKTOP_VERSION 506#endif //DESKTOP_VERSION
508} 507}
509 508
510bool ExternalAppHandler::isFaxAppAvailable() 509bool ExternalAppHandler::isFaxAppAvailable()
511{ 510{
512#ifndef DESKTOP_VERSION 511#ifndef DESKTOP_VERSION
513 if (mFaxAppAvailable == UNDEFINED) 512 if (mFaxAppAvailable == UNDEFINED)
514 { 513 {
515 int client = KPimGlobalPrefs::instance()->mFaxClient; 514 int client = KPimGlobalPrefs::instance()->mFaxClient;
516 if (client == KPimGlobalPrefs::NONE_FAC) 515 if (client == KPimGlobalPrefs::NONE_FAC)
517 mFaxAppAvailable = UNAVAILABLE; 516 mFaxAppAvailable = UNAVAILABLE;
518 else 517 else
519 mFaxAppAvailable = AVAILABLE; 518 mFaxAppAvailable = AVAILABLE;
520 } 519 }
521 520
522 return (mFaxAppAvailable == AVAILABLE); 521 return (mFaxAppAvailable == AVAILABLE);
523#else //DESKTOP_VERSION 522#else //DESKTOP_VERSION
524 return false; 523 return false;
525#endif //DESKTOP_VERSION 524#endif //DESKTOP_VERSION
526} 525}
527 526
528bool ExternalAppHandler::isPagerAppAvailable() 527bool ExternalAppHandler::isPagerAppAvailable()
529{ 528{
530#ifndef DESKTOP_VERSION 529#ifndef DESKTOP_VERSION
531 if (mPagerAppAvailable == UNDEFINED) 530 if (mPagerAppAvailable == UNDEFINED)
532 { 531 {
533 int client = KPimGlobalPrefs::instance()->mPagerClient; 532 int client = KPimGlobalPrefs::instance()->mPagerClient;
534 if (client == KPimGlobalPrefs::NONE_PAC) 533 if (client == KPimGlobalPrefs::NONE_PAC)
535 mPagerAppAvailable = UNAVAILABLE; 534 mPagerAppAvailable = UNAVAILABLE;
536 else 535 else
537 mPagerAppAvailable = AVAILABLE; 536 mPagerAppAvailable = AVAILABLE;
538 } 537 }
539 538
540 return (mPagerAppAvailable == AVAILABLE); 539 return (mPagerAppAvailable == AVAILABLE);
541#else //DESKTOP_VERSION 540#else //DESKTOP_VERSION
542 return false; 541 return false;
543#endif //DESKTOP_VERSION 542#endif //DESKTOP_VERSION
544} 543}
545 544
546/************************************************************************** 545/**************************************************************************
547 * 546 *
548 **************************************************************************/ 547 **************************************************************************/
549 548
550 549
551//calls the emailapplication with a number of attachments that need to be send (Seperated by Comma) 550//calls the emailapplication with a number of attachments that need to be send (Seperated by Comma)
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 4790980..7f683a8 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -1,89 +1,89 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <kglobal.h> 31#include <kglobal.h>
32#include <kconfig.h> 32#include <kconfig.h>
33#include <klocale.h> 33#include <klocale.h>
34#include <kdebug.h> 34#include <kdebug.h>
35#include <kstaticdeleter.h> 35#include <kstaticdeleter.h>
36 36
37#include "kpimglobalprefs.h" 37#include "kpimglobalprefs.h"
38 38
39KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; 39KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0;
40static KStaticDeleter<KPimGlobalPrefs> staticDeleter; 40static KStaticDeleter<KPimGlobalPrefs> staticDeleter;
41 41
42 42
43KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) 43KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
44 : KPrefs("kkdepimrc") 44 : KPrefs("kkdepimrc")
45{ 45{
46 KPrefs::setCurrentGroup( "ExternalApplications" ); 46 KPrefs::setCurrentGroup( "ExternalApplications" );
47 47
48 addItemInt( "EmailChannelType", &mEmailClient, NONE_EMC ); 48 addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC );
49 addItemString( "EmailChannel", &mEmailOtherChannel, "" ); 49 addItemString( "EmailChannel", &mEmailOtherChannel, "" );
50 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" ); 50 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" );
51 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" ); 51 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" );
52 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" ); 52 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" );
53 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" ); 53 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" );
54 54
55 addItemInt( "PhoneChannelType", &mPhoneClient, NONE_PHC ); 55 addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC );
56 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" ); 56 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" );
57 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" ); 57 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" );
58 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" ); 58 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" );
59 59
60 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC ); 60 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC );
61 addItemString( "FaxChannel", &mFaxOtherChannel, "" ); 61 addItemString( "FaxChannel", &mFaxOtherChannel, "" );
62 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" ); 62 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" );
63 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" ); 63 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" );
64 64
65 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC ); 65 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC );
66 addItemString( "SMSChannel", &mSMSOtherChannel, "" ); 66 addItemString( "SMSChannel", &mSMSOtherChannel, "" );
67 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" ); 67 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" );
68 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" ); 68 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" );
69 69
70 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC ); 70 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC );
71 addItemString( "PagerChannel", &mPagerOtherChannel, "" ); 71 addItemString( "PagerChannel", &mPagerOtherChannel, "" );
72 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); 72 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" );
73 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); 73 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" );
74 74
75} 75}
76 76
77KPimGlobalPrefs::~KPimGlobalPrefs() 77KPimGlobalPrefs::~KPimGlobalPrefs()
78{ 78{
79} 79}
80 80
81KPimGlobalPrefs *KPimGlobalPrefs::instance() 81KPimGlobalPrefs *KPimGlobalPrefs::instance()
82{ 82{
83 if ( !sInstance ) { 83 if ( !sInstance ) {
84 sInstance = staticDeleter.setObject( new KPimGlobalPrefs() ); 84 sInstance = staticDeleter.setObject( new KPimGlobalPrefs() );
85 sInstance->readConfig(); 85 sInstance->readConfig();
86 } 86 }
87 87
88 return sInstance; 88 return sInstance;
89} 89}