summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mailit/writemail.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/mailit/writemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mailit/writemail.cpp44
1 files changed, 26 insertions, 18 deletions
diff --git a/noncore/unsupported/mailit/writemail.cpp b/noncore/unsupported/mailit/writemail.cpp
index a9dcb02..0336c83 100644
--- a/noncore/unsupported/mailit/writemail.cpp
+++ b/noncore/unsupported/mailit/writemail.cpp
@@ -18,6 +18,7 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include <qmessagebox.h> 20#include <qmessagebox.h>
21#include <qwhatsthis.h>
21#include "writemail.h" 22#include "writemail.h"
22#include <qpe/resource.h> 23#include <qpe/resource.h>
23 24
@@ -27,7 +28,7 @@ WriteMail::WriteMail( QWidget* parent, const char* name, WFlags fl )
27 showingAddressList = FALSE; 28 showingAddressList = FALSE;
28 init(); 29 init();
29 30
30 addAtt = new AddAtt(0, "Add Attatchments"); 31 addAtt = new AddAtt(0, "Add Attachments");
31} 32}
32 33
33WriteMail::~WriteMail() 34WriteMail::~WriteMail()
@@ -64,20 +65,23 @@ void WriteMail::init()
64 menu->insertItem( tr( "&Add" ), addMenu); 65 menu->insertItem( tr( "&Add" ), addMenu);
65 66
66 bar = new QToolBar(this); 67 bar = new QToolBar(this);
67 attatchButton = new QAction(tr("Attatchment"), Resource::loadPixmap("mailit/attach"), QString::null, 0, this, 0); 68 attachButton = new QAction(tr("Attachment"), Resource::loadPixmap("mailit/attach"), QString::null, 0, this, 0);
68 attatchButton->addTo(bar); 69 attachButton->addTo(bar);
69 attatchButton->addTo(addMenu); 70 attachButton->addTo(addMenu);
70 connect( attatchButton, SIGNAL( activated() ), this, SLOT( attatchFile() ) ); 71 connect( attachButton, SIGNAL( activated() ), this, SLOT( attachFile() ) );
71 72 attachButton->setWhatsThis(tr("Click here to attach files to your mail"));
73
72 confirmButton = new QAction(tr("Enque mail"), Resource::loadPixmap("OKButton"), QString::null, 0, this, 0); 74 confirmButton = new QAction(tr("Enque mail"), Resource::loadPixmap("OKButton"), QString::null, 0, this, 0);
73 confirmButton->addTo(bar); 75 confirmButton->addTo(bar);
74 confirmButton->addTo(mailMenu); 76 confirmButton->addTo(mailMenu);
75 connect( confirmButton, SIGNAL( activated() ), this, SLOT( accept() ) ); 77 connect( confirmButton, SIGNAL( activated() ), this, SLOT( accept() ) );
78 confirmButton->setWhatsThis(tr("This button puts your mail in the send queue"));
76 79
77 newButton = new QAction(tr("New mail"), Resource::loadPixmap("new"), QString::null, 0, this, 0); 80 newButton = new QAction(tr("New mail"), Resource::loadPixmap("new"), QString::null, 0, this, 0);
78 newButton->addTo(mailMenu); 81 newButton->addTo(mailMenu);
79 connect( newButton, SIGNAL( activated() ), this, SLOT( newMail() ) ); 82 connect( newButton, SIGNAL( activated() ), this, SLOT( newMail() ) );
80 83 newButton->setWhatsThis(tr("Click here to create a new mail"));
84
81 widget = new QWidget(this, "widget"); 85 widget = new QWidget(this, "widget");
82 grid = new QGridLayout( widget ); 86 grid = new QGridLayout( widget );
83 87
@@ -88,7 +92,6 @@ void WriteMail::init()
88 grid->addWidget( recipientsBox, 0, 0 ); 92 grid->addWidget( recipientsBox, 0, 0 );
89 connect(recipientsBox,SIGNAL(activated(int)),this, SLOT(changeRecipients(int))); 93 connect(recipientsBox,SIGNAL(activated(int)),this, SLOT(changeRecipients(int)));
90 94
91
92 subjetLabel = new QLabel( widget, "subjetLabel" ); 95 subjetLabel = new QLabel( widget, "subjetLabel" );
93 subjetLabel->setText( tr( "Subject:" ) ); 96 subjetLabel->setText( tr( "Subject:" ) );
94 97
@@ -100,25 +103,28 @@ void WriteMail::init()
100 103
101 subjectInput = new QLineEdit( widget, "subjectInput" ); 104 subjectInput = new QLineEdit( widget, "subjectInput" );
102 grid->addWidget( subjectInput, 1, 1 ); 105 grid->addWidget( subjectInput, 1, 1 );
106 QWhatsThis::add(subjectInput,QWidget::tr("The mail subject should be entered here"));
103 107
104 toInput = new QLineEdit( widget, "toInput" ); 108 toInput = new QLineEdit( widget, "toInput" );
105 grid->addWidget( toInput, 0, 1 ); 109 grid->addWidget( toInput, 0, 1 );
110 QWhatsThis::add(recipientsBox,QWidget::tr("Recipients can be entered here"));
106 111
107 ccInput = new QLineEdit( widget, "ccInput" ); 112 ccInput = new QLineEdit( widget, "ccInput" );
108 ccInput->hide(); 113 ccInput->hide();
109 grid->addWidget( ccInput, 0, 1 ); 114 grid->addWidget( ccInput, 0, 1 );
115 QWhatsThis::add(ccInput,QWidget::tr("If you would like to send copies of your mail they can be entered here"));
110 116
111
112 addressButton = new QToolButton( widget, "addressButton" ); 117 addressButton = new QToolButton( widget, "addressButton" );
113 addressButton->setPixmap( Resource::loadPixmap("AddressBook") ); 118 addressButton->setPixmap( Resource::loadPixmap("AddressBook") );
114 addressButton->setToggleButton(TRUE); 119 addressButton->setToggleButton(TRUE);
115 grid->addWidget( addressButton, 0, 2 ); 120 grid->addWidget( addressButton, 0, 2 );
116 connect(addressButton, SIGNAL(clicked()), this, SLOT(getAddress()) ); 121 connect(addressButton, SIGNAL(clicked()), this, SLOT(getAddress()) );
122 QWhatsThis::add(addressButton,QWidget::tr("This button opens the address selector with all mail adresses from your OPIE addressbook"));
117 123
118 emailInput = new QMultiLineEdit( widget, "emailInput" ); 124 emailInput = new QMultiLineEdit( widget, "emailInput" );
119 grid->addMultiCellWidget( emailInput, 2, 2, 0, 2); 125 grid->addMultiCellWidget( emailInput, 2, 2, 0, 2);
126 QWhatsThis::add(recipientsBox,QWidget::tr("Enter your mail text here"));
120 127
121
122 addressView = new QListView( widget, "addressView"); 128 addressView = new QListView( widget, "addressView");
123 addressView->addColumn("Name"); 129 addressView->addColumn("Name");
124 addressView->addColumn("EMail"); 130 addressView->addColumn("EMail");
@@ -126,11 +132,13 @@ void WriteMail::init()
126 addressView->setMultiSelection(TRUE); 132 addressView->setMultiSelection(TRUE);
127 addressView->hide(); 133 addressView->hide();
128 grid->addMultiCellWidget( addressView, 3, 3, 0, 2); 134 grid->addMultiCellWidget( addressView, 3, 3, 0, 2);
129 135 QWhatsThis::add(recipientsBox,QWidget::tr("Chose the recipients from this list"));
136
130 okButton = new QToolButton(bar, "ok"); 137 okButton = new QToolButton(bar, "ok");
131 okButton->setPixmap( Resource::loadPixmap("enter") ); 138 okButton->setPixmap( Resource::loadPixmap("enter") );
132 okButton->hide(); 139 okButton->hide();
133 connect(okButton, SIGNAL(clicked()), this, SLOT(addRecipients()) ); 140 connect(okButton, SIGNAL(clicked()), this, SLOT(addRecipients()) );
141 QWhatsThis::add(okButton,QWidget::tr("Queue your mail by clicking here"));
134 142
135 setCentralWidget(widget); 143 setCentralWidget(widget);
136} 144}
@@ -143,7 +151,7 @@ void WriteMail::reject()
143// need to insert date 151// need to insert date
144void WriteMail::accept() 152void WriteMail::accept()
145{ 153{
146 QStringList attatchedFiles, attatchmentsType; 154 QStringList attachedFiles, attachmentsType;
147 int idCount = 0; 155 int idCount = 0;
148 156
149 if (toInput->text() == "") 157 if (toInput->text() == "")
@@ -196,13 +204,13 @@ void WriteMail::accept()
196 mail.rawMail += mail.subject; 204 mail.rawMail += mail.subject;
197 mail.rawMail += "\n\n"; 205 mail.rawMail += "\n\n";
198 206
199 attatchedFiles = addAtt->returnAttatchedFiles(); 207 attachedFiles = addAtt->returnattachedFiles();
200 attatchmentsType = addAtt->returnFileTypes(); 208 attachmentsType = addAtt->returnFileTypes();
201 209
202 QStringList::Iterator itType = attatchmentsType.begin(); 210 QStringList::Iterator itType = attachmentsType.begin();
203 211
204 Enclosure e; 212 Enclosure e;
205 for ( QStringList::Iterator it = attatchedFiles.begin(); it != attatchedFiles.end(); ++it ) { 213 for ( QStringList::Iterator it = attachedFiles.begin(); it != attachedFiles.end(); ++it ) {
206 e.id = idCount; 214 e.id = idCount;
207 e.originalName = (*it).latin1(); 215 e.originalName = (*it).latin1();
208 e.contentType = (*itType).latin1(); 216 e.contentType = (*itType).latin1();
@@ -236,7 +244,7 @@ void WriteMail::getAddress()
236 } 244 }
237} 245}
238 246
239void WriteMail::attatchFile() 247void WriteMail::attachFile()
240{ 248{
241 addAtt->showMaximized(); 249 addAtt->showMaximized();
242} 250}
@@ -256,7 +264,7 @@ void WriteMail::reply(Email replyMail, bool replyAll)
256 subjectInput->setText(tr("Re: ") + mail.subject); 264 subjectInput->setText(tr("Re: ") + mail.subject);
257 265
258 pos = 0; 266 pos = 0;
259 mail.body.insert(pos, ">>"); 267 mail.body.insert(pos, ">");
260 while (pos != -1) { 268 while (pos != -1) {
261 pos = mail.body.find('\n', pos); 269 pos = mail.body.find('\n', pos);
262 if (pos != -1) 270 if (pos != -1)