diff --git a/src/OutlookGoogleCalendarSync/Extensions/ColourPicker.cs b/src/OutlookGoogleCalendarSync/Extensions/ColourPicker.cs index ba0743aa..db1120ac 100644 --- a/src/OutlookGoogleCalendarSync/Extensions/ColourPicker.cs +++ b/src/OutlookGoogleCalendarSync/Extensions/ColourPicker.cs @@ -35,7 +35,8 @@ public void AddStandardColours() { /// Add just the colours associated with categories /// 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) { diff --git a/src/OutlookGoogleCalendarSync/Forms/MainForm.Designer.cs b/src/OutlookGoogleCalendarSync/Forms/MainForm.Designer.cs index 82939350..c911e175 100644 --- a/src/OutlookGoogleCalendarSync/Forms/MainForm.Designer.cs +++ b/src/OutlookGoogleCalendarSync/Forms/MainForm.Designer.cs @@ -669,6 +669,7 @@ private void InitializeComponent() { // // btTestOutlookFilter // + this.btTestOutlookFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btTestOutlookFilter.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btTestOutlookFilter.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btTestOutlookFilter.ForeColor = System.Drawing.SystemColors.ControlText; @@ -904,6 +905,7 @@ private void InitializeComponent() { // // lGoogleAPIInstructions // + this.lGoogleAPIInstructions.Anchor = System.Windows.Forms.AnchorStyles.Top; this.lGoogleAPIInstructions.BackColor = System.Drawing.SystemColors.Window; this.lGoogleAPIInstructions.BorderStyle = System.Windows.Forms.BorderStyle.None; this.lGoogleAPIInstructions.Location = new System.Drawing.Point(13, 20); diff --git a/src/OutlookGoogleCalendarSync/Forms/MainForm.cs b/src/OutlookGoogleCalendarSync/Forms/MainForm.cs index 61431bf6..6c1bf151 100644 --- a/src/OutlookGoogleCalendarSync/Forms/MainForm.cs +++ b/src/OutlookGoogleCalendarSync/Forms/MainForm.cs @@ -205,6 +205,7 @@ private void updateGUIsettings() { foreach (KeyValuePair calendarFolder in OutlookOgcs.Calendar.Instance.CalendarFolders) { if (calendarFolder.Value.EntryID == Settings.Instance.UseOutlookCalendar.Id) { cbOutlookCalendars.SelectedIndex = c; + break; } c++; } @@ -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); @@ -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; @@ -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; } } diff --git a/src/OutlookGoogleCalendarSync/OutlookOgcs/OutlookOld.cs b/src/OutlookGoogleCalendarSync/OutlookOgcs/OutlookOld.cs index 722fefd6..5057fcd8 100644 --- a/src/OutlookGoogleCalendarSync/OutlookOgcs/OutlookOld.cs +++ b/src/OutlookGoogleCalendarSync/OutlookOgcs/OutlookOld.cs @@ -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; diff --git a/src/OutlookGoogleCalendarSync/Settings.cs b/src/OutlookGoogleCalendarSync/Settings.cs index 63b8049f..e5f62665 100644 --- a/src/OutlookGoogleCalendarSync/Settings.cs +++ b/src/OutlookGoogleCalendarSync/Settings.cs @@ -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) {