summaryrefslogtreecommitdiff
path: root/noncore/net/mailit/readmail.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mailit/readmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mailit/readmail.cpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/noncore/net/mailit/readmail.cpp b/noncore/net/mailit/readmail.cpp
index dc98a6f..4eae7f6 100644
--- a/noncore/net/mailit/readmail.cpp
+++ b/noncore/net/mailit/readmail.cpp
@@ -38,78 +38,88 @@ ReadMail::~ReadMail()
delete viewAtt;
}
void ReadMail::init()
{
setToolBarsMovable(FALSE);
bar = new QToolBar(this);
bar->setHorizontalStretchable( TRUE );
menu = new QMenuBar( bar );
viewMenu = new QPopupMenu(menu);
menu->insertItem( tr( "&View" ), viewMenu);
mailMenu = new QPopupMenu(menu);
menu->insertItem( tr( "&Mail" ), mailMenu);
bar = new QToolBar(this);
//reply dependant on viewing inbox
replyButton = new QAction( tr( "Reply" ), Resource::loadPixmap( "mailit/reply" ),
QString::null, 0, this, 0 );
connect(replyButton, SIGNAL(activated()), this, SLOT(reply()) );
-
+ replyButton->setWhatsThis(tr("Click here to reply to the selected mail"));
+
forwardButton = new QAction( tr( "Forward" ), Resource::loadPixmap( "mailit/forward" ),
QString::null, 0, this, 0 );
connect(forwardButton, SIGNAL(activated()), this, SLOT(forward()) );
+ forwardButton->setWhatsThis(tr("Click here to forward the selected mail"));
previousButton = new QAction( tr( "Previous" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
connect( previousButton, SIGNAL( activated() ), this, SLOT( previous() ) );
previousButton->addTo(bar);
previousButton->addTo(viewMenu);
+ previousButton->setWhatsThis(tr("Read the previous mail in the list"));
nextButton = new QAction( tr( "Next" ), Resource::loadPixmap( "forward" ), QString::null, 0, this, 0 );
connect( nextButton, SIGNAL( activated() ), this, SLOT( next() ) );
nextButton->addTo(bar);
nextButton->addTo(viewMenu);
+ previousButton->setWhatsThis(tr("Read the next mail in the list"));
- attatchmentsButton = new QAction( tr( "Attatchments" ), Resource::loadPixmap( "mailit/attach" ), QString::null, 0, this, 0 );
- connect( attatchmentsButton, SIGNAL( activated() ), this,
- SLOT( viewAttatchments() ) );
- attatchmentsButton->addTo(bar);
- attatchmentsButton->addTo(viewMenu);
+ attachmentButton = new QAction( tr( "Attatchments" ), Resource::loadPixmap( "mailit/attach" ), QString::null, 0, this, 0 );
+ connect( attachmentButton, SIGNAL( activated() ), this,
+ SLOT( viewAttachments() ) );
+ attachmentButton->addTo(bar);
+ attachmentButton->addTo(viewMenu);
+ attachmentButton->setWhatsThis(tr("Click here to add attachments to your mail"));
plainTextButton = new QAction( tr( "Text Format" ), Resource::loadPixmap( "DocsIcon" ), QString::null, 0, this, 0, TRUE);
connect( plainTextButton, SIGNAL( activated() ), this, SLOT( shiftText() ) );
plainTextButton->addTo(bar);
plainTextButton->addTo(viewMenu);
+ plainTextButton->setWhatsThis(tr("The mail view has 2 modes:\n"
+ "<LI><B>RichText</B> shows the mail as HTML with reach features (no standard line breaks)</LI>"
+ "<LI><B>Plain</B> shows the mail as standard plain text</LI>"
+ "Click here to switch between those view modes" ));
deleteButton = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, 0, this, 0 );
connect( deleteButton, SIGNAL( activated() ), this, SLOT( deleteItem() ) );
deleteButton->addTo(bar);
deleteButton->addTo(mailMenu);
+ deleteButton->setWhatsThis(tr("Click here to remove the selected mail"));
viewMenu->insertItem(Resource::loadPixmap("close"), "Close", this, SLOT(close()));
emailView = new QTextView( this, "emailView" );
setCentralWidget(emailView);
mime = new QMimeSourceFactory();
emailView->setMimeSourceFactory(mime);
}
void ReadMail::updateView()
{
Enclosure *ePtr;
QString mailStringSize;
QString text, temp;
mail->read = TRUE; //mark as read
inbox = mail->received;
replyButton->removeFrom(mailMenu);
replyButton->removeFrom(bar);
forwardButton->removeFrom(mailMenu);
forwardButton->removeFrom(bar);
@@ -227,50 +237,50 @@ void ReadMail::updateView()
text += "\nDate: " + mail->date + "\n";
if (mail->files.count() > 0) {
text += "Attatchments: ";
for ( ePtr=mail->files.first(); ePtr != 0; ePtr=mail->files.next() ) {
text += ePtr->originalName + " ";
}
text += "\n\n";
} else text += "\n";
if (!inbox) {
text += mail->body;
} else if (mail->downloaded) {
text += mail->bodyPlain;
} else {
text += "\nAwaiting download\n";
text += "Size of mail: " + mailStringSize;
}
emailView->setText(text);
}
if (mail->files.count() == 0)
- attatchmentsButton->setEnabled(FALSE);
- else attatchmentsButton->setEnabled(TRUE);
+ attachmentButton->setEnabled(FALSE);
+ else attachmentButton->setEnabled(TRUE);
setCaption("Examining mail: " + mail->subject);
}
//update view with current EmailListItem (item)
void ReadMail::update(QListView *thisView, Email *mailIn)
{
view = thisView;
item = (EmailListItem *) view->selectedItem();
mail = mailIn;
updateView();
updateButtons();
}
void ReadMail::mailUpdated(Email *mailIn)
{
if (mailIn == mail) {
updateView();
} else {
updateButtons();
}
}
void ReadMail::close()
@@ -318,40 +328,40 @@ void ReadMail::deleteItem()
} else close(); //no more items to see
}
void ReadMail::updateButtons()
{
EmailListItem *temp;
temp = item;
if ((EmailListItem *) temp->nextSibling() == NULL)
nextButton->setEnabled(FALSE);
else nextButton->setEnabled(TRUE);
temp = item;
if ((EmailListItem *) temp->itemAbove() == NULL)
previousButton->setEnabled(FALSE);
else previousButton->setEnabled(TRUE);
}
void ReadMail::shiftText()
{
plainTxt = ! plainTxt;
updateView();
}
-void ReadMail::viewAttatchments()
+void ReadMail::viewAttachments()
{
viewAtt->update(mail, inbox);
viewAtt->showMaximized();
}
void ReadMail::reply()
{
emit replyRequested(*mail, (bool&)TRUE);
}
void ReadMail::forward()
{
emit forwardRequested(*mail);
}