summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/accountitem.cpp14
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp4
-rw-r--r--kmicromail/libmailwrapper/mhwrapper.cpp2
-rw-r--r--kmicromail/libmailwrapper/settings.cpp4
-rw-r--r--kmicromail/mainwindow.cpp7
-rw-r--r--kmicromail/mainwindow.h1
-rw-r--r--kmicromail/opiemail.cpp10
-rw-r--r--kmicromail/opiemail.h1
8 files changed, 28 insertions, 15 deletions
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp
index 7b9b881..59c8abb 100644
--- a/kmicromail/accountitem.cpp
+++ b/kmicromail/accountitem.cpp
@@ -15,8 +15,10 @@
#include <qpopupmenu.h>
#include <qmessagebox.h>
#include <kiconloader.h>
+#define GET_NEW_MAILS 101
+
using namespace Opie::Core;
#define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );}
/**
* POP3 Account stuff
@@ -91,14 +93,14 @@ QPopupMenu * POP3viewItem::getContextMenu()
if (!account->getOffline())
{
m->insertItem(QObject::tr("Disconnect",contextName),0);
m->insertItem(QObject::tr("Set offline",contextName),1);
- m->insertItem(QObject::tr("Download new INBOX messages",contextName),2);
+ m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS);
}
else
{
m->insertItem(QObject::tr("Set online",contextName),1);
- m->insertItem(QObject::tr("Download new INBOX messages",contextName),2);
+ m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS);
}
}
return m;
}
@@ -136,9 +138,9 @@ void POP3viewItem::contextMenuSelected(int which)
break;
case 1:
setOnOffline();
break;
- case 2: // daunlood
+ case GET_NEW_MAILS: // daunlood
if (account->getOffline())
setOnOffline();
AccountView*bl = accountView();
if (!bl) return;
@@ -516,15 +518,15 @@ QPopupMenu * IMAPviewItem::getContextMenu()
m->insertSeparator();
m->insertItem(QObject::tr("Disconnect",contextName),2);
m->insertItem(QObject::tr("Set offline",contextName),3);
m->insertSeparator();
- m->insertItem(QObject::tr("Download new INBOX messages",contextName),4);
+ m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS);
}
else
{
m->insertItem(QObject::tr("Set online",contextName),3);
m->insertSeparator();
- m->insertItem(QObject::tr("Download new INBOX messages",contextName),4);
+ m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS);
}
}
return m;
}
@@ -576,9 +578,9 @@ void IMAPviewItem::contextMenuSelected(int id)
account->save();
SETPIX(PIXMAP_IMAPFOLDER);
refreshFolders(false);
break;
- case 4: // daunlood
+ case GET_NEW_MAILS: // daunlood
{
if (account->getOffline()) {
contextMenuSelected( 3 );
}
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp
index 5441a9b..91332c3 100644
--- a/kmicromail/libmailwrapper/imapwrapper.cpp
+++ b/kmicromail/libmailwrapper/imapwrapper.cpp
@@ -170,9 +170,9 @@ void IMAPwrapper::login()
force_tls = true;
}
if ( ssl ) {
- qDebug("using ssl ");
+ //qDebug("using ssl ");
err = mailimap_ssl_connect( m_imap, (char*)server.latin1(), port );
} else {
err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port );
}
@@ -1246,9 +1246,9 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder,
if (targetWrapper != this || maxSizeInKb > 0 ) {
mMax = 0;
progress( tr("Copy"));
AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit, maxSizeInKb);
- qDebug("IMAPwrapper::mvcpAllMails::Using generic");
+ //qDebug("IMAPwrapper::mvcpAllMails::Using generic");
// odebug << "Using generic" << oendl;
return;
}
mailimap_set *set = 0;
diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp
index 962dac0..641d4d9 100644
--- a/kmicromail/libmailwrapper/mhwrapper.cpp
+++ b/kmicromail/libmailwrapper/mhwrapper.cpp
@@ -64,9 +64,8 @@ MHwrapper::~MHwrapper()
}
void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb )
{
- qDebug("MHwrapper::listMessages ");
init_storage();
if (!m_storage) {
return;
}
@@ -193,9 +192,8 @@ int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QStri
if (r != MAIL_NO_ERROR) {
qDebug("error creating folder ");
return 0;
}
- qDebug("Folder created ");
return 1;
}
void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder)
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp
index 766eba0..40b5591 100644
--- a/kmicromail/libmailwrapper/settings.cpp
+++ b/kmicromail/libmailwrapper/settings.cpp
@@ -25,9 +25,8 @@ Settings::Settings()
}
void Settings::checkDirectory()
{
- qDebug("Settings::checkDirectory() ");
return;
locateLocal("data", "kopiemail" );
/*
if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) {
@@ -209,17 +208,16 @@ void IMAPaccount::read()
maxMailSize = conf->readNumEntry( "MaxSize",0 );
int lf = conf->readNumEntry( "LastFetch",0 );
QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) );
leaveOnServer = conf->readBoolEntry("LeaveOnServer",false);
- qDebug("reading last fetch: %d ", lf);
if ( lf < 0 ) lf = 0;
lastFetch = dt.addSecs( lf );
delete conf;
}
void IMAPaccount::save()
{
- qDebug("saving %s ",getFileName().latin1() );
+
Settings::checkDirectory();
KConfig *conf = new KConfig( getFileName() );
conf->setGroup( "IMAP Account" );
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index 21edfd2..5f777a3 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -34,9 +34,14 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
addToolBar( toolBar );
toolBar->setHorizontalStretchable( true );
-
+ QAction* getMail = new QAction( tr( "Get new mail" ), SmallIcon("add"),
+ 0, 0, this );
+ getMail->addTo( toolBar );
+ getMail->addTo( mailMenu );
+ connect(getMail, SIGNAL( activated() ),
+ SLOT( slotGetMail() ) );
composeMail = new QAction( tr( "Compose new mail" ), SmallIcon("composemail"),
0, 0, this );
composeMail->addTo( toolBar );
diff --git a/kmicromail/mainwindow.h b/kmicromail/mainwindow.h
index 680f0a9..ff0ff20 100644
--- a/kmicromail/mainwindow.h
+++ b/kmicromail/mainwindow.h
@@ -40,8 +40,9 @@ protected slots:
virtual void slotEditAccounts();
virtual void slotShowFolders( bool show );
virtual void refreshMailView(const QValueList<RecMailP>&);
virtual void displayMail();
+ virtual void slotGetMail() = 0;
virtual void slotDeleteMail();
virtual void mailHold(int, QListViewItem *,const QPoint&,int);
virtual void slotAdjustLayout();
virtual void slotEditSettings();
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index b2119e6..19ffdb3 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -8,8 +8,9 @@
#include "mailistviewitem.h"
#include "viewmail.h"
#include "selectstore.h"
#include "selectsmtp.h"
+#include "accountitem.h"
#include <qmessagebox.h>
#include <qtimer.h>
#include <libkdepim/externalapphandler.h>
@@ -243,9 +244,16 @@ void OpieMail::displayMail()
{
( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
}
}
-
+void OpieMail::slotGetMail()
+{
+ QListViewItem * item = folderView->currentItem();
+ if ( ! item ) return;
+ while ( item->parent () )
+ item = item->parent ();
+ ((AccountViewItem *)item)->contextMenuSelected( 101 );
+}
void OpieMail::slotDeleteMail()
{
if (!mailView->currentItem()) return;
RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data();
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h
index 1de5f6b..e054b9e 100644
--- a/kmicromail/opiemail.h
+++ b/kmicromail/opiemail.h
@@ -29,8 +29,9 @@ protected slots:
virtual void slotEditSettings();
virtual void slotEditAccounts();
virtual void displayMail();
virtual void slotDeleteMail();
+ virtual void slotGetMail();
virtual void slotDeleteAllMail();
virtual void mailHold(int, QListViewItem *,const QPoint&,int);
virtual void slotShowFolders( bool show );
virtual void refreshMailView(const QValueList<RecMailP>&);