mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-05 16:35:10 +00:00
Add links to download one or all attachments
Also removed the contextual menu over file attachments and changed the label color when moving over the file attachments.
This commit is contained in:
@@ -47,11 +47,12 @@
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <SOGo/SOGoUserManager.h>
|
||||
#import <SOGoUI/UIxComponent.h>
|
||||
#import <Mailer/SOGoMailObject.h>
|
||||
#import <Mailer/SOGoMailAccount.h>
|
||||
#import <Mailer/SOGoMailFolder.h>
|
||||
#import <SOGoUI/UIxComponent.h>
|
||||
#import <MailPartViewers/UIxMailRenderingContext.h> // cyclic
|
||||
#import <MailPartViewers/UIxMailSizeFormatter.h>
|
||||
|
||||
#import "WOContext+UIxMailer.h"
|
||||
|
||||
@@ -60,6 +61,8 @@
|
||||
id currentAddress;
|
||||
NSString *shouldAskReceipt;
|
||||
NSString *matchingIdentityEMail;
|
||||
NSDictionary *attachment;
|
||||
NSArray *attachmentAttrs;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -80,6 +83,8 @@ static NSString *mailETag = nil;
|
||||
- (void) dealloc
|
||||
{
|
||||
[matchingIdentityEMail release];
|
||||
[attachment release];
|
||||
[attachmentAttrs release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -111,6 +116,16 @@ static NSString *mailETag = nil;
|
||||
[self messageSubject]];
|
||||
}
|
||||
|
||||
- (void) setAttachment: (NSDictionary *) newAttachment
|
||||
{
|
||||
ASSIGN (attachment, newAttachment);
|
||||
}
|
||||
|
||||
- (NSDictionary *) attachment
|
||||
{
|
||||
return attachment;
|
||||
}
|
||||
|
||||
/* links (DUP to UIxMailPartViewer!) */
|
||||
|
||||
- (NSString *) linkToEnvelopeAddress: (NGImap4EnvelopeAddress *) _address
|
||||
@@ -146,6 +161,36 @@ static NSString *mailETag = nil;
|
||||
return [[[self clientObject] replyToEnvelopeAddresses] count] > 0 ? YES : NO;
|
||||
}
|
||||
|
||||
/* attachment helper */
|
||||
|
||||
- (NSArray *) attachmentAttrs
|
||||
{
|
||||
if (!attachmentAttrs)
|
||||
{
|
||||
ASSIGN (attachmentAttrs, [[self clientObject] fetchFileAttachmentKeys]);
|
||||
}
|
||||
|
||||
return attachmentAttrs;
|
||||
}
|
||||
|
||||
- (BOOL) hasAttachments
|
||||
{
|
||||
return [[self attachmentAttrs] count] > 0 ? YES : NO;
|
||||
}
|
||||
|
||||
- (NSFormatter *) sizeFormatter
|
||||
{
|
||||
return [UIxMailSizeFormatter sharedMailSizeFormatter];
|
||||
}
|
||||
|
||||
- (NSString *) attachmentsText
|
||||
{
|
||||
if ([[self attachmentAttrs] count] > 1)
|
||||
return [self labelForKey: @"files"];
|
||||
else
|
||||
return [self labelForKey: @"file"];
|
||||
}
|
||||
|
||||
/* viewers */
|
||||
|
||||
- (id) contentViewerComponent
|
||||
|
||||
Reference in New Issue
Block a user