summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp94
-rw-r--r--kaddressbook/kabprefs.cpp3
-rw-r--r--kaddressbook/kabprefs.h12
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.cpp109
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.h8
-rw-r--r--microkde/kdialogbase.cpp1
-rw-r--r--microkde/kutils/kcmultidialog.cpp3
7 files changed, 196 insertions, 34 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index a7ca0ce..2a54900 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -80,4 +80,10 @@
80 80
81//US#include <qpe/resource.h> // needed for Resource::loadPixmap
82//#include <qlabel.h> 81//#include <qlabel.h>
82
83
84#ifdef Q_WS_QWS
85#include <qtopia/services.h>
86#include <qtopia/qcopenvelope_qws.h>
87#endif
88
83#endif // KAB_EMBEDDED 89#endif // KAB_EMBEDDED
@@ -93,2 +99,5 @@
93//US#include <qsplitter.h> 99//US#include <qsplitter.h>
100#include <qmap.h>
101#include <qdir.h>
102#include <qfile.h>
94#include <qvbox.h> 103#include <qvbox.h>
@@ -96,4 +105,7 @@
96#include <qclipboard.h> 105#include <qclipboard.h>
106#include <qtextstream.h>
97 107
98#include <libkdepim/categoryselectdialog.h> 108#include <libkdepim/categoryselectdialog.h>
109#include <kabc/vcardconverter.h>
110
99 111
@@ -131,6 +143,3 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
131{ 143{
132#ifdef KAB_EMBEDDED 144
133 //US we define here our own global actioncollection.
134 //mActionCollection = new KActionCollection(this);
135#endif //KAB_EMBEDDED
136 mExtensionBarSplitter = 0; 145 mExtensionBarSplitter = 0;
@@ -198,2 +207,5 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
198 207
208 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
209 SLOT( sendMail( const QString& ) ) );
210
199#ifndef KAB_EMBEDDED 211#ifndef KAB_EMBEDDED
@@ -202,4 +214,2 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
202 214
203 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
204 SLOT( sendMail( const QString& ) ) );
205 connect( mDetails, SIGNAL( browse( const QString& ) ), 215 connect( mDetails, SIGNAL( browse( const QString& ) ),
@@ -223,8 +233,2 @@ KABCore::~KABCore()
223 KABC::StdAddressBook::close(); 233 KABC::StdAddressBook::close();
224
225#ifdef KAB_EMBEDDED
226 //US we define here our own global actioncollection.
227 // delete mActionCollection;
228#endif //KAB_EMBEDDED
229
230} 234}
@@ -453,7 +457,3 @@ void KABCore::sendMail()
453{ 457{
454#ifndef KAB_EMBEDDED
455 sendMail( mViewManager->selectedEmails().join( ", " ) ); 458 sendMail( mViewManager->selectedEmails().join( ", " ) );
456#else //KAB_EMBEDDED
457 qDebug("KABCore::sendMail() ust be fixed");
458#endif //KAB_EMBEDDED
459} 459}
@@ -462,7 +462,25 @@ void KABCore::sendMail( const QString& email )
462{ 462{
463#ifndef KAB_EMBEDDED 463//US original kde implementation : kapp->invokeMailer( email, "" );
464 kapp->invokeMailer( email, "" ); 464
465#else //KAB_EMBEDDED 465/*US original qtopia implementation
466 qDebug("KABCore::sendMail(const QString& email) ust be fixed"); 466 PimContact c = abList->currentEntry();
467#endif //KAB_EMBEDDED 467 QString name = c.fileAs();
468 QString email = c.defaultEmail();
469#ifndef QT_NO_COP
470 QCopEnvelope e(Service::channel("Email"), "writeMail(QString,QString)");
471 e << name << email;
472#else
473*/
474
475
476#ifndef QT_NO_COP
477 QCString channel = KABPrefs::instance()->mEmailChannel.latin1();
478 qDebug("Using QCopEnvelope e(\"" + channel + "\", \"writeMail(QMap(QString,QString))\")");
479
480 QCopEnvelope e(channel, "writeMail(QString,QString)");
481 //US we need no names in the To field. The emailadresses are enough
482 e << "" << email;
483#else
484 KMessageBox::sorry( this, i18n( "This version does not support sending emails." ) );
485#endif
468} 486}
@@ -471,3 +489,2 @@ void KABCore::mailVCard()
471{ 489{
472#ifndef KAB_EMBEDDED
473 QStringList uids = mViewManager->selectedUids(); 490 QStringList uids = mViewManager->selectedUids();
@@ -475,5 +492,2 @@ void KABCore::mailVCard()
475 mailVCard( uids ); 492 mailVCard( uids );
476#else //KAB_EMBEDDED
477 qDebug("KABCore::mailVCard() must be fixed");
478#endif //KAB_EMBEDDED
479} 493}
@@ -482,5 +496,7 @@ void KABCore::mailVCard( const QStringList& uids )
482{ 496{
483#ifndef KAB_EMBEDDED
484 QStringList urls; 497 QStringList urls;
485 498
499 QString tmpdir = locateLocal("tmp", KGlobal::getAppName());
500
501/*US
486 // Create a temp dir, so that we can put the files in it with proper names 502 // Create a temp dir, so that we can put the files in it with proper names
@@ -494,2 +510,7 @@ void KABCore::mailVCard( const QStringList& uids )
494 tempDir.unlink(); 510 tempDir.unlink();
511*/
512 QString dirName = tmpdir + "/" + KApplication::randomString( 8 );
513
514
515
495 QDir().mkdir( dirName, true ); 516 QDir().mkdir( dirName, true );
@@ -522,3 +543,3 @@ void KABCore::mailVCard( const QStringList& uids )
522 } 543 }
523 544/*US
524 kapp->invokeMailer( QString::null, QString::null, QString::null, 545 kapp->invokeMailer( QString::null, QString::null, QString::null,
@@ -528,5 +549,16 @@ void KABCore::mailVCard( const QStringList& uids )
528 urls ); // attachments 549 urls ); // attachments
529#else //KAB_EMBEDDED 550*/
530 qDebug("KABCore::mailVCard( must be fixed"); 551#ifndef QT_NO_COP
531#endif //KAB_EMBEDDED 552 QCString channel = KABPrefs::instance()->mEmailChannel.latin1();
553 qDebug("Using QCopEnvelope e(\"" + channel + "\", \"writeMail(QMap(QString,QString))\")");
554
555 QMap<QString, QString> parameterMap;
556 parameterMap.insert("ATTACHMENT<n>", urls.join(", "));
557
558 QCopEnvelope e(channel, "writeMail(QMap(QString,QString))");
559 e << parameterMap;
560#else
561 KMessageBox::sorry( this, i18n( "This version does not support sending emails." ) );
562#endif
563
532 564
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index 5b3b1ab..8bd4b15 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -52,2 +52,5 @@ KABPrefs::KABPrefs()
52 addItemBool("ToolBarUp",&mToolBarUp, false ); 52 addItemBool("ToolBarUp",&mToolBarUp, false );
53 addItemInt( "EmailChannelType", &mEmailClient, OMPI );
54 addItemString( "EmailChannelOther", &mEmailChannel, "" );
55
53#endif //KAB_EMBEDDED 56#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h
index 370fc5b..c81a9a9 100644
--- a/kaddressbook/kabprefs.h
+++ b/kaddressbook/kabprefs.h
@@ -39,2 +39,10 @@ class KABPrefs : public KPimPrefs
39 39
40 enum EMailClients {
41 OMPI = 0,
42 QTOPIA = 1,
43 OPIE = 2,
44 OTHER = 3
45 };
46
47
40 // General 48 // General
@@ -51,2 +59,6 @@ class KABPrefs : public KPimPrefs
51 bool mAskForQuit; 59 bool mAskForQuit;
60
61 int mEmailClient;
62 QString mEmailChannel;
63
52 /** Set preferences to default values */ 64 /** Set preferences to default values */
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
index 38c7946..1bac26f 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
@@ -29,2 +29,6 @@
29#include <qtabwidget.h> 29#include <qtabwidget.h>
30#include <qcombobox.h>
31#include <qlineedit.h>
32#include <qlabel.h>
33#include <qfile.h>
30 34
@@ -95,3 +99,3 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name )
95 KDialog::spacingHintSmall() ); 99 KDialog::spacingHintSmall() );
96 100 //general groupbox
97 QGroupBox *groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "General" ), generalPage ); 101 QGroupBox *groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "General" ), generalPage );
@@ -111,2 +115,5 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name )
111 115
116
117 //extensions groupbox
118
112 groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions" ), generalPage ); 119 groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions" ), generalPage );
@@ -147,4 +154,92 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name )
147 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); 154 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) );
155
156 // mailclient page
157 QWidget *mailclientPage = new QWidget( this );
158 layout = new QVBoxLayout( mailclientPage, KDialog::marginHintSmall(),
159 KDialog::spacingHintSmall() );
160
161 groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), mailclientPage );
162 boxLayout = new QVBoxLayout( groupBox->layout() );
163 boxLayout->setAlignment( Qt::AlignTop );
164// boxLayout->setMargin(KDialog::marginHintSmall() );
165// groupBox->layout()->setMargin(KDialog::marginHintSmall()) ;
166// groupBox->layout()->setSpacing(KDialog::spacingHintSmall());
167// boxLayout->setSpacing( KDialog::spacingHintSmall() );
168
169 mEmailClient = new QComboBox( groupBox );
170 mEmailClient->insertItem( i18n("OM/Pi"), KABPrefs::OMPI );
171 mEmailClient->insertItem( i18n("Qtopia mail"), KABPrefs::QTOPIA );
172 mEmailClient->insertItem( i18n("Opie mail"), KABPrefs::OPIE );
173 mEmailClient->insertItem( i18n("Other"), KABPrefs::OTHER );
174 boxLayout->addWidget( mEmailClient );
175
176 connect( mEmailClient, SIGNAL( activated( int ) ),
177 this, SLOT (emailclient_changed( int ) ) );
178
179 QLabel* lab = new QLabel( i18n("Channel:"), groupBox);
180 boxLayout->addWidget( lab );
181 mEmailChannel = new QLineEdit(groupBox);
182 mEmailChannel->setReadOnly(true);
183 boxLayout->addWidget( mEmailChannel );
184
185 layout->addWidget( groupBox );
186 tabWidget->addTab( mailclientPage, i18n( "Mail" ) );
187
188
189
148} 190}
149 191
192
193
194void KABConfigWidget::emailclient_changed( int newClient )
195{
196 if (newClient == KABPrefs::OTHER)
197 mEmailChannel->setReadOnly(false);
198 else
199 mEmailChannel->setReadOnly(true);
200
201 QString opiepath = QString::fromLatin1( getenv("OPIEDIR") );
202 QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") );
203
204 if (opiepath.isEmpty())
205 opiepath = qtopiapath;
206
207 QString text = mEmailChannel->text();
208
209 if (newClient == KABPrefs::OPIE)
210 {
211 if ( QFile::exists( opiepath + "/bin/opiemail" ))
212 text = "QPE/Application/opiemail";
213 else
214 text = "FILENOTFOUND: " + opiepath + "/bin/opiemail";
215 }
216 else if (newClient == KABPrefs::QTOPIA)
217 {
218 if ( QFile::exists( qtopiapath + "/bin/qtmail" ))
219 text = "QPE/Application/qtmail";
220 else
221 text = "FILENOTFOUND: " + qtopiapath + "/bin/qtmail";
222
223 }
224 else if (newClient == KABPrefs::OMPI)
225 {
226 if ( QFile::exists( qtopiapath + "/bin/ompi" ))
227 text = "QPE/Application/ompi";
228 else if ( QFile::exists( opiepath + "/bin/ompi" ))
229 text = "QPE/Application/ompi";
230 else
231 text = "FILENOTFOUND: " + qtopiapath + "/bin/ompi";
232
233 }
234 else
235 {
236 //do nothing if we choosed other
237 }
238
239 mEmailChannel->setText( text );
240
241
242}
243
244
150void KABConfigWidget::restoreSettings() 245void KABConfigWidget::restoreSettings()
@@ -156,2 +251,6 @@ void KABConfigWidget::restoreSettings()
156 mViewsSingleClickBox->setChecked( KABPrefs::instance()->mHonorSingleClick ); 251 mViewsSingleClickBox->setChecked( KABPrefs::instance()->mHonorSingleClick );
252
253 mEmailChannel->setText( KABPrefs::instance()->mEmailChannel );
254 mEmailClient->setCurrentItem(KABPrefs::instance()->mEmailClient);
255
157 mAddresseeWidget->restoreSettings(); 256 mAddresseeWidget->restoreSettings();
@@ -169,2 +268,6 @@ void KABConfigWidget::saveSettings()
169 KABPrefs::instance()->mHonorSingleClick = mViewsSingleClickBox->isChecked(); 268 KABPrefs::instance()->mHonorSingleClick = mViewsSingleClickBox->isChecked();
269
270 KABPrefs::instance()->mEmailClient = mEmailClient->currentItem();
271 KABPrefs::instance()->mEmailChannel = mEmailChannel->text();
272
170 mAddresseeWidget->saveSettings(); 273 mAddresseeWidget->saveSettings();
@@ -182,2 +285,6 @@ void KABConfigWidget::defaults()
182 285
286 mEmailClient->setCurrentItem(KABPrefs::OMPI);
287 emailclient_changed( KABPrefs::OMPI );
288
289
183 emit changed( true ); 290 emit changed( true );
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h
index 0f36d9e..9d1363b 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.h
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.h
@@ -31,3 +31,4 @@ class QListViewItem;
31class QPushButton; 31class QPushButton;
32 32class QComboBox;
33class QLineEdit;
33class KListView; 34class KListView;
@@ -53,2 +54,4 @@ class KABConfigWidget : public QWidget
53 54
55
56
54 private slots: 57 private slots:
@@ -57,2 +60,3 @@ class KABConfigWidget : public QWidget
57 void itemClicked( QListViewItem* ); 60 void itemClicked( QListViewItem* );
61 void emailclient_changed( int newClient );
58 62
@@ -67,2 +71,4 @@ class KABConfigWidget : public QWidget
67 QPushButton *mConfigureButton; 71 QPushButton *mConfigureButton;
72 QComboBox* mEmailClient;
73 QLineEdit* mEmailChannel;
68 74
diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp
index c953058..d1f7630 100644
--- a/microkde/kdialogbase.cpp
+++ b/microkde/kdialogbase.cpp
@@ -80,3 +80,2 @@ void KDialogBase::init( const QString &caption, int buttonMask,
80 if ( buttonMask & Default ) { 80 if ( buttonMask & Default ) {
81 qDebug("buttonMask & Default ");
82 mDefaultButton = new QPushButton( i18n("Default"), this ); 81 mDefaultButton = new QPushButton( i18n("Default"), this );
diff --git a/microkde/kutils/kcmultidialog.cpp b/microkde/kutils/kcmultidialog.cpp
index 4136622..13be2ce 100644
--- a/microkde/kutils/kcmultidialog.cpp
+++ b/microkde/kutils/kcmultidialog.cpp
@@ -45,2 +45,5 @@ KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const ch
45 //connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *))); 45 //connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *)));
46
47 connect( this, SIGNAL( defaultClicked() ), SLOT( slotDefault() ) );
48
46 _baseGroup = baseGroup; 49 _baseGroup = baseGroup;