summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/addressbook.cpp
authoreilers <eilers>2002-10-22 12:34:54 (UTC)
committer eilers <eilers>2002-10-22 12:34:54 (UTC)
commit78152b3adbe3ae4626c8f53e3edd0babcaf6fb72 (patch) (side-by-side diff)
tree89b0b4ffea2fa1efd4eb7dc50545661d3ceeb65d /core/pim/addressbook/addressbook.cpp
parent486280adc2ab5dc383a56d8516c36727eb382812 (diff)
downloadopie-78152b3adbe3ae4626c8f53e3edd0babcaf6fb72.zip
opie-78152b3adbe3ae4626c8f53e3edd0babcaf6fb72.tar.gz
opie-78152b3adbe3ae4626c8f53e3edd0babcaf6fb72.tar.bz2
Find bugfix. Tried to make the letterpicker more visible due to
undelign does not work on my Z.. :( Added use of alternative mail-application (opie-mail instead of QT-Mail)
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp47
1 files changed, 44 insertions, 3 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 3466801..39d8321 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -80,6 +80,8 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
useRegExp(false),
doNotifyWrapAround(true),
caseSensitive(false),
+ m_useQtMail(true),
+ m_useOpieMail(false),
bAbEditFirstTime(TRUE),
syncing(FALSE)
{
@@ -91,6 +93,10 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
useRegExp = cfg.readBoolEntry( "useRegExp" );
caseSensitive = cfg.readBoolEntry( "caseSensitive" );
doNotifyWrapAround = cfg.readBoolEntry( "doNotifyWrapAround" );
+ cfg.setGroup("Mail");
+ m_useQtMail = cfg.readBoolEntry( "useQtMail" );
+ m_useOpieMail=cfg.readBoolEntry( "useOpieMail" );
+
initFields();
@@ -169,7 +175,7 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) );
a->addTo( searchBar );
- a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "qtmail/reply" ),
+ a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "mail/sendmail" ),
QString::null, 0, this, 0 );
//a->setEnabled( FALSE ); we got support for it now :) zecke
actionMail = a;
@@ -282,12 +288,16 @@ void AddressbookWindow::slotConfig()
dlg -> setUseRegExp ( useRegExp );
dlg -> setBeCaseSensitive( caseSensitive );
dlg -> setSignalWrapAround( doNotifyWrapAround );
+ dlg -> setQtMail ( m_useQtMail );
+ dlg -> setOpieMail ( m_useOpieMail );
dlg -> showMaximized();
if ( dlg -> exec() ) {
qWarning ("Config Dialog accepted !");
useRegExp = dlg -> useRegExp();
caseSensitive = dlg -> beCaseSensitive();
doNotifyWrapAround = dlg -> signalWrapAround();
+ m_useQtMail = dlg -> useQtMail();
+ m_useOpieMail= dlg -> useOpieMail();
}
delete dlg;
@@ -380,6 +390,9 @@ AddressbookWindow::~AddressbookWindow()
cfg.writeEntry("useRegExp", useRegExp);
cfg.writeEntry("caseSensitive", caseSensitive);
cfg.writeEntry("doNotifyWrapAround", doNotifyWrapAround);
+ cfg.setGroup("Mail");
+ cfg.writeEntry( "useQtMail", m_useQtMail );
+ cfg.writeEntry( "useOpieMail", m_useOpieMail);
}
void AddressbookWindow::slotUpdateToolbar()
@@ -494,8 +507,36 @@ void AddressbookWindow::writeMail()
OContact c = abList->currentEntry();
QString name = c.fileAs();
QString email = c.defaultEmail();
- QCopEnvelope e("QPE/Application/qtmail", "writeMail(QString,QString)");
- e << name << email;
+
+ // I prefer the OPIE-Environment variable before the
+ // QPE-one..
+ QString basepath = QString::fromLatin1( getenv("OPIEDIR") );
+ if ( basepath.isEmpty() )
+ basepath = QString::fromLatin1( getenv("QPEDIR") );
+
+ // Try to access the preferred. If not possible, try to
+ // switch to the other one..
+ if ( m_useQtMail ){
+ qWarning ("Accessing: %s", (basepath + "/bin/qtmail").latin1());
+ if ( QFile::exists( basepath + "/bin/qtmail" ) ){
+ qWarning ("QCop");
+ QCopEnvelope e("QPE/Application/qtmail", "writeMail(QString,QString)");
+ e << name << email;
+ return;
+ } else
+ m_useOpieMail = true;
+ }
+ if ( m_useOpieMail ){
+ qWarning ("Accessing: %s", (basepath + "/bin/mail").latin1());
+ if ( QFile::exists( basepath + "/bin/mail" ) ){
+ qWarning ("QCop");
+ QCopEnvelope e("QPE/Application/mail", "writeMail(QString,QString)");
+ e << name << email;
+ return;
+ } else
+ m_useQtMail = true;
+ }
+
}
static const char * beamfile = "/tmp/obex/contact.vcf";