1
0
mirror of https://github.com/aluxnimm/outlookcaldavsynchronizer.git synced 2025-10-06 00:12:52 +02:00

Add Aruba Profile and areSyncSettingsVisibleInAdvancedSettings flag.

This commit is contained in:
nimm
2025-06-01 09:33:20 +02:00
parent 2fa93a92c1
commit 908170191b
14 changed files with 134 additions and 11 deletions

View File

@@ -158,7 +158,7 @@ namespace CalDavSynchronizer.UnitTest.Ui.Options.ViewModels
throw new NotImplementedException();
}
public ProfileModelOptions ModelOptions { get; } = new ProfileModelOptions(true, true, true, true, "DAV Url", true, true, true);
public ProfileModelOptions ModelOptions { get; } = new ProfileModelOptions(true, true, true, true, "DAV Url", true, true, true, true);
public string ImageUrl { get; } = string.Empty;

View File

@@ -374,6 +374,7 @@
<Compile Include="IOutlookSession.cs" />
<Compile Include="IProfileExportProcessor.cs" />
<Compile Include="OutlookCategory.cs" />
<Compile Include="ProfileTypes\ConcreteTypes\ArubaProfile.cs" />
<Compile Include="ProfileTypes\ConcreteTypes\CalendariCloudProfile.cs" />
<Compile Include="ProfileTypes\ConcreteTypes\FastMailProfile.cs" />
<Compile Include="ProfileTypes\ConcreteTypes\Open-XchangeProfile.cs" />
@@ -468,6 +469,7 @@
<Compile Include="Ui\Options\Views\GeneralOptionsWindow.xaml.cs">
<DependentUpon>GeneralOptionsWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Ui\Options\Views\MultiValueToVisibilityConverter.cs" />
<Compile Include="Ui\Options\Views\OXInfoDialog.xaml.cs">
<DependentUpon>OXInfoDialog.xaml</DependentUpon>
</Compile>
@@ -839,6 +841,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="LICENSE.txt" />
<Resource Include="Resources\ProfileLogos\logo_aruba.png" />
<Resource Include="Resources\ProfileLogos\logo_untermStrich.png" />
<Resource Include="Resources\ProfileLogos\logo_ox_with_claim.png" />
<Resource Include="Resources\ProfileLogos\logo_fuago.png" />

View File

@@ -0,0 +1,67 @@
// This file is Part of CalDavSynchronizer (http://outlookcaldavsynchronizer.sourceforge.net/)
// Copyright (c) 2015 Gerhard Zehetbauer
// Copyright (c) 2015 Alexander Nimmervoll
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Collections.Generic;
using CalDavSynchronizer.Contracts;
using CalDavSynchronizer.Globalization;
using CalDavSynchronizer.Ui.Options;
using CalDavSynchronizer.Ui.Options.Models;
using CalDavSynchronizer.Ui.Options.ViewModels;
namespace CalDavSynchronizer.ProfileTypes.ConcreteTypes
{
class ArubaProfile : ProfileTypeBase
{
public override string Name => "Aruba";
public override string ImageUrl { get; } = "pack://application:,,,/CalDavSynchronizer;component/Resources/ProfileLogos/logo_aruba.png";
public override IProfileModelFactory CreateModelFactory(IOptionsViewModelParent optionsViewModelParent, IOutlookAccountPasswordProvider outlookAccountPasswordProvider, IReadOnlyList<string> availableCategories, IOptionTasks optionTasks, GeneralOptions generalOptions, IViewOptions viewOptions, OptionModelSessionData sessionData)
{
return new ProfileModelFactory(this, optionsViewModelParent, outlookAccountPasswordProvider, availableCategories, optionTasks, generalOptions, viewOptions, sessionData);
}
public override Contracts.Options CreateOptions()
{
var data = base.CreateOptions();
data.CalenderUrl = "https://syncdav.aruba.it/";
data.EnableChangeTriggeredSynchronization = true;
data.SynchronizationIntervalInMinutes = 15;
data.MappingConfiguration = CreateEventMappingConfiguration();
return data;
}
public override EventMappingConfiguration CreateEventMappingConfiguration()
{
var data = base.CreateEventMappingConfiguration();
data.UseGlobalAppointmentID = true;
data.CleanupDuplicateEvents = true;
return data;
}
class ProfileModelFactory : ProfileModelFactoryBase
{
public ProfileModelFactory(IProfileType profileType, IOptionsViewModelParent optionsViewModelParent, IOutlookAccountPasswordProvider outlookAccountPasswordProvider, IReadOnlyList<string> availableCategories, IOptionTasks optionTasks, GeneralOptions generalOptions, IViewOptions viewOptions, OptionModelSessionData sessionData)
: base(profileType, optionsViewModelParent, outlookAccountPasswordProvider, availableCategories, optionTasks, generalOptions, viewOptions, sessionData)
{
}
public override ProfileModelOptions ModelOptions { get; } = new ProfileModelOptions(true, true, true, true, Strings.Get($"DAV URL"), true, false, true, true);
}
}
}

