2005-07-07 Helge Hess <helge.hess@opengroupware.org>
- * v0.9.129
+ * v0.9.130
+
+ * UIxMailListView.m: implemented empty-trash action
+ * product.plist: added a reduced toolbar when being on the trash folder
+ (no reply/fwd etc, but added an empty trash button)
+
+2005-07-07 Helge Hess <helge.hess@opengroupware.org>
+
+ * v0.9.129
+
* UIxMailAccountView.m: added code to better display shared accounts
* UIxMailTree.m: moved IMAP4 connection string => label code to a
return [self redirectToLocation:@"view"];
}
+- (id)emptyTrashAction {
+ // TODO: we might want to flush the caches?
+ NSException *error;
+ id client;
+
+ if ((client = [self clientObject]) == nil) {
+ return [NSException exceptionWithHTTPStatus:404 /* Not Found */
+ reason:@"did not find mail folder"];
+ }
+
+ if (![client isKindOfClass:NSClassFromString(@"SOGoTrashFolder")]) {
+ /* would be better to move the method to an own class, but well .. */
+ return [NSException exceptionWithHTTPStatus:400 /* Bad Request */
+ reason:@"method cannot be invoked on "
+ @"the specified object"];
+ }
+
+ /* mark all as deleted */
+
+ [self logWithFormat:@"TODO: must mark all as deleted for empty-trash"];
+
+ error = [[self clientObject] addFlagsToAllMessages:@"deleted"];
+ if (error != nil)
+ // TODO: improve error
+ return error;
+
+ /* expunge */
+
+ if ((error = [[self clientObject] expunge]) != nil)
+ // TODO: improve error
+ return error;
+
+ if ([client respondsToSelector:@selector(flushMailCaches)])
+ [client flushMailCaches];
+ return [self redirectToLocation:@"view"];
+}
+
/* folder operations */
- (id)createFolderAction {
# version file
-SUBMINOR_VERSION:=129
+SUBMINOR_VERSION:=130
# v0.9.100 requires libNGMime v4.5.213
# v0.9.99 requires libNGMime v4.5.212
};
};
+ SOGoTrashFolder = {
+ /* just a new toolbar, other things come from SOGoMailFolder */
+ slots = {
+ toolbar = {
+ protectedBy = "View";
+ value = ( /* the toolbar groups */
+ ( /* first group */
+ {
+ link = "getMail";
+ cssClass = "tbicon_getmail"; label = "Get Mail";
+ },
+ {
+ link = "#"; // "compose"; // target = "_blank";
+ isSafe = NO;
+ onclick = "clickedCompose(this);return false;";
+ cssClass = "tbicon_compose"; label = "Write";
+ },
+ ),
+ ( // third group
+ { link = "emptyTrash"; isSafe = NO;
+ enabled = clientObject.isDeleteAndExpungeAllowed;
+ cssClass = "tbicon_trash"; label = "Empty Trash"; },
+/* TODO: enable when implemented
+// TODO: enable when delete works (#1212)
+ { link = "#"; isSafe = NO;
+ cssClass = "tbicon_delete"; label = "Delete"; },
+// TODO: enable when we know how to mark junk (#971)
+ { link = "#"; isSafe = NO;
+ cssClass = "tbicon_junk"; label = "Junk"; },
+*/
+ ),
+ ( /* fourth group */
+ { link = "#"; cssClass = "tbicon_stop"; label = "Stop"; },
+ ),
+ );
+ };
+ };
+ methods = {
+ emptyTrash = {
+ protectedBy = "View";
+ pageName = "UIxMailListView";
+ actionName = "emptyTrash";
+ };
+ };
+ };
+
SOGoMailObject = {
slots = {
toolbar = {