mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-22 03:45:25 +00:00
@@ -169,6 +169,9 @@
|
||||
/* Filter option in messages list */
|
||||
"Show unread messages only" = "Show unread messages only";
|
||||
|
||||
/* Filter option in messages list */
|
||||
"Show flagged messages only" = "Show flagged messages only";
|
||||
|
||||
/* Tree */
|
||||
"SentFolderName" = "Sent";
|
||||
"TrashFolderName" = "Trash";
|
||||
|
||||
@@ -427,7 +427,7 @@
|
||||
NSArray *filters;
|
||||
NSString *searchBy, *searchInput, *searchString, *match;
|
||||
NSMutableArray *qualifiers, *searchArray;
|
||||
BOOL unseenOnly;
|
||||
BOOL unseenOnly, flaggedOnly;
|
||||
int nbFilters, i;
|
||||
|
||||
request = [context request];
|
||||
@@ -439,6 +439,7 @@
|
||||
match = nil;
|
||||
filters = [content objectForKey: @"filters"];
|
||||
unseenOnly = [[content objectForKey: @"unseenOnly"] boolValue];
|
||||
flaggedOnly = [[content objectForKey: @"flaggedOnly"] boolValue];
|
||||
|
||||
if (filters)
|
||||
{
|
||||
@@ -483,6 +484,11 @@
|
||||
searchQualifier = [EOQualifier qualifierWithQualifierFormat: @"(not (flags = %@))", @"seen"];
|
||||
[qualifiers addObject: searchQualifier];
|
||||
}
|
||||
if (flaggedOnly)
|
||||
{
|
||||
searchQualifier = [EOQualifier qualifierWithQualifierFormat: @"(flags = %@)", @"flagged"];
|
||||
[qualifiers addObject: searchQualifier];
|
||||
}
|
||||
|
||||
if ([qualifiers count] > 1)
|
||||
{
|
||||
|
||||
@@ -73,10 +73,28 @@
|
||||
</md-button>
|
||||
<a href="#" class="sg-folder-name"
|
||||
ng-click="mailbox.searchMode($event)" ng-bind="mailbox.service.selectedFolder.$displayName"><!-- mailbox name --></a>
|
||||
<md-button class="sg-icon-button" label:aria-label="Show unread messages only"
|
||||
ng-click="mailbox.selectedFolder.toggleUnseenOnly()">
|
||||
<md-icon class="md-default-theme md-fg md-primary" ng-class="{ 'md-hue-2': mailbox.selectedFolder.$unseenOnly }" >mark_as_unread</md-icon>
|
||||
</md-button>
|
||||
<md-menu>
|
||||
<md-button class="sg-icon-button" label:aria-label="Filter"
|
||||
ng-click="$mdMenu.open()">
|
||||
<md-icon>filter_list</md-icon>
|
||||
</md-button>
|
||||
<md-menu-content width="4">
|
||||
<md-menu-item>
|
||||
<sg-checkmark
|
||||
ng-change="mailbox.selectedFolder.$filter(mailbox.service.$query)"
|
||||
ng-model="mailbox.selectedFolder.$unseenOnly"
|
||||
sg-true-value="1"
|
||||
sg-false-value="0"> <var:string label:value="Show unread messages only"/></sg-checkmark>
|
||||
</md-menu-item>
|
||||
<md-menu-item>
|
||||
<sg-checkmark
|
||||
ng-change="mailbox.selectedFolder.$filter(mailbox.service.$query)"
|
||||
ng-model="mailbox.selectedFolder.$flaggedOnly"
|
||||
sg-true-value="1"
|
||||
sg-false-value="0"> <var:string label:value="Show flagged messages only"/></sg-checkmark>
|
||||
</md-menu-item>
|
||||
</md-menu-content>
|
||||
</md-menu>
|
||||
<md-menu>
|
||||
<md-button class="sg-icon-button" label:aria-label="Sort"
|
||||
ng-click="$mdMenu.open()">
|
||||
@@ -283,7 +301,12 @@
|
||||
<span ng-switch-when="0"><var:string label:value="No message"/></span>
|
||||
<span ng-switch-default="true"><span ng-bind="mailbox.service.selectedFolder.getLength()"><!-- count --></span> <var:string label:value="messages"/></span>
|
||||
</div>
|
||||
<div class="md-truncate"><md-icon ng-class="{ 'md-flip': mailbox.ascending() }">sort</md-icon> <span ng-bind="mailbox.sort() | loc"><!-- active sort --></span></div>
|
||||
<div class="md-truncate">
|
||||
<span ng-show="mailbox.selectedFolder.$unseenOnly"><var:string label:value="Unread"/></span>
|
||||
<span ng-show="mailbox.selectedFolder.$flaggedOnly"><var:string label:value="Flagged"/></span>
|
||||
<md-icon ng-class="{ 'md-flip': mailbox.ascending() }">sort</md-icon>
|
||||
<span ng-bind="mailbox.sort() | loc"><!-- active sort --></span>
|
||||
</div>
|
||||
</div>
|
||||
</md-subheader>
|
||||
<md-virtual-repeat-container class="md-flex" md-top-index="mailbox.selectedFolder.$topIndex">
|
||||
|
||||
@@ -342,17 +342,6 @@
|
||||
return angular.isDefined(this.$selectedMessage);
|
||||
};
|
||||
|
||||
/**
|
||||
* @function toggleUnseenOnly
|
||||
* @memberof Mailbox.prototype
|
||||
* @desc Toggle filter by unseen messages only. Requires a round trip to the server.
|
||||
*/
|
||||
Mailbox.prototype.toggleUnseenOnly = function() {
|
||||
var _this = this;
|
||||
this.$unseenOnly = !this.$unseenOnly;
|
||||
this.$filter(Mailbox.$query);
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $filter
|
||||
* @memberof Mailbox.prototype
|
||||
@@ -408,6 +397,9 @@
|
||||
if (this.$unseenOnly)
|
||||
options.unseenOnly = 1;
|
||||
|
||||
if (this.$flaggedOnly)
|
||||
options.flaggedOnly = 1;
|
||||
|
||||
// Restart the refresh timer, if needed
|
||||
if (!Mailbox.$virtualMode) {
|
||||
var refreshViewCheck = Mailbox.$Preferences.defaults.SOGoRefreshViewCheck;
|
||||
|
||||
Reference in New Issue
Block a user