1
0
mirror of https://github.com/Kopano-dev/kopano-ol-extension.git synced 2023-10-10 13:37:40 +02:00
Conflicts:
	translations/nb.po
This commit is contained in:
Weblate 2017-11-08 14:03:10 +01:00
commit 45d81fd29c
23 changed files with 636 additions and 441 deletions

View File

@ -56,7 +56,7 @@ namespace Acacia.Controls
CheckStateChanged(this, new CheckStateChangedEventArgs(node)); CheckStateChanged(this, new CheckStateChangedEventArgs(node));
} }
} }
private ToolTip toolTip;
private KCheckManager _checkManager; private KCheckManager _checkManager;
[Browsable(false)] [Browsable(false)]
public KCheckManager CheckManager public KCheckManager CheckManager
@ -97,7 +97,7 @@ namespace Acacia.Controls
private void ToggleCheck(KTreeNode node) private void ToggleCheck(KTreeNode node)
{ {
if (_checkManager == null || node == null) if (_checkManager == null || node == null || !node.CheckBoxEnabled)
return; return;
if (!SelectedNodes.Contains(node) || SelectedNodes.Count == 1) if (!SelectedNodes.Contains(node) || SelectedNodes.Count == 1)
@ -181,6 +181,8 @@ namespace Acacia.Controls
SetStyle(ControlStyles.Selectable, true); SetStyle(ControlStyles.Selectable, true);
BackColor = SystemColors.Window; BackColor = SystemColors.Window;
toolTip = new ToolTip();
_rootNodes = new KTreeNodes(this); _rootNodes = new KTreeNodes(this);
SetupRenderer(); SetupRenderer();
InitScrollBars(); InitScrollBars();
@ -449,6 +451,12 @@ namespace Acacia.Controls
// Render new node // Render new node
if (_highlightNode != null) if (_highlightNode != null)
Rerender(_highlightNode); Rerender(_highlightNode);
// Update any tooltips
if (old?.ToolTip != null)
toolTip.SetToolTip(this, null);
if (_highlightNode?.ToolTip != null)
toolTip.SetToolTip(this, _highlightNode.ToolTip);
} }
} }
@ -1147,20 +1155,5 @@ namespace Acacia.Controls
#endregion #endregion
#region Winforms Autogenerated
private void InitializeComponent()
{
this.SuspendLayout();
//
// KTree
//
this.Name = "KTree";
this.ResumeLayout(false);
}
#endregion
} }
} }

View File

