summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mailit/emailclient.cpp
Unidiff
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()
152 connect(sendMailButton, SIGNAL(activated()), this, SLOT(sendQuedMail()) ); 152 connect(sendMailButton, SIGNAL(activated()), this, SLOT(sendQuedMail()) );
153 sendMailButton->addTo(bar); 153 sendMailButton->addTo(bar);
154 sendMailButton->addTo(mail); 154 sendMailButton->addTo(mail);
155 155
156 composeButton = new QAction(tr("Compose"), Resource::loadPixmap("new"), QString::null, 0, this, 0); 156 composeButton = new QAction(tr("Compose"), Resource::loadPixmap("new"), QString::null, 0, this, 0);
157 connect(composeButton, SIGNAL(activated()), this, SLOT(compose()) ); 157 connect(composeButton, SIGNAL(activated()), this, SLOT(compose()) );
158 composeButton->addTo(bar); 158 composeButton->addTo(bar);
159 composeButton->addTo(mail); 159 composeButton->addTo(mail);
160 160
161 cancelButton = new QAction(tr("Cancel transfer"), Resource::loadPixmap("close"), QString::null, 0, this, 0); 161 cancelButton = new QAction(tr("Cancel transfer"), Resource::loadPixmap("close"), QString::null, 0, this, 0);
162 connect(cancelButton, SIGNAL(activated()), this, SLOT(cancel()) ); 162 connect(cancelButton, SIGNAL(activated()), this, SLOT(cancel()) );
163 cancelButton->addTo(mail); 163 cancelButton->addTo(mail);
164 cancelButton->addTo(bar);
164 cancelButton->setEnabled(FALSE); 165 cancelButton->setEnabled(FALSE);
165 166
166 mailboxView = new OTabWidget( this, "mailboxView" ); 167 mailboxView = new OTabWidget( this, "mailboxView" );
167 168
168 QWidget* widget = new QWidget( mailboxView, "widget" ); 169 QWidget* widget = new QWidget( mailboxView, "widget" );
169 grid_2 = new QGridLayout( widget ); 170 grid_2 = new QGridLayout( widget );
170// grid_2->setSpacing(6); 171// grid_2->setSpacing(6);
171// grid_2->setMargin( 11 ); 172// grid_2->setMargin( 11 );
172 173
173 inboxView = new QListView( widget, "inboxView" ); 174 inboxView = new QListView( widget, "inboxView" );
174 inboxView->addColumn( tr( "From" ) ); 175 inboxView->addColumn( tr( "From" ) );
175 inboxView->addColumn( tr( "Subject" ) ); 176 inboxView->addColumn( tr( "Subject" ) );
@@ -205,44 +206,49 @@ void EmailClient::cancel()
205{ 206{
206 emailHandler->cancel(); 207 emailHandler->cancel();
207} 208}
208 209
209AddressList* EmailClient::getAdrListRef() 210AddressList* EmailClient::getAdrListRef()
210{ 211{
211 return addressList; 212 return addressList;
212} 213}
213 214
214//this needs to be rewritten to syncronize with outboxView 215//this needs to be rewritten to syncronize with outboxView
215void EmailClient::enqueMail(const Email &mail) 216void EmailClient::enqueMail(const Email &mail)
216{ 217{
218 if (accountList.count() == 0) {
219 QMessageBox::warning(qApp->activeWindow(),
220 tr("No account selected"), tr("You must create an account"), "OK\n");
221 return;
222 }
223
217 if (accountList.count() > 0) { 224 if (accountList.count() > 0) {
218 currentAccount = accountList.first(); 225 currentAccount = accountList.first();
219 qWarning("using account " + currentAccount->name); 226 qWarning("using account " + currentAccount->name);
220 } 227 }
221 228
222 Email addMail = mail; 229 Email addMail = mail;
223 addMail.from = currentAccount->name; 230 addMail.from = currentAccount->name;
224 addMail.fromMail = currentAccount->emailAddress; 231 addMail.fromMail = currentAccount->emailAddress;
225 addMail.rawMail.prepend("From: " + addMail.from + "<" + addMail.fromMail + ">\n"); 232 addMail.rawMail.prepend("From: " + addMail.from + "<" + addMail.fromMail + ">\n");
226 item = new EmailListItem(outboxView, addMail, false); 233 item = new EmailListItem(outboxView, addMail, false);
227 234
228} 235}
229 236
230void EmailClient::sendQuedMail() 237void EmailClient::sendQuedMail()
231{ 238{
232 int count = 0; 239 int count = 0;
233 240
234 if (accountList.count() == 0) { 241 if (accountList.count() == 0) {
235 QMessageBox::warning(qApp->activeWindow(), 242 QMessageBox::warning(qApp->activeWindow(), "No account selected", "You must create an account", "OK\n");
236 "No account selected", "You must create an account", "OK\n");
237 return; 243 return;
238 } 244 }
239 //traverse listview, find messages to send 245 //traverse listview, find messages to send
240 if (! sending) { 246 if (! sending) {
241 item = (EmailListItem *) outboxView->firstChild(); 247 item = (EmailListItem *) outboxView->firstChild();
242 if (item != NULL) { 248 if (item != NULL) {
243 while (item != NULL) { 249 while (item != NULL) {
244 quedMessages.append(item->getMail()); 250 quedMessages.append(item->getMail());
245 item = (EmailListItem *) item->nextSibling(); 251 item = (EmailListItem *) item->nextSibling();
246 count++; 252 count++;
247 } 253 }
248 setMailAccount(); 254 setMailAccount();