1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-25 09:15:50 +02:00

Redo build configurations and add a TweetDuck variant

This commit is contained in:
chylex 2016-04-12 01:50:21 +02:00
parent fd73c2a7a5
commit 3115ccc896
17 changed files with 62 additions and 55 deletions

View File

@ -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);

View File

@ -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) };

View File

@ -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);

View File

@ -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;

View File

@ -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){

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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());

View File

@ -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();

View File

@ -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+")");

View File

@ -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"));
}
}

View File

@ -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

View File

@ -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("")]

View File

@ -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;
}
}

View File

@ -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();

View File

@ -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" />

View File

@ -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