@ -64,6 +64,7 @@ namespace Acacia.Controls
public int? ImageIndex { get; set; } public int? ImageIndex { get; set; }
public object Tag { get; set; } public object Tag { get; set; }
public string ToolTip { get; set; }
#endregion #endregion
@ -126,6 +127,20 @@ namespace Acacia.Controls
} }
} }
private bool _checkBoxEnabled = true;
public bool CheckBoxEnabled
{
get { return _checkBoxEnabled; }
set
{
if (_checkBoxEnabled != value)
{
_checkBoxEnabled = value;
Owner?.Rerender(this);
}
}
}
private bool _isExpanded; private bool _isExpanded;
public bool IsExpanded public bool IsExpanded
{ {

View File

@ -132,7 +132,7 @@ namespace Acacia.Controls
// Checkbox // Checkbox
if (_tree.CheckManager != null && node.HasCheckBox) if (_tree.CheckManager != null && node.HasCheckBox)
{ {
RenderCheckBox(graphics, node, dims.GetPartRect(KTreeNodeMeasurements.Part.CheckBox, true), highlight); RenderCheckBox(graphics, node, dims.GetPartRect(KTreeNodeMeasurements.Part.CheckBox, true), highlight, node.CheckBoxEnabled);
} }
// Images // Images
@ -159,10 +159,12 @@ namespace Acacia.Controls
protected abstract void RenderNodeOutline(Graphics graphics, KTreeNode node, Rectangle rect, KTreeNodeMeasurements.Part? highlight); protected abstract void RenderNodeOutline(Graphics graphics, KTreeNode node, Rectangle rect, KTreeNodeMeasurements.Part? highlight);
internal protected abstract void RenderNodeExpander(Graphics graphics, KTreeNode node, Rectangle rect, KTreeNodeMeasurements.Part? highlight); internal protected abstract void RenderNodeExpander(Graphics graphics, KTreeNode node, Rectangle rect, KTreeNodeMeasurements.Part? highlight);
protected virtual void RenderCheckBox(Graphics graphics, KTreeNode node, Rectangle rect, KTreeNodeMeasurements.Part? highlight) protected virtual void RenderCheckBox(Graphics graphics, KTreeNode node, Rectangle rect, KTreeNodeMeasurements.Part? highlight, bool enabled)
{ {
int state = (int)node.CheckState * 4 + 1; int state = (int)node.CheckState * 4 + 1;
if (highlight != null && highlight.Value == KTreeNodeMeasurements.Part.CheckBox) if (!enabled)
state += 3;
else if (highlight != null && highlight.Value == KTreeNodeMeasurements.Part.CheckBox)
state += 1; state += 1;
CheckBoxRenderer.DrawCheckBox(graphics, rect.Location, (CheckBoxState)state); CheckBoxRenderer.DrawCheckBox(graphics, rect.Location, (CheckBoxState)state);

View File

@ -515,11 +515,11 @@ namespace Acacia.Features.GAB
contact.CustomerID = id; contact.CustomerID = id;
// Create the contact data // Create the contact data
if (Get<string>(value, "displayName") != null) contact.FullName = Get<string>(value, "displayName");
if (Get<string>(value, "givenName") != null) contact.FirstName = Get<string>(value, "givenName"); if (Get<string>(value, "givenName") != null) contact.FirstName = Get<string>(value, "givenName");
if (Get<string>(value, "initials") != null) contact.Initials = Get<string>(value, "initials"); if (Get<string>(value, "initials") != null) contact.Initials = Get<string>(value, "initials");
if (Get<string>(value, "surname") != null) contact.LastName = Get<string>(value, "surname"); if (Get<string>(value, "surname") != null) contact.LastName = Get<string>(value, "surname");
if (Get<string>(value, "title") != null) contact.JobTitle = Get<string>(value, "title"); if (Get<string>(value, "title") != null) contact.JobTitle = Get<string>(value, "title");
if (Get<string>(value, "displayName") != null) contact.FullName = Get<string>(value, "displayName");
if (Get<string>(value, "smtpAddress") != null) if (Get<string>(value, "smtpAddress") != null)
{ {

View File

@ -88,7 +88,7 @@ namespace Acacia.Features.SharedFolders
private bool CanManageFolder(MenuItem<IFolder> b, IFolder folder) private bool CanManageFolder(MenuItem<IFolder> b, IFolder folder)
{ {
return folder.SyncId?.IsShared == true; return folder.SyncId?.IsCustom == true;
} }
private void ManageFolder(IFolder folder) private void ManageFolder(IFolder folder)
@ -151,7 +151,7 @@ namespace Acacia.Features.SharedFolders
// Check that we can get the id // Check that we can get the id
SyncId folderId = folder.SyncId; SyncId folderId = folder.SyncId;
Logger.Instance.Trace(this, "GetSharedFolder1: {0}", folderId); Logger.Instance.Trace(this, "GetSharedFolder1: {0}", folderId);
if (folderId == null || !folderId.IsShared) if (folderId == null || !folderId.IsCustom)
return null; return null;
// Get the ZPush account // Get the ZPush account
@ -310,7 +310,7 @@ namespace Acacia.Features.SharedFolders
public override bool IsApplicable(IFolder folder) public override bool IsApplicable(IFolder folder)
{ {
if (folder.SyncId != null && folder.SyncId.IsShared) if (folder.SyncId != null && folder.SyncId.IsCustom)
return true; return true;
using (IFolder parent = folder.Parent) using (IFolder parent = folder.Parent)
@ -354,7 +354,7 @@ namespace Acacia.Features.SharedFolders
private void OnSharedFolderDiscovered(IFolder folder) private void OnSharedFolderDiscovered(IFolder folder)
{ {
Logger.Instance.Trace(this, "Shared folder discovered: {0} - {1}", folder.Name, folder.SyncId); Logger.Instance.Trace(this, "Shared folder discovered: {0} - {1}", folder.Name, folder.SyncId);
if (folder.SyncId == null || !folder.SyncId.IsShared) if (folder.SyncId == null || !folder.SyncId.IsCustom)
{ {
Logger.Instance.Warning(this, "Local folder created in shared folder, deleting: {0} - {1}", folder.Name, folder.SyncId); Logger.Instance.Warning(this, "Local folder created in shared folder, deleting: {0} - {1}", folder.Name, folder.SyncId);
// This is a new, locally created folder. Warn and remove // This is a new, locally created folder. Warn and remove
@ -376,7 +376,7 @@ namespace Acacia.Features.SharedFolders
private void Folder_BeforeFolderMove(IFolder src, IFolder moveTo, ref bool cancel) private void Folder_BeforeFolderMove(IFolder src, IFolder moveTo, ref bool cancel)
{ {
if (src.SyncId?.IsShared == true || moveTo.SyncId?.IsShared == true) if (src.SyncId?.IsCustom == true || moveTo.SyncId?.IsCustom == true)
{ {
// Suppress any move of or into a shared folder // Suppress any move of or into a shared folder
Logger.Instance.Warning(this, "Shared folder move: {0} - {1}", src.Name, moveTo.Name); Logger.Instance.Warning(this, "Shared folder move: {0} - {1}", src.Name, moveTo.Name);
@ -399,7 +399,7 @@ namespace Acacia.Features.SharedFolders
private void CheckSharedFolderRename(IFolder folder) private void CheckSharedFolderRename(IFolder folder)
{ {
if (folder.SyncId != null && folder.SyncId.IsShared) if (folder.SyncId != null && folder.SyncId.IsCustom)
{ {
string originalName = (string)folder.GetProperty(OutlookConstants.PR_ZPUSH_NAME); string originalName = (string)folder.GetProperty(OutlookConstants.PR_ZPUSH_NAME);
// The folder.name property is sometimes cached, check against the MAPI property // The folder.name property is sometimes cached, check against the MAPI property

View File

@ -30,6 +30,7 @@ namespace Acacia.Features.SharedFolders
private readonly StoreTreeNode _store; private readonly StoreTreeNode _store;
private readonly AvailableFolder _folder; private readonly AvailableFolder _folder;
private SharedFolder _share; private SharedFolder _share;
public readonly bool IsReadOnly;
public FolderTreeNode(StoreTreeNode store, AvailableFolder folder, SharedFolder share) public FolderTreeNode(StoreTreeNode store, AvailableFolder folder, SharedFolder share)
{ {
@ -39,6 +40,10 @@ namespace Acacia.Features.SharedFolders
this.Text = folder.Name; this.Text = folder.Name;
IsReadOnly = share?.SyncId?.Kind == SyncKind.Configured;
HasCheckBox = true;
CheckBoxEnabled = !IsReadOnly;
// Image // Image
// TODO: clean this up // TODO: clean this up
int index = ((int)OutlookConstants.BASIC_SYNC_TYPES[(int)folder.Type]) - 1; int index = ((int)OutlookConstants.BASIC_SYNC_TYPES[(int)folder.Type]) - 1;

View File

@ -17,7 +17,8 @@ namespace Acacia.Features.SharedFolders
private readonly FeatureSharedFolders _feature; private readonly FeatureSharedFolders _feature;
private readonly IFolder _folder; private readonly IFolder _folder;
private SearchQuery _queryRoot; private SearchQuery _queryRoot;
private SearchQuery.Or _queryCustom; private SearchQuery.Or _queryCustomShared;
private SearchQuery.Or _queryCustomConfigured;
private bool _queryCustomModified; private bool _queryCustomModified;
public RemindersQuery(FeatureSharedFolders feature, IStore store) public RemindersQuery(FeatureSharedFolders feature, IStore store)
@ -28,7 +29,7 @@ namespace Acacia.Features.SharedFolders
public bool Open() public bool Open()
{ {
if (_queryCustom != null) if (_queryCustomShared != null && _queryCustomConfigured != null)
return true; return true;
try try
{ {
@ -39,30 +40,34 @@ namespace Acacia.Features.SharedFolders
SearchQuery.And root = (SearchQuery.And)_queryRoot; SearchQuery.And root = (SearchQuery.And)_queryRoot;
// TODO: more strict checking of query // TODO: more strict checking of query
if (root.Operands.Count == 3) if (root.Operands.Count == 5)
{ {
this._queryCustom = root.Operands.ElementAt(2) as SearchQuery.Or; this._queryCustomShared = root.Operands.ElementAt(2) as SearchQuery.Or;
if (this._queryCustom != null) this._queryCustomConfigured = root.Operands.ElementAt(3) as SearchQuery.Or;
if (this._queryCustomShared != null)
{ {
// TODO: check property test // TODO: check property test
return true; return true;
} }
} }
else if (root.Operands.Count == 3)
{
// KOE-98 introduced also checking of G and C prefixes, which are not yet present
_queryCustomShared = root.Operands.ElementAt(2) as SearchQuery.Or;
}
// We have the root, but not the custom query. Create it. // We have the root, but not the custom query. Create it.
Logger.Instance.Debug(this, "Creating custom query"); Logger.Instance.Debug(this, "Creating custom query");
_queryCustom = new SearchQuery.Or(); if (_queryCustomShared == null)
_queryCustomShared = AddCustomQuery(root, "S");
// Add the prefix exclusion for shared folders _queryCustomConfigured = AddCustomQuery(root, "C");
_queryCustom.Add( // Add the G (GAB) exclusion. Folders will never have a flag with this prefix, so it's simpler
new SearchQuery.Not( root.Operands.Add(new SearchQuery.Not(
new SearchQuery.PropertyContent( new SearchQuery.PropertyContent(
PROP_FOLDER, SearchQuery.ContentMatchOperation.Prefix, SearchQuery.ContentMatchModifiers.None, "S" PROP_FOLDER, SearchQuery.ContentMatchOperation.Prefix, SearchQuery.ContentMatchModifiers.None, "G"
)
) )
); ));
root.Operands.Add(_queryCustom);
Logger.Instance.Debug(this, "Modified query:\n{0}", root.ToString()); Logger.Instance.Debug(this, "Modified query:\n{0}", root.ToString());
// Store it // Store it
FolderQuery = root; FolderQuery = root;
@ -72,7 +77,24 @@ namespace Acacia.Features.SharedFolders
{ {
Logger.Instance.Error(this, "Exception in Open: {0}", e); Logger.Instance.Error(this, "Exception in Open: {0}", e);
} }
return _queryCustom != null; return _queryCustomShared != null && _queryCustomConfigured != null;
}
private SearchQuery.Or AddCustomQuery(SearchQuery.And root, string prefix)
{
SearchQuery.Or custom = new SearchQuery.Or();
// Add the prefix exclusion
custom.Add(
new SearchQuery.Not(
new SearchQuery.PropertyContent(
PROP_FOLDER, SearchQuery.ContentMatchOperation.Prefix, SearchQuery.ContentMatchModifiers.None, prefix
)
)
);
root.Operands.Add(custom);
return custom;
} }
public string LogContextId public string LogContextId
@ -117,15 +139,28 @@ namespace Acacia.Features.SharedFolders
public void UpdateReminders(SyncId folderId, bool wantReminders) public void UpdateReminders(SyncId folderId, bool wantReminders)
{ {
Logger.Instance.Trace(this, "Setting reminders for folder {0}: {1}", wantReminders, folderId); Logger.Instance.Trace(this, "Setting reminders for folder {0}: {1} ({2})", wantReminders, folderId, folderId?.Kind);
switch(folderId.Kind)
{
case SyncKind.Configured:
UpdateReminders(_queryCustomConfigured, folderId, wantReminders);
break;
case SyncKind.Shared:
UpdateReminders(_queryCustomShared, folderId, wantReminders);
break;
}
}
private void UpdateReminders(SearchQuery.Or query, SyncId folderId, bool wantReminders)
{
string prefix = MakeFolderPrefix(folderId); string prefix = MakeFolderPrefix(folderId);
if (prefix == null) if (prefix == null)
return; return;
// Find existing // Find existing
for (int i = 0; i < _queryCustom.Operands.Count;) for (int i = 0; i < query.Operands.Count;)
{ {
SearchQuery.PropertyContent element = _queryCustom.Operands[i] as SearchQuery.PropertyContent; SearchQuery.PropertyContent element = query.Operands[i] as SearchQuery.PropertyContent;
if (element != null && prefix == (string)element.Content) if (element != null && prefix == (string)element.Content)
{ {
Logger.Instance.Trace(this, "Found at {0}: {1}", i, folderId); Logger.Instance.Trace(this, "Found at {0}: {1}", i, folderId);
@ -134,7 +169,8 @@ namespace Acacia.Features.SharedFolders
return; return;
// Otherwise remove it. Still continue looking for others, just in case of duplicates // Otherwise remove it. Still continue looking for others, just in case of duplicates
_queryCustom.Operands.RemoveAt(i); query.Operands.RemoveAt(i);
_queryCustomModified = true;
} }
else ++i; else ++i;
} }
@ -143,7 +179,7 @@ namespace Acacia.Features.SharedFolders
if (wantReminders) if (wantReminders)
{ {
Logger.Instance.Trace(this, "Adding reminders for {0}", folderId); Logger.Instance.Trace(this, "Adding reminders for {0}", folderId);
_queryCustom.Operands.Add(new SearchQuery.PropertyContent( query.Operands.Add(new SearchQuery.PropertyContent(
PROP_FOLDER, SearchQuery.ContentMatchOperation.Prefix, SearchQuery.ContentMatchModifiers.None, prefix PROP_FOLDER, SearchQuery.ContentMatchOperation.Prefix, SearchQuery.ContentMatchModifiers.None, prefix
)); ));
_queryCustomModified = true; _queryCustomModified = true;
@ -152,19 +188,37 @@ namespace Acacia.Features.SharedFolders
public void RemoveStaleReminders(IEnumerable<SyncId> wanted) public void RemoveStaleReminders(IEnumerable<SyncId> wanted)
{ {
// Collect the valid prefixes // Group the valid prefixes on type
HashSet<string> prefixes = new HashSet<string>(); HashSet<string> prefixesS = new HashSet<string>();
HashSet<string> prefixesC = new HashSet<string>();
foreach (SyncId id in wanted) foreach (SyncId id in wanted)
{ {
string prefix = MakeFolderPrefix(id); string prefix = MakeFolderPrefix(id);
if (prefix != null) if (prefix != null)
prefixes.Add(prefix); {
switch (id.Kind)
{
case SyncKind.Configured:
prefixesC.Add(prefix);
break;
case SyncKind.Shared:
prefixesS.Add(prefix);
break;
}
}
} }
// Update the queries
RemoveStaleReminders(prefixesS, _queryCustomShared);
RemoveStaleReminders(prefixesC, _queryCustomConfigured);
}
private void RemoveStaleReminders(ISet<string> prefixes, SearchQuery.Or query)
{
// Remove all operands for which we do not want the prefix // Remove all operands for which we do not want the prefix
for (int i = 0; i < _queryCustom.Operands.Count;) for (int i = 0; i < query.Operands.Count;)
{ {
SearchQuery.PropertyContent element = _queryCustom.Operands[i] as SearchQuery.PropertyContent; SearchQuery.PropertyContent element = query.Operands[i] as SearchQuery.PropertyContent;
if (element != null) if (element != null)
{ {
string prefix = (string)element.Content; string prefix = (string)element.Content;
@ -175,7 +229,7 @@ namespace Acacia.Features.SharedFolders
} }
Logger.Instance.Trace(this, "Unwanted prefix at {0}: {1}", i, prefix); Logger.Instance.Trace(this, "Unwanted prefix at {0}: {1}", i, prefix);
_queryCustom.Operands.RemoveAt(i); query.Operands.RemoveAt(i);
_queryCustomModified = true; _queryCustomModified = true;
} }
else ++i; else ++i;
@ -186,7 +240,7 @@ namespace Acacia.Features.SharedFolders
{ {
// Sanity check. The check for shared folders also excludes any weird ids; e.g. if permissions are wrong, // Sanity check. The check for shared folders also excludes any weird ids; e.g. if permissions are wrong,
// this will not be a sync id, but a backend id. // this will not be a sync id, but a backend id.
if (folderId == null || !folderId.IsShared) if (folderId == null || !folderId.IsCustom)
return null; return null;
return folderId.ToString() + ":"; return folderId.ToString() + ":";
} }

View File

@ -409,6 +409,7 @@ namespace Acacia.Features.SharedFolders
OptionSendAs = null; OptionSendAs = null;
OptionReminders = null; OptionReminders = null;
OptionPermissions = null; OptionPermissions = null;
bool readOnly = false;
foreach (KTreeNode node in nodes) foreach (KTreeNode node in nodes)
{ {
@ -421,6 +422,10 @@ namespace Acacia.Features.SharedFolders
if (!folderNode.IsShared) if (!folderNode.IsShared)
continue; continue;
// Set all controls to read-only if any of the nodes is read-only
if (folderNode.IsReadOnly)
readOnly = true;
SharedFolder share = folderNode.SharedFolder; SharedFolder share = folderNode.SharedFolder;
AvailableFolder folder = folderNode.AvailableFolder; AvailableFolder folder = folderNode.AvailableFolder;
@ -497,6 +502,9 @@ namespace Acacia.Features.SharedFolders
checkReminders.ThreeState = true; checkReminders.ThreeState = true;
} }
} }
// Apply read-only state
_layoutOptions.Enabled = !readOnly;
} }
finally finally
{ {

View File

@ -607,7 +607,7 @@
<value>2</value> <value>2</value>
</data> </data>
<data name="_layoutOptions.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms"> <data name="_layoutOptions.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="_labelName" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="textName" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="_labelSendAs" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="checkSendAs" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="_labelReminders" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="checkReminders" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="_labelPermissions" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="labelPermissionsValue" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /&gt;&lt;/TableLayoutSettings&gt;</value> <value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="_labelName" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="textName" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="_labelSendAs" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="checkSendAs" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="_labelReminders" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="checkReminders" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="_labelPermissions" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="labelPermissionsValue" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Absolute,20" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data> </data>
<data name="_layoutMain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="_layoutMain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value> <value>Fill</value>

View File

@ -46,6 +46,8 @@ namespace Acacia.Features.SharedFolders
private readonly GABHandler _gab; private readonly GABHandler _gab;
private readonly GABUser _user; private readonly GABUser _user;
public readonly bool IsReadOnly;
public StoreTreeNode(SharedFoldersManager folders, GABHandler gab, GABUser user, string text, public StoreTreeNode(SharedFoldersManager folders, GABHandler gab, GABUser user, string text,
Dictionary<BackendId, SharedFolder> currentFolders) Dictionary<BackendId, SharedFolder> currentFolders)
: :
@ -55,6 +57,7 @@ namespace Acacia.Features.SharedFolders
this._feature = folders.Feature; this._feature = folders.Feature;
this._gab = gab; this._gab = gab;
this._user = user; this._user = user;
this.IsReadOnly = false;
// Create an empty current state. When loading the nodes, the shares will be added. This has the benefit of // Create an empty current state. When loading the nodes, the shares will be added. This has the benefit of
// cleaning up automatically any obsolote shares. // cleaning up automatically any obsolote shares.
@ -63,6 +66,7 @@ namespace Acacia.Features.SharedFolders
ChildLoader = new UserFolderLoader(this, folders, user); ChildLoader = new UserFolderLoader(this, folders, user);
ChildLoader.ReloadOnCloseOpen = true; ChildLoader.ReloadOnCloseOpen = true;
HasCheckBox = false; HasCheckBox = false;
ApplyReadOnly(this, IsReadOnly);
// TODO: better icons, better way of handling this // TODO: better icons, better way of handling this
ImageIndex = user == GABUser.USER_PUBLIC ? 0 : 11; ImageIndex = user == GABUser.USER_PUBLIC ? 0 : 11;
@ -78,6 +82,11 @@ namespace Acacia.Features.SharedFolders
Control = _reloader; Control = _reloader;
} }
private static void ApplyReadOnly(KTreeNode node, bool isReadOnly)
{
node.ToolTip = isReadOnly ? Properties.Resources.SharedFolders_Node_Readonly_ToolTip : null;
}
public GABUser User public GABUser User
{ {
get { return ((UserFolderLoader)ChildLoader).User; } get { return ((UserFolderLoader)ChildLoader).User; }
@ -264,6 +273,7 @@ namespace Acacia.Features.SharedFolders
// Create the tree node // Create the tree node
SharedFolder share = rootNode.GetInitialShareState(folder); SharedFolder share = rootNode.GetInitialShareState(folder);
FolderTreeNode child = new FolderTreeNode(rootNode, folder, share); FolderTreeNode child = new FolderTreeNode(rootNode, folder, share);
ApplyReadOnly(child, child.IsReadOnly);
// Add // Add
children.Add(child); children.Add(child);

View File

@ -1093,6 +1093,16 @@ namespace Acacia.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to The folder has been configured by your system administrator and cannot be modified.
///Please contact your system administrator for any required changes..
/// </summary>
internal static string SharedFolders_Node_Readonly_ToolTip {
get {
return ResourceManager.GetString("SharedFolders_Node_Readonly_ToolTip", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to No shared folders are available or you do not have permissions to view the root of the inbox.. /// Looks up a localized string similar to No shared folders are available or you do not have permissions to view the root of the inbox..
/// </summary> /// </summary>

View File

@ -520,4 +520,8 @@
<data name="SharedFolders_LocalFolder_Title" xml:space="preserve"> <data name="SharedFolders_LocalFolder_Title" xml:space="preserve">
<value>Shared folders</value> <value>Shared folders</value>
</data> </data>
<data name="SharedFolders_Node_Readonly_ToolTip" xml:space="preserve">
<value>The folder has been configured by your system administrator and cannot be modified.
Please contact your system administrator for any required changes.</value>
</data>
</root> </root>

View File

@ -156,8 +156,8 @@ namespace Acacia
foreach (Feature feature in Features) foreach (Feature feature in Features)
feature.AfterStartup(); feature.AfterStartup();
// Initial send receive // [KOE-148] Initial send receive
ThisAddIn.Instance.SendReceive(); Instance.SendReceive();
} }
catch (System.Exception e) catch (System.Exception e)
{ {

View File

@ -69,6 +69,14 @@ namespace Acacia.ZPush
#endregion #endregion
} }
public enum SyncKind
{
Normal,
Shared,
Configured,
GAB
}
public class SyncId : ZPushId public class SyncId : ZPushId
{ {
public static readonly SyncId NONE = new SyncId("0"); public static readonly SyncId NONE = new SyncId("0");
@ -76,10 +84,24 @@ namespace Acacia.ZPush
public SyncId(string id) : base(id) { } public SyncId(string id) : base(id) { }
public SyncId(int id) : base(id) { } public SyncId(int id) : base(id) { }
public SyncKind Kind
{
get
{
if (_id.StartsWith("S"))
return SyncKind.Shared;
if (_id.StartsWith("C"))
return SyncKind.Configured;
if (_id.StartsWith("G"))
return SyncKind.GAB;
return SyncKind.Normal;
}
}
/// <summary> /// <summary>
/// Checks if this is a SyncId for a shared folders /// Checks if this is a SyncId for a shared folders
/// </summary> /// </summary>
public bool IsShared { get { return _id.StartsWith("S") || _id.StartsWith("C") || _id.StartsWith("G"); } } public bool IsCustom { get { return Kind != SyncKind.Normal; } }
#region Standard overrides #region Standard overrides

View File

@ -1057,6 +1057,14 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_LocalFolder_Tit
msgid "Shared folders" msgid "Shared folders"
msgstr "" msgstr ""
#: AcaciaZPushPlugin\Properties\Resources\SharedFolders_Node_Readonly_ToolTip
#, csharp-format
msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_Node_Readonly_ToolTip"
msgid ""
"The folder has been configured by your system administrator and cannot be modified. \n"
"Please contact your system administrator for any required changes."
msgstr ""
#: AcaciaZPushPlugin\UI\ProgressDialog\labelMessage.Text #: AcaciaZPushPlugin\UI\ProgressDialog\labelMessage.Text
#, csharp-format #, csharp-format
msgctxt "AcaciaZPushPlugin\\UI\\ProgressDialog\\labelMessage.Text" msgctxt "AcaciaZPushPlugin\\UI\\ProgressDialog\\labelMessage.Text"

View File

@ -1379,3 +1379,11 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_LocalFolder_Tit
msgid "Shared folders" msgid "Shared folders"
msgstr "" msgstr ""
#: AcaciaZPushPlugin\Properties\Resources\SharedFolders_Node_Readonly_ToolTip
#, csharp-format
msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_Node_Readonly_ToolTip"
msgid ""
"The folder has been configured by your system administrator and cannot be modified. \n"
"Please contact your system administrator for any required changes."
msgstr ""

View File

@ -1059,6 +1059,16 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_LocalFolder_Tit
msgid "Shared folders" msgid "Shared folders"
msgstr "Shared folders" msgstr "Shared folders"
#: AcaciaZPushPlugin\Properties\Resources\SharedFolders_Node_Readonly_ToolTip
#, csharp-format
msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_Node_Readonly_ToolTip"
msgid ""
"The folder has been configured by your system administrator and cannot be modified. \n"
"Please contact your system administrator for any required changes."
msgstr ""
"The folder has been configured by your system administrator and cannot be modified. \n"
"Please contact your system administrator for any required changes."
#: AcaciaZPushPlugin\UI\ProgressDialog\labelMessage.Text #: AcaciaZPushPlugin\UI\ProgressDialog\labelMessage.Text
#, csharp-format #, csharp-format
msgctxt "AcaciaZPushPlugin\\UI\\ProgressDialog\\labelMessage.Text" msgctxt "AcaciaZPushPlugin\\UI\\ProgressDialog\\labelMessage.Text"

View File

@ -1377,3 +1377,11 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_LocalFolder_Tit
msgid "Shared folders" msgid "Shared folders"
msgstr "" msgstr ""
#: AcaciaZPushPlugin\Properties\Resources\SharedFolders_Node_Readonly_ToolTip
#, csharp-format
msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_Node_Readonly_ToolTip"
msgid ""
"The folder has been configured by your system administrator and cannot be modified. \n"
"Please contact your system administrator for any required changes."
msgstr ""

View File

@ -1380,3 +1380,11 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_LocalFolder_Tit
msgid "Shared folders" msgid "Shared folders"
msgstr "" msgstr ""
#: AcaciaZPushPlugin\Properties\Resources\SharedFolders_Node_Readonly_ToolTip
#, csharp-format
msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_Node_Readonly_ToolTip"
msgid ""
"The folder has been configured by your system administrator and cannot be modified. \n"
"Please contact your system administrator for any required changes."
msgstr ""

View File

@ -1344,3 +1344,11 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_LocalFolder_Tit
msgid "Shared folders" msgid "Shared folders"
msgstr "" msgstr ""
#: AcaciaZPushPlugin\Properties\Resources\SharedFolders_Node_Readonly_ToolTip
#, csharp-format
msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_Node_Readonly_ToolTip"
msgid ""
"The folder has been configured by your system administrator and cannot be modified. \n"
"Please contact your system administrator for any required changes."
msgstr ""

File diff suppressed because it is too large Load Diff

View File

@ -4,8 +4,7 @@ msgstr ""
"POT-Creation-Date: \n" "POT-Creation-Date: \n"
"PO-Revision-Date: 2017-11-03 10:55+0000\n" "PO-Revision-Date: 2017-11-03 10:55+0000\n"
"Last-Translator: Bob <b.huisman@kopano.com>\n" "Last-Translator: Bob <b.huisman@kopano.com>\n"
"Language-Team: Dutch <http://translate.kopano.io/projects/kopano/kopano-ol-" "Language-Team: Dutch <http://translate.kopano.io/projects/kopano/kopano-ol-extension/nl/>\n"
"extension/nl/>\n"
"Language: nl\n" "Language: nl\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n" "Content-Type: text/plain; charset=iso-8859-1\n"
@ -1372,12 +1371,19 @@ msgstr "Kopieer filter"
#, csharp-format #, csharp-format
msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_LocalFolder_Body" msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_LocalFolder_Body"
msgid "Modifying shared folders locally is not supported. Please use the 'Shared Folders' dialog to modify these folders." msgid "Modifying shared folders locally is not supported. Please use the 'Shared Folders' dialog to modify these folders."
msgstr "" msgstr "Het lokaal aanpassen van gedeelde mappen word niet ondersteund. Gebruik het venster 'Gedeelde Mappen' om deze mappen aan te passen."
"Het lokaal aanpassen van gedeelde mappen word niet ondersteund. Gebruik het "
"venster 'Gedeelde Mappen' om deze mappen aan te passen."
#: AcaciaZPushPlugin\Properties\Resources\SharedFolders_LocalFolder_Title #: AcaciaZPushPlugin\Properties\Resources\SharedFolders_LocalFolder_Title
#, csharp-format #, csharp-format
msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_LocalFolder_Title" msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_LocalFolder_Title"
msgid "Shared folders" msgid "Shared folders"
msgstr "Gedeelde mappen" msgstr "Gedeelde mappen"
#: AcaciaZPushPlugin\Properties\Resources\SharedFolders_Node_Readonly_ToolTip
#, csharp-format
msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_Node_Readonly_ToolTip"
msgid ""
"The folder has been configured by your system administrator and cannot be modified. \n"
"Please contact your system administrator for any required changes."
msgstr ""

View File

@ -1134,3 +1134,11 @@ msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_LocalFolder_Tit
msgid "Shared folders" msgid "Shared folders"
msgstr "" msgstr ""
#: AcaciaZPushPlugin\Properties\Resources\SharedFolders_Node_Readonly_ToolTip
#, csharp-format
msgctxt "AcaciaZPushPlugin\\Properties\\Resources\\SharedFolders_Node_Readonly_ToolTip"
msgid ""
"The folder has been configured by your system administrator and cannot be modified. \n"
"Please contact your system administrator for any required changes."
msgstr ""