First try at forwarding. Quoted forwarding now works.

This commit is contained in:
edwin%woudt.nl 1999-04-19 00:34:28 +00:00
parent 7d1cf44130
commit 968dea3406
4 changed files with 78 additions and 10 deletions

View File

@ -143,7 +143,7 @@ public class Composition extends GeneralFrame {
super.stopAnimation(); super.stopAnimation();
} }
/** Initialize the headers of this composition as being a reply to /** Initialize the headers and body of this composition as being a reply to
the given message. */ the given message. */
public void initializeAsReply(Message msg, boolean replyall) { public void initializeAsReply(Message msg, boolean replyall) {
mCompositionPanel.setReferredMessage(msg); mCompositionPanel.setReferredMessage(msg);
@ -195,6 +195,22 @@ public class Composition extends GeneralFrame {
} }
/** Initialize the headers and body of this composition
as being a message that is forwarded 'quoted'. */
public void initializeAsForward(Message msg) {
mCompositionPanel.setReferredMessage(msg);
MessageExtra mextra = MessageExtraFactory.Get(msg);
try {
mCompositionPanel.setSubject("[Fwd: " + mextra.simplifiedSubject() + "]");
} catch (MessagingException e) {
}
// Quote the original text
mCompositionPanel.QuoteOriginalMessage();
}
class PanelListener implements CompositionPanelListener { class PanelListener implements CompositionPanelListener {
public void sendingMail(ChangeEvent aEvent) { public void sendingMail(ChangeEvent aEvent) {
startAnimation(); startAnimation();

View File

@ -173,6 +173,24 @@ public class FolderPanel extends GeneralPanel {
public static final int kAll = 2; public static final int kAll = 2;
/**
* Forward Quoted
*/
public static final int kQuoted = 0;
/**
* Forward Inline
*/
public static final int kInline = 1;
/**
* Forward as Attachment
*/
public static final int kAttachment = 2;
// //
// Actions that can be enabled/disabled // Actions that can be enabled/disabled
// //
@ -183,6 +201,10 @@ public class FolderPanel extends GeneralPanel {
ReplyAction fReplyAction = new ReplyAction("msgReply", false); ReplyAction fReplyAction = new ReplyAction("msgReply", false);
ReplyAction fReplyAllAction = new ReplyAction("msgReplyAll", true); ReplyAction fReplyAllAction = new ReplyAction("msgReplyAll", true);
ForwardAction fForwardQuoted = new ForwardAction("fwdQuoted", kQuoted);
ForwardAction fForwardInline = new ForwardAction("fwdInline", kInline);
ForwardAction fForwardAttachment = new ForwardAction("fwdAttachment", kAttachment);
MarkAction fMarkMsgReadAction = new MarkAction("markMsgRead", kMessage); MarkAction fMarkMsgReadAction = new MarkAction("markMsgRead", kMessage);
MarkAction fMarkThreadReadAction = new MarkAction("markThreadRead", kThread); MarkAction fMarkThreadReadAction = new MarkAction("markThreadRead", kThread);
MarkAction fMarkAllReadAction = new MarkAction("markAllRead", kAll); MarkAction fMarkAllReadAction = new MarkAction("markAllRead", kAll);
@ -199,6 +221,9 @@ public class FolderPanel extends GeneralPanel {
fThreadAction, fThreadAction,
fReplyAction, fReplyAction,
fReplyAllAction, fReplyAllAction,
fForwardQuoted,
fForwardInline,
fForwardAttachment,
fMarkMsgReadAction, fMarkMsgReadAction,
fMarkThreadReadAction, fMarkThreadReadAction,
fMarkAllReadAction fMarkAllReadAction
@ -886,6 +911,33 @@ public class FolderPanel extends GeneralPanel {
} }
} }
//
// ForwardAction class
//
class ForwardAction extends UIAction {
int fScope;
ForwardAction(String aName, int aScope) {
super(aName);
fScope = aScope;
this.setEnabled(aScope == kQuoted);
}
public void actionPerformed(ActionEvent aEvent) {
Vector selection = getSelectedMessageVector();
if (selection.size() != 1) {
Assert.Assertion(false,
"Need to have exactly one message selected to reply");
}
Composition frame = new Composition();
frame.initializeAsForward((Message) (selection.elementAt(0)));
frame.show();
frame.requestFocus();
}
}
// //
// MarkAction class // MarkAction class
// //

View File

@ -24,9 +24,9 @@ multiMain=multiFile multiEdit multiView multiMessage
multiFile=msgNew folderNew msgOpen msgSaveAs - msgGetNew - appExit multiFile=msgNew folderNew msgOpen msgSaveAs - msgGetNew - appExit
multiEdit=editUndo - editCut editCopy editPaste - folderDelete - appSearch - appPrefs - appRunFilters multiEdit=editUndo - editCut editCopy editPaste - folderDelete - appSearch - appPrefs - appRunFilters
multiView=viewLayout viewSort multiView=viewLayout viewSort
multiMessage=msgNew - msgReply msgReplyAll msgForward msgForwardQuoted - msgMark multiMessage=msgNew - msgReply msgReplyAll msgForward fwdQuoted - msgMark
multiToolBar=msgGetNew msgNew msgReply msgForward print msgDelete stop multiToolBar=msgGetNew msgNew msgReply fwdQuoted print msgDelete stop
#multiToolBar=msgGetNew msgNew msgReply msgDelete #multiToolBar=msgGetNew msgNew msgReply msgDelete
viewLayout=splitTop splitLeft splitRight stacked viewLayout=splitTop splitLeft splitRight stacked
@ -38,9 +38,9 @@ viewLayout=splitTop splitLeft splitRight stacked
messageMain=messageFile messageEdit messageMessage window messageMain=messageFile messageEdit messageMessage window
messageFile=msgSaveAs - appExit messageFile=msgSaveAs - appExit
messageEdit=editUndo - editCut editCopy editPaste editClear - appPrefs messageEdit=editUndo - editCut editCopy editPaste editClear - appPrefs
messageMessage=msgNew - msgReply msgReplyAll msgForward msgForwardQuoted messageMessage=msgNew - msgReply msgReplyAll msgForward fwdQuoted
messageToolBar=msgGetNew msgNew msgReply msgReplyAll msgForward print msgDelete stop messageToolBar=msgGetNew msgNew msgReply msgReplyAll fwdQuoted print msgDelete stop
#messageToolBar=msgGetNew msgNew #messageToolBar=msgGetNew msgNew
@ -51,9 +51,9 @@ messageToolBar=msgGetNew msgNew msgReply msgReplyAll msgForward print msgDelete
folderMain=folderFile folderEdit folderMessage window folderMain=folderFile folderEdit folderMessage window
folderFile=msgNew msgOpen msgSaveAs - msgGetNew - appExit folderFile=msgNew msgOpen msgSaveAs - msgGetNew - appExit
folderEdit=editUndo - editCut editCopy editPaste editClear - appPrefs folderEdit=editUndo - editCut editCopy editPaste editClear - appPrefs
folderMessage=msgNew - msgReply msgReplyAll msgForward msgForwardQuoted folderMessage=msgNew - msgReply msgReplyAll fwdQuoted msgForwardQuoted
folderToolBar=msgGetNew msgNew msgReply msgReplyAll msgForward markAllRead print msgDelete stop folderToolBar=msgGetNew msgNew msgReply msgReplyAll fwdQuoted markAllRead print msgDelete stop
#folderToolBar=msgGetNew msgNew msgDelete msgReply #folderToolBar=msgGetNew msgNew msgDelete msgReply
# #

View File

@ -20,7 +20,7 @@ msgGetNewLabel=Get Msg
msgNewLabel=New Msg msgNewLabel=New Msg
msgReplyLabel=Reply msgReplyLabel=Reply
msgReplyAllLabel=Reply All msgReplyAllLabel=Reply All
msgForwardLabel=Forward fwdQuotedLabel=Forward
markAllReadLabel=Mark Rd markAllReadLabel=Mark Rd
printLabel=Print printLabel=Print
msgDeleteLabel=Delete msgDeleteLabel=Delete
@ -30,7 +30,7 @@ msgGetNewIcon=getmsg
msgNewIcon=newmsg msgNewIcon=newmsg
msgReplyIcon=reply msgReplyIcon=reply
msgReplyAllIcon=replyall msgReplyAllIcon=replyall
msgForwardIcon=forward fwdQuotedIcon=forward
markAllReadIcon=markallread markAllReadIcon=markallread
printIcon=print printIcon=print
msgDeleteIcon=delete msgDeleteIcon=delete
@ -40,7 +40,7 @@ msgGetNewTooltip=Get new messages
msgNewTooltip=Compose a new message msgNewTooltip=Compose a new message
msgReplyTooltip=Reply msgReplyTooltip=Reply
msgReplyAllTooltip=Reply to all recipients msgReplyAllTooltip=Reply to all recipients
msgForwardTooltip=Forward fwdQuotedTooltip=Forward
markAllReadTooltip=Mark all messages read markAllReadTooltip=Mark all messages read
printTooltip=Print this message printTooltip=Print this message
msgDeleteTooltip=Delete this message msgDeleteTooltip=Delete this message