From 593118f552528226c9d27649e3accf12633fb7fe Mon Sep 17 00:00:00 2001 From: Patrick Simpson Date: Wed, 4 Jul 2018 12:55:34 +0300 Subject: [PATCH 1/4] [KOE-166] Added support for reminders query on impersonated stores. [KOE-170] No longer checking impersonated stores for shared folders, as they can never exist --- .../AcaciaZPushPlugin/DebugOptions.cs | 1 - .../SharedFolders/FeatureSharedFolders.cs | 30 +- .../Features/SharedFolders/RemindersQuery.cs | 195 ++++++++---- .../SharedFoldersDialog.Designer.cs | 38 ++- .../SharedFolders/SharedFoldersDialog.cs | 82 ++++- .../SharedFolders/SharedFoldersDialog.resx | 279 +++++++++++++----- .../SharedFolders/SharedFoldersManager.cs | 20 +- .../Features/SharedFolders/StoreTreeNode.cs | 29 +- .../AcaciaZPushPlugin/OutlookConstants.cs | 2 + .../AcaciaZPushPlugin/ZPush/ZPushAccount.cs | 18 ++ 10 files changed, 527 insertions(+), 167 deletions(-) diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/DebugOptions.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/DebugOptions.cs index 25bfafb..d7c5109 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/DebugOptions.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/DebugOptions.cs @@ -234,7 +234,6 @@ namespace Acacia return result; } } - } // General diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/FeatureSharedFolders.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/FeatureSharedFolders.cs index 1191a4b..ebf6fc3 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/FeatureSharedFolders.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/FeatureSharedFolders.cs @@ -171,20 +171,28 @@ namespace Acacia.Features.SharedFolders { Logger.Instance.Debug(this, "Starting sync for account {0}", account); - // Fetch the current shares - ICollection shares = manager.GetCurrentShares(null); - Logger.Instance.Trace(this, "AdditionalFolders_Sync: {0}", shares.Count); + if (account.IsShare) + { + Logger.Instance.Debug(this, "Account {0} is a share", account); + manager.UpdateSharedStore(); + } + else + { + // Fetch the current shares + ICollection shares = manager.GetCurrentShares(null); + Logger.Instance.Trace(this, "AdditionalFolders_Sync: {0}", shares.Count); - // Convert to dictionary - Dictionary dict = shares.ToDictionary(x => x.SyncId); - Logger.Instance.Trace(this, "AdditionalFolders_Sync2: {0}", shares.Count); + // Convert to dictionary + Dictionary dict = shares.ToDictionary(x => x.SyncId); + Logger.Instance.Trace(this, "AdditionalFolders_Sync2: {0}", shares.Count); - // Store any send-as properties - FeatureSendAs sendAs = ThisAddIn.Instance.GetFeature(); - sendAs?.UpdateSendAsAddresses(account, shares); + // Store any send-as properties + FeatureSendAs sendAs = ThisAddIn.Instance.GetFeature(); + sendAs?.UpdateSendAsAddresses(account, shares); - // Store with the account - account.SetFeatureData(this, KEY_SHARES, dict); + // Store with the account + account.SetFeatureData(this, KEY_SHARES, dict); + } } } diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/RemindersQuery.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/RemindersQuery.cs index f6d4966..88a975b 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/RemindersQuery.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/RemindersQuery.cs @@ -10,16 +10,14 @@ using System.Threading.Tasks; namespace Acacia.Features.SharedFolders { - public class RemindersQuery : DisposableWrapper, LogContext + public abstract class RemindersQuery : DisposableWrapper, LogContext { - private static readonly SearchQuery.PropertyIdentifier PROP_FOLDER = new SearchQuery.PropertyIdentifier(PropTag.FromInt(0x6B20001F)); + protected static readonly SearchQuery.PropertyIdentifier PROP_FOLDER = new SearchQuery.PropertyIdentifier(PropTag.FromInt(0x6B20001F)); private readonly FeatureSharedFolders _feature; private readonly IFolder _folder; - private SearchQuery _queryRoot; - private SearchQuery.Or _queryCustomShared; - private SearchQuery.Or _queryCustomConfigured; - private bool _queryCustomModified; + protected SearchQuery _queryRoot; + protected bool _queryCustomModified; public RemindersQuery(FeatureSharedFolders feature, IStore store) { @@ -27,10 +25,68 @@ namespace Acacia.Features.SharedFolders this._folder = store.GetSpecialFolder(SpecialFolder.Reminders); } - public bool Open() + abstract public bool Open(); + + + public string LogContextId + { + get + { + return _feature.LogContextId; + } + } + + protected override void DoRelease() + { + _folder.Dispose(); + } + + public void Commit() + { + if (_queryCustomModified) + { + FolderQuery = _queryRoot; + _queryCustomModified = false; + } + } + + protected SearchQuery FolderQuery + { + get + { + return _folder.SearchCriteria; + } + set + { + if (!_feature.RemindersKeepRunning) + _folder.SearchRunning = false; + + _folder.SearchCriteria = value; + + if (!_feature.RemindersKeepRunning) + _folder.SearchRunning = true; + } + } + + } + + public class RemindersQueryFolders : RemindersQuery + { + // Custom query for shared (S) and configured (C) folders + private SearchQuery.Or _queryCustomShared; + private SearchQuery.Or _queryCustomConfigured; + + public RemindersQueryFolders(FeatureSharedFolders feature, IStore store) + : + base(feature, store) + { + } + + override public bool Open() { if (_queryCustomShared != null && _queryCustomConfigured != null) return true; + try { _queryRoot = FolderQuery; @@ -80,6 +136,7 @@ namespace Acacia.Features.SharedFolders return _queryCustomShared != null && _queryCustomConfigured != null; } + private SearchQuery.Or AddCustomQuery(SearchQuery.And root, string prefix) { SearchQuery.Or custom = new SearchQuery.Or(); @@ -96,51 +153,10 @@ namespace Acacia.Features.SharedFolders root.Operands.Add(custom); return custom; } - - public string LogContextId - { - get - { - return _feature.LogContextId; - } - } - - protected override void DoRelease() - { - _folder.Dispose(); - } - - public void Commit() - { - if (_queryCustomModified) - { - FolderQuery = _queryRoot; - _queryCustomModified = false; - } - } - - private SearchQuery FolderQuery - { - get - { - return _folder.SearchCriteria; - } - set - { - if (!_feature.RemindersKeepRunning) - _folder.SearchRunning = false; - - _folder.SearchCriteria = value; - - if (!_feature.RemindersKeepRunning) - _folder.SearchRunning = true; - } - } - public void UpdateReminders(SyncId folderId, bool wantReminders) { Logger.Instance.Trace(this, "Setting reminders for folder {0}: {1} ({2})", wantReminders, folderId, folderId?.Kind); - switch(folderId.Kind) + switch (folderId.Kind) { case SyncKind.Configured: UpdateReminders(_queryCustomConfigured, folderId, wantReminders); @@ -214,7 +230,7 @@ namespace Acacia.Features.SharedFolders } private void RemoveStaleReminders(ISet prefixes, SearchQuery.Or query) - { + { // Remove all operands for which we do not want the prefix for (int i = 0; i < query.Operands.Count;) { @@ -244,5 +260,84 @@ namespace Acacia.Features.SharedFolders return null; return folderId.ToString() + ":"; } + + } + + public class RemindersQueryStore : RemindersQuery + { + private SearchQuery.Not _queryCustomShared; + + public RemindersQueryStore(FeatureSharedFolders feature, IStore store) : base(feature, store) + { + } + + public override bool Open() + { + if (_queryCustomShared != null) + return true; + + try + { + _queryRoot = FolderQuery; + if (!(_queryRoot is SearchQuery.And)) + return false; + Logger.Instance.Debug(this, "Current query:\n{0}", _queryRoot.ToString()); + + SearchQuery.And root = (SearchQuery.And)_queryRoot; + // TODO: more strict checking of query + // Remove old shared folders query if present + if ((root.Operands.Count == 3 || root.Operands.Count == 5) && root.Operands.ElementAt(2) is SearchQuery.Or) + { + while (root.Operands.Count > 2) + { + root.Operands.RemoveAt(2); + } + } + + if (root.Operands.Count == 3) + { + _queryCustomShared = (SearchQuery.Not)root.Operands.ElementAt(2); + } + else + { + SetReminders(false); // Default to false + root.Operands.Add(_queryCustomShared); + } + + Logger.Instance.Debug(this, "Modified query:\n{0}", root.ToString()); + // Store it + FolderQuery = root; + Logger.Instance.Debug(this, "Modified query readback:\n{0}", FolderQuery); + } + catch (Exception e) + { + Logger.Instance.Error(this, "Exception in Open: {0}", e); + } + return _queryCustomShared != null; + } + + public void SetReminders(bool showReminders) + { + // We do not have support for constants in queries, so use a prefix match (which will always be I for impersonated stores) + // with an unmatchable prefix instead. + // It's wrapped in a NOT, to allow updating that operand rather than the main query + SearchQuery.PropertyContent filter = new SearchQuery.PropertyContent( + PROP_FOLDER, SearchQuery.ContentMatchOperation.Prefix, SearchQuery.ContentMatchModifiers.None, showReminders ? "X" : "I" + ); + + // Check current state + if (_queryCustomShared != null) + { + if (((SearchQuery.PropertyContent)_queryCustomShared.Operand).Content.Equals(filter.Content)) + return; + } + + // Update the filter + if (_queryCustomShared == null) + _queryCustomShared = new SearchQuery.Not(filter); + else + _queryCustomShared.Operand = filter; + _queryCustomModified = true; + } } } diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.Designer.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.Designer.cs index 852ab3e..9eb9085 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.Designer.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.Designer.cs @@ -38,6 +38,8 @@ this.buttonOpenUser = new System.Windows.Forms.Button(); this.kTreeFolders = new Acacia.Controls.KTree(); this._layoutOptions = new System.Windows.Forms.TableLayoutPanel(); + this._labelWholeStoreReminders = new System.Windows.Forms.Label(); + this.checkWholeStoreReminders = new System.Windows.Forms.CheckBox(); this._labelWholeStore = new System.Windows.Forms.Label(); this.checkWholeStore = new System.Windows.Forms.CheckBox(); this.labelPermissionsValue = new System.Windows.Forms.Label(); @@ -137,21 +139,35 @@ // _layoutOptions // resources.ApplyResources(this._layoutOptions, "_layoutOptions"); + this._layoutOptions.Controls.Add(this._labelWholeStoreReminders, 0, 1); + this._layoutOptions.Controls.Add(this.checkWholeStoreReminders, 1, 1); this._layoutOptions.Controls.Add(this._labelWholeStore, 0, 0); this._layoutOptions.Controls.Add(this.checkWholeStore, 1, 0); - this._layoutOptions.Controls.Add(this.labelPermissionsValue, 1, 5); - this._layoutOptions.Controls.Add(this._labelName, 0, 1); - this._layoutOptions.Controls.Add(this.textName, 1, 1); - this._layoutOptions.Controls.Add(this._labelSendAs, 0, 2); - this._layoutOptions.Controls.Add(this.checkSendAs, 1, 2); - this._layoutOptions.Controls.Add(this._labelSendAsAddress, 0, 3); - this._layoutOptions.Controls.Add(this.textSendAsAddress, 1, 3); - this._layoutOptions.Controls.Add(this._labelReminders, 0, 4); - this._layoutOptions.Controls.Add(this.checkReminders, 1, 4); - this._layoutOptions.Controls.Add(this._labelPermissions, 0, 5); + this._layoutOptions.Controls.Add(this.labelPermissionsValue, 1, 6); + this._layoutOptions.Controls.Add(this._labelName, 0, 2); + this._layoutOptions.Controls.Add(this.textName, 1, 2); + this._layoutOptions.Controls.Add(this._labelSendAs, 0, 3); + this._layoutOptions.Controls.Add(this.checkSendAs, 1, 3); + this._layoutOptions.Controls.Add(this._labelSendAsAddress, 0, 4); + this._layoutOptions.Controls.Add(this.textSendAsAddress, 1, 4); + this._layoutOptions.Controls.Add(this._labelReminders, 0, 5); + this._layoutOptions.Controls.Add(this.checkReminders, 1, 5); + this._layoutOptions.Controls.Add(this._labelPermissions, 0, 6); this._layoutOptions.Controls.Add(this._labelRestartRequired, 2, 0); this._layoutOptions.Name = "_layoutOptions"; // + // _labelWholeStoreReminders + // + resources.ApplyResources(this._labelWholeStoreReminders, "_labelWholeStoreReminders"); + this._labelWholeStoreReminders.Name = "_labelWholeStoreReminders"; + // + // checkWholeStoreReminders + // + resources.ApplyResources(this.checkWholeStoreReminders, "checkWholeStoreReminders"); + this.checkWholeStoreReminders.Name = "checkWholeStoreReminders"; + this.checkWholeStoreReminders.UseVisualStyleBackColor = true; + this.checkWholeStoreReminders.CheckedChanged += new System.EventHandler(this.checkWholeStoreReminders_CheckedChanged); + // // _labelWholeStore // resources.ApplyResources(this._labelWholeStore, "_labelWholeStore"); @@ -288,5 +304,7 @@ private System.Windows.Forms.Label _labelRestartRequired; private System.Windows.Forms.Label _labelSendAsAddress; private System.Windows.Forms.TextBox textSendAsAddress; + private System.Windows.Forms.Label _labelWholeStoreReminders; + private System.Windows.Forms.CheckBox checkWholeStoreReminders; } } \ No newline at end of file diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.cs index 485d27d..0b02490 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.cs @@ -194,18 +194,18 @@ namespace Acacia.Features.SharedFolders // Add public folders Dictionary publicShares; shares.TryGetValue(GABUser.USER_PUBLIC, out publicShares); - AddUserFolders(GABUser.USER_PUBLIC, false, publicShares, false); + AddUserFolders(GABUser.USER_PUBLIC, null, publicShares, false); // Add shared stores foreach (ZPushAccount shared in _account.SharedAccounts) { - AddUserFolders(new GABUser(shared.ShareUserName), true, null, false); + AddUserFolders(new GABUser(shared.ShareUserName), shared, null, false); } // Add any users for which we have shared folders foreach (KeyValuePair> entry in shares.OrderBy(x => x.Key.DisplayName)) if (GABUser.USER_PUBLIC != entry.Key) - AddUserFolders(entry.Key, false, entry.Value, false); + AddUserFolders(entry.Key, null, entry.Value, false); } finally { @@ -352,6 +352,8 @@ namespace Acacia.Features.SharedFolders ctx.AddBusy(-state.folders); + List syncAdditional = new List(); + // Handle stores if (state.stores.Count > 0) { @@ -362,7 +364,23 @@ namespace Acacia.Features.SharedFolders { if (store.WantShare) { - add.Add(store); + // Check if it must be added + if (!store.IsShared) + add.Add(store); + + // Update reminders for existing stores + if (store.ShowReminders != store.ShowRemindersInitial) + { + ZPushAccount storeAccount = store.WholeStoreAccount; + if (storeAccount != null) + { + storeAccount.ShowReminders = store.ShowReminders; + syncAdditional.Add(storeAccount); + // Update UI state + store.ShowRemindersInitial = store.ShowReminders; + WholeStoreShareChanged(store); + } + } continue; } else @@ -406,6 +424,10 @@ namespace Acacia.Features.SharedFolders CheckDirty(); } + // Sync accounts + foreach (ZPushAccount account in syncAdditional) + _feature.Sync(account); + if (state.folders != 0) { // Sync account @@ -432,7 +454,7 @@ namespace Acacia.Features.SharedFolders private void buttonOpenUser_Click(object sender, EventArgs e) { - AddUserFolders(gabLookup.SelectedUser, false, null, true); + AddUserFolders(gabLookup.SelectedUser, null, null, true); } private void gabLookup_SelectedUserChanged(object source, GABLookupControl.SelectedUserEventArgs e) @@ -441,7 +463,7 @@ namespace Acacia.Features.SharedFolders if (e.IsChosen) { - AddUserFolders(e.SelectedUser, false, null, true); + AddUserFolders(e.SelectedUser, null, null, true); } } @@ -459,7 +481,7 @@ namespace Acacia.Features.SharedFolders private readonly Dictionary _userFolders = new Dictionary(); - private void AddUserFolders(GABUser user, bool wholeStore, Dictionary currentShares, bool select) + private void AddUserFolders(GABUser user, ZPushAccount wholeStore, Dictionary currentShares, bool select) { if (user == null) return; @@ -480,7 +502,8 @@ namespace Acacia.Features.SharedFolders node = new StoreTreeNode(_folders, gabLookup.GAB, user, sendAsAddress, user.DisplayName, currentShares ?? new Dictionary(), - wholeStore); + wholeStore != null, + wholeStore?.ShowReminders == true); node.DirtyChanged += UserSharesChanged; node.CheckStateChanged += WholeStoreShareChanged; _userFolders.Add(user, node); @@ -646,6 +669,22 @@ namespace Acacia.Features.SharedFolders } private readonly List _optionWholeStoreNodes = new List(); private readonly List _optionWholeStoreNodesInitial = new List(); + private CheckState? OptionWholeStoreReminders + { + get + { + if (checkWholeStoreReminders.Visible) + return checkWholeStoreReminders.CheckState; + return null; + } + + set + { + _labelWholeStoreReminders.Visible = checkWholeStoreReminders.Visible = value != null; + if (value != null) + checkWholeStoreReminders.CheckState = value.Value; + } + } private void ShowOptions(KTreeNode[] nodes) { @@ -667,6 +706,7 @@ namespace Acacia.Features.SharedFolders OptionReminders = null; OptionPermissions = null; OptionWholeStore = null; + OptionWholeStoreReminders = null; bool readOnly = false; bool haveStoreNodes = false; bool haveFolderNodes = false; @@ -749,7 +789,6 @@ namespace Acacia.Features.SharedFolders _labelRestartRequired.Visible = isShared && !wasShared; } - } else { @@ -846,6 +885,7 @@ namespace Acacia.Features.SharedFolders private void checkWholeStore_CheckedChanged(object sender, EventArgs e) { + CheckState? reminders = null; for (int i = 0; i < _optionWholeStoreNodes.Count; ++i) { StoreTreeNode node = _optionWholeStoreNodes[i]; @@ -857,8 +897,32 @@ namespace Acacia.Features.SharedFolders case CheckState.Unchecked: wholeStore = false; break; } + if (wholeStore) + { + CheckState remindersCheck = node.ShowReminders? CheckState.Checked: CheckState.Unchecked; + if (reminders == null) + reminders = remindersCheck; + else if (reminders.Value != remindersCheck) + reminders = CheckState.Indeterminate; + } node.WantShare = wholeStore; } + + OptionWholeStoreReminders = reminders; + } + private void checkWholeStoreReminders_CheckedChanged(object sender, EventArgs e) + { + for (int i = 0; i < _optionWholeStoreNodes.Count; ++i) + { + StoreTreeNode node = _optionWholeStoreNodes[i]; + switch (checkWholeStoreReminders.CheckState) + { + case CheckState.Checked: node.ShowReminders = true; break; + case CheckState.Indeterminate: node.ShowReminders = node.ShowRemindersInitial; break; + case CheckState.Unchecked: node.ShowReminders = false; break; + } + WholeStoreShareChanged(node); + } } private void checkSendAs_CheckedChanged(object sender, EventArgs e) diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.resx b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.resx index e546473..1de5b21 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.resx +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.resx @@ -145,10 +145,13 @@ - 3, 0 + 4, 0 + + + 4, 0, 4, 0 - 105, 29 + 158, 40 0 @@ -175,10 +178,13 @@ Fill - 114, 3 + 170, 5 + + + 4, 5, 4, 5 - 200, 0 + 300, 0 The user was not found @@ -187,7 +193,7 @@ Start typing name - 260, 23 + 401, 30 1 @@ -220,13 +226,16 @@ NoControl - 380, 3 + 579, 5 + + + 4, 5, 4, 5 - 8, 0, 8, 0 + 12, 0, 12, 0 - 59, 23 + 82, 30 2 @@ -250,13 +259,16 @@ Fill - 3, 3 + 4, 5 + + + 4, 5, 4, 5 1 - 442, 29 + 665, 40 0 @@ -274,16 +286,19 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelSelectUser" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="gabLookup" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="buttonOpenUser" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="Percent,100,Absolute,29" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelSelectUser" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="gabLookup" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="buttonOpenUser" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="Percent,100,Absolute,40" /></TableLayoutSettings> Fill - 3, 38 + 4, 55 + + + 4, 5, 4, 5 - 442, 224 + 665, 313 1 @@ -309,6 +324,81 @@ 3 + + True + + + Fill + + + NoControl + + + 4, 52 + + + 4, 0, 4, 0 + + + 133, 42 + + + 13 + + + Show reminders + + + MiddleLeft + + + _labelWholeStoreReminders + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + _layoutOptions + + + 0 + + + True + + + Left + + + NoControl + + + 150, 58 + + + 9, 6, 4, 5 + + + 0, 5, 0, 5 + + + 22, 31 + + + 14 + + + checkWholeStoreReminders + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + _layoutOptions + + + 1 + True @@ -319,13 +409,16 @@ MiddleLeft - 3, 0 + 4, 0 + + + 4, 0, 4, 0 - 0, 4, 0, 3 + 0, 6, 0, 5 - 90, 27 + 133, 52 5 @@ -346,7 +439,7 @@ _layoutOptions - 0 + 2 True @@ -358,16 +451,16 @@ NoControl - 102, 4 + 150, 6 - 6, 4, 3, 3 + 9, 6, 4, 5 - 0, 3, 0, 3 + 0, 5, 0, 5 - 15, 20 + 22, 41 9 @@ -382,7 +475,7 @@ _layoutOptions - 1 + 3 True @@ -394,10 +487,13 @@ NoControl - 99, 133 + 145, 250 + + + 4, 0, 4, 0 - 346, 20 + 524, 31 8 @@ -415,7 +511,7 @@ _layoutOptions - 2 + 4 True @@ -424,10 +520,13 @@ Fill - 3, 27 + 4, 94 + + + 4, 0, 4, 0 - 90, 26 + 133, 36 0 @@ -448,19 +547,19 @@ _layoutOptions - 3 + 5 Fill - 102, 30 + 150, 99 - 6, 3, 3, 3 + 9, 5, 4, 5 - 343, 20 + 519, 26 0 @@ -475,7 +574,7 @@ _layoutOptions - 4 + 6 True @@ -484,10 +583,13 @@ Fill - 3, 53 + 4, 130 + + + 4, 0, 4, 0 - 90, 27 + 133, 42 2 @@ -508,7 +610,7 @@ _layoutOptions - 5 + 7 True @@ -517,16 +619,16 @@ Left - 102, 57 + 150, 136 - 6, 4, 3, 3 + 9, 6, 4, 5 - 0, 3, 0, 3 + 0, 5, 0, 5 - 15, 20 + 22, 31 3 @@ -541,7 +643,7 @@ _layoutOptions - 6 + 8 True @@ -553,10 +655,13 @@ NoControl - 3, 80 + 4, 172 + + + 4, 0, 4, 0 - 90, 26 + 133, 36 11 @@ -577,19 +682,19 @@ _layoutOptions - 7 + 9 Fill - 102, 83 + 150, 177 - 6, 3, 3, 3 + 9, 5, 4, 5 - 343, 20 + 519, 26 12 @@ -604,7 +709,7 @@ _layoutOptions - 8 + 10 True @@ -613,10 +718,13 @@ Fill - 3, 106 + 4, 208 + + + 4, 0, 4, 0 - 90, 27 + 133, 42 6 @@ -637,7 +745,7 @@ _layoutOptions - 9 + 11 True @@ -646,16 +754,16 @@ Left - 102, 110 + 150, 214 - 6, 4, 3, 3 + 9, 6, 4, 5 - 0, 3, 0, 3 + 0, 5, 0, 5 - 15, 20 + 22, 31 7 @@ -670,7 +778,7 @@ _layoutOptions - 10 + 12 True @@ -679,13 +787,16 @@ Fill - 3, 133 + 4, 250 + + + 4, 0, 4, 0 - 0, 4, 0, 3 + 0, 6, 0, 5 - 90, 20 + 133, 31 4 @@ -706,16 +817,19 @@ _layoutOptions - 11 + 13 Fill - 123, 0 + 180, 0 + + + 4, 0, 4, 0 - 322, 27 + 489, 52 10 @@ -739,22 +853,22 @@ _layoutOptions - 12 + 14 Fill - 0, 265 + 0, 373 0, 0, 0, 0 - 6 + 7 - 448, 153 + 673, 281 2 @@ -772,7 +886,7 @@ 2 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="_labelWholeStore" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkWholeStore" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelPermissionsValue" Row="5" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="_labelName" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textName" Row="1" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="_labelSendAs" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkSendAs" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="_labelSendAsAddress" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textSendAsAddress" Row="3" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="_labelReminders" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkReminders" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="_labelPermissions" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="_labelRestartRequired" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0,Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="_labelWholeStoreReminders" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkWholeStoreReminders" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="_labelWholeStore" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkWholeStore" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelPermissionsValue" Row="6" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="_labelName" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textName" Row="2" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="_labelSendAs" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkSendAs" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="_labelSendAsAddress" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textSendAsAddress" Row="4" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="_labelReminders" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkReminders" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="_labelPermissions" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="_labelRestartRequired" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0,Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Absolute,20" /></TableLayoutSettings> Fill @@ -780,11 +894,14 @@ 0, 0 + + 4, 5, 4, 5 + 3 - 448, 418 + 673, 654 0 @@ -808,10 +925,13 @@ Fill - 3, 3 + 4, 5 + + + 4, 5, 4, 5 - 448, 418 + 673, 654 0 @@ -841,13 +961,13 @@ Fill - 2, 425 + 3, 666 - 2, 1, 2, 1 + 3, 2, 3, 2 - 450, 35 + 675, 42 1 @@ -868,7 +988,7 @@ Fill - 6, 6 + 9, 9 0, 0, 0, 0 @@ -877,7 +997,7 @@ 2 - 454, 461 + 681, 710 0 @@ -895,22 +1015,19 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="_mainBusyHider" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="dialogButtons" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Percent,100,AutoSize,0,Absolute,20" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="_mainBusyHider" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="dialogButtons" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Percent,100,AutoSize,0,Absolute,31" /></TableLayoutSettings> True - 6, 13 + 9, 20 - 466, 473 - - - 2, 2, 2, 2 + 699, 728 - 6, 6, 6, 6 + 9, 9, 9, 9 CenterParent diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersManager.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersManager.cs index 7947813..7521814 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersManager.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersManager.cs @@ -98,7 +98,7 @@ namespace Acacia.Features.SharedFolders UpdateReminders(shares); // Remove any reminders from the shares that are not wanted, they are stale - OpenQuery()?.RemoveStaleReminders( + ((RemindersQueryFolders) OpenQuery())?.RemoveStaleReminders( shares .Where(x => x.IsSynced && x.SyncType.IsAppointment() && x.FlagCalendarReminders) .Select(x => x.SyncId) @@ -126,6 +126,18 @@ namespace Acacia.Features.SharedFolders return _api.GetUserFolders(store); } + public void UpdateSharedStore() + { + Logger.Instance.Debug(this, "Updating shared store: {0}", _account); + RemindersQuery query = OpenQuery(); + if (query != null) + { + Logger.Instance.Debug(this, "Updating shared store reminders: {0}", query); + ((RemindersQueryStore)query).SetReminders(_account.ShowReminders); + query.Commit(); + } + } + #endregion #region Reminders @@ -139,7 +151,7 @@ namespace Acacia.Features.SharedFolders Logger.Instance.Debug(this, "UpdateReminders: {0}", share); if (share.IsSynced && share.SyncType.IsAppointment()) { - OpenQuery()?.UpdateReminders(share.SyncId, share.FlagCalendarReminders); + ((RemindersQueryFolders)OpenQuery())?.UpdateReminders(share.SyncId, share.FlagCalendarReminders); } } } @@ -151,7 +163,9 @@ namespace Acacia.Features.SharedFolders { if (_feature.Reminders) { - RemindersQuery query = new RemindersQuery(_feature, _account.Account.Store); + RemindersQuery query = _account.IsShare + ? (RemindersQuery)new RemindersQueryStore(_feature, _account.Account.Store) + : (RemindersQuery)new RemindersQueryFolders(_feature, _account.Account.Store); if (query.Open()) { _query = query; diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/StoreTreeNode.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/StoreTreeNode.cs index 0f6926f..8810fec 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/StoreTreeNode.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/StoreTreeNode.cs @@ -66,8 +66,19 @@ namespace Acacia.Features.SharedFolders } } + public bool ShowReminders + { + get; + set; + } + public bool ShowRemindersInitial + { + get; + set; + } + public StoreTreeNode(SharedFoldersManager folders, GABHandler gab, GABUser user, string sendAsAddress, string text, - Dictionary currentFolders, bool isShared) + Dictionary currentFolders, bool isShared, bool showRemindersWholeStore) : base(text) { @@ -109,6 +120,8 @@ namespace Acacia.Features.SharedFolders // Set up sharing WantShare = isShared; + ShowRemindersInitial = showRemindersWholeStore; + ShowReminders = ShowRemindersInitial; } private static void ApplyReadOnly(KTreeNode node, bool isReadOnly) @@ -148,6 +161,18 @@ namespace Acacia.Features.SharedFolders } } + public ZPushAccount WholeStoreAccount + { + get + { + if (IsShared) + { + return _account.FindSharedAccount(_user.UserName); + } + return null; + } + } + #region Share management /// @@ -289,7 +314,7 @@ namespace Acacia.Features.SharedFolders { get { - return WantShare != IsShared; + return WantShare != IsShared || ShowReminders != ShowRemindersInitial; } } diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/OutlookConstants.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/OutlookConstants.cs index 5364aab..50ae04f 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/OutlookConstants.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/OutlookConstants.cs @@ -46,6 +46,8 @@ namespace Acacia public const string REG_VAL_REPLY_FORWARD_SIGNATURE = "Reply-Forward Signature"; public const string REG_VAL_CURRENT_SIGNATURE = "KOE Signature Digest"; + public const string REG_VAL_SHOW_REMINDERS = "KOE Reminders"; + public const string REG_VAL_SYNC_TIMEFRAME = "KOE SyncTimeFrame"; public const string REG_VAL_SYNC_SLIDER = "EAS SyncSlider"; public const string REG_VAL_NEXT_ACCOUNT_ID = "NextAccountID"; diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ZPush/ZPushAccount.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ZPush/ZPushAccount.cs index 5be9a85..5b14eff 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ZPush/ZPushAccount.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ZPush/ZPushAccount.cs @@ -222,6 +222,11 @@ namespace Acacia.ZPush } } + public bool IsShare + { + get { return ShareFor != null; } + } + public string ShareUserName { get @@ -289,6 +294,19 @@ namespace Acacia.ZPush return null; } + public bool ShowReminders + { + get + { + return RegistryUtil.GetValueDword(Account.RegistryBaseKey, OutlookConstants.REG_VAL_SHOW_REMINDERS, 1) != 0; + } + + set + { + RegistryUtil.SetValueDword(Account.RegistryBaseKey, OutlookConstants.REG_VAL_SHOW_REMINDERS, value ? 1 : 0); + } + } + #endregion #region Signatures From 1e92f75fe48d26d8ba8c426136ec831615a7f9c7 Mon Sep 17 00:00:00 2001 From: Patrick Simpson Date: Wed, 4 Jul 2018 13:28:52 +0300 Subject: [PATCH 2/4] [KOE-166] Added reminders option to EASAccount for initial setup. [KOE-166] Added private appointment suppression to impersonated stores --- .../SharedFolders/FeatureSharedFolders.cs | 6 ++-- .../Features/SharedFolders/RemindersQuery.cs | 2 +- .../SharedFolders/SharedFoldersDialog.cs | 2 +- .../AcaciaZPushPlugin/Stubs/IRestarter.cs | 2 +- .../Stubs/OutlookWrappers/Restarter.cs | 28 +++++++++++++------ .../EASAccount/EASAccount.cpp | 20 ++++++++++--- 6 files changed, 41 insertions(+), 19 deletions(-) diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/FeatureSharedFolders.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/FeatureSharedFolders.cs index ebf6fc3..59e573d 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/FeatureSharedFolders.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/FeatureSharedFolders.cs @@ -234,10 +234,10 @@ namespace Acacia.Features.SharedFolders return share; } - public static bool IsSharedFolder(IFolder folder) + public static bool IsSharedOrImpersonatedFolder(IFolder folder) { string id = (string)folder.GetProperty(OutlookConstants.PR_ZPUSH_SYNC_ID); - return id?.StartsWith("S") == true; + return id?.StartsWith("S") == true || id?.StartsWith("I") == true; } #endregion @@ -324,7 +324,7 @@ namespace Acacia.Features.SharedFolders // Check if in a shared folder using (IFolder parent = item.Parent) { - if (parent == null || !IsSharedFolder(parent)) + if (parent == null || !IsSharedOrImpersonatedFolder(parent)) { Logger.Instance.TraceExtra(this, "Private appointment: suppress: not in a shared folder"); return; diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/RemindersQuery.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/RemindersQuery.cs index 88a975b..22a81c5 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/RemindersQuery.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/RemindersQuery.cs @@ -54,7 +54,7 @@ namespace Acacia.Features.SharedFolders { get { - return _folder.SearchCriteria; + return _folder?.SearchCriteria; } set { diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.cs index 0b02490..cf10988 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.cs @@ -414,7 +414,7 @@ namespace Acacia.Features.SharedFolders IRestarter restarter = ThisAddIn.Instance.Restarter(); restarter.CloseWindows = true; foreach (StoreTreeNode node in state.stores) - restarter.OpenShare(_account, node.User); + restarter.OpenShare(_account, node.User, node.ShowReminders); restarter.Restart(); } diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Stubs/IRestarter.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Stubs/IRestarter.cs index ccafb2a..df2b89d 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Stubs/IRestarter.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Stubs/IRestarter.cs @@ -25,7 +25,7 @@ namespace Acacia.Stubs /// /// /// - void OpenShare(ZPushAccount account, GABUser store); + void OpenShare(ZPushAccount account, GABUser store, bool showReminders); /// /// Performs the actual restart. diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Stubs/OutlookWrappers/Restarter.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Stubs/OutlookWrappers/Restarter.cs index c208d76..5378420 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Stubs/OutlookWrappers/Restarter.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Stubs/OutlookWrappers/Restarter.cs @@ -15,7 +15,14 @@ namespace Acacia.Stubs.OutlookWrappers { private readonly AddInWrapper _addIn; private readonly List _resyncAccounts = new List(); - private readonly List> _shares = new List>(); + + private struct Share + { + public ZPushAccount account; + public GABUser store; + public bool showReminders; + } + private readonly List _shares = new List(); public Restarter(AddInWrapper addIn) { @@ -46,9 +53,12 @@ namespace Acacia.Stubs.OutlookWrappers _resyncAccounts.AddRange(accounts); } - public void OpenShare(ZPushAccount account, GABUser store) + public void OpenShare(ZPushAccount account, GABUser store, bool showReminders) { - _shares.Add(new KeyValuePair(account, store)); + _shares.Add(new Share() + { + account = account, store = store, showReminders = showReminders + }); } public void Restart() @@ -75,16 +85,16 @@ namespace Acacia.Stubs.OutlookWrappers if (_shares.Count > 0) { - foreach (KeyValuePair share in _shares) + foreach (Share share in _shares) { - Logger.Instance.Debug(this, "Adding KOE share: profile={0}, version={1}, accountid={2}, user={3}, email={4}", - _addIn.ProfileName, _addIn.VersionMajor, share.Key.Account.AccountId, share.Value.UserName, share.Value.EmailAddress); + Logger.Instance.Debug(this, "Adding KOE share: profile={0}, version={1}, accountid={2}, user={3}, email={4}, reminders={5}", + _addIn.ProfileName, _addIn.VersionMajor, share.account.Account.AccountId, share.store.UserName, share.store.EmailAddress, share.showReminders); // TODO: escaping commandLine += " /sharekoe " + Util.QuoteCommandLine(_addIn.ProfileName + ":" + _addIn.VersionMajor + ":" + - share.Key.Account.AccountId + ":" + - share.Value.UserName + ":" + share.Value.EmailAddress + ":" + - share.Value.EmailAddress); + share.account.Account.AccountId + ":" + + share.store.UserName + ":" + share.store.EmailAddress + ":" + + share.store.EmailAddress + ":1:" + (share.showReminders ? "1" : "0")); } } diff --git a/src/AcaciaZPushPlugin/EASAccount/EASAccount.cpp b/src/AcaciaZPushPlugin/EASAccount/EASAccount.cpp index 41072ba..f63a0d6 100644 --- a/src/AcaciaZPushPlugin/EASAccount/EASAccount.cpp +++ b/src/AcaciaZPushPlugin/EASAccount/EASAccount.cpp @@ -54,6 +54,7 @@ static const wstring R_EMAIL = L"Email"; static const wstring R_EMAIL_ORIGINAL = L"KOE Share For"; static const wstring R_PASSWORD = L"EAS Password"; static const wstring R_ONE_MONTH = L"EAS SyncSlider"; +static const wstring R_SHOW_REMINDERS = L"KOE Reminders"; struct Account { @@ -70,6 +71,7 @@ public: vector encryptedPassword; wstring dataFolder; bool syncOneMonth; + bool showReminders; private: wstring path; int initializedMAPI = 0; @@ -139,7 +141,9 @@ public: L"\tpath=%ls\n" L"\tservice=%ls\n" L"\tentryId=%ls\n" - L"\taccountId=%.8X\n", + L"\taccountId=%.8X\n" + L"\toneMonth=%d\n" + L"\treminders=%d\n", prefix, profileName.c_str(), outlookVersion.c_str(), @@ -156,7 +160,9 @@ public: path.c_str(), ToHex(&service, sizeof(service)).c_str(), ToHex(entryId).c_str(), - accountId + accountId, + syncOneMonth ? 1 : 0, + showReminders ? 1 : 0 ); } void Create() @@ -504,6 +510,9 @@ private: if (syncOneMonth) WriteAccountKey(R_ONE_MONTH, (DWORD)1); + if (!showReminders) + WriteAccountKey(R_SHOW_REMINDERS, (DWORD)0); + WriteAccountKey(L"clsid", L"{ED475415-B0D6-11D2-8C3B-00104B2A6676}"); WriteAccountKey(R_PASSWORD, &encryptedPassword[0], encryptedPassword.size()); @@ -654,9 +663,9 @@ int __cdecl wmain(int argc, wchar_t **argv) // Main try { - if (argc < 7 || argc > 8) + if (argc < 7 || argc > 9) { - fwprintf(stderr, L"EASAccount: [1 month]\n"); + fwprintf(stderr, L"EASAccount: [1 month] [reminders]\n"); exit(3); } @@ -672,6 +681,9 @@ int __cdecl wmain(int argc, wchar_t **argv) account.syncOneMonth = true; if (argc > 7) account.syncOneMonth = !wcscmp(argv[7], L"1"); + account.showReminders = true; + if (argc > 8) + account.showReminders = !wcscmp(argv[8], L"1"); try { From 87f057dfe5ae73fac0be432026413b15836cf5df Mon Sep 17 00:00:00 2001 From: KOE_Export_Strings_Commit Date: Wed, 4 Jul 2018 12:34:38 +0200 Subject: [PATCH 3/4] Commit strings #281 --- translations/KOE.pot | 6 ++++++ translations/de.po | 6 ++++++ translations/en.po | 6 ++++++ translations/fr.po | 6 ++++++ translations/hu.po | 6 ++++++ translations/it.po | 6 ++++++ translations/nb.po | 6 ++++++ translations/nl.po | 6 ++++++ translations/pt.po | 6 ++++++ translations/pt_br.po | 6 ++++++ 10 files changed, 60 insertions(+) diff --git a/translations/KOE.pot b/translations/KOE.pot index 177ed5f..7d4bf7b 100644 --- a/translations/KOE.pot +++ b/translations/KOE.pot @@ -340,6 +340,12 @@ msgctxt "AcaciaZPushPlugin\\Features\\SharedFolders\\SharedFoldersDialog\\button msgid "Open" msgstr "" +#: AcaciaZPushPlugin\Features\SharedFolders\SharedFoldersDialog\_labelWholeStoreReminders.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\SharedFolders\\SharedFoldersDialog\\_labelWholeStoreReminders.Text" +msgid "Show reminders" +msgstr "" + #: AcaciaZPushPlugin\Features\SharedFolders\SharedFoldersDialog\_labelWholeStore.Text #, csharp-format msgctxt "AcaciaZPushPlugin\\Features\\SharedFolders\\SharedFoldersDialog\\_labelWholeStore.Text" diff --git a/translations/de.po b/translations/de.po index 42cfe72..7fafc0f 100644 --- a/translations/de.po +++ b/translations/de.po @@ -1597,3 +1597,9 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SyncTimeFrame_WEEK_2" msgid "2 weeks" msgstr "" +#: AcaciaZPushPlugin\Features\SharedFolders\SharedFoldersDialog\_labelWholeStoreReminders.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\SharedFolders\\SharedFoldersDialog\\_labelWholeStoreReminders.Text" +msgid "Show reminders" +msgstr "" + diff --git a/translations/en.po b/translations/en.po index 97436da..1891fcd 100644 --- a/translations/en.po +++ b/translations/en.po @@ -340,6 +340,12 @@ msgctxt "AcaciaZPushPlugin\\Features\\SharedFolders\\SharedFoldersDialog\\button msgid "Open" msgstr "Open" +#: AcaciaZPushPlugin\Features\SharedFolders\SharedFoldersDialog\_labelWholeStoreReminders.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\SharedFolders\\SharedFoldersDialog\\_labelWholeStoreReminders.Text" +msgid "Show reminders" +msgstr "Show reminders" + #: AcaciaZPushPlugin\Features\SharedFolders\SharedFoldersDialog\_labelWholeStore.Text #, csharp-format msgctxt "AcaciaZPushPlugin\\Features\\SharedFolders\\SharedFoldersDialog\\_labelWholeStore.Text" diff --git a/translations/fr.po b/translations/fr.po index 519c7c8..a5bf77e 100644 --- a/translations/fr.po +++ b/translations/fr.po @@ -1593,3 +1593,9 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SyncTimeFrame_WEEK_2" msgid "2 weeks" msgstr "" +#: AcaciaZPushPlugin\Features\SharedFolders\SharedFoldersDialog\_labelWholeStoreReminders.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\SharedFolders\\SharedFoldersDialog\\_labelWholeStoreReminders.Text" +msgid "Show reminders" +msgstr "" + diff --git a/translations/hu.po b/translations/hu.po index 082f907..cc1aa24 100644 --- a/translations/hu.po +++ b/translations/hu.po @@ -1598,3 +1598,9 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SyncTimeFrame_WEEK_2" msgid "2 weeks" msgstr "" +#: AcaciaZPushPlugin\Features\SharedFolders\SharedFoldersDialog\_labelWholeStoreReminders.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\SharedFolders\\SharedFoldersDialog\\_labelWholeStoreReminders.Text" +msgid "Show reminders" +msgstr "" + diff --git a/translations/it.po b/translations/it.po index 5012119..89102dc 100644 --- a/translations/it.po +++ b/translations/it.po @@ -1560,3 +1560,9 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SyncTimeFrame_WEEK_2" msgid "2 weeks" msgstr "" +#: AcaciaZPushPlugin\Features\SharedFolders\SharedFoldersDialog\_labelWholeStoreReminders.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\SharedFolders\\SharedFoldersDialog\\_labelWholeStoreReminders.Text" +msgid "Show reminders" +msgstr "" + diff --git a/translations/nb.po b/translations/nb.po index 835e12e..4088ac7 100644 --- a/translations/nb.po +++ b/translations/nb.po @@ -1348,3 +1348,9 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SyncTimeFrame_WEEK_2" msgid "2 weeks" msgstr "" +#: AcaciaZPushPlugin\Features\SharedFolders\SharedFoldersDialog\_labelWholeStoreReminders.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\SharedFolders\\SharedFoldersDialog\\_labelWholeStoreReminders.Text" +msgid "Show reminders" +msgstr "" + diff --git a/translations/nl.po b/translations/nl.po index 3522baa..da7560d 100644 --- a/translations/nl.po +++ b/translations/nl.po @@ -1597,3 +1597,9 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SyncTimeFrame_WEEK_2" msgid "2 weeks" msgstr "" +#: AcaciaZPushPlugin\Features\SharedFolders\SharedFoldersDialog\_labelWholeStoreReminders.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\SharedFolders\\SharedFoldersDialog\\_labelWholeStoreReminders.Text" +msgid "Show reminders" +msgstr "" + diff --git a/translations/pt.po b/translations/pt.po index 8b366a6..faead35 100644 --- a/translations/pt.po +++ b/translations/pt.po @@ -1332,3 +1332,9 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SyncTimeFrame_WEEK_2" msgid "2 weeks" msgstr "2 semanas" +#: AcaciaZPushPlugin\Features\SharedFolders\SharedFoldersDialog\_labelWholeStoreReminders.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\SharedFolders\\SharedFoldersDialog\\_labelWholeStoreReminders.Text" +msgid "Show reminders" +msgstr "" + diff --git a/translations/pt_br.po b/translations/pt_br.po index de735ab..363ff9d 100644 --- a/translations/pt_br.po +++ b/translations/pt_br.po @@ -1352,3 +1352,9 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SyncTimeFrame_WEEK_2" msgid "2 weeks" msgstr "" +#: AcaciaZPushPlugin\Features\SharedFolders\SharedFoldersDialog\_labelWholeStoreReminders.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\SharedFolders\\SharedFoldersDialog\\_labelWholeStoreReminders.Text" +msgid "Show reminders" +msgstr "" + From 8cf69d272743db530ba81b928a5d9d329b32cf02 Mon Sep 17 00:00:00 2001 From: Patrick Simpson Date: Wed, 4 Jul 2018 13:36:07 +0300 Subject: [PATCH 4/4] [KOE-166] Disabled whole store sharing option for stores that have no email address, as they will never be successfully opened. --- .../Features/SharedFolders/SharedFoldersDialog.cs | 2 +- .../AcaciaZPushPlugin/Features/SharedFolders/StoreTreeNode.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.cs index cf10988..3d46f54 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/SharedFoldersDialog.cs @@ -716,7 +716,7 @@ namespace Acacia.Features.SharedFolders // Ignore the root nodes if (node is StoreTreeNode) { - if (!_folders.SupportsWholeStore) + if (!_folders.SupportsWholeStore || !node.HasCheckBox) continue; StoreTreeNode storeNode = (StoreTreeNode)node; diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/StoreTreeNode.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/StoreTreeNode.cs index 8810fec..f5983b9 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/StoreTreeNode.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SharedFolders/StoreTreeNode.cs @@ -102,7 +102,7 @@ namespace Acacia.Features.SharedFolders ChildLoader = new UserFolderLoader(this, folders, user); ChildLoader.ReloadOnCloseOpen = true; - HasCheckBox = folders.SupportsWholeStore; + HasCheckBox = folders.SupportsWholeStore && !string.IsNullOrWhiteSpace(user.EmailAddress); ApplyReadOnly(this, IsReadOnly); // TODO: better icons, better way of handling this