summaryrefslogtreecommitdiffabout
path: root/libkdepim
Unidiff
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/externalapphandler.h18
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp15
2 files changed, 21 insertions, 12 deletions
diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h
index efcdd89..3cf9e06 100644
--- a/libkdepim/externalapphandler.h
+++ b/libkdepim/externalapphandler.h
@@ -1,139 +1,145 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
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#ifndef EXTERNALAPPHANDLER_H 31#ifndef EXTERNALAPPHANDLER_H
32#define EXTERNALAPPHANDLER_H 32#define EXTERNALAPPHANDLER_H
33 33
34#include <qlist.h> 34#include <qlist.h>
35 35
36class QCopEnvelope; 36class QCopEnvelope;
37 37
38 38
39class ExternalAppHandler; 39class ExternalAppHandler;
40 40
41class DefaultAppItem 41class DefaultAppItem
42{ 42{
43 public: 43 public:
44 DefaultAppItem(int type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2) 44 DefaultAppItem(int type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2)
45 : _type(type), _id(id), _label(label), _channel(channel), _message(message), _parameters(parameters), _message2(message2), _parameters2(parameters2) 45 : _type(type), _id(id), _label(label), _channel(channel), _message(message), _parameters(parameters), _message2(message2), _parameters2(parameters2)
46 {} 46 {}
47 47
48 DefaultAppItem() 48 DefaultAppItem()
49 { } 49 { }
50 50
51 public: 51 public:
52 int _type; 52 int _type;
53 int _id; 53 int _id;
54 QString _label; 54 QString _label;
55 QString _channel; 55 QString _channel;
56 QString _message; 56 QString _message;
57 QString _parameters;// a list of parameters in stringrepresentation. Delimiter is ; 57 QString _parameters;// a list of parameters in stringrepresentation. Delimiter is ;
58 QString _message2; 58 QString _message2;
59 QString _parameters2; // a list of parameters in stringrepresentation. Delimiter is ; 59 QString _parameters2; // a list of parameters in stringrepresentation. Delimiter is ;
60 60
61}; 61};
62 62
63class ExternalAppHandler 63class ExternalAppHandler
64{ 64{
65 public: 65 public:
66 virtual ~ExternalAppHandler(); 66 virtual ~ExternalAppHandler();
67 67
68 static ExternalAppHandler *instance(); 68 static ExternalAppHandler *instance();
69 69
70 enum Types { 70 enum Types {
71 EMAIL = 0, 71 EMAIL = 0,
72 PHONE = 1, 72 PHONE = 1,
73 SMS = 2, 73 SMS = 2,
74 FAX = 3, 74 FAX = 3,
75 PAGER = 4 75 PAGER = 4
76 }; 76 };
77 77
78 enum Availability { 78 enum Availability {
79 UNDEFINED = -1, 79 UNDEFINED = -1,
80 UNAVAILABLE = 0, 80 UNAVAILABLE = 0,
81 AVAILABLE = 1 81 AVAILABLE = 1
82 }; 82 };
83 83
84 //calls the emailapplication with a number of attachments that need to be send 84 //calls the emailapplication with a number of attachments that need to be send.
85 bool mailAttachments( const QString& urls ); 85 //either parameter can be left empty.
86 bool mailToMultipleContacts( const QString& recipients, const QString& attachmenturls );
86 87
87 //calls the emailapplication and creates a mail with parameter emails as recipients 88 //calls the emailapplication and creates a mail with parameter emailadress as recipients
88 bool mailToContacts( const QString& emails ); 89 bool mailToOneContact( const QString& name, const QString& emailadress );
90
91 //calls the emailapplication and creates a mail with parameter as recipients
92 // parameters format is
93 // NAME <EMAIL>:SUBJECT
94 bool mailToOneContact( const QString& adressline );
89 95
90 //calls the phoneapplication with the number 96 //calls the phoneapplication with the number
91 bool callByPhone( const QString& phonenumber ); 97 bool callByPhone( const QString& phonenumber );
92 98
93 //calls the smsapplication with the number 99 //calls the smsapplication with the number
94 bool callBySMS( const QString& phonenumber ); 100 bool callBySMS( const QString& phonenumber );
95 101
96 //calls the pagerapplication with the number 102 //calls the pagerapplication with the number
97 bool callByPager( const QString& pagernumber ); 103 bool callByPager( const QString& pagernumber );
98 104
99 //calls the faxapplication with the number 105 //calls the faxapplication with the number
100 bool callByFax( const QString& faxnumber ); 106 bool callByFax( const QString& faxnumber );
101 107
102 bool isEmailAppAvailable(); 108 bool isEmailAppAvailable();
103 bool isSMSAppAvailable(); 109 bool isSMSAppAvailable();
104 bool isPhoneAppAvailable(); 110 bool isPhoneAppAvailable();
105 bool isFaxAppAvailable(); 111 bool isFaxAppAvailable();
106 bool isPagerAppAvailable(); 112 bool isPagerAppAvailable();
107 113
108 114
109 115
110 //loadConfig clears the cache and checks again if the applications are available or not 116 //loadConfig clears the cache and checks again if the applications are available or not
111 void loadConfig(); 117 void loadConfig();
112 118
113 QList<DefaultAppItem> getAvailableDefaultItems(Types); 119 QList<DefaultAppItem> getAvailableDefaultItems(Types);
114 DefaultAppItem* getDefaultItem(Types, int); 120 DefaultAppItem* getDefaultItem(Types, int);
115 121
116 122
117 private: 123 private:
118 ExternalAppHandler(); 124 ExternalAppHandler();
119 QList<DefaultAppItem> mDefaultItems; 125 QList<DefaultAppItem> mDefaultItems;
120 126
121 Availability mEmailAppAvailable; 127 Availability mEmailAppAvailable;
122 Availability mPhoneAppAvailable; 128 Availability mPhoneAppAvailable;
123 Availability mFaxAppAvailable; 129 Availability mFaxAppAvailable;
124 Availability mSMSAppAvailable; 130 Availability mSMSAppAvailable;
125 Availability mPagerAppAvailable; 131 Availability mPagerAppAvailable;
126 132
127 133
128 void addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2); 134 void addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2);
129 135
130 QString& translateMessage(QString& message, const QString& emails) const; 136 QString& translateMessage(QString& message, const QString& param1, const QString& param2) const;
131 void passParameter(QCopEnvelope* e, const QString& parameters, const QString& param1) const; 137 void passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1, const QString& param2) const;
132 138
133 139
134 static ExternalAppHandler *sInstance; 140 static ExternalAppHandler *sInstance;
135 141
136 142
137}; 143};
138 144
139#endif 145#endif
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index c8b94db..4f4cc6a 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -1,561 +1,564 @@
1/* 1/*
2 This file is part of KdePim/Pi. 2 This file is part of KdePim/Pi.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
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 <qlayout.h> 31#include <qlayout.h>
32#include <qtabwidget.h> 32#include <qtabwidget.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qgroupbox.h> 34#include <qgroupbox.h>
35#include <qlabel.h> 35#include <qlabel.h>
36#include <qlineedit.h> 36#include <qlineedit.h>
37#include <qfile.h> 37#include <qfile.h>
38 38
39#include <kdialog.h> 39#include <kdialog.h>
40#include <klocale.h> 40#include <klocale.h>
41 41
42#include <stdlib.h> 42#include <stdlib.h>
43 43
44/*US 44/*US
45#include <qcheckbox.h> 45#include <qcheckbox.h>
46#include <qframe.h> 46#include <qframe.h>
47#include <qpushbutton.h> 47#include <qpushbutton.h>
48#include <qcombobox.h> 48#include <qcombobox.h>
49#include <qlineedit.h> 49#include <qlineedit.h>
50#include <qlabel.h> 50#include <qlabel.h>
51#include <qfile.h> 51#include <qfile.h>
52 52
53#include <kconfig.h> 53#include <kconfig.h>
54#include <kdebug.h> 54#include <kdebug.h>
55#include <kdialog.h> 55#include <kdialog.h>
56#include <klistview.h> 56#include <klistview.h>
57#include <klocale.h> 57#include <klocale.h>
58#include <kglobal.h> 58#include <kglobal.h>
59#include <kmessagebox.h> 59#include <kmessagebox.h>
60#include <kstandarddirs.h> 60#include <kstandarddirs.h>
61 61
62#ifndef KAB_EMBEDDED 62#ifndef KAB_EMBEDDED
63#include <ktrader.h> 63#include <ktrader.h>
64#else // KAB_EMBEDDED 64#else // KAB_EMBEDDED
65#include <mergewidget.h> 65#include <mergewidget.h>
66#include <distributionlistwidget.h> 66#include <distributionlistwidget.h>
67#endif // KAB_EMBEDDED 67#endif // KAB_EMBEDDED
68 68
69#include "addresseewidget.h" 69#include "addresseewidget.h"
70#include "extensionconfigdialog.h" 70#include "extensionconfigdialog.h"
71#include "extensionwidget.h" 71#include "extensionwidget.h"
72*/ 72*/
73 73
74#include "kpimglobalprefs.h" 74#include "kpimglobalprefs.h"
75 75
76#include "kdepimconfigwidget.h" 76#include "kdepimconfigwidget.h"
77 77
78 78
79KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name ) 79KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name )
80 : QWidget( parent, name ) 80 : QWidget( parent, name )
81{ 81{
82 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 82 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
83 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 83 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
84 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 84 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
85 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 85 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
86 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 86 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
87 87
88 88
89 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 89 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
90 KDialog::spacingHint() ); 90 KDialog::spacingHint() );
91 91
92 QTabWidget *tabWidget = new QTabWidget( this ); 92 QTabWidget *tabWidget = new QTabWidget( this );
93 topLayout->addWidget( tabWidget ); 93 topLayout->addWidget( tabWidget );
94 94
95 95
96 96
97 // mailclient page 97 // mailclient page
98 QWidget *externalAppsPage = new QWidget( this ); 98 QWidget *externalAppsPage = new QWidget( this );
99 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 99 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
100 KDialog::spacingHintSmall() ); 100 KDialog::spacingHintSmall() );
101 101
102 mExternalApps = new QComboBox( externalAppsPage ); 102 mExternalApps = new QComboBox( externalAppsPage );
103 103
104 QMap<ExternalAppHandler::Types, QString>::Iterator it; 104 QMap<ExternalAppHandler::Types, QString>::Iterator it;
105 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 105 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
106 mExternalApps->insertItem( it.data(), it.key() ); 106 mExternalApps->insertItem( it.data(), it.key() );
107 107
108 layout->addWidget( mExternalApps ); 108 layout->addWidget( mExternalApps );
109 109
110 connect( mExternalApps, SIGNAL( activated( int ) ), 110 connect( mExternalApps, SIGNAL( activated( int ) ),
111 this, SLOT (externalapp_changed( int ) ) ); 111 this, SLOT (externalapp_changed( int ) ) );
112 112
113 113
114 114
115 115
116 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 116 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
117 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 117 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
118 118
119 119
120 mClient = new QComboBox( mExternalAppGroupBox ); 120 mClient = new QComboBox( mExternalAppGroupBox );
121 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 121 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
122 122
123 connect( mClient, SIGNAL( activated( int ) ), 123 connect( mClient, SIGNAL( activated( int ) ),
124 this, SLOT (client_changed( int ) ) ); 124 this, SLOT (client_changed( int ) ) );
125 125
126 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 126 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
127 boxLayout->addWidget( lab, 1, 0 ); 127 boxLayout->addWidget( lab, 1, 0 );
128 mChannel = new QLineEdit(mExternalAppGroupBox); 128 mChannel = new QLineEdit(mExternalAppGroupBox);
129 mChannel->setReadOnly(true); 129 mChannel->setReadOnly(true);
130 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 130 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
131 131
132 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 132 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
133 boxLayout->addWidget( lab, 3, 0 ); 133 boxLayout->addWidget( lab, 3, 0 );
134 mMessage = new QLineEdit(mExternalAppGroupBox); 134 mMessage = new QLineEdit(mExternalAppGroupBox);
135 mMessage->setReadOnly(true); 135 mMessage->setReadOnly(true);
136 boxLayout->addWidget( mMessage , 4, 0); 136 boxLayout->addWidget( mMessage , 4, 0);
137 137
138 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 138 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
139 boxLayout->addWidget( lab, 3, 1 ); 139 boxLayout->addWidget( lab, 3, 1 );
140 mParameters = new QLineEdit(mExternalAppGroupBox); 140 mParameters = new QLineEdit(mExternalAppGroupBox);
141 mParameters->setReadOnly(true); 141 mParameters->setReadOnly(true);
142 boxLayout->addWidget( mParameters, 4, 1 ); 142 boxLayout->addWidget( mParameters, 4, 1 );
143 143
144 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox);
145 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 );
146
144 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); 147 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox);
145 boxLayout->addWidget( lab, 5, 0 ); 148 boxLayout->addWidget( lab, 6, 0 );
146 mMessage2 = new QLineEdit(mExternalAppGroupBox); 149 mMessage2 = new QLineEdit(mExternalAppGroupBox);
147 mMessage2->setReadOnly(true); 150 mMessage2->setReadOnly(true);
148 boxLayout->addWidget( mMessage2 , 6, 0); 151 boxLayout->addWidget( mMessage2 , 7, 0);
149 152
150 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); 153 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox);
151 boxLayout->addWidget( lab, 5, 1 ); 154 boxLayout->addWidget( lab, 6, 1 );
152 mParameters2 = new QLineEdit(mExternalAppGroupBox); 155 mParameters2 = new QLineEdit(mExternalAppGroupBox);
153 mParameters2->setReadOnly(true); 156 mParameters2->setReadOnly(true);
154 boxLayout->addWidget( mParameters2, 6, 1 ); 157 boxLayout->addWidget( mParameters2, 7, 1 );
155 158
156 lab = new QLabel( i18n("HINT: Delimiter=; Data=%1 "), mExternalAppGroupBox); 159 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox);
157 boxLayout->addMultiCellWidget( lab, 7, 7, 0, 1 ); 160 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 );
158 161
159 162
160 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 163 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
161 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 164 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
162 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 165 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
163 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 166 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
164 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 167 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
165 168
166 169
167 170
168 layout->addWidget( mExternalAppGroupBox ); 171 layout->addWidget( mExternalAppGroupBox );
169 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 172 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
170 173
171} 174}
172 175
173void KDEPIMConfigWidget::externalapp_changed( int newApp ) 176void KDEPIMConfigWidget::externalapp_changed( int newApp )
174{ 177{
175 // first store the current data 178 // first store the current data
176 saveEditFieldSettings(); 179 saveEditFieldSettings();
177 180
178 // set mCurrentApp 181 // set mCurrentApp
179 mCurrentApp = (ExternalAppHandler::Types)newApp; 182 mCurrentApp = (ExternalAppHandler::Types)newApp;
180 183
181 // set mCurrentClient 184 // set mCurrentClient
182 switch(mCurrentApp) 185 switch(mCurrentApp)
183 { 186 {
184 case(ExternalAppHandler::EMAIL): 187 case(ExternalAppHandler::EMAIL):
185 mCurrentClient = mEmailClient; 188 mCurrentClient = mEmailClient;
186 break; 189 break;
187 case(ExternalAppHandler::PHONE): 190 case(ExternalAppHandler::PHONE):
188 mCurrentClient = mPhoneClient; 191 mCurrentClient = mPhoneClient;
189 break; 192 break;
190 case(ExternalAppHandler::SMS): 193 case(ExternalAppHandler::SMS):
191 mCurrentClient = mSMSClient; 194 mCurrentClient = mSMSClient;
192 break; 195 break;
193 case(ExternalAppHandler::FAX): 196 case(ExternalAppHandler::FAX):
194 mCurrentClient = mFaxClient; 197 mCurrentClient = mFaxClient;
195 break; 198 break;
196 case(ExternalAppHandler::PAGER): 199 case(ExternalAppHandler::PAGER):
197 mCurrentClient = mPagerClient; 200 mCurrentClient = mPagerClient;
198 break; 201 break;
199 default: 202 default:
200 return; 203 return;
201 } 204 }
202 205
203 // and at last update the widgets 206 // and at last update the widgets
204 updateClientWidgets(); 207 updateClientWidgets();
205} 208}
206 209
207 210
208 211
209void KDEPIMConfigWidget::client_changed( int newClient ) 212void KDEPIMConfigWidget::client_changed( int newClient )
210{ 213{
211 if (newClient == mCurrentClient) 214 if (newClient == mCurrentClient)
212 return; 215 return;
213 216
214 // first store the current data 217 // first store the current data
215 saveEditFieldSettings(); 218 saveEditFieldSettings();
216 219
217 220
218 //then reset the clientvariable 221 //then reset the clientvariable
219 mCurrentClient = newClient; 222 mCurrentClient = newClient;
220 223
221 // and at last update the widgets 224 // and at last update the widgets
222 updateClientWidgets(); 225 updateClientWidgets();
223 226
224 modified(); 227 modified();
225} 228}
226 229
227void KDEPIMConfigWidget::saveEditFieldSettings() 230void KDEPIMConfigWidget::saveEditFieldSettings()
228{ 231{
229 232
230 switch(mCurrentApp) 233 switch(mCurrentApp)
231 { 234 {
232 case(ExternalAppHandler::EMAIL): 235 case(ExternalAppHandler::EMAIL):
233 mEmailClient = mClient->currentItem(); 236 mEmailClient = mClient->currentItem();
234 break; 237 break;
235 case(ExternalAppHandler::PHONE): 238 case(ExternalAppHandler::PHONE):
236 mPhoneClient= mClient->currentItem(); 239 mPhoneClient= mClient->currentItem();
237 break; 240 break;
238 case(ExternalAppHandler::SMS): 241 case(ExternalAppHandler::SMS):
239 mSMSClient = mClient->currentItem(); 242 mSMSClient = mClient->currentItem();
240 break; 243 break;
241 case(ExternalAppHandler::FAX): 244 case(ExternalAppHandler::FAX):
242 mFaxClient = mClient->currentItem(); 245 mFaxClient = mClient->currentItem();
243 break; 246 break;
244 case(ExternalAppHandler::PAGER): 247 case(ExternalAppHandler::PAGER):
245 mPagerClient = mClient->currentItem(); 248 mPagerClient = mClient->currentItem();
246 break; 249 break;
247 default: 250 default:
248 return; 251 return;
249 } 252 }
250 253
251 //store the current data back to the apropriate membervariables if we had set it to "other" 254 //store the current data back to the apropriate membervariables if we had set it to "other"
252 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 255 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
253 { 256 {
254 mEmailOtherChannel = mChannel->text(); 257 mEmailOtherChannel = mChannel->text();
255 mEmailOtherMessage = mMessage->text(); 258 mEmailOtherMessage = mMessage->text();
256 mEmailOtherMessageParameters = mParameters->text(); 259 mEmailOtherMessageParameters = mParameters->text();
257 mEmailOtherMessage2 = mMessage2->text(); 260 mEmailOtherMessage2 = mMessage2->text();
258 mEmailOtherMessageParameters2 = mParameters2->text(); 261 mEmailOtherMessageParameters2 = mParameters2->text();
259 } 262 }
260 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 263 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
261 { 264 {
262 mPhoneOtherChannel = mChannel->text(); 265 mPhoneOtherChannel = mChannel->text();
263 mPhoneOtherMessage = mMessage->text(); 266 mPhoneOtherMessage = mMessage->text();
264 mPhoneOtherMessageParameters = mParameters->text(); 267 mPhoneOtherMessageParameters = mParameters->text();
265 } 268 }
266 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 269 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
267 { 270 {
268 mSMSOtherChannel = mChannel->text(); 271 mSMSOtherChannel = mChannel->text();
269 mSMSOtherMessage = mMessage->text(); 272 mSMSOtherMessage = mMessage->text();
270 mSMSOtherMessageParameters = mParameters->text(); 273 mSMSOtherMessageParameters = mParameters->text();
271 } 274 }
272 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 275 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
273 { 276 {
274 mFaxOtherChannel = mChannel->text(); 277 mFaxOtherChannel = mChannel->text();
275 mFaxOtherMessage = mMessage->text(); 278 mFaxOtherMessage = mMessage->text();
276 mFaxOtherMessageParameters = mParameters->text(); 279 mFaxOtherMessageParameters = mParameters->text();
277 } 280 }
278 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 281 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
279 { 282 {
280 mPagerOtherChannel = mChannel->text(); 283 mPagerOtherChannel = mChannel->text();
281 mPagerOtherMessage = mMessage->text(); 284 mPagerOtherMessage = mMessage->text();
282 mPagerOtherMessageParameters = mParameters->text(); 285 mPagerOtherMessageParameters = mParameters->text();
283 } 286 }
284 287
285 288
286} 289}
287 290
288void KDEPIMConfigWidget::updateClientWidgets() 291void KDEPIMConfigWidget::updateClientWidgets()
289{ 292{
290 bool blocked = signalsBlocked(); 293 bool blocked = signalsBlocked();
291 blockSignals( true ); 294 blockSignals( true );
292 295
293 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display 296 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display
294 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); 297 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp );
295 if (it == mExternalAppsMap.end()) 298 if (it == mExternalAppsMap.end())
296 return; 299 return;
297 300
298 // update group box 301 // update group box
299 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); 302 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data()));
300 303
301 //update the entries in the client combobox 304 //update the entries in the client combobox
302 mClient->clear(); 305 mClient->clear();
303 306
304 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); 307 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp);
305 DefaultAppItem* dai; 308 DefaultAppItem* dai;
306 for ( dai=items.first(); dai != 0; dai=items.next() ) 309 for ( dai=items.first(); dai != 0; dai=items.next() )
307 { 310 {
308 mClient->insertItem( i18n(dai->_label), dai->_id ); 311 mClient->insertItem( i18n(dai->_label), dai->_id );
309 312
310 if (dai->_id == mCurrentClient) 313 if (dai->_id == mCurrentClient)
311 { 314 {
312 //restore the edit fields with the data of the local membervariables if we had set it to "other". 315 //restore the edit fields with the data of the local membervariables if we had set it to "other".
313 //Otherwise take the default data from externalapphandler. 316 //Otherwise take the default data from externalapphandler.
314 mChannel->setText(dai->_channel); 317 mChannel->setText(dai->_channel);
315 mMessage->setText(dai->_message); 318 mMessage->setText(dai->_message);
316 mParameters->setText(dai->_parameters); 319 mParameters->setText(dai->_parameters);
317 mMessage2->setText(dai->_message2); 320 mMessage2->setText(dai->_message2);
318 mParameters2->setText(dai->_parameters2); 321 mParameters2->setText(dai->_parameters2);
319 322
320 323
321 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 324 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
322 { 325 {
323 mChannel->setText(mEmailOtherChannel); 326 mChannel->setText(mEmailOtherChannel);
324 mMessage->setText(mEmailOtherMessage); 327 mMessage->setText(mEmailOtherMessage);
325 mParameters->setText(mEmailOtherMessageParameters); 328 mParameters->setText(mEmailOtherMessageParameters);
326 mMessage2->setText(mEmailOtherMessage2); 329 mMessage2->setText(mEmailOtherMessage2);
327 mParameters2->setText(mEmailOtherMessageParameters2); 330 mParameters2->setText(mEmailOtherMessageParameters2);
328 } 331 }
329 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 332 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
330 { 333 {
331 mChannel->setText(mPhoneOtherChannel); 334 mChannel->setText(mPhoneOtherChannel);
332 mMessage->setText(mPhoneOtherMessage); 335 mMessage->setText(mPhoneOtherMessage);
333 mParameters->setText(mPhoneOtherMessageParameters); 336 mParameters->setText(mPhoneOtherMessageParameters);
334 } 337 }
335 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 338 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
336 { 339 {
337 mChannel->setText(mSMSOtherChannel); 340 mChannel->setText(mSMSOtherChannel);
338 mMessage->setText(mSMSOtherMessage); 341 mMessage->setText(mSMSOtherMessage);
339 mParameters->setText(mSMSOtherMessageParameters); 342 mParameters->setText(mSMSOtherMessageParameters);
340 } 343 }
341 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 344 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
342 { 345 {
343 mChannel->setText(mFaxOtherChannel); 346 mChannel->setText(mFaxOtherChannel);
344 mMessage->setText(mFaxOtherMessage); 347 mMessage->setText(mFaxOtherMessage);
345 mParameters->setText(mFaxOtherMessageParameters); 348 mParameters->setText(mFaxOtherMessageParameters);
346 } 349 }
347 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 350 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
348 { 351 {
349 mChannel->setText(mPagerOtherChannel); 352 mChannel->setText(mPagerOtherChannel);
350 mMessage->setText(mPagerOtherMessage); 353 mMessage->setText(mPagerOtherMessage);
351 mParameters->setText(mPagerOtherMessageParameters); 354 mParameters->setText(mPagerOtherMessageParameters);
352 } 355 }
353 } 356 }
354 357
355 } 358 }
356 359
357 bool readonly; 360 bool readonly;
358 bool enabled; 361 bool enabled;
359 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 362 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
360 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 363 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
361 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 364 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
362 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 365 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
363 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))) 366 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)))
364 { 367 {
365 readonly = false; 368 readonly = false;
366 } 369 }
367 else 370 else
368 { 371 {
369 readonly = true; 372 readonly = true;
370 } 373 }
371 374
372 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) 375 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC))
373 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) 376 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC))
374 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) 377 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC))
375 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) 378 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC))
376 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC))) 379 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)))
377 { 380 {
378 enabled = false; 381 enabled = false;
379 } 382 }
380 else 383 else
381 { 384 {
382 enabled = true; 385 enabled = true;
383 } 386 }
384 387
385 388
386 mChannel->setReadOnly(readonly); 389 mChannel->setReadOnly(readonly);
387 mMessage->setReadOnly(readonly); 390 mMessage->setReadOnly(readonly);
388 mParameters->setReadOnly(readonly); 391 mParameters->setReadOnly(readonly);
389 mMessage2->setReadOnly(readonly); 392 mMessage2->setReadOnly(readonly);
390 mParameters2->setReadOnly(readonly); 393 mParameters2->setReadOnly(readonly);
391 394
392 mChannel->setEnabled(enabled); 395 mChannel->setEnabled(enabled);
393 mMessage->setEnabled(enabled); 396 mMessage->setEnabled(enabled);
394 mParameters->setEnabled(enabled); 397 mParameters->setEnabled(enabled);
395 mMessage2->setEnabled(enabled); 398 mMessage2->setEnabled(enabled);
396 mParameters2->setEnabled(enabled); 399 mParameters2->setEnabled(enabled);
397 400
398 401
399 402
400 mClient->setCurrentItem(mCurrentClient); 403 mClient->setCurrentItem(mCurrentClient);
401 404
402 405
403 // enable/disable the extra message/parameter field 406 // enable/disable the extra message/parameter field
404 if (mCurrentApp == ExternalAppHandler::EMAIL) 407 if (mCurrentApp == ExternalAppHandler::EMAIL)
405 { 408 {
406 } 409 }
407 else 410 else
408 { 411 {
409 mMessage2->setText( "" ); 412 mMessage2->setText( "" );
410 mParameters2->setText( "" ); 413 mParameters2->setText( "" );
411 } 414 }
412 415
413 if (enabled == true) { 416 if (enabled == true) {
414 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 417 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
415 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 418 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
416 } 419 }
417 420
418 421
419 blockSignals( blocked ); 422 blockSignals( blocked );
420 423
421} 424}
422 425
423 426
424 427
425 428
426void KDEPIMConfigWidget::restoreSettings(KPimGlobalPrefs* prefs) 429void KDEPIMConfigWidget::restoreSettings(KPimGlobalPrefs* prefs)
427{ 430{
428 bool blocked = signalsBlocked(); 431 bool blocked = signalsBlocked();
429 blockSignals( true ); 432 blockSignals( true );
430 433
431 mEmailClient = prefs->mEmailClient; 434 mEmailClient = prefs->mEmailClient;
432 mEmailOtherChannel = prefs->mEmailOtherChannel; 435 mEmailOtherChannel = prefs->mEmailOtherChannel;
433 mEmailOtherMessage = prefs->mEmailOtherMessage; 436 mEmailOtherMessage = prefs->mEmailOtherMessage;
434 mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; 437 mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters;
435 mEmailOtherMessage2 = prefs->mEmailOtherMessage2; 438 mEmailOtherMessage2 = prefs->mEmailOtherMessage2;
436 mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; 439 mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2;
437 440
438 mPhoneClient = prefs->mPhoneClient; 441 mPhoneClient = prefs->mPhoneClient;
439 mPhoneOtherChannel = prefs->mPhoneOtherChannel; 442 mPhoneOtherChannel = prefs->mPhoneOtherChannel;
440 mPhoneOtherMessage = prefs->mPhoneOtherMessage; 443 mPhoneOtherMessage = prefs->mPhoneOtherMessage;
441 mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; 444 mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters;
442 445
443 mFaxClient = prefs->mFaxClient; 446 mFaxClient = prefs->mFaxClient;
444 mFaxOtherChannel = prefs->mFaxOtherChannel; 447 mFaxOtherChannel = prefs->mFaxOtherChannel;
445 mFaxOtherMessage = prefs->mFaxOtherMessage; 448 mFaxOtherMessage = prefs->mFaxOtherMessage;
446 mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters; 449 mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters;
447 450
448 mSMSClient = prefs->mSMSClient; 451 mSMSClient = prefs->mSMSClient;
449 mSMSOtherChannel = prefs->mSMSOtherChannel; 452 mSMSOtherChannel = prefs->mSMSOtherChannel;
450 mSMSOtherMessage = prefs->mSMSOtherMessage; 453 mSMSOtherMessage = prefs->mSMSOtherMessage;
451 mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; 454 mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters;
452 455
453 mPagerClient = prefs->mPagerClient; 456 mPagerClient = prefs->mPagerClient;
454 mPagerOtherChannel = prefs->mPagerOtherChannel; 457 mPagerOtherChannel = prefs->mPagerOtherChannel;
455 mPagerOtherMessage = prefs->mPagerOtherMessage; 458 mPagerOtherMessage = prefs->mPagerOtherMessage;
456 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; 459 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters;
457 460
458 mCurrentApp = ExternalAppHandler::EMAIL; 461 mCurrentApp = ExternalAppHandler::EMAIL;
459 mCurrentClient = mEmailClient; 462 mCurrentClient = mEmailClient;
460 463
461 updateClientWidgets(); 464 updateClientWidgets();
462 465
463 blockSignals( blocked ); 466 blockSignals( blocked );
464 467
465 emit changed( false ); 468 emit changed( false );
466 469
467} 470}
468 471
469void KDEPIMConfigWidget::saveSettings(KPimGlobalPrefs* prefs) 472void KDEPIMConfigWidget::saveSettings(KPimGlobalPrefs* prefs)
470{ 473{
471 saveEditFieldSettings(); 474 saveEditFieldSettings();
472 475
473 prefs->mEmailClient = mEmailClient; 476 prefs->mEmailClient = mEmailClient;
474 prefs->mEmailOtherChannel = mEmailOtherChannel; 477 prefs->mEmailOtherChannel = mEmailOtherChannel;
475 prefs->mEmailOtherMessage = mEmailOtherMessage; 478 prefs->mEmailOtherMessage = mEmailOtherMessage;
476 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; 479 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters;
477 prefs->mEmailOtherMessage2 = mEmailOtherMessage2; 480 prefs->mEmailOtherMessage2 = mEmailOtherMessage2;
478 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; 481 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2;
479 482
480 prefs->mPhoneClient = mPhoneClient; 483 prefs->mPhoneClient = mPhoneClient;
481 prefs->mPhoneOtherChannel = mPhoneOtherChannel; 484 prefs->mPhoneOtherChannel = mPhoneOtherChannel;
482 prefs->mPhoneOtherMessage = mPhoneOtherMessage; 485 prefs->mPhoneOtherMessage = mPhoneOtherMessage;
483 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters; 486 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters;
484 487
485 prefs->mFaxClient = mFaxClient; 488 prefs->mFaxClient = mFaxClient;
486 prefs->mFaxOtherChannel = mFaxOtherChannel; 489 prefs->mFaxOtherChannel = mFaxOtherChannel;
487 prefs->mFaxOtherMessage = mFaxOtherMessage; 490 prefs->mFaxOtherMessage = mFaxOtherMessage;
488 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters; 491 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters;
489 492
490 prefs->mSMSClient = mSMSClient; 493 prefs->mSMSClient = mSMSClient;
491 prefs->mSMSOtherChannel = mSMSOtherChannel; 494 prefs->mSMSOtherChannel = mSMSOtherChannel;
492 prefs->mSMSOtherMessage = mSMSOtherMessage; 495 prefs->mSMSOtherMessage = mSMSOtherMessage;
493 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; 496 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters;
494 497
495 prefs->mPagerClient = mPagerClient; 498 prefs->mPagerClient = mPagerClient;
496 prefs->mPagerOtherChannel = mPagerOtherChannel; 499 prefs->mPagerOtherChannel = mPagerOtherChannel;
497 prefs->mPagerOtherMessage = mPagerOtherMessage; 500 prefs->mPagerOtherMessage = mPagerOtherMessage;
498 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; 501 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters;
499 502
500 prefs->writeConfig(); 503 prefs->writeConfig();
501 504
502 //release the cache that other views can access the changed values instantanious 505 //release the cache that other views can access the changed values instantanious
503 ExternalAppHandler::instance()->loadConfig(); 506 ExternalAppHandler::instance()->loadConfig();
504 507
505 emit changed( false ); 508 emit changed( false );
506} 509}
507 510
508void KDEPIMConfigWidget::defaults(KPimGlobalPrefs* prefs) 511void KDEPIMConfigWidget::defaults(KPimGlobalPrefs* prefs)
509{ 512{
510 513
511 DefaultAppItem* dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC); 514 DefaultAppItem* dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC);
512 515
513 mEmailClient = dai->_id; 516 mEmailClient = dai->_id;
514 mEmailOtherChannel = dai->_channel; 517 mEmailOtherChannel = dai->_channel;
515 mEmailOtherMessage = dai->_message; 518 mEmailOtherMessage = dai->_message;
516 mEmailOtherMessageParameters = dai->_parameters; 519 mEmailOtherMessageParameters = dai->_parameters;
517 mEmailOtherMessage2 = dai->_message2; 520 mEmailOtherMessage2 = dai->_message2;
518 mEmailOtherMessageParameters2 = dai->_parameters2; 521 mEmailOtherMessageParameters2 = dai->_parameters2;
519 522
520 523
521 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC); 524 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC);
522 525
523 mPhoneClient = dai->_id; 526 mPhoneClient = dai->_id;
524 mPhoneOtherChannel = dai->_channel; 527 mPhoneOtherChannel = dai->_channel;
525 mPhoneOtherMessage = dai->_message; 528 mPhoneOtherMessage = dai->_message;
526 mPhoneOtherMessageParameters = dai->_parameters; 529 mPhoneOtherMessageParameters = dai->_parameters;
527 530
528 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC); 531 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC);
529 532
530 mFaxClient = dai->_id; 533 mFaxClient = dai->_id;
531 mFaxOtherChannel = dai->_channel; 534 mFaxOtherChannel = dai->_channel;
532 mFaxOtherMessage = dai->_message; 535 mFaxOtherMessage = dai->_message;
533 mFaxOtherMessageParameters = dai->_parameters; 536 mFaxOtherMessageParameters = dai->_parameters;
534 537
535 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC); 538 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC);
536 539
537 mSMSClient = dai->_id; 540 mSMSClient = dai->_id;
538 mSMSOtherChannel = dai->_channel; 541 mSMSOtherChannel = dai->_channel;
539 mSMSOtherMessage = dai->_message; 542 mSMSOtherMessage = dai->_message;
540 mSMSOtherMessageParameters = dai->_parameters; 543 mSMSOtherMessageParameters = dai->_parameters;
541 544
542 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC); 545 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC);
543 546
544 mPagerClient = dai->_id; 547 mPagerClient = dai->_id;
545 mPagerOtherChannel = dai->_channel; 548 mPagerOtherChannel = dai->_channel;
546 mPagerOtherMessage = dai->_message; 549 mPagerOtherMessage = dai->_message;
547 mPagerOtherMessageParameters = dai->_parameters; 550 mPagerOtherMessageParameters = dai->_parameters;
548 551
549 552
550 emit changed( true ); 553 emit changed( true );
551} 554}
552 555
553void KDEPIMConfigWidget::modified() 556void KDEPIMConfigWidget::modified()
554{ 557{
555 emit changed( true ); 558 emit changed( true );
556} 559}
557 560
558void KDEPIMConfigWidget::textChanged( const QString& text ) 561void KDEPIMConfigWidget::textChanged( const QString& text )
559{ 562{
560 emit changed( true ); 563 emit changed( true );
561} 564}