Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…alendarSync into release

Resolves #1059
  • Loading branch information
phw198 committed Oct 4, 2020
2 parents 71e55c3 + fd2a94b commit c3d206f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/OutlookGoogleCalendarSync/Extensions/ColourPicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public void AddStandardColours() {
/// Add just the colours associated with categories
/// </summary>
public void AddCategoryColours() {
Items.AddRange(OutlookOgcs.Calendar.Categories.DropdownItems().ToArray());
if (OutlookOgcs.Factory.OutlookVersionName != OutlookOgcs.Factory.OutlookVersionNames.Outlook2003)
Items.AddRange(OutlookOgcs.Calendar.Categories.DropdownItems().ToArray());
}

public void ColourPicker_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) {
Expand Down
2 changes: 2 additions & 0 deletions src/OutlookGoogleCalendarSync/Forms/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion src/OutlookGoogleCalendarSync/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ private void updateGUIsettings() {
foreach (KeyValuePair<String, MAPIFolder> calendarFolder in OutlookOgcs.Calendar.Instance.CalendarFolders) {
if (calendarFolder.Value.EntryID == Settings.Instance.UseOutlookCalendar.Id) {
cbOutlookCalendars.SelectedIndex = c;
break;
}
c++;
}
Expand All @@ -226,9 +227,13 @@ private void updateGUIsettings() {
"Include" : "Exclude";
if (OutlookOgcs.Factory.OutlookVersionName == OutlookOgcs.Factory.OutlookVersionNames.Outlook2003) {
clbCategories.Items.Clear();
clbCategories.Items.Add("Outlook 2003 has no categories");
cbCategoryFilter.Enabled = false;
clbCategories.Enabled = false;
lFilterCategories.Enabled = false;
btColourMap.Visible = false;
Settings.Instance.AddColours = false;
cbAddColours.Enabled = false;
} else {
OutlookOgcs.Calendar.Categories.BuildPicker(ref clbCategories);
enableOutlookSettingsUI(true);
Expand Down Expand Up @@ -300,6 +305,7 @@ private void updateGUIsettings() {
Sync.Direction sd = (syncDirection.Items[i] as Sync.Direction);
if (sd.Id == Settings.Instance.SyncDirection.Id) {
syncDirection.SelectedIndex = i;
break;
}
}
if (syncDirection.SelectedIndex == -1) syncDirection.SelectedIndex = 0;
Expand Down Expand Up @@ -1325,9 +1331,17 @@ private void tbTargetCalendar_SelectedItemChanged(object sender, EventArgs e) {
Settings.Instance.TargetCalendar = Sync.Direction.GoogleToOutlook;
this.ddGoogleColour.Visible = false;
this.ddOutlookColour.Visible = true;
if (OutlookOgcs.Factory.OutlookVersionName == OutlookOgcs.Factory.OutlookVersionNames.Outlook2003)
this.cbColour.Checked = false;
break;
}
case "target calendar": {
Settings.Instance.TargetCalendar = Settings.Instance.SyncDirection;
if (OutlookOgcs.Factory.OutlookVersionName == OutlookOgcs.Factory.OutlookVersionNames.Outlook2003
&& Settings.Instance.SyncDirection == Sync.Direction.GoogleToOutlook)
this.cbColour.Checked = false;
break;
}
case "target calendar": Settings.Instance.TargetCalendar = Settings.Instance.SyncDirection; break;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/OutlookGoogleCalendarSync/OutlookOgcs/OutlookOld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ private void getDefaultCalendar(NameSpace oNS, ref MAPIFolder defaultCalendar) {
string excludeDeletedFolder = folders.Application.Session.GetDefaultFolder(OlDefaultFolders.olFolderDeletedItems).EntryID;

Forms.Main.Instance.lOutlookCalendar.BackColor = System.Drawing.Color.Yellow;
Forms.Main.Instance.lOutlookCalendar.Text = "Getting calendars";
Forms.Main.Instance.SetControlPropertyThreadSafe(Forms.Main.Instance.lOutlookCalendar, "Text", "Getting calendars");
findCalendars(((MAPIFolder)defaultCalendar.Parent).Folders, calendarFolders, excludeDeletedFolder, defaultCalendar);
Forms.Main.Instance.lOutlookCalendar.BackColor = System.Drawing.Color.White;
Forms.Main.Instance.lOutlookCalendar.Text = "Select calendar";
Forms.Main.Instance.SetControlPropertyThreadSafe(Forms.Main.Instance.lOutlookCalendar, "Text", "Select calendar");
} catch (System.Exception ex) {
OGCSexception.Analyse(ex, true);
throw;
Expand Down
7 changes: 5 additions & 2 deletions src/OutlookGoogleCalendarSync/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,11 @@ public void LogSettings() {
}
if (ColourMaps.Count > 0) {
log.Info(" Custom Colour/Category Mapping:-");
ColourMaps.ToList().ForEach(c => log.Info(" " + OutlookOgcs.Calendar.Categories.OutlookColour(c.Key) + ":"+ c.Key + " <=> " +
c.Value + ":" + GoogleOgcs.EventColour.Palette.GetColourName(c.Value)));
if (OutlookOgcs.Factory.OutlookVersionName == OutlookOgcs.Factory.OutlookVersionNames.Outlook2003)
log.Fail(" Using Outlook2003 - categories not supported, although mapping exists");
else
ColourMaps.ToList().ForEach(c => log.Info(" " + OutlookOgcs.Calendar.Categories.OutlookColour(c.Key) + ":" + c.Key + " <=> " +
c.Value + ":" + GoogleOgcs.EventColour.Palette.GetColourName(c.Value)));
}
log.Info(" Obfuscate Words: " + Obfuscation.Enabled);
if (Obfuscation.Enabled) {
Expand Down

0 comments on commit c3d206f

Please sign in to comment.