diff --git a/src/OutlookGoogleCalendarSync/Forms/MainForm.Designer.cs b/src/OutlookGoogleCalendarSync/Forms/MainForm.Designer.cs index 7879f0dd..8c3ba98c 100644 --- a/src/OutlookGoogleCalendarSync/Forms/MainForm.Designer.cs +++ b/src/OutlookGoogleCalendarSync/Forms/MainForm.Designer.cs @@ -100,27 +100,44 @@ private void InitializeComponent() { this.panelObscure = new System.Windows.Forms.Panel(); this.panelProfileLoading = new System.Windows.Forms.Panel(); this.txtProfileLoading = new System.Windows.Forms.Label(); - this.cbListHiddenGcals = new System.Windows.Forms.CheckBox(); - this.cbExcludeDeclinedInvites = new System.Windows.Forms.CheckBox(); - this.cbExcludeGoals = new System.Windows.Forms.CheckBox(); - this.label7 = new System.Windows.Forms.Label(); - this.tbConnectedAcc = new System.Windows.Forms.TextBox(); - this.gbDeveloperOptions = new System.Windows.Forms.GroupBox(); + this.label12 = new System.Windows.Forms.Label(); + this.panelGoogle = new System.Windows.Forms.Panel(); + this.pbExpandGoogleOauth = new System.Windows.Forms.PictureBox(); + this.cbShowDeveloperOptions = new System.Windows.Forms.CheckBox(); + this.pbExpandGoogleConfig = new System.Windows.Forms.PictureBox(); + this.pbExpandGoogleAccount = new System.Windows.Forms.PictureBox(); + this.gbGoogle_OAuth = new System.Windows.Forms.GroupBox(); + this.tbClientSecret = new System.Windows.Forms.TextBox(); + this.tbClientID = new System.Windows.Forms.TextBox(); this.llAPIConsole = new System.Windows.Forms.LinkLabel(); this.cbShowClientSecret = new System.Windows.Forms.CheckBox(); this.lGoogleAPIInstructions = new System.Windows.Forms.TextBox(); - this.tbClientSecret = new System.Windows.Forms.TextBox(); - this.tbClientID = new System.Windows.Forms.TextBox(); this.lClientID = new System.Windows.Forms.Label(); this.lSecret = new System.Windows.Forms.Label(); - this.cbShowDeveloperOptions = new System.Windows.Forms.CheckBox(); - this.label13 = new System.Windows.Forms.Label(); - this.label12 = new System.Windows.Forms.Label(); - this.btResetGCal = new System.Windows.Forms.Button(); - this.lGoogleHelp = new System.Windows.Forms.Label(); - this.lGoogleCalendar = new System.Windows.Forms.Label(); - this.bGetGoogleCalendars = new System.Windows.Forms.Button(); + this.gbGoogle_GConfig = new System.Windows.Forms.GroupBox(); + this.cbDeleteWhenColourExcl = new System.Windows.Forms.CheckBox(); + this.label35 = new System.Windows.Forms.Label(); + this.cbColourFilter = new System.Windows.Forms.ComboBox(); + this.clbColours = new System.Windows.Forms.CheckedListBox(); + this.msColours = new System.Windows.Forms.ContextMenuStrip(this.components); + this.miColourSelectAll = new System.Windows.Forms.ToolStripMenuItem(); + this.miColourSelectNone = new System.Windows.Forms.ToolStripMenuItem(); + this.miColourSelectInvert = new System.Windows.Forms.ToolStripMenuItem(); + this.miColourRefresh = new System.Windows.Forms.ToolStripMenuItem(); + this.cbExcludeDeclinedInvites = new System.Windows.Forms.CheckBox(); + this.cbExcludeGoals = new System.Windows.Forms.CheckBox(); + this.gbGoogle_Account = new System.Windows.Forms.GroupBox(); + this.llMultipleOGCS = new System.Windows.Forms.LinkLabel(); + this.label14 = new System.Windows.Forms.Label(); this.cbGoogleCalendars = new System.Windows.Forms.ComboBox(); + this.bGetGoogleCalendars = new System.Windows.Forms.Button(); + this.lGoogleCalendar = new System.Windows.Forms.Label(); + this.lGoogleHelp = new System.Windows.Forms.Label(); + this.btResetGCal = new System.Windows.Forms.Button(); + this.label13 = new System.Windows.Forms.Label(); + this.tbConnectedAcc = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.cbListHiddenGcals = new System.Windows.Forms.CheckBox(); this.tabSyncOptions = new System.Windows.Forms.TabPage(); this.WhatPostit = new System.Windows.Forms.Panel(); this.tbWhatHelp = new System.Windows.Forms.RichTextBox(); @@ -306,7 +323,14 @@ private void InitializeComponent() { this.tabGoogle.SuspendLayout(); this.panelObscure.SuspendLayout(); this.panelProfileLoading.SuspendLayout(); - this.gbDeveloperOptions.SuspendLayout(); + this.panelGoogle.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbExpandGoogleOauth)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbExpandGoogleConfig)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbExpandGoogleAccount)).BeginInit(); + this.gbGoogle_OAuth.SuspendLayout(); + this.gbGoogle_GConfig.SuspendLayout(); + this.msColours.SuspendLayout(); + this.gbGoogle_Account.SuspendLayout(); this.tabSyncOptions.SuspendLayout(); this.WhatPostit.SuspendLayout(); this.panelSyncOptions.SuspendLayout(); @@ -759,7 +783,7 @@ private void InitializeComponent() { this.msCategories.Name = "msCategories"; this.msCategories.ShowImageMargin = false; this.msCategories.ShowItemToolTips = false; - this.msCategories.Size = new System.Drawing.Size(148, 70); + this.msCategories.Size = new System.Drawing.Size(148, 92); // // miCatSelectAll // @@ -910,7 +934,7 @@ private void InitializeComponent() { this.label11.AutoSize = true; this.label11.Font = new System.Drawing.Font("Arial Black", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label11.ForeColor = System.Drawing.SystemColors.MenuHighlight; - this.label11.Location = new System.Drawing.Point(67, 13); + this.label11.Location = new System.Drawing.Point(67, 10); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(268, 15); this.label11.TabIndex = 26; @@ -1000,23 +1024,10 @@ private void InitializeComponent() { // this.tabGoogle.BackColor = System.Drawing.Color.White; this.tabGoogle.Controls.Add(this.panelObscure); - this.tabGoogle.Controls.Add(this.cbListHiddenGcals); - this.tabGoogle.Controls.Add(this.cbExcludeDeclinedInvites); - this.tabGoogle.Controls.Add(this.cbExcludeGoals); - this.tabGoogle.Controls.Add(this.label7); - this.tabGoogle.Controls.Add(this.tbConnectedAcc); - this.tabGoogle.Controls.Add(this.gbDeveloperOptions); - this.tabGoogle.Controls.Add(this.cbShowDeveloperOptions); - this.tabGoogle.Controls.Add(this.label13); this.tabGoogle.Controls.Add(this.label12); - this.tabGoogle.Controls.Add(this.btResetGCal); - this.tabGoogle.Controls.Add(this.lGoogleHelp); - this.tabGoogle.Controls.Add(this.lGoogleCalendar); - this.tabGoogle.Controls.Add(this.bGetGoogleCalendars); - this.tabGoogle.Controls.Add(this.cbGoogleCalendars); + this.tabGoogle.Controls.Add(this.panelGoogle); this.tabGoogle.Location = new System.Drawing.Point(79, 4); this.tabGoogle.Name = "tabGoogle"; - this.tabGoogle.Padding = new System.Windows.Forms.Padding(3); this.tabGoogle.Size = new System.Drawing.Size(392, 455); this.tabGoogle.TabIndex = 1; this.tabGoogle.Text = " Google"; @@ -1054,89 +1065,142 @@ private void InitializeComponent() { this.txtProfileLoading.Text = "PROFILE LOADING"; this.txtProfileLoading.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // cbListHiddenGcals + // label12 // - this.cbListHiddenGcals.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.cbListHiddenGcals.Location = new System.Drawing.Point(299, 197); - this.cbListHiddenGcals.Name = "cbListHiddenGcals"; - this.cbListHiddenGcals.Size = new System.Drawing.Size(79, 17); - this.cbListHiddenGcals.TabIndex = 30; - this.cbListHiddenGcals.Text = "List Hidden"; - this.cbListHiddenGcals.UseVisualStyleBackColor = true; - this.cbListHiddenGcals.CheckedChanged += new System.EventHandler(this.cbListHiddenGcals_CheckedChanged); + this.label12.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.label12.AutoSize = true; + this.label12.Font = new System.Drawing.Font("Arial Black", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label12.ForeColor = System.Drawing.SystemColors.MenuHighlight; + this.label12.Location = new System.Drawing.Point(68, 10); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(263, 15); + this.label12.TabIndex = 27; + this.label12.Text = "Select the Google Calendar to Synchronise"; + this.label12.TextAlign = System.Drawing.ContentAlignment.TopCenter; // - // cbExcludeDeclinedInvites + // panelGoogle // - this.cbExcludeDeclinedInvites.AutoSize = true; - this.cbExcludeDeclinedInvites.Location = new System.Drawing.Point(14, 197); - this.cbExcludeDeclinedInvites.Name = "cbExcludeDeclinedInvites"; - this.cbExcludeDeclinedInvites.Size = new System.Drawing.Size(190, 17); - this.cbExcludeDeclinedInvites.TabIndex = 47; - this.cbExcludeDeclinedInvites.Text = "Exclude invitations I have declined"; - this.cbExcludeDeclinedInvites.UseVisualStyleBackColor = true; - this.cbExcludeDeclinedInvites.CheckedChanged += new System.EventHandler(this.cbExcludeDeclinedInvites_CheckedChanged); + this.panelGoogle.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panelGoogle.AutoScroll = true; + this.panelGoogle.Controls.Add(this.pbExpandGoogleOauth); + this.panelGoogle.Controls.Add(this.cbShowDeveloperOptions); + this.panelGoogle.Controls.Add(this.pbExpandGoogleConfig); + this.panelGoogle.Controls.Add(this.pbExpandGoogleAccount); + this.panelGoogle.Controls.Add(this.gbGoogle_OAuth); + this.panelGoogle.Controls.Add(this.gbGoogle_GConfig); + this.panelGoogle.Controls.Add(this.gbGoogle_Account); + this.panelGoogle.Location = new System.Drawing.Point(4, 31); + this.panelGoogle.Name = "panelGoogle"; + this.panelGoogle.Size = new System.Drawing.Size(385, 427); + this.panelGoogle.TabIndex = 52; + // + // pbExpandGoogleOauth + // + this.pbExpandGoogleOauth.Cursor = System.Windows.Forms.Cursors.Hand; + this.pbExpandGoogleOauth.Image = global::OutlookGoogleCalendarSync.Properties.Resources.expand; + this.pbExpandGoogleOauth.Location = new System.Drawing.Point(1, 394); + this.pbExpandGoogleOauth.Name = "pbExpandGoogleOauth"; + this.pbExpandGoogleOauth.Size = new System.Drawing.Size(20, 20); + this.pbExpandGoogleOauth.TabIndex = 50; + this.pbExpandGoogleOauth.TabStop = false; + this.pbExpandGoogleOauth.Visible = false; + this.pbExpandGoogleOauth.Click += new System.EventHandler(this.pbExpandGoogleOauth_Click); // - // cbExcludeGoals + // cbShowDeveloperOptions // - this.cbExcludeGoals.AutoSize = true; - this.cbExcludeGoals.Location = new System.Drawing.Point(14, 216); - this.cbExcludeGoals.Name = "cbExcludeGoals"; - this.cbExcludeGoals.Size = new System.Drawing.Size(182, 17); - this.cbExcludeGoals.TabIndex = 46; - this.cbExcludeGoals.Text = "Exclude \"Goal\" events from sync"; - this.cbExcludeGoals.UseVisualStyleBackColor = true; - this.cbExcludeGoals.CheckedChanged += new System.EventHandler(this.cbExcludeGoals_CheckedChanged); + this.cbShowDeveloperOptions.AutoSize = true; + this.cbShowDeveloperOptions.Location = new System.Drawing.Point(23, 374); + this.cbShowDeveloperOptions.Name = "cbShowDeveloperOptions"; + this.cbShowDeveloperOptions.Size = new System.Drawing.Size(193, 17); + this.cbShowDeveloperOptions.TabIndex = 48; + this.cbShowDeveloperOptions.Text = "Show advanced/developer options"; + this.cbShowDeveloperOptions.UseVisualStyleBackColor = true; + this.cbShowDeveloperOptions.CheckedChanged += new System.EventHandler(this.cbShowDeveloperOptions_CheckedChanged); // - // label7 + // pbExpandGoogleConfig // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(47, 49); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(102, 13); - this.label7.TabIndex = 33; - this.label7.Text = "Connected Account"; - this.label7.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.pbExpandGoogleConfig.Cursor = System.Windows.Forms.Cursors.Hand; + this.pbExpandGoogleConfig.Image = global::OutlookGoogleCalendarSync.Properties.Resources.expand; + this.pbExpandGoogleConfig.Location = new System.Drawing.Point(1, 243); + this.pbExpandGoogleConfig.Name = "pbExpandGoogleConfig"; + this.pbExpandGoogleConfig.Size = new System.Drawing.Size(20, 20); + this.pbExpandGoogleConfig.TabIndex = 47; + this.pbExpandGoogleConfig.TabStop = false; + this.pbExpandGoogleConfig.Click += new System.EventHandler(this.pbExpandGoogleConfig_Click); // - // tbConnectedAcc + // pbExpandGoogleAccount // - this.tbConnectedAcc.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.pbExpandGoogleAccount.Cursor = System.Windows.Forms.Cursors.Hand; + this.pbExpandGoogleAccount.Image = global::OutlookGoogleCalendarSync.Properties.Resources.expand; + this.pbExpandGoogleAccount.Location = new System.Drawing.Point(1, 0); + this.pbExpandGoogleAccount.Name = "pbExpandGoogleAccount"; + this.pbExpandGoogleAccount.Size = new System.Drawing.Size(20, 20); + this.pbExpandGoogleAccount.TabIndex = 44; + this.pbExpandGoogleAccount.TabStop = false; + this.pbExpandGoogleAccount.Click += new System.EventHandler(this.pbExpandGoogleAccount_Click); + // + // gbGoogle_OAuth + // + this.gbGoogle_OAuth.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.tbConnectedAcc.Location = new System.Drawing.Point(154, 46); - this.tbConnectedAcc.Name = "tbConnectedAcc"; - this.tbConnectedAcc.ReadOnly = true; - this.tbConnectedAcc.Size = new System.Drawing.Size(220, 20); - this.tbConnectedAcc.TabIndex = 32; + this.gbGoogle_OAuth.Controls.Add(this.tbClientSecret); + this.gbGoogle_OAuth.Controls.Add(this.tbClientID); + this.gbGoogle_OAuth.Controls.Add(this.llAPIConsole); + this.gbGoogle_OAuth.Controls.Add(this.cbShowClientSecret); + this.gbGoogle_OAuth.Controls.Add(this.lGoogleAPIInstructions); + this.gbGoogle_OAuth.Controls.Add(this.lClientID); + this.gbGoogle_OAuth.Controls.Add(this.lSecret); + this.gbGoogle_OAuth.Font = new System.Drawing.Font("Arial Black", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.gbGoogle_OAuth.ForeColor = System.Drawing.SystemColors.MenuHighlight; + this.gbGoogle_OAuth.Location = new System.Drawing.Point(10, 397); + this.gbGoogle_OAuth.MinimumSize = new System.Drawing.Size(368, 0); + this.gbGoogle_OAuth.Name = "gbGoogle_OAuth"; + this.gbGoogle_OAuth.Size = new System.Drawing.Size(368, 174); + this.gbGoogle_OAuth.TabIndex = 49; + this.gbGoogle_OAuth.TabStop = false; + this.gbGoogle_OAuth.Text = " Google OAuth API"; + this.gbGoogle_OAuth.Visible = false; + // + // tbClientSecret + // + this.tbClientSecret.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbClientSecret.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tbClientSecret.Location = new System.Drawing.Point(54, 145); + this.tbClientSecret.Name = "tbClientSecret"; + this.tbClientSecret.ReadOnly = true; + this.tbClientSecret.Size = new System.Drawing.Size(230, 20); + this.tbClientSecret.TabIndex = 33; + this.tbClientSecret.UseSystemPasswordChar = true; + this.tbClientSecret.TextChanged += new System.EventHandler(this.tbClientSecret_TextChanged); + this.tbClientSecret.Leave += new System.EventHandler(this.personalApiKey_Leave); // - // gbDeveloperOptions + // tbClientID // - this.gbDeveloperOptions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.tbClientID.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.gbDeveloperOptions.Controls.Add(this.llAPIConsole); - this.gbDeveloperOptions.Controls.Add(this.cbShowClientSecret); - this.gbDeveloperOptions.Controls.Add(this.lGoogleAPIInstructions); - this.gbDeveloperOptions.Controls.Add(this.tbClientSecret); - this.gbDeveloperOptions.Controls.Add(this.tbClientID); - this.gbDeveloperOptions.Controls.Add(this.lClientID); - this.gbDeveloperOptions.Controls.Add(this.lSecret); - this.gbDeveloperOptions.Location = new System.Drawing.Point(14, 257); - this.gbDeveloperOptions.Name = "gbDeveloperOptions"; - this.gbDeveloperOptions.Size = new System.Drawing.Size(364, 171); - this.gbDeveloperOptions.TabIndex = 31; - this.gbDeveloperOptions.TabStop = false; - this.gbDeveloperOptions.Text = "Google OAuth API"; - this.gbDeveloperOptions.Visible = false; + this.tbClientID.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tbClientID.Location = new System.Drawing.Point(54, 119); + this.tbClientID.Name = "tbClientID"; + this.tbClientID.ReadOnly = true; + this.tbClientID.Size = new System.Drawing.Size(289, 20); + this.tbClientID.TabIndex = 32; + this.tbClientID.TextChanged += new System.EventHandler(this.tbClientID_TextChanged); + this.tbClientID.Leave += new System.EventHandler(this.personalApiKey_Leave); // // llAPIConsole // this.llAPIConsole.Anchor = System.Windows.Forms.AnchorStyles.Top; this.llAPIConsole.AutoSize = true; - this.llAPIConsole.Location = new System.Drawing.Point(44, 89); + this.llAPIConsole.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.llAPIConsole.Location = new System.Drawing.Point(38, 94); this.llAPIConsole.Name = "llAPIConsole"; this.llAPIConsole.Size = new System.Drawing.Size(273, 13); - this.llAPIConsole.TabIndex = 5; + this.llAPIConsole.TabIndex = 35; this.llAPIConsole.TabStop = true; this.llAPIConsole.Text = "https://console.developers.google.com/apis/credentials"; - this.llAPIConsole.Visible = false; this.llAPIConsole.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llAPIConsole_LinkClicked); // // cbShowClientSecret @@ -1144,147 +1208,271 @@ private void InitializeComponent() { this.cbShowClientSecret.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.cbShowClientSecret.AutoSize = true; this.cbShowClientSecret.Enabled = false; - this.cbShowClientSecret.Location = new System.Drawing.Point(299, 143); + this.cbShowClientSecret.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbShowClientSecret.ForeColor = System.Drawing.SystemColors.ControlText; + this.cbShowClientSecret.Location = new System.Drawing.Point(290, 148); this.cbShowClientSecret.Name = "cbShowClientSecret"; this.cbShowClientSecret.Size = new System.Drawing.Size(53, 17); - this.cbShowClientSecret.TabIndex = 29; + this.cbShowClientSecret.TabIndex = 36; this.cbShowClientSecret.Text = "Show"; this.cbShowClientSecret.UseVisualStyleBackColor = true; - this.cbShowClientSecret.Visible = false; this.cbShowClientSecret.CheckedChanged += new System.EventHandler(this.cbShowClientSecret_CheckedChanged); // // lGoogleAPIInstructions // - this.lGoogleAPIInstructions.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.lGoogleAPIInstructions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.lGoogleAPIInstructions.BackColor = System.Drawing.SystemColors.Window; this.lGoogleAPIInstructions.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.lGoogleAPIInstructions.Location = new System.Drawing.Point(13, 20); + this.lGoogleAPIInstructions.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lGoogleAPIInstructions.Location = new System.Drawing.Point(8, 25); this.lGoogleAPIInstructions.Multiline = true; this.lGoogleAPIInstructions.Name = "lGoogleAPIInstructions"; this.lGoogleAPIInstructions.ReadOnly = true; - this.lGoogleAPIInstructions.Size = new System.Drawing.Size(339, 71); - this.lGoogleAPIInstructions.TabIndex = 4; + this.lGoogleAPIInstructions.Size = new System.Drawing.Size(335, 71); + this.lGoogleAPIInstructions.TabIndex = 34; this.lGoogleAPIInstructions.Text = resources.GetString("lGoogleAPIInstructions.Text"); this.lGoogleAPIInstructions.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.lGoogleAPIInstructions.Visible = false; - // - // tbClientSecret - // - this.tbClientSecret.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tbClientSecret.Location = new System.Drawing.Point(63, 140); - this.tbClientSecret.Name = "tbClientSecret"; - this.tbClientSecret.ReadOnly = true; - this.tbClientSecret.Size = new System.Drawing.Size(230, 20); - this.tbClientSecret.TabIndex = 3; - this.tbClientSecret.UseSystemPasswordChar = true; - this.tbClientSecret.Visible = false; - this.tbClientSecret.TextChanged += new System.EventHandler(this.tbClientSecret_TextChanged); - this.tbClientSecret.Leave += new System.EventHandler(this.personalApiKey_Leave); - // - // tbClientID - // - this.tbClientID.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tbClientID.Location = new System.Drawing.Point(63, 114); - this.tbClientID.Name = "tbClientID"; - this.tbClientID.ReadOnly = true; - this.tbClientID.Size = new System.Drawing.Size(289, 20); - this.tbClientID.TabIndex = 2; - this.tbClientID.Visible = false; - this.tbClientID.TextChanged += new System.EventHandler(this.tbClientID_TextChanged); - this.tbClientID.Leave += new System.EventHandler(this.personalApiKey_Leave); // // lClientID // this.lClientID.AutoSize = true; - this.lClientID.Location = new System.Drawing.Point(10, 117); + this.lClientID.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lClientID.ForeColor = System.Drawing.SystemColors.ControlText; + this.lClientID.Location = new System.Drawing.Point(5, 122); this.lClientID.Name = "lClientID"; this.lClientID.Size = new System.Drawing.Size(47, 13); - this.lClientID.TabIndex = 0; + this.lClientID.TabIndex = 30; this.lClientID.Text = "Client ID"; - this.lClientID.Visible = false; // // lSecret // this.lSecret.AutoSize = true; - this.lSecret.Location = new System.Drawing.Point(10, 143); + this.lSecret.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lSecret.ForeColor = System.Drawing.SystemColors.ControlText; + this.lSecret.Location = new System.Drawing.Point(5, 148); this.lSecret.Name = "lSecret"; this.lSecret.Size = new System.Drawing.Size(38, 13); - this.lSecret.TabIndex = 1; + this.lSecret.TabIndex = 31; this.lSecret.Text = "Secret"; - this.lSecret.Visible = false; // - // cbShowDeveloperOptions + // gbGoogle_GConfig // - this.cbShowDeveloperOptions.AutoSize = true; - this.cbShowDeveloperOptions.Location = new System.Drawing.Point(14, 235); - this.cbShowDeveloperOptions.Name = "cbShowDeveloperOptions"; - this.cbShowDeveloperOptions.Size = new System.Drawing.Size(193, 17); - this.cbShowDeveloperOptions.TabIndex = 30; - this.cbShowDeveloperOptions.Text = "Show advanced/developer options"; - this.cbShowDeveloperOptions.UseVisualStyleBackColor = true; - this.cbShowDeveloperOptions.CheckedChanged += new System.EventHandler(this.cbShowDeveloperOptions_CheckedChanged); + this.gbGoogle_GConfig.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.gbGoogle_GConfig.Controls.Add(this.cbDeleteWhenColourExcl); + this.gbGoogle_GConfig.Controls.Add(this.label35); + this.gbGoogle_GConfig.Controls.Add(this.cbColourFilter); + this.gbGoogle_GConfig.Controls.Add(this.clbColours); + this.gbGoogle_GConfig.Controls.Add(this.cbExcludeDeclinedInvites); + this.gbGoogle_GConfig.Controls.Add(this.cbExcludeGoals); + this.gbGoogle_GConfig.Font = new System.Drawing.Font("Arial Black", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.gbGoogle_GConfig.ForeColor = System.Drawing.SystemColors.MenuHighlight; + this.gbGoogle_GConfig.Location = new System.Drawing.Point(10, 246); + this.gbGoogle_GConfig.MinimumSize = new System.Drawing.Size(368, 0); + this.gbGoogle_GConfig.Name = "gbGoogle_GConfig"; + this.gbGoogle_GConfig.Size = new System.Drawing.Size(368, 122); + this.gbGoogle_GConfig.TabIndex = 45; + this.gbGoogle_GConfig.TabStop = false; + this.gbGoogle_GConfig.Text = " Sync Configuration"; + // + // cbDeleteWhenColourExcl + // + this.cbDeleteWhenColourExcl.AutoSize = true; + this.cbDeleteWhenColourExcl.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbDeleteWhenColourExcl.ForeColor = System.Drawing.SystemColors.ControlText; + this.cbDeleteWhenColourExcl.Location = new System.Drawing.Point(13, 48); + this.cbDeleteWhenColourExcl.Name = "cbDeleteWhenColourExcl"; + this.cbDeleteWhenColourExcl.Size = new System.Drawing.Size(175, 17); + this.cbDeleteWhenColourExcl.TabIndex = 53; + this.cbDeleteWhenColourExcl.Text = "Delete synced items if excluded"; + this.cbDeleteWhenColourExcl.UseVisualStyleBackColor = true; + this.cbDeleteWhenColourExcl.CheckedChanged += new System.EventHandler(this.cbDeleteWhenColourExcl_CheckedChanged); + // + // label35 + // + this.label35.AutoSize = true; + this.label35.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label35.ForeColor = System.Drawing.SystemColors.ControlText; + this.label35.Location = new System.Drawing.Point(10, 26); + this.label35.Name = "label35"; + this.label35.Size = new System.Drawing.Size(66, 13); + this.label35.TabIndex = 52; + this.label35.Text = "Filter colours"; + // + // cbColourFilter + // + this.cbColourFilter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbColourFilter.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbColourFilter.ForeColor = System.Drawing.SystemColors.ControlText; + this.cbColourFilter.FormattingEnabled = true; + this.cbColourFilter.Items.AddRange(new object[] { + "Exclude", + "Include"}); + this.cbColourFilter.Location = new System.Drawing.Point(82, 23); + this.cbColourFilter.Name = "cbColourFilter"; + this.cbColourFilter.Size = new System.Drawing.Size(114, 21); + this.cbColourFilter.TabIndex = 51; + this.cbColourFilter.SelectedIndexChanged += new System.EventHandler(this.cbColourFilter_SelectedIndexChanged); // - // label13 + // clbColours // - this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(153, 134); - this.label13.MaximumSize = new System.Drawing.Size(200, 0); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(189, 26); - this.label13.TabIndex = 28; - this.label13.Text = "Disconnect the Google account the application is using to synchronise with\r\n"; + this.clbColours.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.clbColours.CheckOnClick = true; + this.clbColours.ContextMenuStrip = this.msColours; + this.clbColours.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.clbColours.ForeColor = System.Drawing.SystemColors.ControlText; + this.clbColours.FormattingEnabled = true; + this.clbColours.Items.AddRange(new object[] { + "Blue", + "Green", + "Red"}); + this.clbColours.Location = new System.Drawing.Point(202, 23); + this.clbColours.Name = "clbColours"; + this.clbColours.Size = new System.Drawing.Size(157, 94); + this.clbColours.Sorted = true; + this.clbColours.TabIndex = 50; + this.clbColours.SelectedIndexChanged += new System.EventHandler(this.clbColours_SelectedIndexChanged); + // + // msColours + // + this.msColours.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miColourSelectAll, + this.miColourSelectNone, + this.miColourSelectInvert, + this.miColourRefresh}); + this.msColours.Name = "msColours"; + this.msColours.ShowImageMargin = false; + this.msColours.ShowItemToolTips = false; + this.msColours.Size = new System.Drawing.Size(133, 92); + // + // miColourSelectAll + // + this.miColourSelectAll.Name = "miColourSelectAll"; + this.miColourSelectAll.Size = new System.Drawing.Size(132, 22); + this.miColourSelectAll.Text = "Select All"; + this.miColourSelectAll.Click += new System.EventHandler(this.miColourSelectAll_Click); + // + // miColourSelectNone + // + this.miColourSelectNone.Name = "miColourSelectNone"; + this.miColourSelectNone.Size = new System.Drawing.Size(132, 22); + this.miColourSelectNone.Text = "Select None"; + this.miColourSelectNone.Click += new System.EventHandler(this.miColourSelectNone_Click); + // + // miColourSelectInvert + // + this.miColourSelectInvert.Name = "miColourSelectInvert"; + this.miColourSelectInvert.Size = new System.Drawing.Size(132, 22); + this.miColourSelectInvert.Text = "Invert Selection"; + this.miColourSelectInvert.Click += new System.EventHandler(this.miColourSelectInvert_Click); + // + // miColourRefresh + // + this.miColourRefresh.Name = "miColourRefresh"; + this.miColourRefresh.Size = new System.Drawing.Size(132, 22); + this.miColourRefresh.Text = "Refresh Colours"; + this.miColourRefresh.Click += new System.EventHandler(this.miColourRefresh_Click); // - // label12 + // cbExcludeDeclinedInvites // - this.label12.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.label12.AutoSize = true; - this.label12.Font = new System.Drawing.Font("Arial Black", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label12.ForeColor = System.Drawing.SystemColors.MenuHighlight; - this.label12.Location = new System.Drawing.Point(68, 13); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(263, 15); - this.label12.TabIndex = 27; - this.label12.Text = "Select the Google Calendar to Synchronise"; - this.label12.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.cbExcludeDeclinedInvites.AutoSize = true; + this.cbExcludeDeclinedInvites.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbExcludeDeclinedInvites.ForeColor = System.Drawing.SystemColors.ControlText; + this.cbExcludeDeclinedInvites.Location = new System.Drawing.Point(13, 71); + this.cbExcludeDeclinedInvites.Name = "cbExcludeDeclinedInvites"; + this.cbExcludeDeclinedInvites.Size = new System.Drawing.Size(190, 17); + this.cbExcludeDeclinedInvites.TabIndex = 49; + this.cbExcludeDeclinedInvites.Text = "Exclude invitations I have declined"; + this.cbExcludeDeclinedInvites.UseVisualStyleBackColor = true; + this.cbExcludeDeclinedInvites.CheckedChanged += new System.EventHandler(this.cbExcludeDeclinedInvites_CheckedChanged); // - // btResetGCal + // cbExcludeGoals // - this.btResetGCal.BackColor = System.Drawing.Color.Transparent; - this.btResetGCal.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.btResetGCal.ForeColor = System.Drawing.Color.Red; - this.btResetGCal.Location = new System.Drawing.Point(34, 136); - this.btResetGCal.Name = "btResetGCal"; - this.btResetGCal.Size = new System.Drawing.Size(115, 23); - this.btResetGCal.TabIndex = 10; - this.btResetGCal.Text = "Disconnect Account"; - this.btResetGCal.UseVisualStyleBackColor = false; - this.btResetGCal.Click += new System.EventHandler(this.btResetGCal_Click); + this.cbExcludeGoals.AutoSize = true; + this.cbExcludeGoals.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbExcludeGoals.ForeColor = System.Drawing.SystemColors.ControlText; + this.cbExcludeGoals.Location = new System.Drawing.Point(13, 90); + this.cbExcludeGoals.Name = "cbExcludeGoals"; + this.cbExcludeGoals.Size = new System.Drawing.Size(182, 17); + this.cbExcludeGoals.TabIndex = 48; + this.cbExcludeGoals.Text = "Exclude \"Goal\" events from sync"; + this.cbExcludeGoals.UseVisualStyleBackColor = true; + this.cbExcludeGoals.CheckedChanged += new System.EventHandler(this.cbExcludeGoals_CheckedChanged); // - // lGoogleHelp + // gbGoogle_Account // - this.lGoogleHelp.Location = new System.Drawing.Point(155, 75); - this.lGoogleHelp.MaximumSize = new System.Drawing.Size(220, 52); - this.lGoogleHelp.Name = "lGoogleHelp"; - this.lGoogleHelp.Size = new System.Drawing.Size(199, 52); - this.lGoogleHelp.TabIndex = 9; - this.lGoogleHelp.Text = "If this is the first time, you\'ll need to authorise the app to connect.\r\nJust tak" + - "es a few clicks and your password is never exposed."; + this.gbGoogle_Account.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.gbGoogle_Account.Controls.Add(this.llMultipleOGCS); + this.gbGoogle_Account.Controls.Add(this.label14); + this.gbGoogle_Account.Controls.Add(this.cbGoogleCalendars); + this.gbGoogle_Account.Controls.Add(this.bGetGoogleCalendars); + this.gbGoogle_Account.Controls.Add(this.lGoogleCalendar); + this.gbGoogle_Account.Controls.Add(this.lGoogleHelp); + this.gbGoogle_Account.Controls.Add(this.btResetGCal); + this.gbGoogle_Account.Controls.Add(this.label13); + this.gbGoogle_Account.Controls.Add(this.tbConnectedAcc); + this.gbGoogle_Account.Controls.Add(this.label7); + this.gbGoogle_Account.Controls.Add(this.cbListHiddenGcals); + this.gbGoogle_Account.Font = new System.Drawing.Font("Arial Black", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.gbGoogle_Account.ForeColor = System.Drawing.SystemColors.MenuHighlight; + this.gbGoogle_Account.Location = new System.Drawing.Point(10, 2); + this.gbGoogle_Account.MinimumSize = new System.Drawing.Size(368, 0); + this.gbGoogle_Account.Name = "gbGoogle_Account"; + this.gbGoogle_Account.Size = new System.Drawing.Size(368, 242); + this.gbGoogle_Account.TabIndex = 43; + this.gbGoogle_Account.TabStop = false; + this.gbGoogle_Account.Text = " Account && Calendar"; + // + // llMultipleOGCS + // + this.llMultipleOGCS.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.llMultipleOGCS.AutoSize = true; + this.llMultipleOGCS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.llMultipleOGCS.ForeColor = System.Drawing.SystemColors.ControlText; + this.llMultipleOGCS.Location = new System.Drawing.Point(104, 47); + this.llMultipleOGCS.Name = "llMultipleOGCS"; + this.llMultipleOGCS.Size = new System.Drawing.Size(156, 13); + this.llMultipleOGCS.TabIndex = 51; + this.llMultipleOGCS.TabStop = true; + this.llMultipleOGCS.Text = "run multiple instances of OGCS."; + this.llMultipleOGCS.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llMultipleOGCS_LinkClicked); + // + // label14 + // + this.label14.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label14.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label14.ForeColor = System.Drawing.SystemColors.WindowText; + this.label14.Location = new System.Drawing.Point(9, 21); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(346, 33); + this.label14.TabIndex = 50; + this.label14.Text = "The Google account is the same across all Profiles.\r\nTo sync calendars from more " + + "than one account,"; + this.label14.TextAlign = System.Drawing.ContentAlignment.TopCenter; // - // lGoogleCalendar + // cbGoogleCalendars // - this.lGoogleCalendar.Location = new System.Drawing.Point(11, 173); - this.lGoogleCalendar.Name = "lGoogleCalendar"; - this.lGoogleCalendar.Size = new System.Drawing.Size(81, 14); - this.lGoogleCalendar.TabIndex = 8; - this.lGoogleCalendar.Text = "Select calendar"; + this.cbGoogleCalendars.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.cbGoogleCalendars.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbGoogleCalendars.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbGoogleCalendars.FormattingEnabled = true; + this.cbGoogleCalendars.Location = new System.Drawing.Point(114, 194); + this.cbGoogleCalendars.Name = "cbGoogleCalendars"; + this.cbGoogleCalendars.Size = new System.Drawing.Size(241, 21); + this.cbGoogleCalendars.TabIndex = 6; + this.cbGoogleCalendars.SelectedIndexChanged += new System.EventHandler(this.cbGoogleCalendars_SelectedIndexChanged); // // bGetGoogleCalendars // this.bGetGoogleCalendars.FlatStyle = System.Windows.Forms.FlatStyle.System; this.bGetGoogleCalendars.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.bGetGoogleCalendars.Location = new System.Drawing.Point(34, 89); + this.bGetGoogleCalendars.Location = new System.Drawing.Point(24, 113); this.bGetGoogleCalendars.Name = "bGetGoogleCalendars"; this.bGetGoogleCalendars.Size = new System.Drawing.Size(115, 23); this.bGetGoogleCalendars.TabIndex = 7; @@ -1292,17 +1480,89 @@ private void InitializeComponent() { this.bGetGoogleCalendars.UseVisualStyleBackColor = true; this.bGetGoogleCalendars.Click += new System.EventHandler(this.GetMyGoogleCalendars_Click); // - // cbGoogleCalendars + // lGoogleCalendar // - this.cbGoogleCalendars.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.lGoogleCalendar.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lGoogleCalendar.ForeColor = System.Drawing.SystemColors.ControlText; + this.lGoogleCalendar.Location = new System.Drawing.Point(6, 197); + this.lGoogleCalendar.Name = "lGoogleCalendar"; + this.lGoogleCalendar.Size = new System.Drawing.Size(81, 14); + this.lGoogleCalendar.TabIndex = 8; + this.lGoogleCalendar.Text = "Select calendar"; + // + // lGoogleHelp + // + this.lGoogleHelp.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lGoogleHelp.ForeColor = System.Drawing.SystemColors.ControlText; + this.lGoogleHelp.Location = new System.Drawing.Point(145, 99); + this.lGoogleHelp.MaximumSize = new System.Drawing.Size(220, 52); + this.lGoogleHelp.Name = "lGoogleHelp"; + this.lGoogleHelp.Size = new System.Drawing.Size(199, 52); + this.lGoogleHelp.TabIndex = 9; + this.lGoogleHelp.Text = "If this is the first time, you\'ll need to authorise the app to connect.\r\nJust tak" + + "es a few clicks and your password is never exposed."; + // + // btResetGCal + // + this.btResetGCal.BackColor = System.Drawing.Color.Transparent; + this.btResetGCal.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btResetGCal.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btResetGCal.ForeColor = System.Drawing.Color.Red; + this.btResetGCal.Location = new System.Drawing.Point(24, 160); + this.btResetGCal.Name = "btResetGCal"; + this.btResetGCal.Size = new System.Drawing.Size(115, 23); + this.btResetGCal.TabIndex = 10; + this.btResetGCal.Text = "Disconnect Account"; + this.btResetGCal.UseVisualStyleBackColor = false; + this.btResetGCal.Click += new System.EventHandler(this.btResetGCal_Click); + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label13.ForeColor = System.Drawing.SystemColors.ControlText; + this.label13.Location = new System.Drawing.Point(143, 158); + this.label13.MaximumSize = new System.Drawing.Size(200, 0); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(189, 26); + this.label13.TabIndex = 28; + this.label13.Text = "Disconnect the Google account the application is using to synchronise with\r\n"; + // + // tbConnectedAcc + // + this.tbConnectedAcc.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.cbGoogleCalendars.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbGoogleCalendars.FormattingEnabled = true; - this.cbGoogleCalendars.Location = new System.Drawing.Point(97, 170); - this.cbGoogleCalendars.Name = "cbGoogleCalendars"; - this.cbGoogleCalendars.Size = new System.Drawing.Size(281, 21); - this.cbGoogleCalendars.TabIndex = 6; - this.cbGoogleCalendars.SelectedIndexChanged += new System.EventHandler(this.cbGoogleCalendars_SelectedIndexChanged); + this.tbConnectedAcc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tbConnectedAcc.Location = new System.Drawing.Point(114, 70); + this.tbConnectedAcc.Name = "tbConnectedAcc"; + this.tbConnectedAcc.ReadOnly = true; + this.tbConnectedAcc.Size = new System.Drawing.Size(241, 20); + this.tbConnectedAcc.TabIndex = 32; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label7.ForeColor = System.Drawing.SystemColors.ControlText; + this.label7.Location = new System.Drawing.Point(6, 73); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(102, 13); + this.label7.TabIndex = 33; + this.label7.Text = "Connected Account"; + this.label7.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // cbListHiddenGcals + // + this.cbListHiddenGcals.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.cbListHiddenGcals.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbListHiddenGcals.ForeColor = System.Drawing.SystemColors.ControlText; + this.cbListHiddenGcals.Location = new System.Drawing.Point(280, 221); + this.cbListHiddenGcals.Name = "cbListHiddenGcals"; + this.cbListHiddenGcals.Size = new System.Drawing.Size(79, 17); + this.cbListHiddenGcals.TabIndex = 30; + this.cbListHiddenGcals.Text = "List Hidden"; + this.cbListHiddenGcals.UseVisualStyleBackColor = true; + this.cbListHiddenGcals.CheckedChanged += new System.EventHandler(this.cbListHiddenGcals_CheckedChanged); // // tabSyncOptions // @@ -1346,7 +1606,7 @@ private void InitializeComponent() { this.label15.AutoSize = true; this.label15.Font = new System.Drawing.Font("Arial Black", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label15.ForeColor = System.Drawing.SystemColors.MenuHighlight; - this.label15.Location = new System.Drawing.Point(121, 13); + this.label15.Location = new System.Drawing.Point(121, 10); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(153, 15); this.label15.TabIndex = 35; @@ -3618,8 +3878,18 @@ private void InitializeComponent() { this.panelObscure.ResumeLayout(false); this.panelProfileLoading.ResumeLayout(false); this.panelProfileLoading.PerformLayout(); - this.gbDeveloperOptions.ResumeLayout(false); - this.gbDeveloperOptions.PerformLayout(); + this.panelGoogle.ResumeLayout(false); + this.panelGoogle.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbExpandGoogleOauth)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbExpandGoogleConfig)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbExpandGoogleAccount)).EndInit(); + this.gbGoogle_OAuth.ResumeLayout(false); + this.gbGoogle_OAuth.PerformLayout(); + this.gbGoogle_GConfig.ResumeLayout(false); + this.gbGoogle_GConfig.PerformLayout(); + this.msColours.ResumeLayout(false); + this.gbGoogle_Account.ResumeLayout(false); + this.gbGoogle_Account.PerformLayout(); this.tabSyncOptions.ResumeLayout(false); this.tabSyncOptions.PerformLayout(); this.WhatPostit.ResumeLayout(false); @@ -3783,6 +4053,11 @@ private void InitializeComponent() { private System.Windows.Forms.ToolStripMenuItem miCatSelectNone; private System.Windows.Forms.ToolStripMenuItem miCatSelectInvert; private System.Windows.Forms.ToolStripMenuItem miCatRefresh; + private System.Windows.Forms.ContextMenuStrip msColours; + private System.Windows.Forms.ToolStripMenuItem miColourSelectAll; + private System.Windows.Forms.ToolStripMenuItem miColourSelectNone; + private System.Windows.Forms.ToolStripMenuItem miColourSelectInvert; + private System.Windows.Forms.ToolStripMenuItem miColourRefresh; private System.Windows.Forms.ContextMenuStrip msProfileActions; private System.Windows.Forms.ToolStripMenuItem miAddProfile; private System.Windows.Forms.ToolStripMenuItem miDeleteProfile; @@ -3790,15 +4065,6 @@ private void InitializeComponent() { private System.Windows.Forms.ContextMenuStrip msSettingsActions; private System.Windows.Forms.ToolStripMenuItem miExportSettings; private System.Windows.Forms.ToolStripMenuItem miImportSettings; - private System.Windows.Forms.GroupBox gbDeveloperOptions; - private System.Windows.Forms.LinkLabel llAPIConsole; - private System.Windows.Forms.CheckBox cbShowClientSecret; - private System.Windows.Forms.TextBox lGoogleAPIInstructions; - private System.Windows.Forms.TextBox tbClientSecret; - private System.Windows.Forms.TextBox tbClientID; - private System.Windows.Forms.Label lClientID; - private System.Windows.Forms.Label lSecret; - private System.Windows.Forms.CheckBox cbShowDeveloperOptions; public System.Windows.Forms.Label lOutlookCalendar; public System.Windows.Forms.TabPage tabOutlook; private System.Windows.Forms.Panel howObfuscatePanel; @@ -3847,13 +4113,11 @@ private void InitializeComponent() { public Extensions.GoogleColourPicker ddGoogleColour; private System.Windows.Forms.DataGridViewTextBoxColumn AboutColumnLabel; private System.Windows.Forms.DataGridViewTextBoxColumn AboutColumnValue; - private System.Windows.Forms.CheckBox cbExcludeGoals; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4; private System.Windows.Forms.ComboBox ddAvailabilty; - private System.Windows.Forms.CheckBox cbExcludeDeclinedInvites; private System.Windows.Forms.CheckBox cbSingleCategoryOnly; private System.Windows.Forms.NumericUpDown tbMaxAttendees; private System.Windows.Forms.CheckBox cbListHiddenGcals; @@ -3916,5 +4180,28 @@ private void InitializeComponent() { private System.Windows.Forms.CheckBox cbDeleteWhenCatExcl; private System.Windows.Forms.TextBox tbExcludeSubjectText; private System.Windows.Forms.CheckBox cbExcludeSubject; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Panel panelGoogle; + private System.Windows.Forms.PictureBox pbExpandGoogleAccount; + private System.Windows.Forms.GroupBox gbGoogle_Account; + private System.Windows.Forms.LinkLabel llMultipleOGCS; + private System.Windows.Forms.PictureBox pbExpandGoogleConfig; + private System.Windows.Forms.GroupBox gbGoogle_GConfig; + private System.Windows.Forms.CheckBox cbExcludeDeclinedInvites; + private System.Windows.Forms.CheckBox cbExcludeGoals; + private System.Windows.Forms.PictureBox pbExpandGoogleOauth; + private System.Windows.Forms.GroupBox gbGoogle_OAuth; + private System.Windows.Forms.LinkLabel llAPIConsole; + private System.Windows.Forms.CheckBox cbShowClientSecret; + private System.Windows.Forms.TextBox lGoogleAPIInstructions; + private System.Windows.Forms.TextBox tbClientSecret; + private System.Windows.Forms.TextBox tbClientID; + private System.Windows.Forms.Label lClientID; + private System.Windows.Forms.Label lSecret; + private System.Windows.Forms.CheckBox cbShowDeveloperOptions; + private System.Windows.Forms.Label label35; + public System.Windows.Forms.ComboBox cbColourFilter; + public System.Windows.Forms.CheckedListBox clbColours; + private System.Windows.Forms.CheckBox cbDeleteWhenColourExcl; } } diff --git a/src/OutlookGoogleCalendarSync/Forms/MainForm.cs b/src/OutlookGoogleCalendarSync/Forms/MainForm.cs index ec8332b3..70ceb955 100644 --- a/src/OutlookGoogleCalendarSync/Forms/MainForm.cs +++ b/src/OutlookGoogleCalendarSync/Forms/MainForm.cs @@ -30,10 +30,13 @@ public Main(string startingTab = null) { InitializeComponent(); //MinimumSize is set in Designer to stop it keep messing around with the width //Then unsetting here, so the scrollbars can reduce width if necessary - gbSyncOptions_How.MinimumSize = new System.Drawing.Size(0, 0); - gbSyncOptions_When.MinimumSize = new System.Drawing.Size(0, 0); - gbSyncOptions_What.MinimumSize = new System.Drawing.Size(0, 0); - gbAppBehaviour_Proxy.MinimumSize = new System.Drawing.Size(0, 0); + gbGoogle_Account.MinimumSize = + gbGoogle_GConfig.MinimumSize = + gbGoogle_OAuth.MinimumSize = + gbSyncOptions_How.MinimumSize = + gbSyncOptions_When.MinimumSize = + gbSyncOptions_What.MinimumSize = + gbAppBehaviour_Proxy.MinimumSize = gbAppBehaviour_Logging.MinimumSize = new System.Drawing.Size(0, 0); if (startingTab != null && startingTab == "Help") this.tabApp.SelectedTab = this.tabPage_Help; @@ -90,6 +93,8 @@ private void updateGUIsettings() { "Disconnect the Google account being used to synchonize with."); ToolTips.SetToolTip(cbListHiddenGcals, "Include hidden calendars in the above drop down."); + ToolTips.SetToolTip(cbDeleteWhenColourExcl, + "If items are already synced in Outlook and subsequently excluded by a colour filter."); //Settings ToolTips.SetToolTip(tbInterval, @@ -167,8 +172,8 @@ private void updateGUIsettings() { #endregion UpdateGUIsettings_Profile(); #region Application behaviour - syncOptionSizing(gbAppBehaviour_Logging, pbExpandLogging, true); - syncOptionSizing(gbAppBehaviour_Proxy, pbExpandProxy, false); + groupboxSizing(gbAppBehaviour_Logging, pbExpandLogging, true); + groupboxSizing(gbAppBehaviour_Proxy, pbExpandProxy, false); cbShowBubbleTooltips.Checked = Settings.Instance.ShowBubbleTooltipWhenSyncing; cbStartOnStartup.Checked = Settings.Instance.StartOnStartup; cbStartOnStartupAllUsers.Enabled = Settings.Instance.StartOnStartup; @@ -264,7 +269,7 @@ public void UpdateGUIsettings_Profile() { LastSyncVal = profile.LastSyncDateText; NextSyncVal = profile.OgcsTimer?.NextSyncDateText; #endregion - #region Outlook box + #region Outlook page #region Mailbox if (OutlookOgcs.Factory.OutlookVersionName == OutlookOgcs.Factory.OutlookVersionNames.Outlook2003) { rbOutlookDefaultMB.Checked = true; @@ -408,7 +413,11 @@ public void UpdateGUIsettings_Profile() { } #endregion #endregion - #region Google box + #region Google page + groupboxSizing(gbGoogle_Account, pbExpandGoogleAccount, true); + groupboxSizing(gbGoogle_GConfig, pbExpandGoogleConfig, true); + groupboxSizing(gbGoogle_OAuth, pbExpandGoogleOauth, false); + tbConnectedAcc.Text = string.IsNullOrEmpty(Settings.Instance.GaccountEmail) ? "Not connected" : Settings.Instance.GaccountEmail; if (profile.UseGoogleCalendar?.Id != null) { foreach (GoogleCalendarListEntry cle in this.cbGoogleCalendars.Items) { @@ -428,6 +437,9 @@ public void UpdateGUIsettings_Profile() { tbClientSecret.ReadOnly = false; } + cbColourFilter.SelectedItem = profile.ColoursRestrictBy == SettingsStore.Calendar.RestrictBy.Include ? "Include" : "Exclude"; + GoogleOgcs.Calendar.BuildOfflineColourPicker(clbColours); + cbDeleteWhenColourExcl.Checked = profile.DeleteWhenColourExcluded; cbExcludeDeclinedInvites.Checked = profile.ExcludeDeclinedInvites; cbExcludeGoals.Checked = profile.ExcludeGoals; cbExcludeGoals.Enabled = GoogleOgcs.Calendar.IsDefaultCalendar() ?? true; @@ -438,10 +450,10 @@ public void UpdateGUIsettings_Profile() { tbClientSecret.Text = Settings.Instance.PersonalClientSecret; } #endregion - #region Sync Options box - syncOptionSizing(gbSyncOptions_How, pbExpandHow, true); - syncOptionSizing(gbSyncOptions_When, pbExpandWhen, false); - syncOptionSizing(gbSyncOptions_What, pbExpandWhat, false); + #region Sync Options page + groupboxSizing(gbSyncOptions_How, pbExpandHow, true); + groupboxSizing(gbSyncOptions_When, pbExpandWhen, false); + groupboxSizing(gbSyncOptions_What, pbExpandWhat, false); #region How if (syncDirection.Items.Count == 0) { syncDirection.Items.Add(Sync.Direction.OutlookToGoogle); @@ -1234,6 +1246,52 @@ private void miRenameProfile_Click(object sender, EventArgs e) { new Forms.ProfileManage("Rename", ddProfile).ShowDialog(); } #endregion + + private void groupboxSizing(GroupBox section, PictureBox sectionImage, Boolean? expand = null) { + int minSectionHeight = Convert.ToInt16(22 * magnification); + Boolean expandSection = expand ?? section.Height - minSectionHeight <= 5; + if (expandSection) { + if (!(expand ?? false)) sectionImage.Image.RotateFlip(RotateFlipType.Rotate90FlipNone); + switch (section.Name.ToString().Split('_').LastOrDefault()) { + //Google + case "Account": section.Height = 242; break; + case "GConfig": section.Height = 122; break; + case "OAuth": section.Height = 174; break; + //Settings + case "How": section.Height = btCloseRegexRules.Visible ? 251 : 198; break; + case "When": section.Height = 119; break; + case "What": section.Height = 228; break; + //Application Behaviour + case "Logging": section.Height = 111; break; + case "Proxy": section.Height = 197; break; + } + section.Height = Convert.ToInt16(section.Height * magnification); + } else { + if (section.Height > minSectionHeight) + sectionImage.Image.RotateFlip(RotateFlipType.Rotate270FlipNone); + section.Height = minSectionHeight; + } + sectionImage.Refresh(); + + if ("pbExpandGoogleAccount|pbExpandGoogleConfig|pbExpandGoogleOauth".Contains(sectionImage.Name)) { + gbGoogle_GConfig.Top = gbGoogle_Account.Location.Y + gbGoogle_Account.Height + Convert.ToInt16(10 * magnification); + pbExpandGoogleConfig.Top = gbGoogle_GConfig.Top - Convert.ToInt16(2 * magnification); + cbShowDeveloperOptions.Top = gbGoogle_GConfig.Location.Y + gbGoogle_GConfig.Height + Convert.ToInt16(5 * magnification); + gbGoogle_OAuth.Top = cbShowDeveloperOptions.Location.Y + cbShowDeveloperOptions.Height + Convert.ToInt16(5 * magnification); + pbExpandGoogleOauth.Top = gbGoogle_OAuth.Top - Convert.ToInt16(2 * magnification); + + } else if ("pbExpandHow|pbExpandWhen|pbExpandWhat".Contains(sectionImage.Name)) { + gbSyncOptions_When.Top = gbSyncOptions_How.Location.Y + gbSyncOptions_How.Height + Convert.ToInt16(10 * magnification); + pbExpandWhen.Top = gbSyncOptions_When.Top - Convert.ToInt16(2 * magnification); + gbSyncOptions_What.Top = gbSyncOptions_When.Location.Y + gbSyncOptions_When.Height + Convert.ToInt16(10 * magnification); + pbExpandWhat.Top = gbSyncOptions_What.Top - Convert.ToInt16(2 * magnification); + + } else if ("pbExpandLogging|pbExpandProxy".Contains(sectionImage.Name)) { + gbAppBehaviour_Proxy.Top = gbAppBehaviour_Logging.Location.Y + gbAppBehaviour_Logging.Height + Convert.ToInt16(10 * magnification); + pbExpandProxy.Top = gbAppBehaviour_Proxy.Top - Convert.ToInt16(2 * magnification); + } + } + #region Outlook settings private void enableOutlookSettingsUI(Boolean enable) { this.clbCategories.Enabled = enable; @@ -1426,6 +1484,21 @@ private void urlDateFormats_LinkClicked(object sender, LinkLabelLinkClickedEvent #endregion #endregion #region Google settings + private void pbExpandGoogleAccount_Click(object sender, EventArgs e) { + groupboxSizing(gbGoogle_Account, pbExpandGoogleAccount); + } + private void pbExpandGoogleConfig_Click(object sender, EventArgs e) { + groupboxSizing(gbGoogle_GConfig, pbExpandGoogleConfig); + } + private void pbExpandGoogleOauth_Click(object sender, EventArgs e) { + groupboxSizing(gbGoogle_OAuth, pbExpandGoogleOauth); + } + + #region Google Account + private void llMultipleOGCS_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { + Helper.OpenBrowser("https://github.com/phw198/OutlookGoogleCalendarSync/wiki/Running-Multiple-Instances-of-OGCS"); + } + private void GetMyGoogleCalendars_Click(object sender, EventArgs e) { if (bGetGoogleCalendars.Text == "Cancel retrieval") { log.Warn("User cancelled retrieval of Google calendars."); @@ -1528,6 +1601,65 @@ private void btResetGCal_Click(object sender, EventArgs e) { private void cbListHiddenGcals_CheckedChanged(object sender, EventArgs e) { cbGoogleCalendars_BuildList(); } + #endregion + + #region GoogleConfig + #region Colours + private void cbColourFilter_SelectedIndexChanged(object sender, EventArgs e) { + if (this.LoadingProfileConfig) return; + + ActiveCalendarProfile.ColoursRestrictBy = (cbColourFilter.SelectedItem.ToString() == "Include") ? + SettingsStore.Calendar.RestrictBy.Include : SettingsStore.Calendar.RestrictBy.Exclude; + //Invert selection + miColourSelectInvert_Click(null, null); + } + + private void cbDeleteWhenColourExcl_CheckedChanged(object sender, EventArgs e) { + ActiveCalendarProfile.DeleteWhenColourExcluded = cbDeleteWhenColourExcl.Checked; + } + + private void clbColours_SelectedIndexChanged(object sender, EventArgs e) { + if (this.LoadingProfileConfig) return; + + ActiveCalendarProfile.Colours.Clear(); + foreach (object item in clbColours.CheckedItems) { + ActiveCalendarProfile.Colours.Add(item.ToString()); + } + } + + private void refreshColours() { + GoogleOgcs.Calendar.Instance.ColourPalette.Get(); + GoogleOgcs.Calendar.Instance.ColourPalette.BuildPicker(clbColours); + } + private void miColourRefresh_Click(object sender, EventArgs e) { + refreshColours(); + } + /// Shim function to work around x-thread call of BuildPicker() + public void miColourBuildPicker_Click(object sender, EventArgs e) { + CheckedListBox clb = GetControlThreadSafe(clbColours) as CheckedListBox; + GoogleOgcs.Calendar.Instance.ColourPalette.BuildPicker(clb); + SetControlPropertyThreadSafe(clbColours, "Items", clb.Items); + } + private void miColourSelectNone_Click(object sender, EventArgs e) { + for (int i = 0; i < clbColours.Items.Count; i++) { + clbColours.SetItemCheckState(i, CheckState.Unchecked); + } + clbColours_SelectedIndexChanged(null, null); + this.clbColours.SelectedIndexChanged += new System.EventHandler(this.clbColours_SelectedIndexChanged); + } + private void miColourSelectAll_Click(object sender, EventArgs e) { + for (int i = 0; i < clbColours.Items.Count; i++) { + clbColours.SetItemCheckState(i, CheckState.Checked); + } + clbColours_SelectedIndexChanged(null, null); + } + private void miColourSelectInvert_Click(object sender, EventArgs e) { + for (int i = 0; i < clbColours.Items.Count; i++) { + clbColours.SetItemChecked(i, !clbColours.CheckedIndices.Contains(i)); + } + clbColours_SelectedIndexChanged(null, null); + } + #endregion private void cbExcludeDeclinedInvites_CheckedChanged(object sender, EventArgs e) { ActiveCalendarProfile.ExcludeDeclinedInvites = cbExcludeDeclinedInvites.Checked; @@ -1535,18 +1667,13 @@ private void cbExcludeDeclinedInvites_CheckedChanged(object sender, EventArgs e) private void cbExcludeGoals_CheckedChanged(object sender, EventArgs e) { ActiveCalendarProfile.ExcludeGoals = cbExcludeGoals.Checked; } + #endregion #region Developer Options private void cbShowDeveloperOptions_CheckedChanged(object sender, EventArgs e) { //Toggle visibility - gbDeveloperOptions.Visible = - lGoogleAPIInstructions.Visible = - llAPIConsole.Visible = - lClientID.Visible = - lSecret.Visible = - tbClientID.Visible = - tbClientSecret.Visible = - cbShowClientSecret.Visible = + pbExpandGoogleOauth.Visible = + gbGoogle_OAuth.Visible = cbShowDeveloperOptions.Checked; } @@ -1581,46 +1708,14 @@ private void setMaxSyncRange() { #endregion #endregion #region Sync options - private void syncOptionSizing(GroupBox section, PictureBox sectionImage, Boolean? expand = null) { - int minSectionHeight = Convert.ToInt16(22 * magnification); - Boolean expandSection = expand ?? section.Height - minSectionHeight <= 5; - if (expandSection) { - if (!(expand ?? false)) sectionImage.Image.RotateFlip(RotateFlipType.Rotate90FlipNone); - switch (section.Name.ToString().Split('_').LastOrDefault()) { - case "How": section.Height = btCloseRegexRules.Visible ? 251 : 198; break; - case "When": section.Height = 119; break; - case "What": section.Height = 250; break; - case "Logging": section.Height = 111; break; - case "Proxy": section.Height = 197; break; - } - section.Height = Convert.ToInt16(section.Height * magnification); - } else { - if (section.Height > minSectionHeight) - sectionImage.Image.RotateFlip(RotateFlipType.Rotate270FlipNone); - section.Height = minSectionHeight; - } - sectionImage.Refresh(); - - if ("pbExpandHow|pbExpandWhen|pbExpandWhat".Contains(sectionImage.Name)) { - gbSyncOptions_When.Top = gbSyncOptions_How.Location.Y + gbSyncOptions_How.Height + Convert.ToInt16(10 * magnification); - pbExpandWhen.Top = gbSyncOptions_When.Top - Convert.ToInt16(2 * magnification); - gbSyncOptions_What.Top = gbSyncOptions_When.Location.Y + gbSyncOptions_When.Height + Convert.ToInt16(10 * magnification); - pbExpandWhat.Top = gbSyncOptions_What.Top - Convert.ToInt16(2 * magnification); - - } else if ("pbExpandLogging|pbExpandProxy".Contains(sectionImage.Name)) { - gbAppBehaviour_Proxy.Top = gbAppBehaviour_Logging.Location.Y + gbAppBehaviour_Logging.Height + Convert.ToInt16(10 * magnification); - pbExpandProxy.Top = gbAppBehaviour_Proxy.Top - Convert.ToInt16(2 * magnification); - } - } - private void pbExpandHow_Click(object sender, EventArgs e) { - syncOptionSizing(gbSyncOptions_How, pbExpandHow); + groupboxSizing(gbSyncOptions_How, pbExpandHow); } private void pbExpandWhen_Click(object sender, EventArgs e) { - syncOptionSizing(gbSyncOptions_When, pbExpandWhen); + groupboxSizing(gbSyncOptions_When, pbExpandWhen); } private void pbExpandWhat_Click(object sender, EventArgs e) { - syncOptionSizing(gbSyncOptions_What, pbExpandWhat); + groupboxSizing(gbSyncOptions_What, pbExpandWhat); } #region How @@ -1628,7 +1723,6 @@ private void syncDirection_SelectedIndexChanged(object sender, EventArgs e) { ActiveCalendarProfile.SyncDirection = (Sync.Direction)syncDirection.SelectedItem; if (ActiveCalendarProfile.SyncDirection.Id == Sync.Direction.Bidirectional.Id) { ActiveCalendarProfile.RegisterForPushSync(); - cbDeleteWhenCatExcl.Visible = true; cbObfuscateDirection.Enabled = true; cbObfuscateDirection.SelectedIndex = Sync.Direction.OutlookToGoogle.Id - 1; @@ -1648,7 +1742,6 @@ private void syncDirection_SelectedIndexChanged(object sender, EventArgs e) { lWhatExcludeInfo.Left = 207; cbExcludeTentative.Visible = true; } else { - cbDeleteWhenCatExcl.Visible = false; cbObfuscateDirection.Enabled = false; cbObfuscateDirection.SelectedIndex = ActiveCalendarProfile.SyncDirection.Id - 1; @@ -1716,13 +1809,13 @@ private void btObfuscateRules_Click(object sender, EventArgs e) { this.howObfuscatePanel.Visible = true; this.howMorePanel.Visible = false; this.btCloseRegexRules.Visible = true; - syncOptionSizing(gbSyncOptions_How, pbExpandHow, true); + groupboxSizing(gbSyncOptions_How, pbExpandHow, true); } private void btCloseRegexRules_Click(object sender, EventArgs e) { this.btCloseRegexRules.Visible = false; this.howMorePanel.Visible = true; this.howObfuscatePanel.Visible = false; - syncOptionSizing(gbSyncOptions_How, pbExpandHow, true); + groupboxSizing(gbSyncOptions_How, pbExpandHow, true); } private void gbSyncOptions_HowExpand(Boolean show, Int16 newHeight) { int minPanelHeight = Convert.ToInt16(50 * magnification); @@ -2260,11 +2353,11 @@ private void cbPortable_CheckedChanged(object sender, EventArgs e) { } private void pbExpandLogging_Click(object sender, EventArgs e) { - syncOptionSizing(gbAppBehaviour_Logging, pbExpandLogging); + groupboxSizing(gbAppBehaviour_Logging, pbExpandLogging); } private void pbExpandProxy_Click(object sender, EventArgs e) { - syncOptionSizing(gbAppBehaviour_Proxy, pbExpandProxy); + groupboxSizing(gbAppBehaviour_Proxy, pbExpandProxy); } private void cbCreateFiles_CheckedChanged(object sender, EventArgs e) { @@ -2395,20 +2488,20 @@ private void cbAlphaReleases_CheckedChanged(object sender, EventArgs e) { #endregion #region Thread safe access to form components - //private delegate Control getControlThreadSafeDelegate(Control control); + private delegate Control getControlThreadSafeDelegate(Control control); - private delegate void setControlPropertyThreadSafeDelegate(Control control, string propertyName, object propertyValue); private delegate object getControlPropertyThreadSafeDelegate(Control control, string propertyName); + private delegate void setControlPropertyThreadSafeDelegate(Control control, string propertyName, object propertyValue); private delegate void callControlMethodThreadSafeDelegate(Control control, string methodName, object methodArgValue); - //private static Control getControlThreadSafe(Control control) { - // if (control.InvokeRequired) { - // return (Control)control.Invoke(new getControlThreadSafeDelegate(getControlThreadSafe), new object[] { control }); - // } else { - // return control; - // } - //} + public static Control GetControlThreadSafe(Control control) { + if (control.InvokeRequired) { + return (Control)control.Invoke(new getControlThreadSafeDelegate(GetControlThreadSafe), new object[] { control }); + } else { + return control.GetType().InvokeMember("discarded", System.Reflection.BindingFlags.CreateInstance, null, control, null) as Control; + } + } public object GetControlPropertyThreadSafe(Control control, string propertyName) { if (control.InvokeRequired) { @@ -2421,8 +2514,12 @@ public void SetControlPropertyThreadSafe(Control control, string propertyName, o if (control.InvokeRequired) { control.Invoke(new setControlPropertyThreadSafeDelegate(SetControlPropertyThreadSafe), new object[] { control, propertyName, propertyValue }); } else { + if (control is CheckedListBox && propertyValue is CheckedListBox.ObjectCollection) { + (control as CheckedListBox).Items.AddRange(propertyValue as CheckedListBox.ObjectCollection); + return; + } var theObject = control.GetType().InvokeMember(propertyName, System.Reflection.BindingFlags.SetProperty, null, control, new object[] { propertyValue }); - if (control.GetType().Name == "TextBox") { + if (control is TextBox) { TextBox tb = control as TextBox; tb.SelectionStart = tb.Text.Length; tb.ScrollToCaret(); diff --git a/src/OutlookGoogleCalendarSync/Forms/MainForm.resx b/src/OutlookGoogleCalendarSync/Forms/MainForm.resx index 5b4ff2be..25eade93 100644 --- a/src/OutlookGoogleCalendarSync/Forms/MainForm.resx +++ b/src/OutlookGoogleCalendarSync/Forms/MainForm.resx @@ -118,10 +118,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 142, 17 + 403, 17 - 17, 17 + 126, 17 To change the Client ID and secret, first disconnect your account @@ -131,9 +131,12 @@ Obtain new values from the Google Developer Console. You'll need to enable the Calendar API in your project: - + 17, 17 + + 251, 17 + On the "Google" tab, select the calendar you wish to synchronise. @@ -160,7 +163,7 @@ or support further improvements, any donations would be greatly appreciated! - 285, 17 + 546, 17 diff --git a/src/OutlookGoogleCalendarSync/GoogleOgcs/EventColour.cs b/src/OutlookGoogleCalendarSync/GoogleOgcs/EventColour.cs index 0589e085..786c98de 100644 --- a/src/OutlookGoogleCalendarSync/GoogleOgcs/EventColour.cs +++ b/src/OutlookGoogleCalendarSync/GoogleOgcs/EventColour.cs @@ -232,6 +232,26 @@ public void Get() { foreach (KeyValuePair colour in colours.Calendar) { calendarPalette.Add(new Palette(Palette.Type.Calendar, colour.Key, colour.Value.Background, OutlookOgcs.Categories.Map.RgbColour(colour.Value.Background))); } + Forms.Main.Instance.miColourBuildPicker_Click(null, null); + } + + /// + /// Build colour list from those downloaded from Google. + /// + /// The checklistbox to populate with the colours. + public void BuildPicker(System.Windows.Forms.CheckedListBox clb) { + clb.BeginUpdate(); + clb.Items.Clear(); + clb.Items.Add(""); + foreach (Palette colour in GoogleOgcs.Calendar.Instance.ColourPalette.eventPalette) { + clb.Items.Add(colour.Name); + } + foreach (String colour in Forms.Main.Instance.ActiveCalendarProfile.Colours) { + try { + clb.SetItemChecked(clb.Items.IndexOf(colour), true); + } catch { /* Colour "colour" no longer exists */ } + } + clb.EndUpdate(); } /// diff --git a/src/OutlookGoogleCalendarSync/GoogleOgcs/GoogleCalendar.cs b/src/OutlookGoogleCalendarSync/GoogleOgcs/GoogleCalendar.cs index 3ab7ec45..ac740f09 100644 --- a/src/OutlookGoogleCalendarSync/GoogleOgcs/GoogleCalendar.cs +++ b/src/OutlookGoogleCalendarSync/GoogleOgcs/GoogleCalendar.cs @@ -26,9 +26,10 @@ public static Calendar Instance { Authenticator = new GoogleOgcs.Authenticator() }; instance.Authenticator.GetAuthenticated(); - if (instance.Authenticator.Authenticated) + if (instance.Authenticator.Authenticated) { instance.Authenticator.OgcsUserStatus(); - else { + _ = instance.ColourPalette; + } else { instance = null; if (Forms.Main.Instance.Console.DocumentText.Contains("Authorisation to allow OGCS to manage your Google calendar was cancelled.")) throw new OperationCanceledException(); @@ -43,6 +44,9 @@ public Calendar() { } private Boolean openedIssue1593 = false; public GoogleOgcs.Authenticator Authenticator; + /// Google Events excluded through user config + public Dictionary ExcludedByColour { get; private set; } + private GoogleOgcs.EventColour colourPalette; public static Boolean IsColourPaletteNull { get { return instance?.colourPalette == null; } } @@ -272,6 +276,7 @@ public List GetCalendarEntriesInRange() { public List GetCalendarEntriesInRange(DateTime from, DateTime to) { List result = new List(); + ExcludedByColour = new Dictionary(); Events request = null; String pageToken = null; Int16 pageNum = 1; @@ -347,6 +352,26 @@ public List GetCalendarEntriesInRange(DateTime from, DateTime to) { List privacy = new(); List declined = new(); List goals = new(); + List colour = new(); + + //Colours + if (profile.ColoursRestrictBy == SettingsStore.Calendar.RestrictBy.Include) { + colour = result.Where(ev => (profile.Colours.Count() == 0 || (String.IsNullOrEmpty(ev.ColorId) && !profile.Colours.Contains("")) || + !String.IsNullOrEmpty(ev.ColorId) && !profile.Colours.Contains(EventColour.Palette.GetColourName(ev.ColorId)))).ToList(); + + } else if (profile.ColoursRestrictBy == SettingsStore.Calendar.RestrictBy.Exclude) { + colour = result.Where(ev => (profile.Colours.Count() > 0 && (String.IsNullOrEmpty(ev.ColorId) && profile.Colours.Contains("")) || + !String.IsNullOrEmpty(ev.ColorId) && profile.Colours.Contains(EventColour.Palette.GetColourName(ev.ColorId)))).ToList(); + } + if (colour.Count > 0) { + log.Debug(colour.Count + " Google items contain a colour that is filtered out."); + } + foreach (Event ev in colour) { + ExcludedByColour.Add(ev.Id, CustomProperty.Get(ev, CustomProperty.MetadataId.oEntryId)); + } + result = result.Except(colour).ToList(); + + //Availability, Privacy if (profile.SyncDirection.Id != Sync.Direction.OutlookToGoogle.Id) { //Sync direction means G->O will delete previously synced all-days if (profile.ExcludeFree) { availability = result.Where(ev => ev.Transparency == "transparent").ToList(); @@ -379,6 +404,7 @@ public List GetCalendarEntriesInRange(DateTime from, DateTime to) { } } + //Invitation if (profile.ExcludeDeclinedInvites) { declined = result.Where(ev => string.IsNullOrEmpty(ev.RecurringEventId) && ev.Attendees != null && ev.Attendees.Count(a => a.Self == true && a.ResponseStatus == "declined") == 1).ToList(); if (declined.Count > 0) { @@ -387,6 +413,7 @@ public List GetCalendarEntriesInRange(DateTime from, DateTime to) { } } + //Goals if ((IsDefaultCalendar() ?? true) && profile.ExcludeGoals) { goals = result.Where(ev => !string.IsNullOrEmpty(ev.Description) && ev.Description.Contains("This event was added from Goals in Google Calendar.") && @@ -1070,7 +1097,7 @@ private Boolean deleteCalendarEntry(Event ev) { if (OgcsMessageBox.Show("Delete " + eventSummary + "?", "Confirm Deletion From Google", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { doDelete = false; - if (Sync.Engine.Calendar.Instance.Profile.SyncDirection.Id == Sync.Direction.Bidirectional.Id && CustomProperty.ExistsAny(ev)) { + if (Sync.Engine.Calendar.Instance.Profile.SyncDirection.Id == Sync.Direction.Bidirectional.Id && CustomProperty.ExistAnyOutlookIDs(ev)) { CustomProperty.RemoveOutlookIDs(ref ev); UpdateCalendarEntry_save(ref ev); } @@ -1408,15 +1435,24 @@ public void IdentifyEventDifferences( if (responseFiltered > 0) log.Info(responseFiltered + " Outlook items will not be created due to only syncing invites that have been responded to."); } - if (google.Count > 0 && OutlookOgcs.Calendar.Instance.ExcludedByCategory.Count > 0 && profile.SyncDirection.Id == Sync.Direction.Bidirectional.Id && !profile.DeleteWhenCategoryExcluded) { + if (google.Count > 0 && OutlookOgcs.Calendar.Instance.ExcludedByCategory.Count > 0 && !profile.DeleteWhenCategoryExcluded) { //Check if Google items to be deleted were filtered out from Outlook for (int g = google.Count - 1; g >= 0; g--) { - if (CustomProperty.Exists(google[g], CustomProperty.MetadataId.oEntryId) && - OutlookOgcs.Calendar.Instance.ExcludedByCategory.Contains(CustomProperty.Get(google[g], CustomProperty.MetadataId.oEntryId))) { + if (OutlookOgcs.Calendar.Instance.ExcludedByCategory.ContainsValue(google[g].Id) || + OutlookOgcs.Calendar.Instance.ExcludedByCategory.ContainsKey(CustomProperty.Get(google[g], CustomProperty.MetadataId.oEntryId) ?? "")) { google.Remove(google[g]); } } } + if (outlook.Count > 0 && GoogleOgcs.Calendar.Instance.ExcludedByColour.Count > 0) { + //Check if Outlook items to be created were filtered out from Google + for (int o = outlook.Count - 1; o >= 0; o--) { + if (ExcludedByColour.ContainsValue(outlook[o].EntryID) || + ExcludedByColour.ContainsKey(OutlookOgcs.CustomProperty.Get(outlook[o], OutlookOgcs.CustomProperty.MetadataId.gEventID) ?? "")) { + outlook.Remove(outlook[o]); + } + } + } if (profile.DisableDelete) { if (google.Count > 0) { @@ -2202,6 +2238,23 @@ public static ApiException HandleAPIlimits(ref Google.GoogleApiException ex, Eve return null; } } + + /// + /// Build colour list from any saved in Settings, instead of downloading from Google. + /// + /// The checklistbox to populate with the colours. + public static void BuildOfflineColourPicker(System.Windows.Forms.CheckedListBox clb) { + if (IsInstanceNull || !Instance.Authenticator.Authenticated) { + clb.BeginUpdate(); + clb.Items.Clear(); + foreach (String colour in Forms.Main.Instance.ActiveCalendarProfile.Colours) { + clb.Items.Add(colour, true); + } + clb.EndUpdate(); + } else { + Instance.ColourPalette.BuildPicker(clb); + } + } #endregion /// diff --git a/src/OutlookGoogleCalendarSync/OutlookOgcs/OutlookCalendar.cs b/src/OutlookGoogleCalendarSync/OutlookOgcs/OutlookCalendar.cs index dc1225d8..f5b08a2e 100644 --- a/src/OutlookGoogleCalendarSync/OutlookOgcs/OutlookCalendar.cs +++ b/src/OutlookGoogleCalendarSync/OutlookOgcs/OutlookCalendar.cs @@ -60,8 +60,8 @@ public enum Service { } public EphemeralProperties EphemeralProperties = new EphemeralProperties(); - /// Outlook Event IDs excluded through user config - public List ExcludedByCategory; + /// Outlook Appointment excluded through user config + public Dictionary ExcludedByCategory { get; private set; } public Calendar() { InstanceConnect = true; @@ -234,7 +234,7 @@ public List FilterCalendarEntries(SettingsStore.Calendar profil (profile.CategoriesRestrictBy == SettingsStore.Calendar.RestrictBy.Exclude && profile.Categories.Contains(""))); } else throw; } - if (filtered) { ExcludedByCategory.Add(ai.EntryID); continue; } + if (filtered) { ExcludedByCategory.Add(ai.EntryID, CustomProperty.Get(ai, CustomProperty.MetadataId.gEventID)); continue; } //Availability, Privacy, Subject if (profile.SyncDirection.Id != Sync.Direction.GoogleToOutlook.Id) { //Sync direction means O->G will delete previously synced excluded items @@ -1484,6 +1484,25 @@ public static void IdentifyEventDifferences( if (responseFiltered > 0) log.Info(responseFiltered + " Outlook items will not be deleted due to only syncing invites that have been responded to."); } + if (outlook.Count > 0 && GoogleOgcs.Calendar.Instance.ExcludedByColour.Count > 0 && !profile.DeleteWhenColourExcluded) { + //Check if Outlook items to be deleted were filtered out from Google + for (int o = outlook.Count - 1; o >= 0; o--) { + if (GoogleOgcs.Calendar.Instance.ExcludedByColour.ContainsValue(outlook[o].EntryID) || + GoogleOgcs.Calendar.Instance.ExcludedByColour.ContainsKey(CustomProperty.Get(outlook[o], CustomProperty.MetadataId.gEventID) ?? "")) { + outlook.Remove(outlook[o]); + } + } + } + if (google.Count > 0 && Instance.ExcludedByCategory.Count > 0) { + //Check if Google items to be created were filtered out from Outlook + for (int g = google.Count - 1; g >= 0; g--) { + if (Instance.ExcludedByCategory.ContainsValue(google[g].Id) || + Instance.ExcludedByCategory.ContainsKey(GoogleOgcs.CustomProperty.Get(google[g], GoogleOgcs.CustomProperty.MetadataId.oEntryId) ?? "")) { + google.Remove(google[g]); + } + } + } + if (profile.DisableDelete) { if (outlook.Count > 0) { Forms.Main.Instance.Console.Update(outlook.Count + " Outlook items would have been deleted, but you have deletions disabled.", Console.Markup.warning); diff --git a/src/OutlookGoogleCalendarSync/SettingsStore/Calendar.cs b/src/OutlookGoogleCalendarSync/SettingsStore/Calendar.cs index d208b895..9e12fe41 100644 --- a/src/OutlookGoogleCalendarSync/SettingsStore/Calendar.cs +++ b/src/OutlookGoogleCalendarSync/SettingsStore/Calendar.cs @@ -47,6 +47,9 @@ private void setDefaults() { //Google UseGoogleCalendar = new GoogleCalendarListEntry(); CloakEmail = true; + ColoursRestrictBy = RestrictBy.Exclude; + DeleteWhenColourExcluded = true; + Colours = new List(); ExcludeDeclinedInvites = true; ExcludeGoals = true; @@ -129,6 +132,9 @@ [DataMember] public Boolean OutlookGalBlocked { #region Google [DataMember] public GoogleCalendarListEntry UseGoogleCalendar { get; set; } [DataMember] public Boolean CloakEmail { get; set; } + [DataMember] public RestrictBy ColoursRestrictBy { get; set; } + [DataMember] public Boolean DeleteWhenColourExcluded { get; set; } + [DataMember] public List Colours { get; set; } [DataMember] public Boolean ExcludeDeclinedInvites { get; set; } [DataMember] public Boolean ExcludeGoals { get; set; } #endregion @@ -277,6 +283,9 @@ public void LogSettings() { log.Info("GOOGLE SETTINGS:-"); log.Info(" Calendar: " + (UseGoogleCalendar?.Id == null ? "" : UseGoogleCalendar.ToString(true))); + log.Info(" Colour Filter: " + ColoursRestrictBy.ToString()); + log.Info(" Delete When Excluded:" + DeleteWhenColourExcluded); + log.Info(" Colours: " + String.Join(",", Colours.ToArray())); log.Info(" Exclude Declined Invites: " + ExcludeDeclinedInvites); log.Info(" Exclude Goals: " + ExcludeGoals); log.Info(" Cloak Email: " + CloakEmail);