View File

@@ -83,7 +83,7 @@ namespace CalDavSynchronizer.ProfileTypes.ConcreteTypes
ViewOptions);
}
public override ProfileModelOptions ModelOptions { get; } = new ProfileModelOptions(true, true, false, true, Strings.Get($"DAV URL"), true, true, true);
public override ProfileModelOptions ModelOptions { get; } = new ProfileModelOptions(true, true, false, true, Strings.Get($"DAV URL"), true, true, true, true);
public override IOptionsViewModel CreateViewModel(OptionsModel model)
{

View File

@@ -78,7 +78,7 @@ namespace CalDavSynchronizer.ProfileTypes.ConcreteTypes
ViewOptions);
}
public override ProfileModelOptions ModelOptions { get; } = new ProfileModelOptions(true, true, true, true, Strings.Get($"Kolab URL"), true, true, true);
public override ProfileModelOptions ModelOptions { get; } = new ProfileModelOptions(true, true, true, true, Strings.Get($"Kolab URL"), true, true, true, true);
}
}
}

View File

@@ -67,7 +67,7 @@ namespace CalDavSynchronizer.ProfileTypes.ConcreteTypes.Swisscom
return new SwisscomServerSettingsDetector();
}
public override ProfileModelOptions ModelOptions { get; } = new ProfileModelOptions(false, false, false, false, Strings.Get($"Detected URL"), false, false, false);
public override ProfileModelOptions ModelOptions { get; } = new ProfileModelOptions(false, false, false, false, Strings.Get($"Detected URL"), false, false, false, false);
}
}
}

View File

@@ -29,6 +29,6 @@ namespace CalDavSynchronizer.ProfileTypes
return GenericOptionsViewModel.DesignInstance;
}
public ProfileModelOptions ModelOptions { get; } = new ProfileModelOptions(false, false, false, false, Strings.Get($"DAV URL"), false, true, true);
public ProfileModelOptions ModelOptions { get; } = new ProfileModelOptions(false, false, false, false, Strings.Get($"DAV URL"), false, true, true, true);
}
}

View File

