diff --git a/Core/FormBrowser.Designer.cs b/Core/FormBrowser.Designer.cs index aea97f31..fd4dd598 100644 --- a/Core/FormBrowser.Designer.cs +++ b/Core/FormBrowser.Designer.cs @@ -1,5 +1,5 @@ namespace TweetDick.Core { - partial class FormBrowser { + sealed partial class FormBrowser { /// <summary> /// Required designer variable. /// </summary> @@ -34,7 +34,6 @@ private void InitializeComponent() { this.Location = new System.Drawing.Point(32000, 32000); this.Name = "FormBrowser"; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Text = "TweetDick"; this.ResizeEnd += new System.EventHandler(this.FormBrowser_ResizeEnd); this.ResumeLayout(false); diff --git a/Core/FormBrowser.cs b/Core/FormBrowser.cs index 8fc526e9..418e1907 100644 --- a/Core/FormBrowser.cs +++ b/Core/FormBrowser.cs @@ -10,7 +10,7 @@ using TweetDick.Resources; namespace TweetDick.Core{ - partial class FormBrowser : Form{ + sealed partial class FormBrowser : Form{ private static UserConfig Config{ get{ return Program.UserConfig; @@ -27,6 +27,8 @@ private static UserConfig Config{ public FormBrowser(){ InitializeComponent(); + Text = Program.BrandName; + bridge = new TweetDeckBridge(this); browser = new ChromiumWebBrowser("https://tweetdeck.twitter.com/"){ MenuHandler = new ContextMenuHandler(this) }; diff --git a/Core/FormNotification.Designer.cs b/Core/FormNotification.Designer.cs index 7febc2e4..a8f7c814 100644 --- a/Core/FormNotification.Designer.cs +++ b/Core/FormNotification.Designer.cs @@ -1,5 +1,5 @@ namespace TweetDick.Core { - partial class FormNotification { + sealed partial class FormNotification { /// <summary> /// Required designer variable. /// </summary> @@ -69,7 +69,6 @@ private void InitializeComponent() { this.Name = "FormNotification"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Text = "TweetDick"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormNotification_FormClosing); this.ResumeLayout(false); diff --git a/Core/FormNotification.cs b/Core/FormNotification.cs index 10c49a92..3968b00e 100644 --- a/Core/FormNotification.cs +++ b/Core/FormNotification.cs @@ -9,7 +9,7 @@ using TweetDick.Resources; namespace TweetDick.Core{ - partial class FormNotification : Form{ + sealed partial class FormNotification : Form{ private readonly Form owner; private readonly ChromiumWebBrowser browser; @@ -22,6 +22,8 @@ partial class FormNotification : Form{ public FormNotification(Form owner, TweetDeckBridge bridge, bool autoHide){ InitializeComponent(); + Text = Program.BrandName; + this.owner = owner; this.autoHide = autoHide; diff --git a/Core/Handling/ContextMenuHandler.cs b/Core/Handling/ContextMenuHandler.cs index 5791b461..f704eb52 100644 --- a/Core/Handling/ContextMenuHandler.cs +++ b/Core/Handling/ContextMenuHandler.cs @@ -29,7 +29,7 @@ public void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IF model.AddSeparator(); } - model.AddItem((CefMenuCommand)MenuAbout,"About TweetDick"); + model.AddItem((CefMenuCommand)MenuAbout,"About "+Program.BrandName); } public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags){ diff --git a/Core/Handling/TweetDeckBridge.cs b/Core/Handling/TweetDeckBridge.cs index 87a17d6b..b82e76ae 100644 --- a/Core/Handling/TweetDeckBridge.cs +++ b/Core/Handling/TweetDeckBridge.cs @@ -4,6 +4,12 @@ namespace TweetDick.Core.Handling{ class TweetDeckBridge{ private readonly FormBrowser form; + public string BrandName{ + get{ + return Program.BrandName; + } + } + public TweetDeckBridge(FormBrowser form){ this.form = form; } diff --git a/Core/Other/FormAbout.Designer.cs b/Core/Other/FormAbout.Designer.cs index 3bd1c16c..80058df4 100644 --- a/Core/Other/FormAbout.Designer.cs +++ b/Core/Other/FormAbout.Designer.cs @@ -1,5 +1,5 @@ namespace TweetDick.Core.Other { - partial class FormAbout { + sealed partial class FormAbout { /// <summary> /// Required designer variable. /// </summary> @@ -54,7 +54,6 @@ private void InitializeComponent() { this.MinimizeBox = false; this.Name = "FormAbout"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "About TweetDick"; this.ResumeLayout(false); } diff --git a/Core/Other/FormAbout.cs b/Core/Other/FormAbout.cs index ba3f0253..8b166dc1 100644 --- a/Core/Other/FormAbout.cs +++ b/Core/Other/FormAbout.cs @@ -3,13 +3,15 @@ using TweetDick.Core.Controls; namespace TweetDick.Core.Other{ - public partial class FormAbout : Form{ + sealed partial class FormAbout : Form{ public FormAbout(){ InitializeComponent(); + Text = "About "+Program.BrandName; + StringBuilder build = new StringBuilder(); - build.Append(@"\fs22TweetDick was created by chylex as a replacement to the discontinued TweetDeck client for Windows, and is released under the MIT license.\par "); - build.Append(@"Official Website: ").Append(RichTextLabel.AddLink("http://tweetdick.chylex.com")).Append(@"\line "); + build.Append(@"\fs22").Append(Program.BrandName).Append(@" was created by chylex as a replacement to the discontinued TweetDeck client for Windows, and is released under the MIT license.\par "); + build.Append(@"Official Website: ").Append(RichTextLabel.AddLink(Program.Website)).Append(@"\line "); build.Append(@"Source Code: ").Append(RichTextLabel.AddLink("https://github.com/chylex/TweetDick")); labelAbout.Rtf = RichTextLabel.Wrap(build.ToString()); diff --git a/Core/Other/FormSettings.Designer.cs b/Core/Other/FormSettings.Designer.cs index 4ddfd9c4..d02d09dc 100644 --- a/Core/Other/FormSettings.Designer.cs +++ b/Core/Other/FormSettings.Designer.cs @@ -1,5 +1,5 @@ namespace TweetDick.Core.Other { - partial class FormSettings { + sealed partial class FormSettings { /// <summary> /// Required designer variable. /// </summary> @@ -277,7 +277,6 @@ private void InitializeComponent() { this.MinimizeBox = false; this.Name = "FormSettings"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "TweetDick Settings"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormSettings_FormClosing); this.groupNotificationLocation.ResumeLayout(false); this.groupNotificationLocation.PerformLayout(); diff --git a/Core/Other/FormSettings.cs b/Core/Other/FormSettings.cs index d8f82f3a..ff0cd3d4 100644 --- a/Core/Other/FormSettings.cs +++ b/Core/Other/FormSettings.cs @@ -4,7 +4,7 @@ using TweetDick.Core.Handling; namespace TweetDick.Core.Other{ - partial class FormSettings : Form{ + sealed partial class FormSettings : Form{ private static UserConfig Config{ get{ return Program.UserConfig; @@ -18,6 +18,8 @@ public FormSettings(FormBrowser browserForm){ InitializeComponent(); Shown += (sender, args) => isLoaded = true; + Text = Program.BrandName+" Settings"; + notification = new FormNotification(browserForm,false); notification.Show(this); @@ -42,7 +44,7 @@ public FormSettings(FormBrowser browserForm){ case TweetNotification.Duration.VeryLong: radioDurVeryLong.Checked = true; break; } - comboBoxDisplay.Items.Add("(Same As TweetDick)"); + comboBoxDisplay.Items.Add("(Same As "+Program.BrandName+")"); foreach(Screen screen in Screen.AllScreens){ comboBoxDisplay.Items.Add(screen.DeviceName+" ("+screen.Bounds.Width+"x"+screen.Bounds.Height+")"); diff --git a/Migration/MigrationManager.cs b/Migration/MigrationManager.cs index 95695a72..c6204cf6 100644 --- a/Migration/MigrationManager.cs +++ b/Migration/MigrationManager.cs @@ -112,10 +112,10 @@ private static bool BeginMigration(MigrationDecision decision, Action<Exception> LnkEditor lnk = new LnkEditor(linkFile); lnk.SetPath(Application.ExecutablePath); lnk.SetWorkingDirectory(Environment.CurrentDirectory); - lnk.SetComment("TweetDick"); // TODO add a tagline + lnk.SetComment(Program.BrandName); // TODO add a tagline lnk.Save(); - File.Move(linkFile,Path.Combine(location,"TweetDick.lnk")); + File.Move(linkFile,Path.Combine(location,Program.BrandName+".lnk")); } } diff --git a/Program.cs b/Program.cs index e5aa832f..a031a583 100644 --- a/Program.cs +++ b/Program.cs @@ -10,7 +10,15 @@ namespace TweetDick{ static class Program{ - public static readonly string StoragePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),"TweetDick"); + #if DUCK + public const string BrandName = "TweetDuck"; + public const string Website = "http://tweetduck.chylex.com"; + #else + public const string BrandName = "TweetDick"; + public const string Website = "http://tweetdick.chylex.com"; + #endif + + public static readonly string StoragePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),BrandName); public static readonly UserConfig UserConfig; private static string HeaderAcceptLanguage{ @@ -52,7 +60,7 @@ private static void Main(){ Cef.Initialize(new CefSettings{ AcceptLanguageList = HeaderAcceptLanguage, - UserAgent = "TweetDick "+Application.ProductVersion, + UserAgent = BrandName+" "+Application.ProductVersion, Locale = CultureInfo.CurrentCulture.TwoLetterISOLanguageName, CachePath = StoragePath, #if !DEBUG diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 32b4c3da..4bf23f53 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -1,14 +1,15 @@ using System.Reflection; using System.Runtime.InteropServices; +using TweetDick; // 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("TweetDick")] +[assembly: AssemblyTitle(Program.BrandName)] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TweetDick")] +[assembly: AssemblyProduct(Program.BrandName)] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/Resources/ScriptLoader.cs b/Resources/ScriptLoader.cs index d8e912c8..c9deb3c0 100644 --- a/Resources/ScriptLoader.cs +++ b/Resources/ScriptLoader.cs @@ -9,7 +9,7 @@ public static string LoadResource(string name){ try{ return File.ReadAllText(name,Encoding.UTF8); }catch(Exception ex){ - MessageBox.Show("Unfortunately, TweetDick could not load the "+name+" file. The program will continue running with limited functionality.\r\n\r\n"+ex.Message,"TweetDick Has Failed :(",MessageBoxButtons.OK,MessageBoxIcon.Error); + MessageBox.Show("Unfortunately, "+Program.BrandName+" could not load the "+name+" file. The program will continue running with limited functionality.\r\n\r\n"+ex.Message,"TweetDick Has Failed :(",MessageBoxButtons.OK,MessageBoxIcon.Error); return null; } } diff --git a/Resources/code.js b/Resources/code.js index 231d8fe0..20dae5a9 100644 --- a/Resources/code.js +++ b/Resources/code.js @@ -24,7 +24,7 @@ var menu = $(".js-dropdown-content").children("ul").first(); if (menu.length == 0)return; - menu.children(".drp-h-divider").last().after('<li class="is-selectable" data-tweetdick><a href="#" data-action>TweetDick</a></li><li class="drp-h-divider"></li>'); + menu.children(".drp-h-divider").last().after('<li class="is-selectable" data-std><a href="#" data-action>'+$TD.brandName+'</a></li><li class="drp-h-divider"></li>'); var tweetDickBtn = menu.children("[data-std]").first(); diff --git a/TweetDick.csproj b/TweetDick.csproj index bfebfb20..467d23d1 100644 --- a/TweetDick.csproj +++ b/TweetDick.csproj @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="packages\CefSharp.WinForms.49.0.0-pre02\build\CefSharp.WinForms.props" Condition="Exists('packages\CefSharp.WinForms.49.0.0-pre02\build\CefSharp.WinForms.props')" /> <Import Project="packages\CefSharp.Common.49.0.0-pre02\build\CefSharp.Common.props" Condition="Exists('packages\CefSharp.Common.49.0.0-pre02\build\CefSharp.Common.props')" /> @@ -31,25 +31,6 @@ <UseApplicationTrust>false</UseApplicationTrust> <BootstrapperEnabled>true</BootstrapperEnabled> </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <PlatformTarget>AnyCPU</PlatformTarget> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <PlatformTarget>AnyCPU</PlatformTarget> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> <DebugSymbols>true</DebugSymbols> <OutputPath>bin\x86\Debug\</OutputPath> @@ -59,8 +40,8 @@ <ErrorReport>prompt</ErrorReport> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> - <OutputPath>bin\x86\Release\</OutputPath> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release Dick|x86' "> + <OutputPath>bin\x86\Release Dick\</OutputPath> <DefineConstants> </DefineConstants> <Optimize>true</Optimize> @@ -74,6 +55,16 @@ <PropertyGroup> <ApplicationIcon>Resources\icon.ico</ApplicationIcon> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release Duck|x86' "> + <OutputPath>bin\x86\Release Duck\</OutputPath> + <Optimize>true</Optimize> + <PlatformTarget>x86</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> + <ErrorReport>prompt</ErrorReport> + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> + <DefineConstants>DUCK</DefineConstants> + </PropertyGroup> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Core" /> diff --git a/TweetDick.sln b/TweetDick.sln index 7cb20102..64e4a7ea 100644 --- a/TweetDick.sln +++ b/TweetDick.sln @@ -7,21 +7,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetDick", "TweetDick.cspr EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x86 = Release|x86 + Release Dick|x86 = Release Dick|x86 + Release Duck|x86 = Release Duck|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2389A7CD-E0D3-4706-8294-092929A33A2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2389A7CD-E0D3-4706-8294-092929A33A2D}.Debug|Any CPU.Build.0 = Debug|Any CPU {2389A7CD-E0D3-4706-8294-092929A33A2D}.Debug|x86.ActiveCfg = Debug|x86 {2389A7CD-E0D3-4706-8294-092929A33A2D}.Debug|x86.Build.0 = Debug|x86 {2389A7CD-E0D3-4706-8294-092929A33A2D}.Debug|x86.Deploy.0 = Debug|x86 - {2389A7CD-E0D3-4706-8294-092929A33A2D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2389A7CD-E0D3-4706-8294-092929A33A2D}.Release|Any CPU.Build.0 = Release|Any CPU - {2389A7CD-E0D3-4706-8294-092929A33A2D}.Release|x86.ActiveCfg = Release|x86 - {2389A7CD-E0D3-4706-8294-092929A33A2D}.Release|x86.Build.0 = Release|x86 + {2389A7CD-E0D3-4706-8294-092929A33A2D}.Release Dick|x86.ActiveCfg = Release Duck|x86 + {2389A7CD-E0D3-4706-8294-092929A33A2D}.Release Dick|x86.Build.0 = Release Duck|x86 + {2389A7CD-E0D3-4706-8294-092929A33A2D}.Release Duck|x86.ActiveCfg = Release Duck|x86 + {2389A7CD-E0D3-4706-8294-092929A33A2D}.Release Duck|x86.Build.0 = Release Duck|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE