summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mailit/emailclient.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/mailit/emailclient.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mailit/emailclient.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/noncore/unsupported/mailit/emailclient.cpp b/noncore/unsupported/mailit/emailclient.cpp
index fc4276b..9258aac 100644
--- a/noncore/unsupported/mailit/emailclient.cpp
+++ b/noncore/unsupported/mailit/emailclient.cpp
@@ -152,24 +152,25 @@ void EmailClient::init()
connect(sendMailButton, SIGNAL(activated()), this, SLOT(sendQuedMail()) );
sendMailButton->addTo(bar);
sendMailButton->addTo(mail);
composeButton = new QAction(tr("Compose"), Resource::loadPixmap("new"), QString::null, 0, this, 0);
connect(composeButton, SIGNAL(activated()), this, SLOT(compose()) );
composeButton->addTo(bar);
composeButton->addTo(mail);
cancelButton = new QAction(tr("Cancel transfer"), Resource::loadPixmap("close"), QString::null, 0, this, 0);
connect(cancelButton, SIGNAL(activated()), this, SLOT(cancel()) );
cancelButton->addTo(mail);
+ cancelButton->addTo(bar);
cancelButton->setEnabled(FALSE);
mailboxView = new OTabWidget( this, "mailboxView" );
QWidget* widget = new QWidget( mailboxView, "widget" );
grid_2 = new QGridLayout( widget );
// grid_2->setSpacing(6);
// grid_2->setMargin( 11 );
inboxView = new QListView( widget, "inboxView" );
inboxView->addColumn( tr( "From" ) );
inboxView->addColumn( tr( "Subject" ) );
@@ -205,44 +206,49 @@ void EmailClient::cancel()
{
emailHandler->cancel();
}
AddressList* EmailClient::getAdrListRef()
{
return addressList;
}
//this needs to be rewritten to syncronize with outboxView
void EmailClient::enqueMail(const Email &mail)
{
+ if (accountList.count() == 0) {
+ QMessageBox::warning(qApp->activeWindow(),
+ tr("No account selected"), tr("You must create an account"), "OK\n");
+ return;
+ }
+
if (accountList.count() > 0) {
currentAccount = accountList.first();
qWarning("using account " + currentAccount->name);
}
Email addMail = mail;
addMail.from = currentAccount->name;
addMail.fromMail = currentAccount->emailAddress;
addMail.rawMail.prepend("From: " + addMail.from + "<" + addMail.fromMail + ">\n");
item = new EmailListItem(outboxView, addMail, false);
}
void EmailClient::sendQuedMail()
{
int count = 0;
if (accountList.count() == 0) {
- QMessageBox::warning(qApp->activeWindow(),
- "No account selected", "You must create an account", "OK\n");
+ QMessageBox::warning(qApp->activeWindow(), "No account selected", "You must create an account", "OK\n");
return;
}
//traverse listview, find messages to send
if (! sending) {
item = (EmailListItem *) outboxView->firstChild();
if (item != NULL) {
while (item != NULL) {
quedMessages.append(item->getMail());
item = (EmailListItem *) item->nextSibling();
count++;
}
setMailAccount();