@@ -106,7 +106,7 @@ namespace CalDavSynchronizer.ProfileTypes
return optionsViewModel;
}
public virtual ProfileModelOptions ModelOptions { get; } = new ProfileModelOptions(true, true, true, true, Strings.Get($"DAV URL"), true, true, true);
public virtual ProfileModelOptions ModelOptions { get; } = new ProfileModelOptions(true, true, true, true, Strings.Get($"DAV URL"), true, true, true, true);
protected virtual IOptionsViewModel CreateTemplateViewModel(OptionsModel prototypeModel)
{

View File

@@ -21,7 +21,7 @@ namespace CalDavSynchronizer.ProfileTypes
{
public class ProfileModelOptions
{
public ProfileModelOptions(bool areAdvancedNetWorkSettingsEnabled, bool isEnableChangeTriggeredSynchronizationEnabled, bool isTaskMappingConfigurationEnabled, bool isContactMappingConfigurationEnabled, string davUrlLabelText, bool areSyncSettingsEnabled, bool areSyncSettingsVisible, bool isEnableChangeTriggeredSynchronizationVisible)
public ProfileModelOptions(bool areAdvancedNetWorkSettingsEnabled, bool isEnableChangeTriggeredSynchronizationEnabled, bool isTaskMappingConfigurationEnabled, bool isContactMappingConfigurationEnabled, string davUrlLabelText, bool areSyncSettingsEnabled, bool areSyncSettingsVisible, bool areSyncSettingsVisibleInAdvancedSettings, bool isEnableChangeTriggeredSynchronizationVisible)
{
AreAdvancedNetWorkSettingsEnabled = areAdvancedNetWorkSettingsEnabled;
IsEnableChangeTriggeredSynchronizationEnabled = isEnableChangeTriggeredSynchronizationEnabled;
@@ -30,10 +30,12 @@ namespace CalDavSynchronizer.ProfileTypes
DavUrlLabelText = davUrlLabelText;
AreSyncSettingsEnabled = areSyncSettingsEnabled;
AreSyncSettingsVisible = areSyncSettingsVisible;
AreSyncSettingsVisibleInAdvancedSettings = areSyncSettingsVisibleInAdvancedSettings;
IsEnableChangeTriggeredSynchronizationVisible = isEnableChangeTriggeredSynchronizationVisible;
}
public bool AreSyncSettingsVisible { get; }
public bool AreSyncSettingsVisibleInAdvancedSettings { get; }
public bool AreSyncSettingsEnabled { get; }
public bool AreAdvancedNetWorkSettingsEnabled { get; }
public bool IsEnableChangeTriggeredSynchronizationVisible { get; }

View File

@@ -69,6 +69,7 @@ namespace CalDavSynchronizer.ProfileTypes
all.Add(new EGroupwareProfile());
all.Add(new FastMailProfile());
all.Add(new untermStrichProfile());
all.Add(new ArubaProfile());
return new ProfileTypeRegistry(all, generic, google);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -157,7 +157,7 @@ namespace CalDavSynchronizer.Ui.Options.BulkOptions.ViewModels
}
public static ServerSettingsTemplateViewModel DesignInstance = new ServerSettingsTemplateViewModel(NullOutlookAccountPasswordProvider.Instance, OptionsModel.DesignInstance, new ProfileModelOptions(false, false, false, false, "DAV Url", false, true, true))
public static ServerSettingsTemplateViewModel DesignInstance = new ServerSettingsTemplateViewModel(NullOutlookAccountPasswordProvider.Instance, OptionsModel.DesignInstance, new ProfileModelOptions(false, false, false, false, "DAV Url", false, true, true, true))
{
CalenderUrl = "http://bulkurl",
EmailAddress = "bulkemail",

View File

@@ -0,0 +1,41 @@
// This file is Part of CalDavSynchronizer (http://outlookcaldavsynchronizer.sourceforge.net/)
// Copyright (c) 2015 Gerhard Zehetbauer
// Copyright (c) 2015 Alexander Nimmervoll
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Windows;
using System.Globalization;
using System.Windows.Data;
namespace CalDavSynchronizer.Ui.Options.Views
{
public class MultiValueToVisibilityConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
bool a = (bool)values[0];
bool b = (bool)values[1];
bool c = (bool)values[2];
return a || (b && c) ? Visibility.Visible : Visibility.Collapsed;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -5,13 +5,22 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:viewModels="clr-namespace:CalDavSynchronizer.Ui.Options.ViewModels"
xmlns:g="clr-namespace:CalDavSynchronizer.Globalization"
xmlns:views="clr-namespace:CalDavSynchronizer.Ui.Options.Views"
mc:Ignorable="d"
d:DataContext="{x:Static viewModels:SyncSettingsViewModel.DesignInstance}">
<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<views:MultiValueToVisibilityConverter x:Key="MultiValueToVisibilityConverter" />
</UserControl.Resources>
<GroupBox Header="{g:Localize Sync Settings}" IsEnabled="{Binding ModelOptions.AreSyncSettingsEnabled}" Visibility="{Binding ModelOptions.AreSyncSettingsVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
<Grid DockPanel.Dock="Top">
<GroupBox Header="{g:Localize Sync Settings}" IsEnabled="{Binding ModelOptions.AreSyncSettingsEnabled}">
<GroupBox.Visibility>
<MultiBinding Converter="{StaticResource MultiValueToVisibilityConverter}">
<Binding Path="ModelOptions.AreSyncSettingsVisible" />
<Binding Path="ViewOptions.IsAdvancedViewEnabled" />
<Binding Path="ModelOptions.AreSyncSettingsVisibleInAdvancedSettings" />
</MultiBinding>
</GroupBox.Visibility>
<Grid DockPanel.Dock="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />