From eed328e2c72b5d1e84982af30f218a94392aeec1 Mon Sep 17 00:00:00 2001 From: Viktar Karpach Date: Sat, 17 Mar 2018 17:21:03 -0500 Subject: [PATCH] Add chrome user folder and make command re-runnable --- .../Karpach.Remote.Keep.Command.Runner.csproj | 3 - .../Helpers/StringExtensionsTests.cs | 20 +++++ .../Karpach.Remote.Keep.Command.Tests.csproj | 59 ++++++++++++++ .../Properties/AssemblyInfo.cs | 36 +++++++++ Karpach.Remote.Keep.Command.sln | 11 ++- .../Helpers/StringExtensions.cs | 19 +++++ .../Karpach.Remote.Keep.Command.csproj | 6 +- Karpach.Remote.Keep.Command/KeepCommand.cs | 61 ++++++++------ .../KeepCommandSettings.cs | 1 + .../KeepCommandSettingsForm.cs | 81 ++++++++++++++----- .../KeepCommandSettingsForm.resx | 6 ++ 11 files changed, 254 insertions(+), 49 deletions(-) create mode 100644 Karpach.Remote.Keep.Command.Tests/Helpers/StringExtensionsTests.cs create mode 100644 Karpach.Remote.Keep.Command.Tests/Karpach.Remote.Keep.Command.Tests.csproj create mode 100644 Karpach.Remote.Keep.Command.Tests/Properties/AssemblyInfo.cs create mode 100644 Karpach.Remote.Keep.Command/Helpers/StringExtensions.cs diff --git a/Karpach.Remote.Keep.Command.Runner/Karpach.Remote.Keep.Command.Runner.csproj b/Karpach.Remote.Keep.Command.Runner/Karpach.Remote.Keep.Command.Runner.csproj index 37e59fe..35b0461 100644 --- a/Karpach.Remote.Keep.Command.Runner/Karpach.Remote.Keep.Command.Runner.csproj +++ b/Karpach.Remote.Keep.Command.Runner/Karpach.Remote.Keep.Command.Runner.csproj @@ -64,9 +64,6 @@ - - - diff --git a/Karpach.Remote.Keep.Command.Tests/Helpers/StringExtensionsTests.cs b/Karpach.Remote.Keep.Command.Tests/Helpers/StringExtensionsTests.cs new file mode 100644 index 0000000..70fa172 --- /dev/null +++ b/Karpach.Remote.Keep.Command.Tests/Helpers/StringExtensionsTests.cs @@ -0,0 +1,20 @@ +using Karpach.Remote.Keep.Command.Helpers; +using NUnit.Framework; + +namespace Karpach.Remote.Keep.Command.Tests.Helpers +{ + [TestFixture] + public class StringExtensionsTests + { + [TestCase(null, ExpectedResult = null)] + [TestCase("", ExpectedResult = null)] + [TestCase("C:\\Tmp\\", ExpectedResult = "C:/Tmp/")] + [TestCase("C:\\Tmp\\Default", ExpectedResult = "C:/Tmp/")] + [TestCase("C:\\Tmp\\Default\\", ExpectedResult = "C:/Tmp/")] + [TestCase("C:/Tmp/Default", ExpectedResult = "C:/Tmp/")] + public string NormalizeChromeProfileFolder_Tests(string path) + { + return path.NormalizeChromeProfileFolder(); + } + } +} \ No newline at end of file diff --git a/Karpach.Remote.Keep.Command.Tests/Karpach.Remote.Keep.Command.Tests.csproj b/Karpach.Remote.Keep.Command.Tests/Karpach.Remote.Keep.Command.Tests.csproj new file mode 100644 index 0000000..70b8fac --- /dev/null +++ b/Karpach.Remote.Keep.Command.Tests/Karpach.Remote.Keep.Command.Tests.csproj @@ -0,0 +1,59 @@ + + + + + Debug + AnyCPU + {AF8DFD8A-056D-4222-90AE-05EBD6FB10E4} + Library + Properties + Karpach.Remote.Keep.Command.Tests + Karpach.Remote.Keep.Command.Tests + v4.6.1 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + 3.10.1 + + + + + {e2f6efe1-51f6-4f9e-a548-079ddc6352b2} + Karpach.Remote.Keep.Command + + + + \ No newline at end of file diff --git a/Karpach.Remote.Keep.Command.Tests/Properties/AssemblyInfo.cs b/Karpach.Remote.Keep.Command.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9b44c4c --- /dev/null +++ b/Karpach.Remote.Keep.Command.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Karpach.Remote.Keep.Command.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Karpach.Remote.Keep.Command.Tests")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("af8dfd8a-056d-4222-90ae-05ebd6fb10e4")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Karpach.Remote.Keep.Command.sln b/Karpach.Remote.Keep.Command.sln index a1a4d6f..e746a92 100644 --- a/Karpach.Remote.Keep.Command.sln +++ b/Karpach.Remote.Keep.Command.sln @@ -1,12 +1,14 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26430.13 +VisualStudioVersion = 15.0.27130.2027 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Karpach.Remote.Keep.Command", "Karpach.Remote.Keep.Command\Karpach.Remote.Keep.Command.csproj", "{E2F6EFE1-51F6-4F9E-A548-079DDC6352B2}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Karpach.Remote.Keep.Command.Runner", "Karpach.Remote.Keep.Command.Runner\Karpach.Remote.Keep.Command.Runner.csproj", "{4B5FCA92-BE5D-463F-A878-1E4AC4E2B6E3}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Karpach.Remote.Keep.Command.Tests", "Karpach.Remote.Keep.Command.Tests\Karpach.Remote.Keep.Command.Tests.csproj", "{AF8DFD8A-056D-4222-90AE-05EBD6FB10E4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,8 +23,15 @@ Global {4B5FCA92-BE5D-463F-A878-1E4AC4E2B6E3}.Debug|Any CPU.Build.0 = Debug|Any CPU {4B5FCA92-BE5D-463F-A878-1E4AC4E2B6E3}.Release|Any CPU.ActiveCfg = Release|Any CPU {4B5FCA92-BE5D-463F-A878-1E4AC4E2B6E3}.Release|Any CPU.Build.0 = Release|Any CPU + {AF8DFD8A-056D-4222-90AE-05EBD6FB10E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF8DFD8A-056D-4222-90AE-05EBD6FB10E4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF8DFD8A-056D-4222-90AE-05EBD6FB10E4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF8DFD8A-056D-4222-90AE-05EBD6FB10E4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {736C96AB-D22C-4A36-A7C2-C027D7700F07} + EndGlobalSection EndGlobal diff --git a/Karpach.Remote.Keep.Command/Helpers/StringExtensions.cs b/Karpach.Remote.Keep.Command/Helpers/StringExtensions.cs new file mode 100644 index 0000000..edb2204 --- /dev/null +++ b/Karpach.Remote.Keep.Command/Helpers/StringExtensions.cs @@ -0,0 +1,19 @@ +using System; +using System.Text.RegularExpressions; + +namespace Karpach.Remote.Keep.Command.Helpers +{ + public static class StringExtensions + { + public static string NormalizeChromeProfileFolder(this string folder) + { + if (string.IsNullOrEmpty(folder)) + { + return null; + } + string result = folder.Replace("\\", "/"); + result = Regex.Replace(result, "/Default/?$", "/"); + return result; + } + } +} \ No newline at end of file diff --git a/Karpach.Remote.Keep.Command/Karpach.Remote.Keep.Command.csproj b/Karpach.Remote.Keep.Command/Karpach.Remote.Keep.Command.csproj index 984be6a..310a07c 100644 --- a/Karpach.Remote.Keep.Command/Karpach.Remote.Keep.Command.csproj +++ b/Karpach.Remote.Keep.Command/Karpach.Remote.Keep.Command.csproj @@ -76,6 +76,7 @@ + @@ -117,11 +118,12 @@ + 3.1 - + @@ -129,4 +131,4 @@ - + \ No newline at end of file diff --git a/Karpach.Remote.Keep.Command/KeepCommand.cs b/Karpach.Remote.Keep.Command/KeepCommand.cs index b567c65..df559f5 100644 --- a/Karpach.Remote.Keep.Command/KeepCommand.cs +++ b/Karpach.Remote.Keep.Command/KeepCommand.cs @@ -9,6 +9,7 @@ using System.Windows.Forms; using Karpach.Remote.Commands.Base; using Karpach.Remote.Commands.Interfaces; +using Karpach.Remote.Keep.Command.Helpers; using NLog; using OpenQA.Selenium; using OpenQA.Selenium.Chrome; @@ -41,6 +42,12 @@ public KeepCommand(Guid? id) : base(id) { options.AddArguments("--headless"); options.AddArguments("--disable-gpu"); + } + + string chromeProfileFolder = ((KeepCommandSettings) Settings).ChromeProfileFolder.NormalizeChromeProfileFolder(); + if (!string.IsNullOrEmpty(chromeProfileFolder)) + { + options.AddArguments($"--user-data-dir={chromeProfileFolder}"); } return new ChromeDriver(driverService, options); }); @@ -82,33 +89,41 @@ public override void RunCommand(params object[] parameters) } try { - string url = "https://photos.google.com/login"; - WebDriverWait wait; - ReadOnlyCollection elements; - if (!string.Equals(_chromeDriver.Value.Url, url)) - { - _chromeDriver.Value.Navigate().GoToUrl(url); - wait = new WebDriverWait(_chromeDriver.Value, TimeSpan.FromSeconds(KeepLoadTimeout)); - elements = wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.CssSelector("#initialView #identifierId"))); - if (elements.Count == 1) - { - if (!Login(elements[0])) + string keepUrl = $"https://keep.google.com/#LIST/{((KeepCommandSettings)Settings).ListId}"; + if (!string.Equals(_chromeDriver.Value.Url, keepUrl, StringComparison.InvariantCultureIgnoreCase)) + { + string photosUrl = "https://photos.google.com"; + WebDriverWait wait; + ReadOnlyCollection elements; + _chromeDriver.Value.Navigate().GoToUrl($"{photosUrl}/login"); + if (!_chromeDriver.Value.Url.Contains(photosUrl)) + { + wait = new WebDriverWait(_chromeDriver.Value, TimeSpan.FromSeconds(KeepLoadTimeout)); + elements = wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.CssSelector("#initialView #identifierId"))); + if (elements.Count == 1) { - Logger.Log(LogLevel.Error, "Unable to login:\n" + _chromeDriver.Value.PageSource + "\n\n"); + if (!Login(elements[0])) + { + Logger.Log(LogLevel.Error, "Unable to login:\n" + _chromeDriver.Value.PageSource + "\n\n"); + return; + } + wait = new WebDriverWait(_chromeDriver.Value, TimeSpan.FromSeconds(KeepLoadTimeout * 5)); + wait.Until(ExpectedConditions.UrlContains(photosUrl)); + } + else + { + Logger.Log(LogLevel.Error, "Unable to load login page:\n" + _chromeDriver.Value.PageSource + "\n\n"); return; } - wait = new WebDriverWait(_chromeDriver.Value, TimeSpan.FromSeconds(KeepLoadTimeout)); - wait.Until(ExpectedConditions.UrlContains("https://photos.google.com")); - url = $"https://keep.google.com/#LIST/{((KeepCommandSettings)Settings).ListId}"; - _chromeDriver.Value.Navigate().GoToUrl(url); + } + _chromeDriver.Value.Navigate().GoToUrl(keepUrl); + wait = new WebDriverWait(_chromeDriver.Value, TimeSpan.FromSeconds(KeepLoadTimeout)); + elements = wait.Until(VisibleElementsByLocatedBy(By.XPath("//div[@aria-label='Remind me']"),1)); + if (elements.Count != 1) + { + Logger.Log(LogLevel.Error, "Unable to load keep page:\n" + _chromeDriver.Value.PageSource + "\n\n"); + return; } - } - wait = new WebDriverWait(_chromeDriver.Value, TimeSpan.FromSeconds(KeepLoadTimeout)); - elements = wait.Until(VisibleElementsByLocatedBy(By.XPath("//div[@aria-label='Remind me']"),1)); - if (elements.Count != 1) - { - Logger.Log(LogLevel.Error, "Unable to load keep page:\n" + _chromeDriver.Value.PageSource + "\n\n"); - return; } if (parameters != null && parameters.Length == 1) { diff --git a/Karpach.Remote.Keep.Command/KeepCommandSettings.cs b/Karpach.Remote.Keep.Command/KeepCommandSettings.cs index b0a9cad..6e23f3c 100644 --- a/Karpach.Remote.Keep.Command/KeepCommandSettings.cs +++ b/Karpach.Remote.Keep.Command/KeepCommandSettings.cs @@ -10,5 +10,6 @@ public class KeepCommandSettings : CommandSettingsBase public string GoogleUserName { get; set; } public string GooglePassword { get; set; } public bool Headless { get; set; } + public string ChromeProfileFolder { get; set; } } } \ No newline at end of file diff --git a/Karpach.Remote.Keep.Command/KeepCommandSettingsForm.cs b/Karpach.Remote.Keep.Command/KeepCommandSettingsForm.cs index 8396005..ddae6f0 100644 --- a/Karpach.Remote.Keep.Command/KeepCommandSettingsForm.cs +++ b/Karpach.Remote.Keep.Command/KeepCommandSettingsForm.cs @@ -20,6 +20,11 @@ public class SampleCommandSettingsForm : Form private Label _lbGmailPassword; private TextBox _txtGmailPassword; private CheckBox _chkHeadless; + private Label _lbChromeProfileFolder; + private TextBox _txtChromeProfileFolder; + private ToolTip _ttChromeProfileFolder; + private System.ComponentModel.IContainer components; + private NotifyIcon notifyIcon1; private TextBox _txtDelay; public SampleCommandSettingsForm(KeepCommandSettings settings) @@ -32,10 +37,12 @@ public SampleCommandSettingsForm(KeepCommandSettings settings) _txtGmailPassword.Text = Settings.GooglePassword; _txtListId.Text = Settings.ListId; _chkHeadless.Checked = Settings.Headless; + _txtChromeProfileFolder.Text = Settings.ChromeProfileFolder; } private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SampleCommandSettingsForm)); this._btnOk = new System.Windows.Forms.Button(); this._btnCancel = new System.Windows.Forms.Button(); @@ -50,15 +57,19 @@ private void InitializeComponent() this._lbGmailPassword = new System.Windows.Forms.Label(); this._txtGmailPassword = new System.Windows.Forms.TextBox(); this._chkHeadless = new System.Windows.Forms.CheckBox(); + this._lbChromeProfileFolder = new System.Windows.Forms.Label(); + this._txtChromeProfileFolder = new System.Windows.Forms.TextBox(); + this._ttChromeProfileFolder = new System.Windows.Forms.ToolTip(this.components); + this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.SuspendLayout(); // // _btnOk // this._btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; - this._btnOk.Location = new System.Drawing.Point(133, 247); + this._btnOk.Location = new System.Drawing.Point(167, 286); this._btnOk.Name = "_btnOk"; this._btnOk.Size = new System.Drawing.Size(75, 23); - this._btnOk.TabIndex = 4; + this._btnOk.TabIndex = 7; this._btnOk.Text = "Ok"; this._btnOk.UseVisualStyleBackColor = true; this._btnOk.Click += new System.EventHandler(this._btnOk_Click); @@ -66,10 +77,10 @@ private void InitializeComponent() // _btnCancel // this._btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this._btnCancel.Location = new System.Drawing.Point(214, 247); + this._btnCancel.Location = new System.Drawing.Point(248, 286); this._btnCancel.Name = "_btnCancel"; this._btnCancel.Size = new System.Drawing.Size(75, 23); - this._btnCancel.TabIndex = 5; + this._btnCancel.TabIndex = 8; this._btnCancel.Text = "Cancel"; this._btnCancel.UseVisualStyleBackColor = true; this._btnCancel.Click += new System.EventHandler(this._btnCancel_Click); @@ -77,7 +88,7 @@ private void InitializeComponent() // _lbCommandName // this._lbCommandName.AutoSize = true; - this._lbCommandName.Location = new System.Drawing.Point(22, 25); + this._lbCommandName.Location = new System.Drawing.Point(83, 25); this._lbCommandName.Name = "_lbCommandName"; this._lbCommandName.Size = new System.Drawing.Size(88, 13); this._lbCommandName.TabIndex = 0; @@ -85,7 +96,7 @@ private void InitializeComponent() // // _txtCommandName // - this._txtCommandName.Location = new System.Drawing.Point(116, 22); + this._txtCommandName.Location = new System.Drawing.Point(186, 22); this._txtCommandName.Name = "_txtCommandName"; this._txtCommandName.Size = new System.Drawing.Size(271, 20); this._txtCommandName.TabIndex = 0; @@ -93,7 +104,7 @@ private void InitializeComponent() // _lbDelay // this._lbDelay.AutoSize = true; - this._lbDelay.Location = new System.Drawing.Point(9, 61); + this._lbDelay.Location = new System.Drawing.Point(70, 61); this._lbDelay.Name = "_lbDelay"; this._lbDelay.Size = new System.Drawing.Size(101, 13); this._lbDelay.TabIndex = 0; @@ -101,7 +112,7 @@ private void InitializeComponent() // // _txtDelay // - this._txtDelay.Location = new System.Drawing.Point(116, 58); + this._txtDelay.Location = new System.Drawing.Point(186, 58); this._txtDelay.Name = "_txtDelay"; this._txtDelay.Size = new System.Drawing.Size(271, 20); this._txtDelay.TabIndex = 1; @@ -109,7 +120,7 @@ private void InitializeComponent() // _lbListId // this._lbListId.AutoSize = true; - this._lbListId.Location = new System.Drawing.Point(70, 176); + this._lbListId.Location = new System.Drawing.Point(138, 176); this._lbListId.Name = "_lbListId"; this._lbListId.Size = new System.Drawing.Size(38, 13); this._lbListId.TabIndex = 0; @@ -117,15 +128,15 @@ private void InitializeComponent() // // _txtListId // - this._txtListId.Location = new System.Drawing.Point(116, 173); + this._txtListId.Location = new System.Drawing.Point(186, 173); this._txtListId.Name = "_txtListId"; this._txtListId.Size = new System.Drawing.Size(271, 20); - this._txtListId.TabIndex = 3; + this._txtListId.TabIndex = 4; // // _lbGoogleUserName // this._lbGoogleUserName.AutoSize = true; - this._lbGoogleUserName.Location = new System.Drawing.Point(46, 98); + this._lbGoogleUserName.Location = new System.Drawing.Point(107, 98); this._lbGoogleUserName.Name = "_lbGoogleUserName"; this._lbGoogleUserName.Size = new System.Drawing.Size(64, 13); this._lbGoogleUserName.TabIndex = 0; @@ -133,7 +144,7 @@ private void InitializeComponent() // // _txtGmailEmail // - this._txtGmailEmail.Location = new System.Drawing.Point(116, 95); + this._txtGmailEmail.Location = new System.Drawing.Point(186, 95); this._txtGmailEmail.Name = "_txtGmailEmail"; this._txtGmailEmail.Size = new System.Drawing.Size(271, 20); this._txtGmailEmail.TabIndex = 2; @@ -141,7 +152,7 @@ private void InitializeComponent() // _lbGmailPassword // this._lbGmailPassword.AutoSize = true; - this._lbGmailPassword.Location = new System.Drawing.Point(25, 134); + this._lbGmailPassword.Location = new System.Drawing.Point(86, 134); this._lbGmailPassword.Name = "_lbGmailPassword"; this._lbGmailPassword.Size = new System.Drawing.Size(85, 13); this._lbGmailPassword.TabIndex = 0; @@ -149,31 +160,60 @@ private void InitializeComponent() // // _txtGmailPassword // - this._txtGmailPassword.Location = new System.Drawing.Point(116, 131); + this._txtGmailPassword.Location = new System.Drawing.Point(186, 131); this._txtGmailPassword.Name = "_txtGmailPassword"; this._txtGmailPassword.Size = new System.Drawing.Size(271, 20); - this._txtGmailPassword.TabIndex = 2; + this._txtGmailPassword.TabIndex = 3; // // _chkHeadless // this._chkHeadless.AutoSize = true; this._chkHeadless.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; - this._chkHeadless.Location = new System.Drawing.Point(25, 211); + this._chkHeadless.Location = new System.Drawing.Point(15, 249); this._chkHeadless.Name = "_chkHeadless"; - this._chkHeadless.Size = new System.Drawing.Size(103, 17); + this._chkHeadless.Size = new System.Drawing.Size(174, 17); this._chkHeadless.TabIndex = 6; - this._chkHeadless.Text = "Headless Mode:"; + this._chkHeadless.Text = "Headless Mode (experimental) :"; this._chkHeadless.UseVisualStyleBackColor = true; // + // _lbChromeProfileFolder + // + this._lbChromeProfileFolder.AutoSize = true; + this._lbChromeProfileFolder.Location = new System.Drawing.Point(17, 213); + this._lbChromeProfileFolder.Name = "_lbChromeProfileFolder"; + this._lbChromeProfileFolder.Size = new System.Drawing.Size(152, 13); + this._lbChromeProfileFolder.TabIndex = 0; + this._lbChromeProfileFolder.Text = "Optional Chrome Profile Folder:"; + // + // _txtChromeProfileFolder + // + this._txtChromeProfileFolder.Location = new System.Drawing.Point(186, 210); + this._txtChromeProfileFolder.Name = "_txtChromeProfileFolder"; + this._txtChromeProfileFolder.Size = new System.Drawing.Size(271, 20); + this._txtChromeProfileFolder.TabIndex = 5; + this._ttChromeProfileFolder.SetToolTip(this._txtChromeProfileFolder, "C:/Users/username/AppData/Local/Google/Chrome/User Data/Profile Test/"); + // + // _ttChromeProfileFolder + // + this._ttChromeProfileFolder.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info; + this._ttChromeProfileFolder.ToolTipTitle = "Example"; + // + // notifyIcon1 + // + this.notifyIcon1.Text = "notifyIcon1"; + this.notifyIcon1.Visible = true; + // // SampleCommandSettingsForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(397, 292); + this.ClientSize = new System.Drawing.Size(480, 326); this.Controls.Add(this._chkHeadless); + this.Controls.Add(this._txtChromeProfileFolder); this.Controls.Add(this._txtListId); this.Controls.Add(this._txtGmailPassword); this.Controls.Add(this._txtGmailEmail); + this.Controls.Add(this._lbChromeProfileFolder); this.Controls.Add(this._txtDelay); this.Controls.Add(this._lbListId); this.Controls.Add(this._lbGmailPassword); @@ -202,6 +242,7 @@ private void _btnOk_Click(object sender, EventArgs e) Settings.GoogleUserName = _txtGmailEmail.Text; Settings.GooglePassword = _txtGmailPassword.Text; Settings.Headless = _chkHeadless.Checked; + Settings.ChromeProfileFolder = _txtChromeProfileFolder.Text; Close(); } diff --git a/Karpach.Remote.Keep.Command/KeepCommandSettingsForm.resx b/Karpach.Remote.Keep.Command/KeepCommandSettingsForm.resx index 5283a08..9b19363 100644 --- a/Karpach.Remote.Keep.Command/KeepCommandSettingsForm.resx +++ b/Karpach.Remote.Keep.Command/KeepCommandSettingsForm.resx @@ -117,6 +117,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + + + 194, 17 +