mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-09-14 10:32:10 +02:00
Compare commits
56 Commits
Author | SHA1 | Date | |
---|---|---|---|
28cc60d007 | |||
1fa69bdb3b | |||
11f5f9b72e | |||
61f6543041 | |||
0c9ab32f37 | |||
fde984d02b | |||
f23db31306 | |||
8dce99b8b3 | |||
342ac51cda | |||
ba31f7ae01 | |||
8d0fa030f8 | |||
d030a79c81 | |||
6690efc4d9 | |||
afa8098463 | |||
c064e579d2 | |||
01dc4e4714 | |||
6fbc246b12 | |||
1efe2a02f7 | |||
ab2ab06f60 | |||
a71d889682 | |||
2252d85b27 | |||
3f09100177 | |||
6b79c89f42 | |||
5f249d4603 | |||
fa64309909 | |||
c46aafdab6 | |||
3e9c397494 | |||
47935165db | |||
be77f753e7 | |||
2c30613279 | |||
d83eaec987 | |||
e6f199a224 | |||
6636a2aa9e | |||
221bdc58fe | |||
e48a068e9d | |||
3371c31e63 | |||
aa2c60f7e9 | |||
f7dc200684 | |||
ad306c56c7 | |||
86aba1eb52 | |||
826f1aba7a | |||
8abf4364c6 | |||
4c45d91d4e | |||
3176b6cb8f | |||
27971e09cd | |||
bf95ae00de | |||
0dbfa7e101 | |||
85d09c4b5e | |||
4f9bc40476 | |||
757ccbf9d3 | |||
4cf9730130 | |||
1dd0d70ab9 | |||
340eaece0f | |||
c151e7cd37 | |||
ca0baae832 | |||
478e6ed8df |
@@ -90,7 +90,7 @@ namespace TweetDck.Configuration{
|
|||||||
try{
|
try{
|
||||||
File.Delete(file);
|
File.Delete(file);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
Program.Log(e.ToString());
|
Program.Reporter.Log(e.ToString());
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -35,6 +35,7 @@ namespace TweetDck.Configuration{
|
|||||||
public int NotificationDurationValue { get; set; }
|
public int NotificationDurationValue { get; set; }
|
||||||
public bool NotificationLegacyLoad { get; set; }
|
public bool NotificationLegacyLoad { get; set; }
|
||||||
|
|
||||||
|
public bool EnableSpellCheck { get; set; }
|
||||||
public bool ExpandLinksOnHover { get; set; }
|
public bool ExpandLinksOnHover { get; set; }
|
||||||
public bool EnableTrayHighlight { get; set; }
|
public bool EnableTrayHighlight { get; set; }
|
||||||
|
|
||||||
@@ -188,13 +189,14 @@ namespace TweetDck.Configuration{
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
Program.HandleException("Could not save the configuration file.", e);
|
Program.Reporter.HandleException("Configuration Error", "Could not save the configuration file.", true, e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UserConfig Load(string file){
|
public static UserConfig Load(string file){
|
||||||
UserConfig config = null;
|
UserConfig config = null;
|
||||||
|
Exception firstException = null;
|
||||||
|
|
||||||
for(int attempt = 0; attempt < 2; attempt++){
|
for(int attempt = 0; attempt < 2; attempt++){
|
||||||
try{
|
try{
|
||||||
@@ -210,9 +212,21 @@ namespace TweetDck.Configuration{
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}catch(FileNotFoundException){
|
}catch(FileNotFoundException){
|
||||||
|
}catch(DirectoryNotFoundException){
|
||||||
|
break;
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
Program.HandleException("Could not open the configuration file.", e);
|
if (attempt == 0){
|
||||||
|
firstException = e;
|
||||||
|
Program.Reporter.Log(e.ToString());
|
||||||
}
|
}
|
||||||
|
else if (firstException != null){
|
||||||
|
Program.Reporter.HandleException("Configuration Error", "Could not open the backup configuration file. If you continue, you may lose your settings and list of enabled plugins.", true, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (firstException != null && config == null){
|
||||||
|
Program.Reporter.HandleException("Configuration Error", "Could not open the configuration file.", true, firstException);
|
||||||
}
|
}
|
||||||
|
|
||||||
return config ?? new UserConfig(file);
|
return config ?? new UserConfig(file);
|
||||||
@@ -224,12 +238,7 @@ namespace TweetDck.Configuration{
|
|||||||
|
|
||||||
private class SerializationCompatibilityHandler : SerializationBinder{
|
private class SerializationCompatibilityHandler : SerializationBinder{
|
||||||
public override Type BindToType(string assemblyName, string typeName){
|
public override Type BindToType(string assemblyName, string typeName){
|
||||||
#if DUCK
|
|
||||||
assemblyName = assemblyName.Replace("TweetDick", "TweetDuck");
|
assemblyName = assemblyName.Replace("TweetDick", "TweetDuck");
|
||||||
#else
|
|
||||||
assemblyName = assemblyName.Replace("TweetDuck", "TweetDick");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typeName = typeName.Replace("TweetDick", "TweetDck");
|
typeName = typeName.Replace("TweetDick", "TweetDck");
|
||||||
return Type.GetType(string.Format(CultureInfo.CurrentCulture, "{0}, {1}", typeName, assemblyName));
|
return Type.GetType(string.Format(CultureInfo.CurrentCulture, "{0}, {1}", typeName, assemblyName));
|
||||||
}
|
}
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/></startup></configuration>
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<packages xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<package id="cef.redist.x64" version="3.2623.1396" targetFramework="net40-Client" />
|
<package id="cef.redist.x64" version="3.2785.1478" targetFramework="net452" />
|
||||||
<package id="cef.redist.x86" version="3.2623.1396" targetFramework="net40-Client" />
|
<package id="cef.redist.x86" version="3.2785.1478" targetFramework="net452" />
|
||||||
<package id="CefSharp.Common" version="49.0.0-pre02" targetFramework="net40-Client" />
|
<package id="CefSharp.Common" version="53.0.0-pre01" targetFramework="net452" />
|
||||||
<package id="CefSharp.WinForms" version="49.0.0-pre02" targetFramework="net40-Client" />
|
<package id="CefSharp.WinForms" version="53.0.0-pre01" targetFramework="net452" />
|
||||||
<package id="Microsoft.VC120.CRT.JetBrains" version="12.0.21005.2" targetFramework="net40-Client" />
|
<package id="Microsoft.VC120.CRT.JetBrains" version="12.0.21005.2" targetFramework="net452" />
|
||||||
</packages>
|
</packages>
|
@@ -34,5 +34,15 @@ namespace TweetDck.Core.Controls{
|
|||||||
trackBar.Value = value;
|
trackBar.Value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void EnableMultilineShortcuts(this TextBox textBox){
|
||||||
|
textBox.KeyDown += (sender, args) => {
|
||||||
|
if (args.Control && args.KeyCode == Keys.A){
|
||||||
|
((TextBox)sender).SelectAll();
|
||||||
|
args.SuppressKeyPress = true;
|
||||||
|
args.Handled = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -101,6 +101,12 @@ namespace TweetDck.Core{
|
|||||||
|
|
||||||
private void Browser_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e){
|
private void Browser_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e){
|
||||||
if (!e.IsLoading){
|
if (!e.IsLoading){
|
||||||
|
browser.AddWordToDictionary("tweetdeck");
|
||||||
|
browser.AddWordToDictionary("TweetDeck");
|
||||||
|
browser.AddWordToDictionary("tweetduck");
|
||||||
|
browser.AddWordToDictionary("TweetDuck");
|
||||||
|
browser.AddWordToDictionary("TD");
|
||||||
|
|
||||||
Invoke(new Action(SetupWindow));
|
Invoke(new Action(SetupWindow));
|
||||||
browser.LoadingStateChanged -= Browser_LoadingStateChanged;
|
browser.LoadingStateChanged -= Browser_LoadingStateChanged;
|
||||||
}
|
}
|
||||||
|
16
Core/Handling/BrowserProcessHandler.cs
Normal file
16
Core/Handling/BrowserProcessHandler.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using CefSharp;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace TweetDck.Core.Handling{
|
||||||
|
class BrowserProcessHandler : IBrowserProcessHandler{
|
||||||
|
void IBrowserProcessHandler.OnContextInitialized(){
|
||||||
|
using(IRequestContext ctx = Cef.GetGlobalRequestContext()){
|
||||||
|
string err;
|
||||||
|
ctx.SetPreference("browser.enable_spellchecking", Program.UserConfig.EnableSpellCheck, out err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void IBrowserProcessHandler.OnScheduleMessagePumpWork(long delay){}
|
||||||
|
void IDisposable.Dispose(){}
|
||||||
|
}
|
||||||
|
}
|
@@ -119,6 +119,10 @@ namespace TweetDck.Core.Handling{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void LoadNextNotification(){
|
||||||
|
notification.InvokeSafe(notification.FinishCurrentTweet);
|
||||||
|
}
|
||||||
|
|
||||||
public void TryPasteImage(){
|
public void TryPasteImage(){
|
||||||
form.InvokeSafe(() => {
|
form.InvokeSafe(() => {
|
||||||
if (Clipboard.ContainsImage()){
|
if (Clipboard.ContainsImage()){
|
||||||
@@ -133,7 +137,7 @@ namespace TweetDck.Core.Handling{
|
|||||||
|
|
||||||
form.OnImagePasted();
|
form.OnImagePasted();
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
Program.HandleException("Could not paste image from clipboard.", e);
|
Program.Reporter.HandleException("Clipboard Image Error", "Could not paste image from clipboard.", true, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -20,7 +20,7 @@ namespace TweetDck.Core.Handling{
|
|||||||
|
|
||||||
private static string CustomCSS{
|
private static string CustomCSS{
|
||||||
get{
|
get{
|
||||||
return @".scroll-styled-v::-webkit-scrollbar{width:8px}.scroll-styled-v::-webkit-scrollbar-thumb{border-radius:0}a[data-full-url]{word-break:break-all}";
|
return @".scroll-styled-v::-webkit-scrollbar{width:8px}.scroll-styled-v::-webkit-scrollbar-thumb{border-radius:0}a[data-full-url]{word-break:break-all}#td-skip{opacity:0;cursor:pointer;transition:opacity 0.15s ease}.td-hover #td-skip{opacity:0.75}#td-skip:hover{opacity:1}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ namespace TweetDck.Core.Handling{
|
|||||||
|
|
||||||
build.Append(@"</div></div></article>");
|
build.Append(@"</div></div></article>");
|
||||||
|
|
||||||
return new TweetNotification(build.ToString(), "", 95);
|
return new TweetNotification(build.ToString(), "", 95, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,11 +84,15 @@ namespace TweetDck.Core.Handling{
|
|||||||
private readonly string html;
|
private readonly string html;
|
||||||
private readonly string url;
|
private readonly string url;
|
||||||
private readonly int characters;
|
private readonly int characters;
|
||||||
|
private readonly bool isExample;
|
||||||
|
|
||||||
public TweetNotification(string html, string url, int characters){
|
public TweetNotification(string html, string url, int characters) : this(html, url, characters, false){}
|
||||||
|
|
||||||
|
private TweetNotification(string html, string url, int characters, bool isExample){
|
||||||
this.html = html;
|
this.html = html;
|
||||||
this.url = url;
|
this.url = url;
|
||||||
this.characters = characters;
|
this.characters = characters;
|
||||||
|
this.isExample = isExample;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetDisplayDuration(int value){
|
public int GetDisplayDuration(int value){
|
||||||
@@ -106,7 +110,7 @@ namespace TweetDck.Core.Handling{
|
|||||||
}
|
}
|
||||||
|
|
||||||
build.Append("</head>");
|
build.Append("</head>");
|
||||||
build.Append("<body class='hearty'><div class='app-columns-container'><div class='column scroll-styled-v' style='width:100%;overflow-y:auto'>");
|
build.Append("<body class='hearty'").Append(isExample ? " td-example-notification" : "").Append("><div class='app-columns-container'><div class='column scroll-styled-v' style='width:100%;overflow-y:auto'>");
|
||||||
build.Append(html);
|
build.Append(html);
|
||||||
build.Append("</div></div></body>");
|
build.Append("</div></div></body>");
|
||||||
build.Append("</html>");
|
build.Append("</html>");
|
||||||
|
30
Core/Other/FormAbout.Designer.cs
generated
30
Core/Other/FormAbout.Designer.cs
generated
@@ -28,7 +28,7 @@ namespace TweetDck.Core.Other {
|
|||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAbout));
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAbout));
|
||||||
this.pictureLogo = new System.Windows.Forms.PictureBox();
|
this.pictureLogo = new System.Windows.Forms.PictureBox();
|
||||||
this.labelDescription = new System.Windows.Forms.Label();
|
this.labelDescription = new System.Windows.Forms.Label();
|
||||||
this.labelSourceCode = new System.Windows.Forms.LinkLabel();
|
this.labelTips = new System.Windows.Forms.LinkLabel();
|
||||||
this.labelWebsite = new System.Windows.Forms.LinkLabel();
|
this.labelWebsite = new System.Windows.Forms.LinkLabel();
|
||||||
this.tablePanelLinks = new System.Windows.Forms.TableLayoutPanel();
|
this.tablePanelLinks = new System.Windows.Forms.TableLayoutPanel();
|
||||||
this.labelIssues = new System.Windows.Forms.LinkLabel();
|
this.labelIssues = new System.Windows.Forms.LinkLabel();
|
||||||
@@ -59,19 +59,19 @@ namespace TweetDck.Core.Other {
|
|||||||
this.labelDescription.Size = new System.Drawing.Size(232, 109);
|
this.labelDescription.Size = new System.Drawing.Size(232, 109);
|
||||||
this.labelDescription.TabIndex = 1;
|
this.labelDescription.TabIndex = 1;
|
||||||
//
|
//
|
||||||
// labelSourceCode
|
// labelTips
|
||||||
//
|
//
|
||||||
this.labelSourceCode.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.labelTips.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.labelSourceCode.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
this.labelTips.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||||
this.labelSourceCode.LinkArea = new System.Windows.Forms.LinkArea(0, 0);
|
this.labelTips.LinkArea = new System.Windows.Forms.LinkArea(0, 0);
|
||||||
this.labelSourceCode.Location = new System.Drawing.Point(117, 0);
|
this.labelTips.Location = new System.Drawing.Point(117, 0);
|
||||||
this.labelSourceCode.Margin = new System.Windows.Forms.Padding(0);
|
this.labelTips.Margin = new System.Windows.Forms.Padding(0);
|
||||||
this.labelSourceCode.Name = "labelSourceCode";
|
this.labelTips.Name = "labelTips";
|
||||||
this.labelSourceCode.Size = new System.Drawing.Size(99, 16);
|
this.labelTips.Size = new System.Drawing.Size(99, 16);
|
||||||
this.labelSourceCode.TabIndex = 3;
|
this.labelTips.TabIndex = 3;
|
||||||
this.labelSourceCode.Text = "Source Code";
|
this.labelTips.Text = "Tips && Tricks";
|
||||||
this.labelSourceCode.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
this.labelTips.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||||
this.labelSourceCode.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnLinkClicked);
|
this.labelTips.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnLinkClicked);
|
||||||
//
|
//
|
||||||
// labelWebsite
|
// labelWebsite
|
||||||
//
|
//
|
||||||
@@ -98,7 +98,7 @@ namespace TweetDck.Core.Other {
|
|||||||
this.tablePanelLinks.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35.14F));
|
this.tablePanelLinks.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35.14F));
|
||||||
this.tablePanelLinks.Controls.Add(this.labelIssues, 2, 0);
|
this.tablePanelLinks.Controls.Add(this.labelIssues, 2, 0);
|
||||||
this.tablePanelLinks.Controls.Add(this.labelWebsite, 0, 0);
|
this.tablePanelLinks.Controls.Add(this.labelWebsite, 0, 0);
|
||||||
this.tablePanelLinks.Controls.Add(this.labelSourceCode, 1, 0);
|
this.tablePanelLinks.Controls.Add(this.labelTips, 1, 0);
|
||||||
this.tablePanelLinks.Location = new System.Drawing.Point(12, 124);
|
this.tablePanelLinks.Location = new System.Drawing.Point(12, 124);
|
||||||
this.tablePanelLinks.Name = "tablePanelLinks";
|
this.tablePanelLinks.Name = "tablePanelLinks";
|
||||||
this.tablePanelLinks.RowCount = 1;
|
this.tablePanelLinks.RowCount = 1;
|
||||||
@@ -146,7 +146,7 @@ namespace TweetDck.Core.Other {
|
|||||||
|
|
||||||
private System.Windows.Forms.PictureBox pictureLogo;
|
private System.Windows.Forms.PictureBox pictureLogo;
|
||||||
private System.Windows.Forms.Label labelDescription;
|
private System.Windows.Forms.Label labelDescription;
|
||||||
private System.Windows.Forms.LinkLabel labelSourceCode;
|
private System.Windows.Forms.LinkLabel labelTips;
|
||||||
private System.Windows.Forms.LinkLabel labelWebsite;
|
private System.Windows.Forms.LinkLabel labelWebsite;
|
||||||
private System.Windows.Forms.TableLayoutPanel tablePanelLinks;
|
private System.Windows.Forms.TableLayoutPanel tablePanelLinks;
|
||||||
private System.Windows.Forms.LinkLabel labelIssues;
|
private System.Windows.Forms.LinkLabel labelIssues;
|
||||||
|
@@ -3,7 +3,7 @@ using TweetDck.Core.Utils;
|
|||||||
|
|
||||||
namespace TweetDck.Core.Other{
|
namespace TweetDck.Core.Other{
|
||||||
sealed partial class FormAbout : Form{
|
sealed partial class FormAbout : Form{
|
||||||
private const string GitHubLink = "https://github.com/chylex/TweetDuck";
|
private const string TipsLink = "https://github.com/chylex/TweetDuck/wiki";
|
||||||
private const string IssuesLink = "https://github.com/chylex/TweetDuck/issues";
|
private const string IssuesLink = "https://github.com/chylex/TweetDuck/issues";
|
||||||
|
|
||||||
public FormAbout(){
|
public FormAbout(){
|
||||||
@@ -14,7 +14,7 @@ namespace TweetDck.Core.Other{
|
|||||||
labelDescription.Text = Program.BrandName+" was created by chylex as a replacement to the discontinued official TweetDeck client for Windows.\n\nThe program is available for free under the open source MIT license.";
|
labelDescription.Text = Program.BrandName+" was created by chylex as a replacement to the discontinued official TweetDeck client for Windows.\n\nThe program is available for free under the open source MIT license.";
|
||||||
|
|
||||||
labelWebsite.Links.Add(new LinkLabel.Link(0, labelWebsite.Text.Length, Program.Website));
|
labelWebsite.Links.Add(new LinkLabel.Link(0, labelWebsite.Text.Length, Program.Website));
|
||||||
labelSourceCode.Links.Add(new LinkLabel.Link(0, labelSourceCode.Text.Length, GitHubLink));
|
labelTips.Links.Add(new LinkLabel.Link(0, labelTips.Text.Length, TipsLink));
|
||||||
labelIssues.Links.Add(new LinkLabel.Link(0, labelIssues.Text.Length, IssuesLink));
|
labelIssues.Links.Add(new LinkLabel.Link(0, labelIssues.Text.Length, IssuesLink));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
79
Core/Other/FormMessage.Designer.cs
generated
Normal file
79
Core/Other/FormMessage.Designer.cs
generated
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
namespace TweetDck.Core.Other {
|
||||||
|
partial class FormMessage {
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing) {
|
||||||
|
if (disposing && (components != null)) {
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent() {
|
||||||
|
this.panelActions = new System.Windows.Forms.Panel();
|
||||||
|
this.labelMessage = new System.Windows.Forms.Label();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// panelActions
|
||||||
|
//
|
||||||
|
this.panelActions.BackColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.panelActions.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||||
|
this.panelActions.Location = new System.Drawing.Point(0, 84);
|
||||||
|
this.panelActions.Name = "panelActions";
|
||||||
|
this.panelActions.Size = new System.Drawing.Size(233, 49);
|
||||||
|
this.panelActions.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// labelMessage
|
||||||
|
//
|
||||||
|
this.labelMessage.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.labelMessage.AutoSize = true;
|
||||||
|
this.labelMessage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||||
|
this.labelMessage.Location = new System.Drawing.Point(62, 33);
|
||||||
|
this.labelMessage.Margin = new System.Windows.Forms.Padding(53, 24, 27, 24);
|
||||||
|
this.labelMessage.MaximumSize = new System.Drawing.Size(600, 0);
|
||||||
|
this.labelMessage.MinimumSize = new System.Drawing.Size(0, 24);
|
||||||
|
this.labelMessage.Name = "labelMessage";
|
||||||
|
this.labelMessage.Size = new System.Drawing.Size(0, 24);
|
||||||
|
this.labelMessage.TabIndex = 1;
|
||||||
|
this.labelMessage.SizeChanged += new System.EventHandler(this.labelMessage_SizeChanged);
|
||||||
|
//
|
||||||
|
// FormMessage
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.BackColor = System.Drawing.Color.White;
|
||||||
|
this.ClientSize = new System.Drawing.Size(98, 133);
|
||||||
|
this.Controls.Add(this.labelMessage);
|
||||||
|
this.Controls.Add(this.panelActions);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "FormMessage";
|
||||||
|
this.ShowIcon = false;
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Panel panelActions;
|
||||||
|
private System.Windows.Forms.Label labelMessage;
|
||||||
|
}
|
||||||
|
}
|
118
Core/Other/FormMessage.cs
Normal file
118
Core/Other/FormMessage.cs
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace TweetDck.Core.Other{
|
||||||
|
sealed partial class FormMessage : Form{
|
||||||
|
public Button ClickedButton { get; private set; }
|
||||||
|
|
||||||
|
private readonly Icon icon;
|
||||||
|
private readonly bool isReady;
|
||||||
|
|
||||||
|
private int realFormWidth, minFormWidth;
|
||||||
|
private int buttonCount;
|
||||||
|
private int prevLabelWidth, prevLabelHeight;
|
||||||
|
private bool wasLabelMultiline;
|
||||||
|
|
||||||
|
public FormMessage(string caption, string text, MessageBoxIcon messageIcon){
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
this.prevLabelWidth = labelMessage.Width;
|
||||||
|
this.prevLabelHeight = labelMessage.Height;
|
||||||
|
this.minFormWidth = 18;
|
||||||
|
|
||||||
|
switch(messageIcon){
|
||||||
|
case MessageBoxIcon.Information:
|
||||||
|
icon = SystemIcons.Information;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MessageBoxIcon.Warning:
|
||||||
|
icon = SystemIcons.Warning;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MessageBoxIcon.Error:
|
||||||
|
icon = SystemIcons.Error;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MessageBoxIcon.Question:
|
||||||
|
icon = SystemIcons.Question;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
icon = null;
|
||||||
|
labelMessage.Location = new Point(labelMessage.Location.X-32, labelMessage.Location.Y);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isReady = true;
|
||||||
|
|
||||||
|
this.Text = caption;
|
||||||
|
this.labelMessage.Text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Button AddButton(string title){
|
||||||
|
Button button = new Button{
|
||||||
|
Anchor = AnchorStyles.Bottom | AnchorStyles.Right,
|
||||||
|
Location = new Point(Width-112-buttonCount*96, 12),
|
||||||
|
Size = new Size(88, 26),
|
||||||
|
TabIndex = buttonCount,
|
||||||
|
Text = title,
|
||||||
|
UseVisualStyleBackColor = true
|
||||||
|
};
|
||||||
|
|
||||||
|
button.Click += (sender, args) => {
|
||||||
|
ClickedButton = (Button)sender;
|
||||||
|
DialogResult = DialogResult.OK;
|
||||||
|
Close();
|
||||||
|
};
|
||||||
|
|
||||||
|
panelActions.Controls.Add(button);
|
||||||
|
|
||||||
|
minFormWidth += 96;
|
||||||
|
Width = Math.Max(realFormWidth, minFormWidth);
|
||||||
|
|
||||||
|
++buttonCount;
|
||||||
|
return button;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddActionControl(Control control){
|
||||||
|
panelActions.Controls.Add(control);
|
||||||
|
|
||||||
|
minFormWidth += control.Width+control.Margin.Horizontal;
|
||||||
|
Width = Math.Max(realFormWidth, minFormWidth);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void labelMessage_SizeChanged(object sender, EventArgs e){
|
||||||
|
if (!isReady){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isMultiline = labelMessage.Height > labelMessage.MinimumSize.Height;
|
||||||
|
|
||||||
|
if (isMultiline && !wasLabelMultiline){
|
||||||
|
labelMessage.Location = new Point(labelMessage.Location.X, labelMessage.Location.Y-8);
|
||||||
|
prevLabelHeight += 8;
|
||||||
|
}
|
||||||
|
else if (!isMultiline && wasLabelMultiline){
|
||||||
|
labelMessage.Location = new Point(labelMessage.Location.X, labelMessage.Location.Y+8);
|
||||||
|
prevLabelHeight -= 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
realFormWidth = Width-(icon == null ? 32+35+(labelMessage.Margin.Left-labelMessage.Margin.Right) : 0)+labelMessage.Margin.Right+labelMessage.Width-prevLabelWidth;
|
||||||
|
Width = Math.Max(realFormWidth, minFormWidth);
|
||||||
|
Height += labelMessage.Height-prevLabelHeight;
|
||||||
|
|
||||||
|
prevLabelWidth = labelMessage.Width;
|
||||||
|
prevLabelHeight = labelMessage.Height;
|
||||||
|
wasLabelMultiline = isMultiline;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnPaint(PaintEventArgs e){
|
||||||
|
if (icon != null){
|
||||||
|
e.Graphics.DrawIcon(icon, 25, 26);
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnPaint(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -14,5 +14,11 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
public BaseTabSettings(){
|
public BaseTabSettings(){
|
||||||
Padding = new Padding(6);
|
Padding = new Padding(6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static void PromptRestart(){
|
||||||
|
if (MessageBox.Show("The application must restart for the setting to take place. Do you want to restart now?", Program.BrandName+" Settings", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes){
|
||||||
|
Program.Restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -48,14 +48,14 @@
|
|||||||
this.textBoxBrowserCSS.Multiline = true;
|
this.textBoxBrowserCSS.Multiline = true;
|
||||||
this.textBoxBrowserCSS.Name = "textBoxBrowserCSS";
|
this.textBoxBrowserCSS.Name = "textBoxBrowserCSS";
|
||||||
this.textBoxBrowserCSS.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
this.textBoxBrowserCSS.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||||
this.textBoxBrowserCSS.Size = new System.Drawing.Size(226, 193);
|
this.textBoxBrowserCSS.Size = new System.Drawing.Size(373, 253);
|
||||||
this.textBoxBrowserCSS.TabIndex = 0;
|
this.textBoxBrowserCSS.TabIndex = 0;
|
||||||
this.textBoxBrowserCSS.WordWrap = false;
|
this.textBoxBrowserCSS.WordWrap = false;
|
||||||
//
|
//
|
||||||
// btnCancel
|
// btnCancel
|
||||||
//
|
//
|
||||||
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.btnCancel.Location = new System.Drawing.Point(354, 227);
|
this.btnCancel.Location = new System.Drawing.Point(654, 287);
|
||||||
this.btnCancel.Name = "btnCancel";
|
this.btnCancel.Name = "btnCancel";
|
||||||
this.btnCancel.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
this.btnCancel.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||||
this.btnCancel.Size = new System.Drawing.Size(56, 23);
|
this.btnCancel.Size = new System.Drawing.Size(56, 23);
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
// btnApply
|
// btnApply
|
||||||
//
|
//
|
||||||
this.btnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
this.btnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.btnApply.Location = new System.Drawing.Point(416, 227);
|
this.btnApply.Location = new System.Drawing.Point(716, 287);
|
||||||
this.btnApply.Name = "btnApply";
|
this.btnApply.Name = "btnApply";
|
||||||
this.btnApply.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
this.btnApply.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||||
this.btnApply.Size = new System.Drawing.Size(56, 23);
|
this.btnApply.Size = new System.Drawing.Size(56, 23);
|
||||||
@@ -95,8 +95,8 @@
|
|||||||
this.splitContainer.Panel2.Controls.Add(this.labelNotification);
|
this.splitContainer.Panel2.Controls.Add(this.labelNotification);
|
||||||
this.splitContainer.Panel2.Controls.Add(this.textBoxNotificationCSS);
|
this.splitContainer.Panel2.Controls.Add(this.textBoxNotificationCSS);
|
||||||
this.splitContainer.Panel2MinSize = 64;
|
this.splitContainer.Panel2MinSize = 64;
|
||||||
this.splitContainer.Size = new System.Drawing.Size(460, 209);
|
this.splitContainer.Size = new System.Drawing.Size(760, 269);
|
||||||
this.splitContainer.SplitterDistance = 226;
|
this.splitContainer.SplitterDistance = 373;
|
||||||
this.splitContainer.SplitterWidth = 5;
|
this.splitContainer.SplitterWidth = 5;
|
||||||
this.splitContainer.TabIndex = 5;
|
this.splitContainer.TabIndex = 5;
|
||||||
//
|
//
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
this.textBoxNotificationCSS.Multiline = true;
|
this.textBoxNotificationCSS.Multiline = true;
|
||||||
this.textBoxNotificationCSS.Name = "textBoxNotificationCSS";
|
this.textBoxNotificationCSS.Name = "textBoxNotificationCSS";
|
||||||
this.textBoxNotificationCSS.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
this.textBoxNotificationCSS.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||||
this.textBoxNotificationCSS.Size = new System.Drawing.Size(226, 193);
|
this.textBoxNotificationCSS.Size = new System.Drawing.Size(378, 253);
|
||||||
this.textBoxNotificationCSS.TabIndex = 1;
|
this.textBoxNotificationCSS.TabIndex = 1;
|
||||||
this.textBoxNotificationCSS.WordWrap = false;
|
this.textBoxNotificationCSS.WordWrap = false;
|
||||||
//
|
//
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
//
|
//
|
||||||
this.labelWarning.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
this.labelWarning.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
this.labelWarning.AutoSize = true;
|
this.labelWarning.AutoSize = true;
|
||||||
this.labelWarning.Location = new System.Drawing.Point(9, 232);
|
this.labelWarning.Location = new System.Drawing.Point(9, 292);
|
||||||
this.labelWarning.Name = "labelWarning";
|
this.labelWarning.Name = "labelWarning";
|
||||||
this.labelWarning.Size = new System.Drawing.Size(341, 13);
|
this.labelWarning.Size = new System.Drawing.Size(341, 13);
|
||||||
this.labelWarning.TabIndex = 6;
|
this.labelWarning.TabIndex = 6;
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(484, 262);
|
this.ClientSize = new System.Drawing.Size(784, 322);
|
||||||
this.Controls.Add(this.labelWarning);
|
this.Controls.Add(this.labelWarning);
|
||||||
this.Controls.Add(this.splitContainer);
|
this.Controls.Add(this.splitContainer);
|
||||||
this.Controls.Add(this.btnApply);
|
this.Controls.Add(this.btnApply);
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using TweetDck.Core.Controls;
|
||||||
|
|
||||||
namespace TweetDck.Core.Other.Settings.Dialogs{
|
namespace TweetDck.Core.Other.Settings.Dialogs{
|
||||||
sealed partial class DialogSettingsCSS : Form{
|
sealed partial class DialogSettingsCSS : Form{
|
||||||
@@ -20,7 +21,10 @@ namespace TweetDck.Core.Other.Settings.Dialogs{
|
|||||||
|
|
||||||
Text = Program.BrandName+" Settings - CSS";
|
Text = Program.BrandName+" Settings - CSS";
|
||||||
|
|
||||||
|
textBoxBrowserCSS.EnableMultilineShortcuts();
|
||||||
textBoxBrowserCSS.Text = Program.UserConfig.CustomBrowserCSS ?? "";
|
textBoxBrowserCSS.Text = Program.UserConfig.CustomBrowserCSS ?? "";
|
||||||
|
|
||||||
|
textBoxNotificationCSS.EnableMultilineShortcuts();
|
||||||
textBoxNotificationCSS.Text = Program.UserConfig.CustomNotificationCSS ?? "";
|
textBoxNotificationCSS.Text = Program.UserConfig.CustomNotificationCSS ?? "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using TweetDck.Core.Controls;
|
||||||
using TweetDck.Core.Utils;
|
using TweetDck.Core.Utils;
|
||||||
|
|
||||||
namespace TweetDck.Core.Other.Settings.Dialogs{
|
namespace TweetDck.Core.Other.Settings.Dialogs{
|
||||||
@@ -16,6 +16,7 @@ namespace TweetDck.Core.Other.Settings.Dialogs{
|
|||||||
|
|
||||||
Text = Program.BrandName+" Settings - CEF Arguments";
|
Text = Program.BrandName+" Settings - CEF Arguments";
|
||||||
|
|
||||||
|
textBoxArgs.EnableMultilineShortcuts();
|
||||||
textBoxArgs.Text = Program.UserConfig.CustomCefArgs ?? "";
|
textBoxArgs.Text = Program.UserConfig.CustomCefArgs ?? "";
|
||||||
textBoxArgs.Select(textBoxArgs.Text.Length, 0);
|
textBoxArgs.Select(textBoxArgs.Text.Length, 0);
|
||||||
}
|
}
|
||||||
@@ -33,7 +34,7 @@ namespace TweetDck.Core.Other.Settings.Dialogs{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int count = CommandLineArgsParser.AddToDictionary(CefArgs, new Dictionary<string, string>());
|
int count = CommandLineArgsParser.ReadCefArguments(CefArgs).Count;
|
||||||
string prompt = count == 0 && !string.IsNullOrWhiteSpace(prevArgs) ? "All arguments will be removed from the settings. Continue?" : count+(count == 1 ? " argument" : " arguments")+" will be added to the settings. Continue?";
|
string prompt = count == 0 && !string.IsNullOrWhiteSpace(prevArgs) ? "All arguments will be removed from the settings. Continue?" : count+(count == 1 ? " argument" : " arguments")+" will be added to the settings. Continue?";
|
||||||
|
|
||||||
if (MessageBox.Show(prompt, "Confirm CEF Arguments", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK){
|
if (MessageBox.Show(prompt, "Confirm CEF Arguments", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK){
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@@ -8,8 +7,8 @@ using TweetDck.Plugins;
|
|||||||
|
|
||||||
namespace TweetDck.Core.Other.Settings.Export{
|
namespace TweetDck.Core.Other.Settings.Export{
|
||||||
sealed class ExportManager{
|
sealed class ExportManager{
|
||||||
public static readonly string CookiesPath = Path.Combine(Program.StoragePath, "Cookies");
|
private static readonly string CookiesPath = Path.Combine(Program.StoragePath, "Cookies");
|
||||||
public static readonly string TempCookiesPath = Path.Combine(Program.StoragePath, "CookiesTmp");
|
private static readonly string TempCookiesPath = Path.Combine(Program.StoragePath, "CookiesTmp");
|
||||||
|
|
||||||
public bool IsRestarting { get; private set; }
|
public bool IsRestarting { get; private set; }
|
||||||
public Exception LastException { get; private set; }
|
public Exception LastException { get; private set; }
|
||||||
@@ -105,8 +104,7 @@ namespace TweetDck.Core.Other.Settings.Export{
|
|||||||
|
|
||||||
// okay to and restart, 'cookies' is always the last entry
|
// okay to and restart, 'cookies' is always the last entry
|
||||||
IsRestarting = true;
|
IsRestarting = true;
|
||||||
Process.Start(Application.ExecutablePath, "-restart -importcookies");
|
Program.Restart(new string[]{ "-importcookies" });
|
||||||
Application.Exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -125,6 +123,20 @@ namespace TweetDck.Core.Other.Settings.Export{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void ImportCookies(){
|
||||||
|
if (File.Exists(TempCookiesPath)){
|
||||||
|
try{
|
||||||
|
if (File.Exists(CookiesPath)){
|
||||||
|
File.Delete(CookiesPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
File.Move(TempCookiesPath, CookiesPath);
|
||||||
|
}catch(Exception e){
|
||||||
|
Program.Reporter.HandleException("Profile Import Error", "Could not import the cookie file to restore login session.", true, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static IEnumerable<PathInfo> EnumerateFilesRelative(string root){
|
private static IEnumerable<PathInfo> EnumerateFilesRelative(string root){
|
||||||
return Directory.EnumerateFiles(root, "*.*", SearchOption.AllDirectories).Select(fullPath => new PathInfo{
|
return Directory.EnumerateFiles(root, "*.*", SearchOption.AllDirectories).Select(fullPath => new PathInfo{
|
||||||
Full = fullPath,
|
Full = fullPath,
|
||||||
|
44
Core/Other/Settings/TabSettingsAdvanced.Designer.cs
generated
44
Core/Other/Settings/TabSettingsAdvanced.Designer.cs
generated
@@ -34,8 +34,12 @@
|
|||||||
this.btnExport = new System.Windows.Forms.Button();
|
this.btnExport = new System.Windows.Forms.Button();
|
||||||
this.groupPerformance = new System.Windows.Forms.GroupBox();
|
this.groupPerformance = new System.Windows.Forms.GroupBox();
|
||||||
this.groupConfiguration = new System.Windows.Forms.GroupBox();
|
this.groupConfiguration = new System.Windows.Forms.GroupBox();
|
||||||
|
this.groupApp = new System.Windows.Forms.GroupBox();
|
||||||
|
this.btnRestartLog = new System.Windows.Forms.Button();
|
||||||
|
this.btnRestart = new System.Windows.Forms.Button();
|
||||||
this.groupPerformance.SuspendLayout();
|
this.groupPerformance.SuspendLayout();
|
||||||
this.groupConfiguration.SuspendLayout();
|
this.groupConfiguration.SuspendLayout();
|
||||||
|
this.groupApp.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// btnClearCache
|
// btnClearCache
|
||||||
@@ -148,10 +152,46 @@
|
|||||||
this.groupConfiguration.TabStop = false;
|
this.groupConfiguration.TabStop = false;
|
||||||
this.groupConfiguration.Text = "Configuration";
|
this.groupConfiguration.Text = "Configuration";
|
||||||
//
|
//
|
||||||
|
// groupApp
|
||||||
|
//
|
||||||
|
this.groupApp.Controls.Add(this.btnRestartLog);
|
||||||
|
this.groupApp.Controls.Add(this.btnRestart);
|
||||||
|
this.groupApp.Location = new System.Drawing.Point(198, 9);
|
||||||
|
this.groupApp.Name = "groupApp";
|
||||||
|
this.groupApp.Size = new System.Drawing.Size(183, 77);
|
||||||
|
this.groupApp.TabIndex = 20;
|
||||||
|
this.groupApp.TabStop = false;
|
||||||
|
this.groupApp.Text = "App";
|
||||||
|
//
|
||||||
|
// btnRestartLog
|
||||||
|
//
|
||||||
|
this.btnRestartLog.Location = new System.Drawing.Point(6, 48);
|
||||||
|
this.btnRestartLog.Name = "btnRestartLog";
|
||||||
|
this.btnRestartLog.Size = new System.Drawing.Size(171, 23);
|
||||||
|
this.btnRestartLog.TabIndex = 17;
|
||||||
|
this.btnRestartLog.Text = "Restart with Logging";
|
||||||
|
this.toolTip.SetToolTip(this.btnRestartLog, "Restarts the program and enables logging\r\ninto a debug.txt file in the installati" +
|
||||||
|
"on folder.");
|
||||||
|
this.btnRestartLog.UseVisualStyleBackColor = true;
|
||||||
|
this.btnRestartLog.Click += new System.EventHandler(this.btnRestartLog_Click);
|
||||||
|
//
|
||||||
|
// btnRestart
|
||||||
|
//
|
||||||
|
this.btnRestart.Location = new System.Drawing.Point(6, 19);
|
||||||
|
this.btnRestart.Name = "btnRestart";
|
||||||
|
this.btnRestart.Size = new System.Drawing.Size(171, 23);
|
||||||
|
this.btnRestart.TabIndex = 16;
|
||||||
|
this.btnRestart.Text = "Restart the Program";
|
||||||
|
this.toolTip.SetToolTip(this.btnRestart, "Restarts the program using the same command\r\nline arguments that were used at lau" +
|
||||||
|
"nch.");
|
||||||
|
this.btnRestart.UseVisualStyleBackColor = true;
|
||||||
|
this.btnRestart.Click += new System.EventHandler(this.btnRestart_Click);
|
||||||
|
//
|
||||||
// TabSettingsAdvanced
|
// TabSettingsAdvanced
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.Controls.Add(this.groupApp);
|
||||||
this.Controls.Add(this.groupConfiguration);
|
this.Controls.Add(this.groupConfiguration);
|
||||||
this.Controls.Add(this.groupPerformance);
|
this.Controls.Add(this.groupPerformance);
|
||||||
this.Controls.Add(this.btnReset);
|
this.Controls.Add(this.btnReset);
|
||||||
@@ -162,6 +202,7 @@
|
|||||||
this.groupPerformance.ResumeLayout(false);
|
this.groupPerformance.ResumeLayout(false);
|
||||||
this.groupPerformance.PerformLayout();
|
this.groupPerformance.PerformLayout();
|
||||||
this.groupConfiguration.ResumeLayout(false);
|
this.groupConfiguration.ResumeLayout(false);
|
||||||
|
this.groupApp.ResumeLayout(false);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
@@ -179,5 +220,8 @@
|
|||||||
private System.Windows.Forms.GroupBox groupConfiguration;
|
private System.Windows.Forms.GroupBox groupConfiguration;
|
||||||
private System.Windows.Forms.Button btnEditCefArgs;
|
private System.Windows.Forms.Button btnEditCefArgs;
|
||||||
private System.Windows.Forms.Button btnEditCSS;
|
private System.Windows.Forms.Button btnEditCSS;
|
||||||
|
private System.Windows.Forms.GroupBox groupApp;
|
||||||
|
private System.Windows.Forms.Button btnRestartLog;
|
||||||
|
private System.Windows.Forms.Button btnRestart;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using TweetDck.Core.Controls;
|
using TweetDck.Core.Controls;
|
||||||
using TweetDck.Core.Other.Settings.Dialogs;
|
using TweetDck.Core.Other.Settings.Dialogs;
|
||||||
@@ -71,13 +70,16 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
|
|
||||||
if (form.ShowDialog(ParentForm) == DialogResult.OK){
|
if (form.ShowDialog(ParentForm) == DialogResult.OK){
|
||||||
Config.CustomCefArgs = form.CefArgs;
|
Config.CustomCefArgs = form.CefArgs;
|
||||||
|
form.Dispose();
|
||||||
PromptRestart();
|
PromptRestart();
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
form.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnEditCSS_Click(object sender, EventArgs e){
|
private void btnEditCSS_Click(object sender, EventArgs e){
|
||||||
DialogSettingsCSS form = new DialogSettingsCSS();
|
using(DialogSettingsCSS form = new DialogSettingsCSS()){
|
||||||
|
|
||||||
if (form.ShowDialog(ParentForm) == DialogResult.OK){
|
if (form.ShowDialog(ParentForm) == DialogResult.OK){
|
||||||
bool hasChangedBrowser = form.BrowserCSS != Config.CustomBrowserCSS;
|
bool hasChangedBrowser = form.BrowserCSS != Config.CustomBrowserCSS;
|
||||||
|
|
||||||
@@ -89,6 +91,7 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void btnExport_Click(object sender, EventArgs e){
|
private void btnExport_Click(object sender, EventArgs e){
|
||||||
DialogResult resultSaveCredentials = MessageBox.Show("Do you want to include your login session? This will not save your password into the file, but it will allow anyone with the file to login into TweetDeck as you.", "Export "+Program.BrandName+" Settings", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);
|
DialogResult resultSaveCredentials = MessageBox.Show("Do you want to include your login session? This will not save your password into the file, but it will allow anyone with the file to login into TweetDeck as you.", "Export "+Program.BrandName+" Settings", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);
|
||||||
@@ -115,7 +118,7 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
ExportManager manager = new ExportManager(file, plugins);
|
ExportManager manager = new ExportManager(file, plugins);
|
||||||
|
|
||||||
if (!manager.Export(saveCredentials)){
|
if (!manager.Export(saveCredentials)){
|
||||||
Program.HandleException("An exception happened while exporting "+Program.BrandName+" settings.", manager.LastException);
|
Program.Reporter.HandleException("Profile Export Error", "An exception happened while exporting "+Program.BrandName+" settings.", true, manager.LastException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,7 +144,7 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
Program.HandleException("An exception happened while importing "+Program.BrandName+" settings.", manager.LastException);
|
Program.Reporter.HandleException("Profile Import Error", "An exception happened while importing "+Program.BrandName+" settings.", true, manager.LastException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,11 +156,12 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void PromptRestart(){
|
private void btnRestart_Click(object sender, EventArgs e){
|
||||||
if (MessageBox.Show("The application must restart for the setting to take place. Do you want to restart now?", Program.BrandName+" Settings", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes){
|
Program.Restart();
|
||||||
Process.Start(Application.ExecutablePath, "-restart");
|
|
||||||
Application.Exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void btnRestartLog_Click(object sender, EventArgs e){
|
||||||
|
Program.Restart(new string[]{ "-log" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
19
Core/Other/Settings/TabSettingsGeneral.Designer.cs
generated
19
Core/Other/Settings/TabSettingsGeneral.Designer.cs
generated
@@ -28,6 +28,7 @@
|
|||||||
this.comboBoxTrayType = new System.Windows.Forms.ComboBox();
|
this.comboBoxTrayType = new System.Windows.Forms.ComboBox();
|
||||||
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
|
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
|
||||||
this.checkTrayHighlight = new System.Windows.Forms.CheckBox();
|
this.checkTrayHighlight = new System.Windows.Forms.CheckBox();
|
||||||
|
this.checkSpellCheck = new System.Windows.Forms.CheckBox();
|
||||||
this.groupTray = new System.Windows.Forms.GroupBox();
|
this.groupTray = new System.Windows.Forms.GroupBox();
|
||||||
this.labelTrayIcon = new System.Windows.Forms.Label();
|
this.labelTrayIcon = new System.Windows.Forms.Label();
|
||||||
this.groupInterface = new System.Windows.Forms.GroupBox();
|
this.groupInterface = new System.Windows.Forms.GroupBox();
|
||||||
@@ -74,12 +75,24 @@
|
|||||||
this.checkTrayHighlight.UseVisualStyleBackColor = true;
|
this.checkTrayHighlight.UseVisualStyleBackColor = true;
|
||||||
this.checkTrayHighlight.CheckedChanged += new System.EventHandler(this.checkTrayHighlight_CheckedChanged);
|
this.checkTrayHighlight.CheckedChanged += new System.EventHandler(this.checkTrayHighlight_CheckedChanged);
|
||||||
//
|
//
|
||||||
|
// checkSpellCheck
|
||||||
|
//
|
||||||
|
this.checkSpellCheck.AutoSize = true;
|
||||||
|
this.checkSpellCheck.Location = new System.Drawing.Point(9, 44);
|
||||||
|
this.checkSpellCheck.Name = "checkSpellCheck";
|
||||||
|
this.checkSpellCheck.Size = new System.Drawing.Size(119, 17);
|
||||||
|
this.checkSpellCheck.TabIndex = 15;
|
||||||
|
this.checkSpellCheck.Text = "Enable Spell Check";
|
||||||
|
this.toolTip.SetToolTip(this.checkSpellCheck, "Underlines words that are spelled incorrectly.");
|
||||||
|
this.checkSpellCheck.UseVisualStyleBackColor = true;
|
||||||
|
this.checkSpellCheck.CheckedChanged += new System.EventHandler(this.checkSpellCheck_CheckedChanged);
|
||||||
|
//
|
||||||
// groupTray
|
// groupTray
|
||||||
//
|
//
|
||||||
this.groupTray.Controls.Add(this.checkTrayHighlight);
|
this.groupTray.Controls.Add(this.checkTrayHighlight);
|
||||||
this.groupTray.Controls.Add(this.labelTrayIcon);
|
this.groupTray.Controls.Add(this.labelTrayIcon);
|
||||||
this.groupTray.Controls.Add(this.comboBoxTrayType);
|
this.groupTray.Controls.Add(this.comboBoxTrayType);
|
||||||
this.groupTray.Location = new System.Drawing.Point(9, 63);
|
this.groupTray.Location = new System.Drawing.Point(9, 86);
|
||||||
this.groupTray.Name = "groupTray";
|
this.groupTray.Name = "groupTray";
|
||||||
this.groupTray.Size = new System.Drawing.Size(183, 93);
|
this.groupTray.Size = new System.Drawing.Size(183, 93);
|
||||||
this.groupTray.TabIndex = 15;
|
this.groupTray.TabIndex = 15;
|
||||||
@@ -98,10 +111,11 @@
|
|||||||
//
|
//
|
||||||
// groupInterface
|
// groupInterface
|
||||||
//
|
//
|
||||||
|
this.groupInterface.Controls.Add(this.checkSpellCheck);
|
||||||
this.groupInterface.Controls.Add(this.checkExpandLinks);
|
this.groupInterface.Controls.Add(this.checkExpandLinks);
|
||||||
this.groupInterface.Location = new System.Drawing.Point(9, 9);
|
this.groupInterface.Location = new System.Drawing.Point(9, 9);
|
||||||
this.groupInterface.Name = "groupInterface";
|
this.groupInterface.Name = "groupInterface";
|
||||||
this.groupInterface.Size = new System.Drawing.Size(183, 48);
|
this.groupInterface.Size = new System.Drawing.Size(183, 71);
|
||||||
this.groupInterface.TabIndex = 16;
|
this.groupInterface.TabIndex = 16;
|
||||||
this.groupInterface.TabStop = false;
|
this.groupInterface.TabStop = false;
|
||||||
this.groupInterface.Text = "User Interface";
|
this.groupInterface.Text = "User Interface";
|
||||||
@@ -131,5 +145,6 @@
|
|||||||
private System.Windows.Forms.GroupBox groupInterface;
|
private System.Windows.Forms.GroupBox groupInterface;
|
||||||
private System.Windows.Forms.Label labelTrayIcon;
|
private System.Windows.Forms.Label labelTrayIcon;
|
||||||
private System.Windows.Forms.CheckBox checkTrayHighlight;
|
private System.Windows.Forms.CheckBox checkTrayHighlight;
|
||||||
|
private System.Windows.Forms.CheckBox checkSpellCheck;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,8 +12,9 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
comboBoxTrayType.Items.Add("Combined");
|
comboBoxTrayType.Items.Add("Combined");
|
||||||
comboBoxTrayType.SelectedIndex = Math.Min(Math.Max((int)Config.TrayBehavior, 0), comboBoxTrayType.Items.Count-1);
|
comboBoxTrayType.SelectedIndex = Math.Min(Math.Max((int)Config.TrayBehavior, 0), comboBoxTrayType.Items.Count-1);
|
||||||
|
|
||||||
checkExpandLinks.Checked = Program.UserConfig.ExpandLinksOnHover;
|
checkExpandLinks.Checked = Config.ExpandLinksOnHover;
|
||||||
checkTrayHighlight.Checked = Program.UserConfig.EnableTrayHighlight;
|
checkSpellCheck.Checked = Config.EnableSpellCheck;
|
||||||
|
checkTrayHighlight.Checked = Config.EnableTrayHighlight;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkExpandLinks_CheckedChanged(object sender, EventArgs e){
|
private void checkExpandLinks_CheckedChanged(object sender, EventArgs e){
|
||||||
@@ -22,6 +23,13 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
Config.ExpandLinksOnHover = checkExpandLinks.Checked;
|
Config.ExpandLinksOnHover = checkExpandLinks.Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkSpellCheck_CheckedChanged(object sender, EventArgs e){
|
||||||
|
if (!Ready)return;
|
||||||
|
|
||||||
|
Config.EnableSpellCheck = checkSpellCheck.Checked;
|
||||||
|
PromptRestart();
|
||||||
|
}
|
||||||
|
|
||||||
private void comboBoxTrayType_SelectedIndexChanged(object sender, EventArgs e){
|
private void comboBoxTrayType_SelectedIndexChanged(object sender, EventArgs e){
|
||||||
if (!Ready)return;
|
if (!Ready)return;
|
||||||
|
|
||||||
|
@@ -8,14 +8,11 @@ namespace TweetDck.Core.Utils{
|
|||||||
static class BrowserCache{
|
static class BrowserCache{
|
||||||
private static bool ClearOnExit { get; set; }
|
private static bool ClearOnExit { get; set; }
|
||||||
|
|
||||||
private static readonly string IndexFile = Path.Combine(Program.StoragePath, "index");
|
private static readonly string CacheFolder = Path.Combine(Program.StoragePath, "Cache");
|
||||||
|
|
||||||
private static IEnumerable<string> CacheFiles{
|
private static IEnumerable<string> CacheFiles{
|
||||||
get{
|
get{
|
||||||
return Directory.EnumerateFiles(Program.StoragePath).Where(path => {
|
return Directory.EnumerateFiles(CacheFolder);
|
||||||
string file = Path.GetFileName(path);
|
|
||||||
return file != null && (file.StartsWith("data_", StringComparison.Ordinal) || file.StartsWith("f_", StringComparison.Ordinal));
|
|
||||||
}).Concat(new[]{ IndexFile });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,6 +31,21 @@ namespace TweetDck.Core.Utils{
|
|||||||
task.Start();
|
task.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void ClearOldCacheFiles(){
|
||||||
|
if (!Directory.Exists(CacheFolder)){
|
||||||
|
foreach(string file in Directory.EnumerateFiles(Program.StoragePath).Where(path => {
|
||||||
|
string file = Path.GetFileName(path);
|
||||||
|
return file != null && (file.StartsWith("data_", StringComparison.Ordinal) || file.StartsWith("f_", StringComparison.Ordinal));
|
||||||
|
}).Concat(new[]{ Path.Combine(Program.StoragePath, "index") })){
|
||||||
|
try{
|
||||||
|
File.Delete(file);
|
||||||
|
}catch{
|
||||||
|
// welp, too bad
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void SetClearOnExit(){
|
public static void SetClearOnExit(){
|
||||||
ClearOnExit = true;
|
ClearOnExit = true;
|
||||||
}
|
}
|
||||||
|
107
Core/Utils/CommandLineArgs.cs
Normal file
107
Core/Utils/CommandLineArgs.cs
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace TweetDck.Core.Utils{
|
||||||
|
class CommandLineArgs{
|
||||||
|
public static CommandLineArgs FromStringArray(char entryChar, string[] array){
|
||||||
|
CommandLineArgs args = new CommandLineArgs();
|
||||||
|
ReadStringArray(entryChar, array, args);
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ReadStringArray(char entryChar, string[] array, CommandLineArgs targetArgs){
|
||||||
|
for(int index = 0; index < array.Length; index++){
|
||||||
|
string entry = array[index];
|
||||||
|
|
||||||
|
if (entry.Length > 0 && entry[0] == entryChar){
|
||||||
|
if (index < array.Length-1){
|
||||||
|
string potentialValue = array[index+1];
|
||||||
|
|
||||||
|
if (potentialValue.Length > 0 && potentialValue[0] == entryChar){
|
||||||
|
targetArgs.AddFlag(entry);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
targetArgs.SetValue(entry, potentialValue);
|
||||||
|
++index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
targetArgs.AddFlag(entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly HashSet<string> flags = new HashSet<string>();
|
||||||
|
private readonly Dictionary<string, string> values = new Dictionary<string, string>();
|
||||||
|
|
||||||
|
public int Count{
|
||||||
|
get{
|
||||||
|
return flags.Count+values.Count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddFlag(string flag){
|
||||||
|
flags.Add(flag.ToLowerInvariant());
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool HasFlag(string flag){
|
||||||
|
return flags.Contains(flag.ToLowerInvariant());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveFlag(string flag){
|
||||||
|
flags.Remove(flag.ToLowerInvariant());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetValue(string key, string value){
|
||||||
|
values[key.ToLowerInvariant()] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetValue(string key, string defaultValue){
|
||||||
|
string val;
|
||||||
|
return values.TryGetValue(key.ToLowerInvariant(), out val) ? val : defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveValue(string key){
|
||||||
|
values.Remove(key.ToLowerInvariant());
|
||||||
|
}
|
||||||
|
|
||||||
|
public CommandLineArgs Clone(){
|
||||||
|
CommandLineArgs copy = new CommandLineArgs();
|
||||||
|
|
||||||
|
foreach(string flag in flags){
|
||||||
|
copy.AddFlag(flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach(KeyValuePair<string, string> kvp in values){
|
||||||
|
copy.SetValue(kvp.Key, kvp.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return copy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ToDictionary(IDictionary<string, string> target){
|
||||||
|
foreach(string flag in flags){
|
||||||
|
target[flag] = "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach(KeyValuePair<string, string> kvp in values){
|
||||||
|
target[kvp.Key] = kvp.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString(){
|
||||||
|
StringBuilder build = new StringBuilder();
|
||||||
|
|
||||||
|
foreach(string flag in flags){
|
||||||
|
build.Append(flag).Append(' ');
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach(KeyValuePair<string, string> kvp in values){
|
||||||
|
build.Append(kvp.Key).Append(" \"").Append(kvp.Value).Append("\" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
return build.Remove(build.Length-1, 1).ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,5 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using System.Text.RegularExpressions;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
|
|
||||||
namespace TweetDck.Core.Utils{
|
namespace TweetDck.Core.Utils{
|
||||||
static class CommandLineArgsParser{
|
static class CommandLineArgsParser{
|
||||||
@@ -7,18 +6,18 @@ namespace TweetDck.Core.Utils{
|
|||||||
|
|
||||||
private static Regex SplitRegex{
|
private static Regex SplitRegex{
|
||||||
get{
|
get{
|
||||||
return splitRegex ?? (splitRegex = new Regex(@"([^=\s]+(?:=(?:""[^""]*?""|[^ ]*))?)", RegexOptions.Compiled));
|
return splitRegex ?? (splitRegex = new Regex(@"([^=\s]+(?:=(?:[^ ]*""[^""]*?""[^ ]*|[^ ]*))?)", RegexOptions.Compiled));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int AddToDictionary(string args, IDictionary<string, string> dictionary){
|
public static CommandLineArgs ReadCefArguments(string argumentString){
|
||||||
if (string.IsNullOrWhiteSpace(args)){
|
CommandLineArgs args = new CommandLineArgs();
|
||||||
return 0;
|
|
||||||
|
if (string.IsNullOrWhiteSpace(argumentString)){
|
||||||
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
int count = 0;
|
foreach(Match match in SplitRegex.Matches(argumentString)){
|
||||||
|
|
||||||
foreach(Match match in SplitRegex.Matches(args)){
|
|
||||||
string matchValue = match.Value;
|
string matchValue = match.Value;
|
||||||
|
|
||||||
int indexEquals = matchValue.IndexOf('=');
|
int indexEquals = matchValue.IndexOf('=');
|
||||||
@@ -34,12 +33,11 @@ namespace TweetDck.Core.Utils{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (key.Length != 0){
|
if (key.Length != 0){
|
||||||
dictionary[key] = value;
|
args.SetValue(key, value);
|
||||||
++count;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return args;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
33
Core/Utils/WindowsUtils.cs
Normal file
33
Core/Utils/WindowsUtils.cs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Security.AccessControl;
|
||||||
|
using System.Security.Principal;
|
||||||
|
|
||||||
|
namespace TweetDck.Core.Utils{
|
||||||
|
static class WindowsUtils{
|
||||||
|
public static bool CheckFolderPermission(string path, FileSystemRights right){
|
||||||
|
try{
|
||||||
|
AuthorizationRuleCollection rules = Directory.GetAccessControl(path).GetAccessRules(true, true, typeof(SecurityIdentifier));
|
||||||
|
WindowsIdentity identity = WindowsIdentity.GetCurrent();
|
||||||
|
|
||||||
|
if (identity == null || identity.Groups == null){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool accessAllow = false, accessDeny = false;
|
||||||
|
|
||||||
|
foreach(FileSystemAccessRule rule in rules.Cast<FileSystemAccessRule>().Where(rule => identity.Groups.Contains(rule.IdentityReference) && (right & rule.FileSystemRights) == right)){
|
||||||
|
switch(rule.AccessControlType){
|
||||||
|
case AccessControlType.Allow: accessAllow = true; break;
|
||||||
|
case AccessControlType.Deny: accessDeny = true; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return accessAllow && !accessDeny;
|
||||||
|
}
|
||||||
|
catch{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
148
Migration/FormMigrationQuestion.Designer.cs
generated
148
Migration/FormMigrationQuestion.Designer.cs
generated
@@ -1,148 +0,0 @@
|
|||||||
using TweetDck.Core.Controls;
|
|
||||||
|
|
||||||
namespace TweetDck.Migration {
|
|
||||||
partial class FormMigrationQuestion {
|
|
||||||
/// <summary>
|
|
||||||
/// Required designer variable.
|
|
||||||
/// </summary>
|
|
||||||
private System.ComponentModel.IContainer components = null;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clean up any resources being used.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
|
||||||
protected override void Dispose(bool disposing) {
|
|
||||||
if (disposing && (components != null)) {
|
|
||||||
components.Dispose();
|
|
||||||
}
|
|
||||||
base.Dispose(disposing);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Windows Form Designer generated code
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Required method for Designer support - do not modify
|
|
||||||
/// the contents of this method with the code editor.
|
|
||||||
/// </summary>
|
|
||||||
private void InitializeComponent() {
|
|
||||||
this.btnIgnore = new System.Windows.Forms.Button();
|
|
||||||
this.panelButtons = new System.Windows.Forms.FlowLayoutPanel();
|
|
||||||
this.btnAskLater = new System.Windows.Forms.Button();
|
|
||||||
this.btnMigrate = new System.Windows.Forms.Button();
|
|
||||||
this.btnMigrateUninstall = new System.Windows.Forms.Button();
|
|
||||||
this.labelQuestion = new System.Windows.Forms.Label();
|
|
||||||
this.panelButtons.SuspendLayout();
|
|
||||||
this.SuspendLayout();
|
|
||||||
//
|
|
||||||
// btnIgnore
|
|
||||||
//
|
|
||||||
this.btnIgnore.AutoSize = true;
|
|
||||||
this.btnIgnore.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
|
||||||
this.btnIgnore.Location = new System.Drawing.Point(391, 0);
|
|
||||||
this.btnIgnore.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
|
||||||
this.btnIgnore.Name = "btnIgnore";
|
|
||||||
this.btnIgnore.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
|
||||||
this.btnIgnore.Size = new System.Drawing.Size(53, 23);
|
|
||||||
this.btnIgnore.TabIndex = 1;
|
|
||||||
this.btnIgnore.Text = "Ignore";
|
|
||||||
this.btnIgnore.UseVisualStyleBackColor = true;
|
|
||||||
this.btnIgnore.Click += new System.EventHandler(this.btnIgnore_Click);
|
|
||||||
//
|
|
||||||
// panelButtons
|
|
||||||
//
|
|
||||||
this.panelButtons.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
|
||||||
this.panelButtons.Controls.Add(this.btnAskLater);
|
|
||||||
this.panelButtons.Controls.Add(this.btnIgnore);
|
|
||||||
this.panelButtons.Controls.Add(this.btnMigrate);
|
|
||||||
this.panelButtons.Controls.Add(this.btnMigrateUninstall);
|
|
||||||
this.panelButtons.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
|
||||||
this.panelButtons.Location = new System.Drawing.Point(12, 67);
|
|
||||||
this.panelButtons.Name = "panelButtons";
|
|
||||||
this.panelButtons.Size = new System.Drawing.Size(518, 23);
|
|
||||||
this.panelButtons.TabIndex = 0;
|
|
||||||
//
|
|
||||||
// btnAskLater
|
|
||||||
//
|
|
||||||
this.btnAskLater.AutoSize = true;
|
|
||||||
this.btnAskLater.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
|
||||||
this.btnAskLater.Location = new System.Drawing.Point(450, 0);
|
|
||||||
this.btnAskLater.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
|
|
||||||
this.btnAskLater.Name = "btnAskLater";
|
|
||||||
this.btnAskLater.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
|
||||||
this.btnAskLater.Size = new System.Drawing.Size(68, 23);
|
|
||||||
this.btnAskLater.TabIndex = 0;
|
|
||||||
this.btnAskLater.Text = "Ask Later";
|
|
||||||
this.btnAskLater.UseVisualStyleBackColor = true;
|
|
||||||
this.btnAskLater.Click += new System.EventHandler(this.btnAskLater_Click);
|
|
||||||
//
|
|
||||||
// btnMigrate
|
|
||||||
//
|
|
||||||
this.btnMigrate.AutoSize = true;
|
|
||||||
this.btnMigrate.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
|
||||||
this.btnMigrate.Location = new System.Drawing.Point(327, 0);
|
|
||||||
this.btnMigrate.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
|
||||||
this.btnMigrate.Name = "btnMigrate";
|
|
||||||
this.btnMigrate.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
|
||||||
this.btnMigrate.Size = new System.Drawing.Size(58, 23);
|
|
||||||
this.btnMigrate.TabIndex = 3;
|
|
||||||
this.btnMigrate.Text = "Migrate";
|
|
||||||
this.btnMigrate.UseVisualStyleBackColor = true;
|
|
||||||
this.btnMigrate.Click += new System.EventHandler(this.btnMigrate_Click);
|
|
||||||
//
|
|
||||||
// btnMigrateUninstall
|
|
||||||
//
|
|
||||||
this.btnMigrateUninstall.AutoSize = true;
|
|
||||||
this.btnMigrateUninstall.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
|
||||||
this.btnMigrateUninstall.Location = new System.Drawing.Point(223, 0);
|
|
||||||
this.btnMigrateUninstall.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
|
||||||
this.btnMigrateUninstall.Name = "btnMigrateUninstall";
|
|
||||||
this.btnMigrateUninstall.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
|
||||||
this.btnMigrateUninstall.Size = new System.Drawing.Size(98, 23);
|
|
||||||
this.btnMigrateUninstall.TabIndex = 4;
|
|
||||||
this.btnMigrateUninstall.Text = "Migrate && Purge";
|
|
||||||
this.btnMigrateUninstall.UseVisualStyleBackColor = true;
|
|
||||||
this.btnMigrateUninstall.Click += new System.EventHandler(this.btnMigrateUninstall_Click);
|
|
||||||
//
|
|
||||||
// labelQuestion
|
|
||||||
//
|
|
||||||
this.labelQuestion.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.labelQuestion.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
|
||||||
this.labelQuestion.Location = new System.Drawing.Point(49, 9);
|
|
||||||
this.labelQuestion.Margin = new System.Windows.Forms.Padding(40, 3, 3, 3);
|
|
||||||
this.labelQuestion.Name = "labelQuestion";
|
|
||||||
this.labelQuestion.Size = new System.Drawing.Size(481, 52);
|
|
||||||
this.labelQuestion.TabIndex = 2;
|
|
||||||
//
|
|
||||||
// FormMigrationQuestion
|
|
||||||
//
|
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
|
||||||
this.ClientSize = new System.Drawing.Size(542, 102);
|
|
||||||
this.Controls.Add(this.labelQuestion);
|
|
||||||
this.Controls.Add(this.panelButtons);
|
|
||||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
|
||||||
this.MaximizeBox = false;
|
|
||||||
this.MinimizeBox = false;
|
|
||||||
this.Name = "FormMigrationQuestion";
|
|
||||||
this.ShowIcon = false;
|
|
||||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
|
||||||
this.Text = "TweetDeck Migration";
|
|
||||||
this.panelButtons.ResumeLayout(false);
|
|
||||||
this.panelButtons.PerformLayout();
|
|
||||||
this.ResumeLayout(false);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private System.Windows.Forms.Button btnIgnore;
|
|
||||||
private System.Windows.Forms.FlowLayoutPanel panelButtons;
|
|
||||||
private System.Windows.Forms.Button btnMigrate;
|
|
||||||
private System.Windows.Forms.Label labelQuestion;
|
|
||||||
private System.Windows.Forms.Button btnAskLater;
|
|
||||||
private System.Windows.Forms.Button btnMigrateUninstall;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,42 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace TweetDck.Migration{
|
|
||||||
partial class FormMigrationQuestion : Form{
|
|
||||||
public MigrationDecision Decision { get; private set; }
|
|
||||||
|
|
||||||
public FormMigrationQuestion(){
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
labelQuestion.Text = "Hey there, I found some TweetDeck data! Do you want to »Migrate« it and delete the old data folder, »Ignore« the request forever, or try "+Program.BrandName+" out first?\r\nYou may also »Migrate && Purge« which uninstalls TweetDeck too!";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnPaint(PaintEventArgs e){
|
|
||||||
e.Graphics.DrawIcon(SystemIcons.Question, 10, 10);
|
|
||||||
base.OnPaint(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnMigrateUninstall_Click(object sender, EventArgs e){
|
|
||||||
Close(MigrationDecision.MigratePurge);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnMigrate_Click(object sender, EventArgs e){
|
|
||||||
Close(MigrationDecision.Migrate);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnIgnore_Click(object sender, EventArgs e){
|
|
||||||
Close(MigrationDecision.Ignore);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnAskLater_Click(object sender, EventArgs e){
|
|
||||||
Close(MigrationDecision.AskLater);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Close(MigrationDecision decision){
|
|
||||||
Decision = decision;
|
|
||||||
DialogResult = DialogResult.OK;
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -6,7 +6,8 @@ using System.Threading;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using TweetDck.Migration.Helpers;
|
using TweetDck.Core.Other;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
namespace TweetDck.Migration{
|
namespace TweetDck.Migration{
|
||||||
static class MigrationManager{
|
static class MigrationManager{
|
||||||
@@ -16,26 +17,41 @@ namespace TweetDck.Migration{
|
|||||||
private static readonly string TweetDickStorage = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "TweetDick");
|
private static readonly string TweetDickStorage = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "TweetDick");
|
||||||
|
|
||||||
public static void Run(){
|
public static void Run(){
|
||||||
#if DUCK
|
|
||||||
if (!Program.IsPortable && Directory.Exists(TweetDickStorage) && !Directory.Exists(Program.StoragePath)){
|
if (!Program.IsPortable && Directory.Exists(TweetDickStorage) && !Directory.Exists(Program.StoragePath)){
|
||||||
if (MessageBox.Show("Welcome to TweetDuck! Would you like to move your old TweetDick configuration and login data?", "TweetDick Migration", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes){
|
if (MessageBox.Show("Welcome to TweetDuck! Would you like to move your old TweetDick configuration and login data?", "TweetDick Migration", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes){
|
||||||
try{
|
try{
|
||||||
Directory.Move(TweetDickStorage, Program.StoragePath);
|
Directory.Move(TweetDickStorage, Program.StoragePath);
|
||||||
MessageBox.Show("All done! You can now uninstall TweetDick.", "TweetDick Migration", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("All done! You can now uninstall TweetDick.", "TweetDick Migration", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}catch(Exception ex){
|
}catch(Exception ex){
|
||||||
Program.HandleException("An unexpected exception has occurred during the migration process.", ex);
|
Program.Reporter.HandleException("Migration Error", "An unexpected error occurred during the migration process.", true, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!Program.UserConfig.IgnoreMigration && Directory.Exists(TweetDeckPath)){
|
if (!Program.UserConfig.IgnoreMigration && Directory.Exists(TweetDeckPath)){
|
||||||
MigrationDecision decision;
|
MigrationDecision decision;
|
||||||
|
|
||||||
using(FormMigrationQuestion formQuestion = new FormMigrationQuestion()){
|
const string prompt = "Hey there, I found some TweetDeck data! Do you want to »Migrate« it and delete the old data folder, »Ignore« the prompt, or try "+Program.BrandName+" out first? You may also »Migrate && Purge« which uninstalls TweetDeck too!";
|
||||||
decision = formQuestion.ShowDialog() == DialogResult.OK ? formQuestion.Decision : MigrationDecision.AskLater;
|
|
||||||
|
using(FormMessage formQuestion = new FormMessage("TweetDeck Migration", prompt, MessageBoxIcon.Question)){
|
||||||
|
formQuestion.AddButton("Ask Later");
|
||||||
|
Button btnIgnore = formQuestion.AddButton("Ignore");
|
||||||
|
Button btnMigrate = formQuestion.AddButton("Migrate");
|
||||||
|
Button btnMigrateAndPurge = formQuestion.AddButton("Migrate && Purge");
|
||||||
|
|
||||||
|
btnMigrateAndPurge.Location = new Point(btnMigrateAndPurge.Location.X-18, btnMigrateAndPurge.Location.Y);
|
||||||
|
btnMigrateAndPurge.Width += 18;
|
||||||
|
|
||||||
|
if (formQuestion.ShowDialog() == DialogResult.OK){
|
||||||
|
decision = formQuestion.ClickedButton == btnMigrateAndPurge ? MigrationDecision.MigratePurge :
|
||||||
|
formQuestion.ClickedButton == btnMigrate ? MigrationDecision.Migrate :
|
||||||
|
formQuestion.ClickedButton == btnIgnore ? MigrationDecision.Ignore : MigrationDecision.AskLater;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
decision = MigrationDecision.AskLater;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(decision){
|
switch(decision){
|
||||||
@@ -48,7 +64,7 @@ namespace TweetDck.Migration{
|
|||||||
formWait.Close();
|
formWait.Close();
|
||||||
|
|
||||||
if (ex != null){
|
if (ex != null){
|
||||||
Program.HandleException("An unexpected exception has occurred during the migration process.", ex);
|
Program.Reporter.HandleException("Migration Error", "An unexpected error occurred during the migration process.", true, ex);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,10 +84,10 @@ namespace TweetDck.Migration{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!Program.UserConfig.IgnoreUninstallCheck){
|
else if (!Program.UserConfig.IgnoreUninstallCheck){
|
||||||
string guid = ProgramRegistrySearch.FindByDisplayName("TweetDeck");
|
string guid = MigrationUtils.FindProgramGuidByDisplayName("TweetDeck");
|
||||||
|
|
||||||
if (guid != null && MessageBox.Show("TweetDeck is still installed on your computer, do you want to uninstall it?", "Uninstall TweetDeck", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes){
|
if (guid != null && MessageBox.Show("TweetDeck is still installed on your computer, do you want to uninstall it?", "Uninstall TweetDeck", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes){
|
||||||
RunUninstaller(guid, 0);
|
MigrationUtils.RunUninstaller(guid, 0);
|
||||||
CleanupTweetDeck();
|
CleanupTweetDeck();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,10 +153,10 @@ namespace TweetDck.Migration{
|
|||||||
|
|
||||||
if (decision == MigrationDecision.MigratePurge){
|
if (decision == MigrationDecision.MigratePurge){
|
||||||
// uninstall in the background
|
// uninstall in the background
|
||||||
string guid = ProgramRegistrySearch.FindByDisplayName("TweetDeck");
|
string guid = MigrationUtils.FindProgramGuidByDisplayName("TweetDeck");
|
||||||
|
|
||||||
if (guid != null){
|
if (guid != null){
|
||||||
RunUninstaller(guid, 5000);
|
MigrationUtils.RunUninstaller(guid, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
// registry cleanup
|
// registry cleanup
|
||||||
@@ -164,18 +180,6 @@ namespace TweetDck.Migration{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void RunUninstaller(string guid, int timeout){
|
|
||||||
Process uninstaller = Process.Start("msiexec.exe", "/x "+guid+" /quiet /qn");
|
|
||||||
|
|
||||||
if (uninstaller != null){
|
|
||||||
if (timeout > 0){
|
|
||||||
uninstaller.WaitForExit(timeout); // it appears that the process is restarted or something that triggers this, but it shouldn't be a problem
|
|
||||||
}
|
|
||||||
|
|
||||||
uninstaller.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void CleanupTweetDeck(){
|
private static void CleanupTweetDeck(){
|
||||||
try{
|
try{
|
||||||
Registry.CurrentUser.DeleteSubKeyTree(@"Software\Twitter\TweetDeck", true);
|
Registry.CurrentUser.DeleteSubKeyTree(@"Software\Twitter\TweetDeck", true);
|
||||||
|
@@ -1,10 +1,23 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
|
||||||
namespace TweetDck.Migration.Helpers{
|
namespace TweetDck.Migration{
|
||||||
static class ProgramRegistrySearch{
|
static class MigrationUtils{
|
||||||
public static string FindByDisplayName(string displayName){
|
public static void RunUninstaller(string guid, int timeout){
|
||||||
|
Process uninstaller = Process.Start("msiexec.exe", "/x "+guid+" /quiet /qn");
|
||||||
|
|
||||||
|
if (uninstaller != null){
|
||||||
|
if (timeout > 0){
|
||||||
|
uninstaller.WaitForExit(timeout); // it appears that the process is restarted or something that triggers this, but it shouldn't be a problem
|
||||||
|
}
|
||||||
|
|
||||||
|
uninstaller.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string FindProgramGuidByDisplayName(string displayName){
|
||||||
Predicate<RegistryKey> predicate = key => displayName.Equals(key.GetValue("DisplayName") as string, StringComparison.OrdinalIgnoreCase);
|
Predicate<RegistryKey> predicate = key => displayName.Equals(key.GetValue("DisplayName") as string, StringComparison.OrdinalIgnoreCase);
|
||||||
string guid;
|
string guid;
|
||||||
|
|
@@ -24,12 +24,6 @@ namespace TweetDck.Plugins{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string FolderPath{
|
|
||||||
get{
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool HasConfig{
|
public bool HasConfig{
|
||||||
get{
|
get{
|
||||||
return ConfigFile.Length > 0 && GetFullPathIfSafe(ConfigFile).Length > 0;
|
return ConfigFile.Length > 0 && GetFullPathIfSafe(ConfigFile).Length > 0;
|
||||||
@@ -83,7 +77,7 @@ namespace TweetDck.Plugins{
|
|||||||
try{
|
try{
|
||||||
File.Copy(defaultConfigPath, configPath, false);
|
File.Copy(defaultConfigPath, configPath, false);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
Program.HandleException("Could not generate a configuration file for '"+identifier+"' plugin.", e);
|
Program.Reporter.HandleException("Plugin Loading Error", "Could not generate a configuration file for '"+identifier+"' plugin.", true, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -40,7 +40,7 @@ namespace TweetDck.Plugins{
|
|||||||
public string ReadFile(int token, string path, bool cache){
|
public string ReadFile(int token, string path, bool cache){
|
||||||
string fullPath = GetFullPathIfSafe(token, path);
|
string fullPath = GetFullPathIfSafe(token, path);
|
||||||
|
|
||||||
if (fullPath == string.Empty){
|
if (fullPath.Length == 0){
|
||||||
throw new Exception("File path has to be relative to the plugin folder.");
|
throw new Exception("File path has to be relative to the plugin folder.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
151
Program.cs
151
Program.cs
@@ -1,8 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using CefSharp;
|
using CefSharp;
|
||||||
using TweetDck.Configuration;
|
using TweetDck.Configuration;
|
||||||
@@ -14,31 +12,31 @@ using System.Threading;
|
|||||||
using TweetDck.Plugins;
|
using TweetDck.Plugins;
|
||||||
using TweetDck.Plugins.Events;
|
using TweetDck.Plugins.Events;
|
||||||
using TweetDck.Core.Other.Settings.Export;
|
using TweetDck.Core.Other.Settings.Export;
|
||||||
|
using TweetDck.Core.Handling;
|
||||||
|
using System.Security.AccessControl;
|
||||||
|
|
||||||
[assembly: CLSCompliant(true)]
|
[assembly: CLSCompliant(true)]
|
||||||
namespace TweetDck{
|
namespace TweetDck{
|
||||||
static class Program{
|
static class Program{
|
||||||
#if DUCK
|
|
||||||
public const string BrandName = "TweetDuck";
|
public const string BrandName = "TweetDuck";
|
||||||
public const string Website = "http://tweetduck.chylex.com";
|
public const string Website = "https://tweetduck.chylex.com";
|
||||||
#else
|
|
||||||
public const string BrandName = "TweetDick";
|
|
||||||
public const string Website = "http://tweetdick.chylex.com";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public const string BrowserSubprocess = BrandName+".Browser.exe";
|
public const string BrowserSubprocess = BrandName+".Browser.exe";
|
||||||
|
|
||||||
public const string VersionTag = "1.3.2";
|
public const string VersionTag = "1.4";
|
||||||
public const string VersionFull = "1.3.2.0";
|
public const string VersionFull = "1.4.0.0";
|
||||||
|
|
||||||
public static readonly Version Version = new Version(VersionTag);
|
public static readonly Version Version = new Version(VersionTag);
|
||||||
|
|
||||||
public static readonly bool IsPortable = File.Exists("makeportable");
|
public static readonly bool IsPortable = File.Exists("makeportable");
|
||||||
|
private static readonly CommandLineArgs Args = CommandLineArgs.FromStringArray('-', Environment.GetCommandLineArgs());
|
||||||
|
|
||||||
public static readonly string ProgramPath = AppDomain.CurrentDomain.BaseDirectory;
|
public static readonly string ProgramPath = AppDomain.CurrentDomain.BaseDirectory;
|
||||||
public static readonly string StoragePath = IsPortable ? Path.Combine(ProgramPath, "portable", "storage") : GetDataStoragePath();
|
public static readonly string StoragePath = IsPortable ? Path.Combine(ProgramPath, "portable", "storage") : GetDataStoragePath();
|
||||||
public static readonly string TemporaryPath = IsPortable ? Path.Combine(ProgramPath, "portable", "tmp") : Path.Combine(Path.GetTempPath(), BrandName+'_'+Path.GetRandomFileName().Substring(0, 6));
|
public static readonly string TemporaryPath = IsPortable ? Path.Combine(ProgramPath, "portable", "tmp") : Path.Combine(Path.GetTempPath(), BrandName+'_'+Path.GetRandomFileName().Substring(0, 6));
|
||||||
|
|
||||||
public static readonly string ConfigFilePath = Path.Combine(StoragePath, "TD_UserConfig.cfg");
|
public static readonly string ConfigFilePath = Path.Combine(StoragePath, "TD_UserConfig.cfg");
|
||||||
|
private static readonly string LogFilePath = Path.Combine(StoragePath, "TD_Log.txt");
|
||||||
|
|
||||||
public static readonly string ScriptPath = Path.Combine(ProgramPath, "scripts");
|
public static readonly string ScriptPath = Path.Combine(ProgramPath, "scripts");
|
||||||
public static readonly string PluginPath = Path.Combine(ProgramPath, "plugins");
|
public static readonly string PluginPath = Path.Combine(ProgramPath, "plugins");
|
||||||
@@ -49,12 +47,7 @@ namespace TweetDck{
|
|||||||
private static bool HasCleanedUp;
|
private static bool HasCleanedUp;
|
||||||
|
|
||||||
public static UserConfig UserConfig { get; private set; }
|
public static UserConfig UserConfig { get; private set; }
|
||||||
|
public static Reporter Reporter { get; private set; }
|
||||||
public static string LogFile{
|
|
||||||
get{
|
|
||||||
return Path.Combine(ProgramPath, "td-log.txt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[STAThread]
|
[STAThread]
|
||||||
private static void Main(){
|
private static void Main(){
|
||||||
@@ -63,14 +56,22 @@ namespace TweetDck{
|
|||||||
|
|
||||||
WindowRestoreMessage = NativeMethods.RegisterWindowMessage("TweetDuckRestore");
|
WindowRestoreMessage = NativeMethods.RegisterWindowMessage("TweetDuckRestore");
|
||||||
|
|
||||||
if (!File.Exists(LogFile) && !Log(string.Empty)){
|
if (!WindowsUtils.CheckFolderPermission(ProgramPath, FileSystemRights.WriteData)){
|
||||||
MessageBox.Show("Could not write to the log file. If you installed "+BrandName+" to Program Files, please run it as Administrator.", "Administrator Required", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
MessageBox.Show(BrandName+" does not have write permissions to the program folder. If it is installed in Program Files, please run it as Administrator.", "Administrator Required", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string[] programArguments = Environment.GetCommandLineArgs();
|
Reporter = new Reporter(LogFilePath);
|
||||||
|
|
||||||
if (programArguments.Contains("-restart")){
|
AppDomain.CurrentDomain.UnhandledException += (sender, args) => {
|
||||||
|
Exception ex = args.ExceptionObject as Exception;
|
||||||
|
|
||||||
|
if (ex != null){
|
||||||
|
Reporter.HandleException(BrandName+" Has Failed :(", "An unhandled exception has occurred.", false, ex);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (Args.HasFlag("-restart")){
|
||||||
for(int attempt = 0; attempt < 41; attempt++){
|
for(int attempt = 0; attempt < 41; attempt++){
|
||||||
if (LockManager.Lock()){
|
if (LockManager.Lock()){
|
||||||
break;
|
break;
|
||||||
@@ -83,8 +84,13 @@ namespace TweetDck{
|
|||||||
Thread.Sleep(500);
|
Thread.Sleep(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReloadConfig();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
ReloadConfig();
|
||||||
|
MigrationManager.Run();
|
||||||
|
|
||||||
if (!LockManager.Lock()){
|
if (!LockManager.Lock()){
|
||||||
if (LockManager.LockingProcess.MainWindowHandle == IntPtr.Zero && LockManager.LockingProcess.Responding){ // restore if the original process is in tray
|
if (LockManager.LockingProcess.MainWindowHandle == IntPtr.Zero && LockManager.LockingProcess.Responding){ // restore if the original process is in tray
|
||||||
NativeMethods.SendMessage(NativeMethods.HWND_BROADCAST, WindowRestoreMessage, 0, IntPtr.Zero);
|
NativeMethods.SendMessage(NativeMethods.HWND_BROADCAST, WindowRestoreMessage, 0, IntPtr.Zero);
|
||||||
@@ -102,51 +108,26 @@ namespace TweetDck{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (programArguments.Contains("-importcookies") && File.Exists(ExportManager.TempCookiesPath)){
|
if (Args.HasFlag("-importcookies")){
|
||||||
try{
|
ExportManager.ImportCookies();
|
||||||
if (File.Exists(ExportManager.CookiesPath)){
|
|
||||||
File.Delete(ExportManager.CookiesPath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
File.Move(ExportManager.TempCookiesPath, ExportManager.CookiesPath);
|
BrowserCache.ClearOldCacheFiles();
|
||||||
}catch(Exception e){
|
|
||||||
HandleException("Could not import the cookie file to restore login session.", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ReloadConfig();
|
|
||||||
|
|
||||||
MigrationManager.Run();
|
|
||||||
|
|
||||||
Cef.OnContextInitialized = () => {
|
|
||||||
using(IRequestContext ctx = Cef.GetGlobalRequestContext()){
|
|
||||||
string err;
|
|
||||||
ctx.SetPreference("browser.enable_spellchecking", false, out err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
CefSettings settings = new CefSettings{
|
CefSettings settings = new CefSettings{
|
||||||
AcceptLanguageList = BrowserUtils.HeaderAcceptLanguage,
|
AcceptLanguageList = BrowserUtils.HeaderAcceptLanguage,
|
||||||
UserAgent = BrowserUtils.HeaderUserAgent,
|
UserAgent = BrowserUtils.HeaderUserAgent,
|
||||||
Locale = CultureInfo.CurrentCulture.TwoLetterISOLanguageName,
|
Locale = Args.GetValue("-locale", "en"),
|
||||||
CachePath = StoragePath,
|
CachePath = StoragePath,
|
||||||
BrowserSubprocessPath = File.Exists(BrowserSubprocess) ? BrowserSubprocess : "CefSharp.BrowserSubprocess.exe",
|
BrowserSubprocessPath = File.Exists(BrowserSubprocess) ? BrowserSubprocess : "CefSharp.BrowserSubprocess.exe",
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
LogSeverity = programArguments.Contains("-log") ? LogSeverity.Info : LogSeverity.Disable
|
LogSeverity = Args.HasFlag("-log") ? LogSeverity.Info : LogSeverity.Disable
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
CommandLineArgsParser.AddToDictionary(UserConfig.CustomCefArgs, settings.CefCommandLineArgs);
|
CommandLineArgsParser.ReadCefArguments(UserConfig.CustomCefArgs).ToDictionary(settings.CefCommandLineArgs);
|
||||||
|
|
||||||
Cef.Initialize(settings);
|
Cef.Initialize(settings, false, new BrowserProcessHandler());
|
||||||
|
|
||||||
AppDomain.CurrentDomain.UnhandledException += (sender, args) => {
|
|
||||||
Exception ex = args.ExceptionObject as Exception;
|
|
||||||
|
|
||||||
if (ex != null){
|
|
||||||
HandleException("An unhandled exception has occurred.", ex);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Application.ApplicationExit += (sender, args) => ExitCleanup();
|
Application.ApplicationExit += (sender, args) => ExitCleanup();
|
||||||
|
|
||||||
@@ -172,55 +153,24 @@ namespace TweetDck{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetCmdArgumentValue(string search){
|
|
||||||
string[] args = Environment.GetCommandLineArgs();
|
|
||||||
int index = Array.FindIndex(args, arg => arg.Equals(search, StringComparison.OrdinalIgnoreCase));
|
|
||||||
|
|
||||||
return index >= 0 && index < args.Length-1 ? args[index+1] : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetDataStoragePath(){
|
private static string GetDataStoragePath(){
|
||||||
string custom = GetCmdArgumentValue("-datafolder");
|
string custom = Args.GetValue("-datafolder", null);
|
||||||
|
|
||||||
if (custom != null && (custom.Contains(Path.DirectorySeparatorChar) || custom.Contains(Path.AltDirectorySeparatorChar))){
|
if (custom != null && (custom.Contains(Path.DirectorySeparatorChar) || custom.Contains(Path.AltDirectorySeparatorChar))){
|
||||||
return custom;
|
if (Path.GetInvalidPathChars().Any(custom.Contains)){
|
||||||
|
Reporter.HandleEarlyFailure("Data Folder Invalid", "The data folder contains invalid characters:\n"+custom);
|
||||||
|
}
|
||||||
|
else if (!Path.IsPathRooted(custom)){
|
||||||
|
Reporter.HandleEarlyFailure("Data Folder Invalid", "The data folder has to be either a simple folder name, or a full path:\n"+custom);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Environment.ExpandEnvironmentVariables(custom);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), custom ?? BrandName);
|
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), custom ?? BrandName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void HandleException(string message, Exception e){
|
|
||||||
if (Log(e.ToString())){
|
|
||||||
if (MessageBox.Show(message+"\r\nDo you want to open the log file to report the issue?", BrandName+" Has Failed :(", MessageBoxButtons.YesNo, MessageBoxIcon.Error, MessageBoxDefaultButton.Button2) == DialogResult.Yes){
|
|
||||||
Process.Start(LogFile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
MessageBox.Show(message+"\r\nFailed writing the error into the log file.\r\nOriginal exception: "+e, BrandName+" Has Failed :(", MessageBoxButtons.OK);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool Log(string data){
|
|
||||||
StringBuilder build = new StringBuilder();
|
|
||||||
|
|
||||||
if (!File.Exists(LogFile)){
|
|
||||||
build.Append("Please, report all issues to: https://github.com/chylex/TweetDuck/issues\r\n\r\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.Length > 0){
|
|
||||||
build.Append("[").Append(DateTime.Now.ToString("G", CultureInfo.CurrentCulture)).Append("]\r\n");
|
|
||||||
build.Append(data).Append("\r\n\r\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
try{
|
|
||||||
File.AppendAllText(LogFile, build.ToString(), Encoding.UTF8);
|
|
||||||
return true;
|
|
||||||
}catch{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void ReloadConfig(){
|
public static void ReloadConfig(){
|
||||||
UserConfig = UserConfig.Load(ConfigFilePath);
|
UserConfig = UserConfig.Load(ConfigFilePath);
|
||||||
}
|
}
|
||||||
@@ -230,13 +180,28 @@ namespace TweetDck{
|
|||||||
File.Delete(ConfigFilePath);
|
File.Delete(ConfigFilePath);
|
||||||
File.Delete(UserConfig.GetBackupFile(ConfigFilePath));
|
File.Delete(UserConfig.GetBackupFile(ConfigFilePath));
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
HandleException("Could not delete configuration files to reset the settings.", e);
|
Reporter.HandleException("Configuration Reset Error", "Could not delete configuration files to reset the settings.", true, e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReloadConfig();
|
ReloadConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void Restart(){
|
||||||
|
Restart(new string[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Restart(string[] extraArgs){
|
||||||
|
CommandLineArgs args = Args.Clone();
|
||||||
|
args.AddFlag("-restart");
|
||||||
|
args.RemoveFlag("-importcookies");
|
||||||
|
|
||||||
|
CommandLineArgs.ReadStringArray('-', extraArgs, args);
|
||||||
|
|
||||||
|
Process.Start(Application.ExecutablePath, args.ToString());
|
||||||
|
Application.Exit();
|
||||||
|
}
|
||||||
|
|
||||||
private static void ExitCleanup(){
|
private static void ExitCleanup(){
|
||||||
if (HasCleanedUp)return;
|
if (HasCleanedUp)return;
|
||||||
|
|
||||||
|
@@ -1,13 +1,11 @@
|
|||||||
# Build Instructions
|
# Build Instructions
|
||||||
|
|
||||||
The program was build using Visual Studio 2013. After opening the solution, make sure you have **CefSharp.WinForms** and **Microsoft.VC120.CRT.JetBrains** included - if not, download them using NuGet. For **CefSharp**, you will need version 49 or newer currently available as a pre-release.
|
The program was build using Visual Studio 2013. After opening the solution, make sure you have **CefSharp.WinForms** and **Microsoft.VC120.CRT.JetBrains** included - if not, download them using NuGet. For **CefSharp**, you will need version 53 or newer currently available as a pre-release.
|
||||||
```
|
```
|
||||||
PM> Install-Package CefSharp.WinForms -Pre -Version 49.0.0-pre02
|
PM> Install-Package CefSharp.WinForms -Pre -Version 53.0.0-pre01
|
||||||
PM> Install-Package Microsoft.VC120.CRT.JetBrains
|
PM> Install-Package Microsoft.VC120.CRT.JetBrains
|
||||||
```
|
```
|
||||||
|
|
||||||
TweetD\*ck comes in two variants - TweetDick and TweetDuck. The solution includes both configurations under the names **Release Dick** and **Release Duck**, so make sure to select the correct one, or build both using Batch Build.
|
|
||||||
|
|
||||||
After building, run **_postbuild.bat** which deletes unnecessary files that CefSharp adds after post-build events >_>
|
After building, run **_postbuild.bat** which deletes unnecessary files that CefSharp adds after post-build events >_>
|
||||||
|
|
||||||
Built files are then available in **bin/x86** and/or **bin/x64**.
|
Built files are then available in **bin/x86** and/or **bin/x64**.
|
||||||
|
89
Reporter.cs
Normal file
89
Reporter.cs
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using TweetDck.Core.Other;
|
||||||
|
|
||||||
|
namespace TweetDck{
|
||||||
|
class Reporter{
|
||||||
|
private readonly string logFile;
|
||||||
|
|
||||||
|
public Reporter(string logFile){
|
||||||
|
this.logFile = logFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Log(string data){
|
||||||
|
StringBuilder build = new StringBuilder();
|
||||||
|
|
||||||
|
if (!File.Exists(logFile)){
|
||||||
|
build.Append("Please, report all issues to: https://github.com/chylex/TweetDuck/issues\r\n\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
build.Append("[").Append(DateTime.Now.ToString("G", CultureInfo.CurrentCulture)).Append("]\r\n");
|
||||||
|
build.Append(data).Append("\r\n\r\n");
|
||||||
|
|
||||||
|
try{
|
||||||
|
File.AppendAllText(logFile, build.ToString(), Encoding.UTF8);
|
||||||
|
return true;
|
||||||
|
}catch{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void HandleException(string caption, string message, bool canIgnore, Exception e){
|
||||||
|
Log(e.ToString());
|
||||||
|
|
||||||
|
FormMessage form = new FormMessage(caption, message+"\r\nError: "+e.Message, canIgnore ? MessageBoxIcon.Warning : MessageBoxIcon.Error);
|
||||||
|
|
||||||
|
form.AddButton("Exit");
|
||||||
|
Button btnIgnore = form.AddButton("Ignore");
|
||||||
|
|
||||||
|
Button btnOpenLog = new Button{
|
||||||
|
Anchor = AnchorStyles.Bottom | AnchorStyles.Left,
|
||||||
|
Location = new Point(12, 12),
|
||||||
|
Margin = new Padding(0, 0, 48, 0),
|
||||||
|
Size = new Size(88, 26),
|
||||||
|
Text = "Show Error Log",
|
||||||
|
UseVisualStyleBackColor = true
|
||||||
|
};
|
||||||
|
|
||||||
|
btnOpenLog.Click += (sender, args) => Process.Start(logFile);
|
||||||
|
|
||||||
|
form.AddActionControl(btnOpenLog);
|
||||||
|
|
||||||
|
if (!canIgnore){
|
||||||
|
btnIgnore.Enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (form.ShowDialog() == DialogResult.OK){
|
||||||
|
if (form.ClickedButton == btnIgnore){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try{
|
||||||
|
Process.GetCurrentProcess().Kill();
|
||||||
|
}catch{
|
||||||
|
Environment.FailFast(message, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void HandleEarlyFailure(string caption, string message){
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
|
||||||
|
FormMessage form = new FormMessage(caption, message, MessageBoxIcon.Error);
|
||||||
|
form.AddButton("Exit");
|
||||||
|
form.ShowDialog();
|
||||||
|
|
||||||
|
try{
|
||||||
|
Process.GetCurrentProcess().Kill();
|
||||||
|
}catch{
|
||||||
|
Environment.FailFast(message, new Exception(message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -3,12 +3,16 @@ Clear columns
|
|||||||
|
|
||||||
[description]
|
[description]
|
||||||
- Adds buttons and keyboard shortcuts to quickly clear columns
|
- Adds buttons and keyboard shortcuts to quickly clear columns
|
||||||
|
- Hold Shift when clicking or using a keyboard shortcut to reset the column instead
|
||||||
|
|
||||||
[author]
|
[author]
|
||||||
chylex
|
chylex
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
1.0
|
1.1
|
||||||
|
|
||||||
[website]
|
[website]
|
||||||
https://tweetduck.chylex.com
|
https://tweetduck.chylex.com
|
||||||
|
|
||||||
|
[requires]
|
||||||
|
1.4.1
|
@@ -11,38 +11,75 @@ enabled(){
|
|||||||
TD.controller.stats.columnActionClick("clear");
|
TD.controller.stats.columnActionClick("clear");
|
||||||
};
|
};
|
||||||
|
|
||||||
var clearAllColumns = () => {
|
var resetColumn = (columnName) => {
|
||||||
Object.keys(TD.controller.columnManager.getAll()).forEach(key => clearColumn(key));
|
var col = TD.controller.columnManager.get(columnName);
|
||||||
|
col.model.setClearedTimestamp(0);
|
||||||
|
col.reloadTweets();
|
||||||
|
};
|
||||||
|
|
||||||
|
var forEachColumn = (func) => {
|
||||||
|
Object.keys(TD.controller.columnManager.getAll()).forEach(func);
|
||||||
};
|
};
|
||||||
|
|
||||||
var replaceMustache = (key, search, replace) => {
|
var replaceMustache = (key, search, replace) => {
|
||||||
TD.mustaches[key] = TD.mustaches[key].replace(search, replace);
|
TD.mustaches[key] = TD.mustaches[key].replace(search, replace);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var wasShiftPressed = false;
|
||||||
|
|
||||||
|
var updateShiftState = (pressed) => {
|
||||||
|
if (pressed != wasShiftPressed){
|
||||||
|
wasShiftPressed = pressed;
|
||||||
|
|
||||||
|
if (pressed){
|
||||||
|
$(document).on("mousemove", this.eventKeyUp);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$(document).off("mousemove", this.eventKeyUp);
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#clear-columns-btn-all").text(pressed ? "Reset all" : "Clear all");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// prepare event handlers
|
// prepare event handlers
|
||||||
this.eventClearSingle = function(){
|
this.eventClickSingle = function(e){
|
||||||
clearColumn($(this).closest(".js-column").attr("data-column"));
|
var name = $(this).closest(".js-column").attr("data-column");
|
||||||
|
e.shiftKey ? resetColumn(name) : clearColumn(name);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.eventClearAll = function(){
|
this.eventClickAll = function(e){
|
||||||
clearAllColumns();
|
forEachColumn(e.shiftKey ? resetColumn : clearColumn);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.eventKeys = function(e){
|
this.eventKeyDown = function(e){
|
||||||
if (e.keyCode === 46 && (document.activeElement === null || document.activeElement === document.body)){ // 46 = delete
|
if (!(document.activeElement === null || document.activeElement === document.body)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
updateShiftState(e.shiftKey);
|
||||||
|
|
||||||
|
if (e.keyCode === 46){ // 46 = delete
|
||||||
if (e.altKey){
|
if (e.altKey){
|
||||||
clearAllColumns();
|
forEachColumn(e.shiftKey ? resetColumn : clearColumn);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
var focusedColumn = $(".js-column.is-focused");
|
var focusedColumn = $(".js-column.is-focused");
|
||||||
|
|
||||||
if (focusedColumn.length){
|
if (focusedColumn.length){
|
||||||
clearColumn(focusedColumn.attr("data-column"));
|
var name = focusedColumn.attr("data-column");
|
||||||
|
e.shiftKey ? resetColumn(name) : clearColumn(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.eventKeyUp = function(e){
|
||||||
|
if (!e.shiftKey){
|
||||||
|
updateShiftState(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// add column buttons and keyboard shortcut info to UI
|
// add column buttons and keyboard shortcut info to UI
|
||||||
replaceMustache("column/column_header.mustache", "</header>", [
|
replaceMustache("column/column_header.mustache", "</header>", [
|
||||||
'{{^isTemporary}}',
|
'{{^isTemporary}}',
|
||||||
@@ -62,27 +99,26 @@ enabled(){
|
|||||||
].join(""));
|
].join(""));
|
||||||
|
|
||||||
// load custom style
|
// load custom style
|
||||||
var style = document.createElement("style");
|
var css = window.TDPF_createCustomStyle(this);
|
||||||
document.head.appendChild(style);
|
css.insert(".column-title { margin-right: 60px !important; }");
|
||||||
|
css.insert(".column-type-message .column-title { margin-right: 115px !important; }");
|
||||||
var sheet = style.sheet;
|
css.insert(".mark-all-read-link { right: 59px !important; }");
|
||||||
sheet.insertRule(".column-title { margin-right: 60px !important; }", 0);
|
css.insert(".open-compose-dm-link { right: 90px !important; }");
|
||||||
sheet.insertRule(".column-type-message .column-title { margin-right: 115px !important; }", 0);
|
css.insert("button[data-action='clear'].btn-options-tray { display: none !important; }");
|
||||||
sheet.insertRule(".mark-all-read-link { right: 59px !important; }", 0);
|
|
||||||
sheet.insertRule(".open-compose-dm-link { right: 90px !important; }", 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ready(){
|
ready(){
|
||||||
// setup events
|
// setup events
|
||||||
$(document).on("click", "[data-action='td-clearcolumns-dosingle']", this.eventClearSingle);
|
$(document).on("click", "[data-action='td-clearcolumns-dosingle']", this.eventClickSingle);
|
||||||
$(document).on("click", "[data-action='td-clearcolumns-doall']", this.eventClearAll);
|
$(document).on("click", "[data-action='td-clearcolumns-doall']", this.eventClickAll);
|
||||||
$(document).on("keydown", this.eventKeys);
|
$(document).on("keydown", this.eventKeyDown);
|
||||||
|
$(document).on("keyup", this.eventKeyUp);
|
||||||
|
|
||||||
// add clear all button
|
// add clear all button
|
||||||
$("nav.app-navigator").first().append([
|
$("nav.app-navigator").first().append([
|
||||||
'<a class="link-clean cf app-nav-link padding-hl" data-title="Clear all" data-action="td-clearcolumns-doall">',
|
'<a class="link-clean cf app-nav-link padding-hl" data-title="Clear all" data-action="td-clearcolumns-doall">',
|
||||||
'<div class="obj-left"><i class="icon icon-large icon-clear-timeline"></i></div>',
|
'<div class="obj-left"><i class="icon icon-large icon-clear-timeline"></i></div>',
|
||||||
'<div class="nbfc padding-ts hide-condensed">Clear all</div>',
|
'<div id="clear-columns-btn-all" class="nbfc padding-ts hide-condensed">Clear all</div>',
|
||||||
'</a></nav>'
|
'</a></nav>'
|
||||||
].join(""));
|
].join(""));
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,10 @@ Revert TweetDeck design changes
|
|||||||
chylex
|
chylex
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
1.0
|
1.1
|
||||||
|
|
||||||
[website]
|
[website]
|
||||||
https://tweetduck.chylex.com
|
https://tweetduck.chylex.com
|
||||||
|
|
||||||
|
[requires]
|
||||||
|
1.4.1
|
@@ -1,15 +1,11 @@
|
|||||||
enabled(){
|
enabled(){
|
||||||
// add a stylesheet to change tweet actions
|
// add a stylesheet to change tweet actions
|
||||||
var style = document.createElement("style");
|
this.css = window.TDPF_createCustomStyle(this);
|
||||||
style.id = "design-revert";
|
this.css.insert(".tweet-actions { float: right !important; width: auto !important; }");
|
||||||
document.head.appendChild(style);
|
this.css.insert(".tweet-action { opacity: 0; }");
|
||||||
|
this.css.insert(".is-favorite .tweet-action, .is-retweet .tweet-action { opacity: 0.5; visibility: visible !important; }");
|
||||||
var sheet = style.sheet;
|
this.css.insert(".tweet:hover .tweet-action, .is-favorite .tweet-action[rel='favorite'], .is-retweet .tweet-action[rel='retweet'] { opacity: 1; visibility: visible !important; }");
|
||||||
sheet.insertRule(".tweet-actions { float: right !important; width: auto !important; }", 0);
|
this.css.insert(".tweet-actions > li:nth-child(4) { margin-right: 2px !important; }");
|
||||||
sheet.insertRule(".tweet-action { opacity: 0; }", 0);
|
|
||||||
sheet.insertRule(".is-favorite .tweet-action, .is-retweet .tweet-action { opacity: 0.5; visibility: visible !important; }", 0);
|
|
||||||
sheet.insertRule(".tweet:hover .tweet-action, .is-favorite .tweet-action[rel='favorite'], .is-retweet .tweet-action[rel='retweet'] { opacity: 1; visibility: visible !important; }", 0);
|
|
||||||
sheet.insertRule(".tweet-actions > li:nth-child(4) { margin-right: 2px !important; }", 0);
|
|
||||||
|
|
||||||
// revert small links around the tweet
|
// revert small links around the tweet
|
||||||
this.prevFooterMustache = TD.mustaches["status/tweet_single_footer.mustache"];
|
this.prevFooterMustache = TD.mustaches["status/tweet_single_footer.mustache"];
|
||||||
@@ -31,7 +27,8 @@ ready(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
disabled(){
|
disabled(){
|
||||||
$("#design-revert").remove();
|
this.css.remove();
|
||||||
|
|
||||||
$(document).off("uiShowActionsMenu", this.uiShowActionsMenuEvent);
|
$(document).off("uiShowActionsMenu", this.uiShowActionsMenuEvent);
|
||||||
TD.mustaches["status/tweet_single_footer.mustache"] = this.prevFooterMustache;
|
TD.mustaches["status/tweet_single_footer.mustache"] = this.prevFooterMustache;
|
||||||
}
|
}
|
@@ -8,7 +8,7 @@ Custom reply account
|
|||||||
chylex
|
chylex
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
1.0
|
1.1
|
||||||
|
|
||||||
[website]
|
[website]
|
||||||
https://tweetduck.chylex.com
|
https://tweetduck.chylex.com
|
||||||
|
@@ -1,67 +1,120 @@
|
|||||||
enabled(){
|
enabled(){
|
||||||
var configuration = { defaultAccount: "" };
|
var configuration = { defaultAccount: "#preferred" };
|
||||||
|
|
||||||
window.TDPF_loadConfigurationFile(this, "configuration.js", "configuration.default.js", obj => configuration = obj);
|
window.TDPF_loadConfigurationFile(this, "configuration.js", "configuration.default.js", obj => configuration = obj);
|
||||||
|
|
||||||
this.uiInlineComposeTweetEvent = function(e, data){
|
this.lastSelectedAccount = null;
|
||||||
var account = null;
|
|
||||||
|
|
||||||
if (configuration.useAdvancedSelector && configuration.customSelector){
|
this.uiComposeTweetEvent = (e, data) => {
|
||||||
var column = TD.controller.columnManager.get(data.element.closest("section.column").attr("data-column"));
|
if (data.type !== "reply"){
|
||||||
var result = configuration.customSelector(column);
|
|
||||||
|
|
||||||
if (typeof result === "string" && result[0] === '@'){
|
|
||||||
account = result.substring(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (account === null){
|
|
||||||
if (configuration.defaultAccount === false){
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (configuration.defaultAccount !== "" && configuration.defaultAccount[0] === '@'){
|
|
||||||
account = configuration.defaultAccount.substring(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var identifier;
|
var query;
|
||||||
|
|
||||||
if (account === null){
|
if (configuration.useAdvancedSelector){
|
||||||
identifier = TD.storage.clientController.client.getDefaultAccount();
|
if (configuration.customSelector){
|
||||||
|
var column = TD.controller.columnManager.get(data.element.closest("section.column").attr("data-column"));
|
||||||
|
query = configuration.customSelector(column);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
var obj = TD.storage.accountController.getAccountFromUsername(account);
|
$TD.alert("warning", "Plugin reply-account has invalid configuration: useAdvancedSelector is true, but customSelector function is missing");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
query = configuration.defaultAccount;
|
||||||
|
|
||||||
|
if (query === ""){
|
||||||
|
query = "#preferred";
|
||||||
|
}
|
||||||
|
else if (typeof query !== "string"){
|
||||||
|
query = "#default";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof query === "undefined"){
|
||||||
|
query = "#preferred";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof query !== "string"){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (query.length === 0){
|
||||||
|
$TD.alert("warning", "Plugin reply-account has invalid configuration: the requested account is empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (query[0] !== '@' && query[0] !== '#'){
|
||||||
|
$TD.alert("warning", "Plugin reply-account has invalid configuration: the requested account does not begin with @ or #: "+query);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var identifier = null;
|
||||||
|
|
||||||
|
switch(query){
|
||||||
|
case "#preferred":
|
||||||
|
identifier = TD.storage.clientController.client.getDefaultAccount();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "#last":
|
||||||
|
if (this.lastSelectedAccount === null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
identifier = this.lastSelectedAccount;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "#default":
|
||||||
|
return;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if (query[0] === '@'){
|
||||||
|
var obj = TD.storage.accountController.getAccountFromUsername(query.substring(1));
|
||||||
|
|
||||||
if (obj.length === 0){
|
if (obj.length === 0){
|
||||||
|
$TD.alert("warning", "Plugin reply-account has invalid configuration: requested account not found: "+query);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
identifier = obj[0].privateState.key;
|
identifier = obj[0].privateState.key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
$TD.alert("warning", "Plugin reply-account has invalid configuration: unknown requested account query: "+query);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
data.singleFrom = data.from = [ identifier ];
|
data.singleFrom = data.from = [ identifier ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.onSelectedAccountChanged = () => {
|
||||||
|
var selected = $(".js-account-item.is-selected", ".js-account-list");
|
||||||
|
this.lastSelectedAccount = selected.length === 1 ? selected.attr("data-account-key") : null;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
ready(){
|
ready(){
|
||||||
var events = $._data(document, "events");
|
var events = $._data(document, "events");
|
||||||
|
|
||||||
if ("uiInlineComposeTweet" in events){
|
for(var event of [ "uiInlineComposeTweet", "uiDockedComposeTweet" ]){
|
||||||
$(document).on("uiInlineComposeTweet", this.uiInlineComposeTweetEvent);
|
$(document).on(event, this.uiComposeTweetEvent);
|
||||||
|
|
||||||
var handlers = events["uiInlineComposeTweet"];
|
var handlers = events[event];
|
||||||
var oldHandler = handlers[0];
|
var newHandler = handlers[handlers.length-1];
|
||||||
var newHandler = handlers[1];
|
|
||||||
|
for(var index = handlers.length-1; index > 0; index--){
|
||||||
|
handlers[index] = handlers[index-1];
|
||||||
|
}
|
||||||
|
|
||||||
handlers[0] = newHandler;
|
handlers[0] = newHandler;
|
||||||
handlers[1] = oldHandler;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$(document).on("uiInlineComposeTweet", this.uiInlineComposeTweetEvent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(document).on("click", ".js-account-list .js-account-item", this.onSelectedAccountChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
disabled(){
|
disabled(){
|
||||||
$(document).off("uiInlineComposeTweet", this.uiInlineComposeTweetEvent);
|
$(document).off("uiInlineComposeTweet", this.uiComposeTweetEvent);
|
||||||
|
$(document).off("uiDockedComposeTweet", this.uiComposeTweetEvent);
|
||||||
|
$(document).off("click", ".js-account-list .js-account-item", this.onSelectedAccountChanged);
|
||||||
}
|
}
|
@@ -13,13 +13,14 @@
|
|||||||
*
|
*
|
||||||
* Set value of 'defaultAccount' to one of the following values:
|
* Set value of 'defaultAccount' to one of the following values:
|
||||||
*
|
*
|
||||||
* "" to use your preferred TweetDeck account for all replies (default)
|
* "#preferred" to use your preferred TweetDeck account (the one used to log into TweetDeck)
|
||||||
|
* "#last" to specify the account that was selected last time (only updates if a single account is selected)
|
||||||
|
* "#default" to fall back to default TweetDeck behavior; useful for advanced configuration below, otherwise disable the plugin instead
|
||||||
* "@myAccount" to specify an account name to use; has to be one of your registered account names
|
* "@myAccount" to specify an account name to use; has to be one of your registered account names
|
||||||
* false to fall back to default TweetDeck behavior; useful for advanced configuration below, otherwise disable the plugin instead
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defaultAccount: "",
|
defaultAccount: "#preferred",
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Advanced way of configuring the plugin
|
* Advanced way of configuring the plugin
|
||||||
@@ -30,8 +31,8 @@
|
|||||||
* 1. Set value of 'useAdvancedSelector' to true
|
* 1. Set value of 'useAdvancedSelector' to true
|
||||||
* 2. Uncomment the 'customSelector' function, and replace the example code with your desired behavior
|
* 2. Uncomment the 'customSelector' function, and replace the example code with your desired behavior
|
||||||
*
|
*
|
||||||
* If 'customSelector' returns a string containing a full name of one of the registered accounts (including @), that account is used.
|
* The 'customSelector' function should return a string in one of the formats supported by 'defaultAccount'.
|
||||||
* If it returns anything else (for example false, undefined, or an account name that is not registered), it falls back to 'defaultAccount' behavior.
|
* If it returns anything else (for example, false or undefined), it falls back to 'defaultAccount' behavior.
|
||||||
*
|
*
|
||||||
* The 'column' parameter is a TweetDeck column object. If you want to see all properties of the object, open your browser, nagivate to TweetDeck,
|
* The 'column' parameter is a TweetDeck column object. If you want to see all properties of the object, open your browser, nagivate to TweetDeck,
|
||||||
* log in, and run the following code in your browser console, which will return an object containing all of the column objects mapped to their IDs:
|
* log in, and run the following code in your browser console, which will return an object containing all of the column objects mapped to their IDs:
|
||||||
|
18
Resources/Plugins/timeline-polls/.meta
Normal file
18
Resources/Plugins/timeline-polls/.meta
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
[name]
|
||||||
|
Polls in timelines
|
||||||
|
|
||||||
|
[description]
|
||||||
|
- Adds poll result display directly into timelines
|
||||||
|
- Experimental, may be buggy or break when TweetDeck updates
|
||||||
|
|
||||||
|
[author]
|
||||||
|
chylex
|
||||||
|
|
||||||
|
[version]
|
||||||
|
1.0
|
||||||
|
|
||||||
|
[website]
|
||||||
|
https://tweetduck.chylex.com
|
||||||
|
|
||||||
|
[requires]
|
||||||
|
1.4.1
|
30
Resources/Plugins/timeline-polls/browser.js
Normal file
30
Resources/Plugins/timeline-polls/browser.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
constructor(){
|
||||||
|
super({
|
||||||
|
requiresPageReload: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
enabled(){
|
||||||
|
// add a stylesheet
|
||||||
|
this.css = window.TDPF_createCustomStyle(this);
|
||||||
|
this.css.insert(".column-detail .timeline-poll-container { display: none }");
|
||||||
|
|
||||||
|
// setup layout injecting
|
||||||
|
this.prevMustaches = {};
|
||||||
|
|
||||||
|
var injectLayout = (mustache, onlyIfNotFound, search, replace) => {
|
||||||
|
if (TD.mustaches[mustache].indexOf(onlyIfNotFound) === -1){
|
||||||
|
this.prevMustaches[mustache] = TD.mustaches[mustache];
|
||||||
|
TD.mustaches[mustache] = TD.mustaches[mustache].replace(search, replace);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// add poll rendering to tweets
|
||||||
|
injectLayout("status/tweet_single.mustache", "status/poll", "{{/quotedTweetMissing}} {{#translation}}", "{{/quotedTweetMissing}} <div class='timeline-poll-container'>{{>duck/tweet_single/poll}}</div> {{#translation}}");
|
||||||
|
TD.mustaches["duck/tweet_single/poll.mustache"] = '<div class="js-poll margin-tl"> {{#poll}} <ul class="margin-b--12"> {{#choices}} <li class="position-rel margin-b--8 height-3"> <div class="poll-bar pin-top height-p--100 br-1 {{#isWinner}}poll-bar--winner{{/isWinner}} {{#hasTimeLeft}}br-left{{/hasTimeLeft}} width-p--{{percentage}}"/> <div class="poll-label position-rel padding-a--4"> <span class="txt-bold txt-right inline-block width-5 padding-r--4">{{percentage}}%</span> {{{label}}} {{#isSelectedChoice}} <i class="icon icon-check txt-size-variable--11"></i> {{/isSelectedChoice}} </div> </li> {{/choices}} </ul> <span class="inline-block txt-small padding-ls txt-seamful-deep-gray"> {{{prettyCount}}} · {{#hasTimeLeft}} {{{prettyTimeLeft}}} {{/hasTimeLeft}} {{^hasTimeLeft}} {{_i}}Final results{{/i}} {{/hasTimeLeft}} </span> {{/poll}} </div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
disabled(){
|
||||||
|
this.css.remove();
|
||||||
|
Object.keys(this.prevMustaches).forEach(mustache => TD.mustaches[mustache] = this.prevMustaches[mustache]);
|
||||||
|
}
|
@@ -378,13 +378,19 @@
|
|||||||
//
|
//
|
||||||
window.TDGF_onMouseClickExtra = function(button){
|
window.TDGF_onMouseClickExtra = function(button){
|
||||||
if (button === 1){ // back button
|
if (button === 1){ // back button
|
||||||
var modal = $("#open-modal");
|
var inlineComposer, drawerComposer, modal;
|
||||||
|
|
||||||
if (highlightedColumnEle && highlightedColumnEle.closest(".js-column").is(".is-shifted-1")){
|
if ((modal = $("#open-modal")).is(":visible")){
|
||||||
|
modal.find("a[rel=dismiss]").click();
|
||||||
|
}
|
||||||
|
else if ((inlineComposer = $(".js-inline-compose-close")).length === 1){
|
||||||
|
inlineComposer.click();
|
||||||
|
}
|
||||||
|
else if (highlightedColumnEle && highlightedColumnEle.closest(".js-column").is(".is-shifted-1")){
|
||||||
highlightedColumnEle.find(".js-column-back").first().click();
|
highlightedColumnEle.find(".js-column-back").first().click();
|
||||||
}
|
}
|
||||||
else if (modal.is(":visible")){
|
else if ((drawerComposer = $(".js-app-content.is-open .js-drawer-close:visible")).length === 1){
|
||||||
modal.find("a[rel=dismiss]").click();
|
drawerComposer.click();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$(".js-column-back").click();
|
$(".js-column-back").click();
|
||||||
|
@@ -117,6 +117,36 @@
|
|||||||
$TD.setNotificationTweetEmbedded(account[0].getAttribute("href")+"/status/"+tweetId);
|
$TD.setNotificationTweetEmbedded(account[0].getAttribute("href")+"/status/"+tweetId);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Block: Setup a skip button.
|
||||||
|
//
|
||||||
|
(function(){
|
||||||
|
if (document.body.hasAttribute("td-example-notification")){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.body.insertAdjacentHTML("afterbegin", [
|
||||||
|
'<svg id="td-skip" xmlns="http://www.w3.org/2000/svg" width="10" height="17" viewBox="0 0 350 600" style="position:fixed;left:30px;bottom:10px;z-index:1000">',
|
||||||
|
'<path fill="#888" d="M0,151.656l102.208-102.22l247.777,247.775L102.208,544.986L0,442.758l145.546-145.547">',
|
||||||
|
'</svg>'
|
||||||
|
].join(""));
|
||||||
|
|
||||||
|
document.getElementById("td-skip").addEventListener("click", function(){
|
||||||
|
$TD.loadNextNotification();
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Block: Setup a hover class on body.
|
||||||
|
//
|
||||||
|
document.body.addEventListener("mouseenter", function(){
|
||||||
|
document.body.classList.add("td-hover");
|
||||||
|
});
|
||||||
|
|
||||||
|
document.body.addEventListener("mouseleave", function(){
|
||||||
|
document.body.classList.remove("td-hover");
|
||||||
|
});
|
||||||
|
|
||||||
//
|
//
|
||||||
// Block: Page fully loaded.
|
// Block: Page fully loaded.
|
||||||
//
|
//
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
try{
|
try{
|
||||||
obj = eval("("+contents+")");
|
obj = eval("("+contents+")");
|
||||||
}catch(err){
|
}catch(err){
|
||||||
if (!(onFailure && onFailure(err.message))){
|
if (!(onFailure && onFailure(err))){
|
||||||
$TD.alert("warning", "Problem loading '"+fileName+"' file for '"+identifier+"' plugin, the JavaScript syntax is invalid: "+err.message);
|
$TD.alert("warning", "Problem loading '"+fileName+"' file for '"+identifier+"' plugin, the JavaScript syntax is invalid: "+err.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,4 +34,21 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// Block: Setup a function to add/remove custom CSS.
|
||||||
|
//
|
||||||
|
window.TDPF_createCustomStyle = function(pluginObject){
|
||||||
|
var element = document.createElement("style");
|
||||||
|
element.id = "plugin-"+pluginObject.$id+"-"+Math.random().toString(36).substring(2, 7);
|
||||||
|
document.head.appendChild(element);
|
||||||
|
|
||||||
|
var obj = {
|
||||||
|
insert: (rule) => element.sheet.insertRule(rule, 0),
|
||||||
|
remove: () => $(element).remove()
|
||||||
|
};
|
||||||
|
|
||||||
|
obj.element = element;
|
||||||
|
return obj;
|
||||||
|
};
|
||||||
})($TDP);
|
})($TDP);
|
@@ -1,5 +1,7 @@
|
|||||||
<?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">
|
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="packages\CefSharp.WinForms.53.0.0-pre01\build\CefSharp.WinForms.props" Condition="Exists('packages\CefSharp.WinForms.53.0.0-pre01\build\CefSharp.WinForms.props')" />
|
||||||
|
<Import Project="packages\CefSharp.Common.53.0.0-pre01\build\CefSharp.Common.props" Condition="Exists('packages\CefSharp.Common.53.0.0-pre01\build\CefSharp.Common.props')" />
|
||||||
<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.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')" />
|
<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')" />
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
@@ -11,12 +13,12 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>TweetDck</RootNamespace>
|
<RootNamespace>TweetDck</RootNamespace>
|
||||||
<AssemblyName Condition=" '$(Configuration)' == 'Debug' ">TweetDick</AssemblyName>
|
<AssemblyName Condition=" '$(Configuration)' == 'Debug' ">TweetDick</AssemblyName>
|
||||||
<AssemblyName Condition=" '$(Configuration)' == 'Release Dick' ">TweetDick</AssemblyName>
|
<AssemblyName Condition=" '$(Configuration)' == 'Release' ">TweetDuck</AssemblyName>
|
||||||
<AssemblyName Condition=" '$(Configuration)' == 'Release Duck' ">TweetDuck</AssemblyName>
|
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<NuGetPackageImportStamp>ff8ce4f3</NuGetPackageImportStamp>
|
<NuGetPackageImportStamp>e83161d1</NuGetPackageImportStamp>
|
||||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
<TargetFrameworkProfile>
|
||||||
|
</TargetFrameworkProfile>
|
||||||
<PublishUrl>publish\</PublishUrl>
|
<PublishUrl>publish\</PublishUrl>
|
||||||
<Install>true</Install>
|
<Install>true</Install>
|
||||||
<InstallFrom>Disk</InstallFrom>
|
<InstallFrom>Disk</InstallFrom>
|
||||||
@@ -41,24 +43,13 @@
|
|||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release Dick|x86' ">
|
|
||||||
<OutputPath>bin\x86\Release Dick\</OutputPath>
|
|
||||||
<DefineConstants>
|
|
||||||
</DefineConstants>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<DebugType>none</DebugType>
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
|
||||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
|
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release Duck|x86' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||||
<OutputPath>bin\x86\Release Duck\</OutputPath>
|
<OutputPath>bin\x86\Release\</OutputPath>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
@@ -66,7 +57,12 @@
|
|||||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<DefineConstants>DUCK</DefineConstants>
|
<DefineConstants>
|
||||||
|
</DefineConstants>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<AssemblyName>TweetDuck</AssemblyName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
@@ -99,6 +95,7 @@
|
|||||||
<Compile Include="Core\Controls\TabPanel.Designer.cs">
|
<Compile Include="Core\Controls\TabPanel.Designer.cs">
|
||||||
<DependentUpon>TabPanel.cs</DependentUpon>
|
<DependentUpon>TabPanel.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Core\Handling\BrowserProcessHandler.cs" />
|
||||||
<Compile Include="Core\Handling\ContextMenuBase.cs" />
|
<Compile Include="Core\Handling\ContextMenuBase.cs" />
|
||||||
<Compile Include="Core\Handling\ContextMenuBrowser.cs" />
|
<Compile Include="Core\Handling\ContextMenuBrowser.cs" />
|
||||||
<Compile Include="Core\FormBrowser.cs">
|
<Compile Include="Core\FormBrowser.cs">
|
||||||
@@ -123,6 +120,12 @@
|
|||||||
<Compile Include="Core\Other\FormAbout.Designer.cs">
|
<Compile Include="Core\Other\FormAbout.Designer.cs">
|
||||||
<DependentUpon>FormAbout.cs</DependentUpon>
|
<DependentUpon>FormAbout.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Core\Other\FormMessage.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Core\Other\FormMessage.Designer.cs">
|
||||||
|
<DependentUpon>FormMessage.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Core\Other\FormPlugins.cs">
|
<Compile Include="Core\Other\FormPlugins.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -173,8 +176,10 @@
|
|||||||
<Compile Include="Core\Other\Settings\TabSettingsUpdates.Designer.cs">
|
<Compile Include="Core\Other\Settings\TabSettingsUpdates.Designer.cs">
|
||||||
<DependentUpon>TabSettingsUpdates.cs</DependentUpon>
|
<DependentUpon>TabSettingsUpdates.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Core\Utils\CommandLineArgs.cs" />
|
||||||
<Compile Include="Core\Utils\CommandLineArgsParser.cs" />
|
<Compile Include="Core\Utils\CommandLineArgsParser.cs" />
|
||||||
<Compile Include="Core\Utils\WindowState.cs" />
|
<Compile Include="Core\Utils\WindowState.cs" />
|
||||||
|
<Compile Include="Core\Utils\WindowsUtils.cs" />
|
||||||
<Compile Include="Migration\FormBackgroundWork.cs">
|
<Compile Include="Migration\FormBackgroundWork.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -188,6 +193,7 @@
|
|||||||
<Compile Include="Core\Other\FormSettings.Designer.cs">
|
<Compile Include="Core\Other\FormSettings.Designer.cs">
|
||||||
<DependentUpon>FormSettings.cs</DependentUpon>
|
<DependentUpon>FormSettings.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Migration\MigrationUtils.cs" />
|
||||||
<Compile Include="Plugins\Controls\PluginControl.cs">
|
<Compile Include="Plugins\Controls\PluginControl.cs">
|
||||||
<SubType>UserControl</SubType>
|
<SubType>UserControl</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -209,6 +215,7 @@
|
|||||||
<Compile Include="Plugins\Events\PluginLoadEventArgs.cs" />
|
<Compile Include="Plugins\Events\PluginLoadEventArgs.cs" />
|
||||||
<Compile Include="Plugins\PluginManager.cs" />
|
<Compile Include="Plugins\PluginManager.cs" />
|
||||||
<Compile Include="Plugins\PluginScriptGenerator.cs" />
|
<Compile Include="Plugins\PluginScriptGenerator.cs" />
|
||||||
|
<Compile Include="Reporter.cs" />
|
||||||
<Compile Include="Updates\FormUpdateDownload.cs">
|
<Compile Include="Updates\FormUpdateDownload.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -229,15 +236,8 @@
|
|||||||
<Compile Include="Updates\UpdateCheckEventArgs.cs" />
|
<Compile Include="Updates\UpdateCheckEventArgs.cs" />
|
||||||
<Compile Include="Updates\UpdateHandler.cs" />
|
<Compile Include="Updates\UpdateHandler.cs" />
|
||||||
<Compile Include="Updates\UpdateInfo.cs" />
|
<Compile Include="Updates\UpdateInfo.cs" />
|
||||||
<Compile Include="Migration\FormMigrationQuestion.cs">
|
|
||||||
<SubType>Form</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Migration\FormMigrationQuestion.Designer.cs">
|
|
||||||
<DependentUpon>FormMigrationQuestion.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Migration\MigrationDecision.cs" />
|
<Compile Include="Migration\MigrationDecision.cs" />
|
||||||
<Compile Include="Migration\MigrationManager.cs" />
|
<Compile Include="Migration\MigrationManager.cs" />
|
||||||
<Compile Include="Migration\Helpers\ProgramRegistrySearch.cs" />
|
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
@@ -312,15 +312,13 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('packages\cef.redist.x86.3.2623.1396\build\cef.redist.x86.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x86.3.2623.1396\build\cef.redist.x86.targets'))" />
|
<Error Condition="!Exists('packages\cef.redist.x86.3.2785.1478\build\cef.redist.x86.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x86.3.2785.1478\build\cef.redist.x86.targets'))" />
|
||||||
<Error Condition="!Exists('packages\cef.redist.x64.3.2623.1396\build\cef.redist.x64.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x64.3.2623.1396\build\cef.redist.x64.targets'))" />
|
<Error Condition="!Exists('packages\cef.redist.x64.3.2785.1478\build\cef.redist.x64.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x64.3.2785.1478\build\cef.redist.x64.targets'))" />
|
||||||
<Error Condition="!Exists('packages\CefSharp.Common.49.0.0-pre02\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.49.0.0-pre02\build\CefSharp.Common.props'))" />
|
<Error Condition="!Exists('packages\CefSharp.Common.53.0.0-pre01\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.53.0.0-pre01\build\CefSharp.Common.props'))" />
|
||||||
<Error Condition="!Exists('packages\CefSharp.Common.49.0.0-pre02\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.49.0.0-pre02\build\CefSharp.Common.targets'))" />
|
<Error Condition="!Exists('packages\CefSharp.Common.53.0.0-pre01\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.53.0.0-pre01\build\CefSharp.Common.targets'))" />
|
||||||
<Error Condition="!Exists('packages\CefSharp.WinForms.49.0.0-pre02\build\CefSharp.WinForms.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.WinForms.49.0.0-pre02\build\CefSharp.WinForms.props'))" />
|
<Error Condition="!Exists('packages\CefSharp.WinForms.53.0.0-pre01\build\CefSharp.WinForms.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.WinForms.53.0.0-pre01\build\CefSharp.WinForms.props'))" />
|
||||||
|
<Error Condition="!Exists('packages\CefSharp.WinForms.53.0.0-pre01\build\CefSharp.WinForms.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.WinForms.53.0.0-pre01\build\CefSharp.WinForms.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
<Import Project="packages\cef.redist.x86.3.2623.1396\build\cef.redist.x86.targets" Condition="Exists('packages\cef.redist.x86.3.2623.1396\build\cef.redist.x86.targets')" />
|
|
||||||
<Import Project="packages\cef.redist.x64.3.2623.1396\build\cef.redist.x64.targets" Condition="Exists('packages\cef.redist.x64.3.2623.1396\build\cef.redist.x64.targets')" />
|
|
||||||
<Import Project="packages\CefSharp.Common.49.0.0-pre02\build\CefSharp.Common.targets" Condition="Exists('packages\CefSharp.Common.49.0.0-pre02\build\CefSharp.Common.targets')" />
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>del "$(TargetPath).config"
|
<PostBuildEvent>del "$(TargetPath).config"
|
||||||
xcopy "$(ProjectDir)LICENSE.md" "$(TargetDir)" /Y
|
xcopy "$(ProjectDir)LICENSE.md" "$(TargetDir)" /Y
|
||||||
@@ -340,6 +338,10 @@ xcopy "$(ProjectDir)Resources\Plugins\*" "$(TargetDir)plugins\official\" /E /Y
|
|||||||
rmdir "$(ProjectDir)\bin\Debug"
|
rmdir "$(ProjectDir)\bin\Debug"
|
||||||
rmdir "$(ProjectDir)\bin\Release"</PostBuildEvent>
|
rmdir "$(ProjectDir)\bin\Release"</PostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<Import Project="packages\cef.redist.x86.3.2785.1478\build\cef.redist.x86.targets" Condition="Exists('packages\cef.redist.x86.3.2785.1478\build\cef.redist.x86.targets')" />
|
||||||
|
<Import Project="packages\cef.redist.x64.3.2785.1478\build\cef.redist.x64.targets" Condition="Exists('packages\cef.redist.x64.3.2785.1478\build\cef.redist.x64.targets')" />
|
||||||
|
<Import Project="packages\CefSharp.Common.53.0.0-pre01\build\CefSharp.Common.targets" Condition="Exists('packages\CefSharp.Common.53.0.0-pre01\build\CefSharp.Common.targets')" />
|
||||||
|
<Import Project="packages\CefSharp.WinForms.53.0.0-pre01\build\CefSharp.WinForms.targets" Condition="Exists('packages\CefSharp.WinForms.53.0.0-pre01\build\CefSharp.WinForms.targets')" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
<Target Name="BeforeBuild">
|
<Target Name="BeforeBuild">
|
||||||
|
11
TweetDck.sln
11
TweetDck.sln
@@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 2013
|
# Visual Studio 2013
|
||||||
VisualStudioVersion = 12.0.40629.0
|
VisualStudioVersion = 12.0.40629.0
|
||||||
@@ -8,17 +8,14 @@ EndProject
|
|||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|x86 = Debug|x86
|
Debug|x86 = Debug|x86
|
||||||
Release Dick|x86 = Release Dick|x86
|
Release|x86 = Release|x86
|
||||||
Release Duck|x86 = Release Duck|x86
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{2389A7CD-E0D3-4706-8294-092929A33A2D}.Debug|x86.ActiveCfg = Debug|x86
|
{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.Build.0 = Debug|x86
|
||||||
{2389A7CD-E0D3-4706-8294-092929A33A2D}.Debug|x86.Deploy.0 = Debug|x86
|
{2389A7CD-E0D3-4706-8294-092929A33A2D}.Debug|x86.Deploy.0 = Debug|x86
|
||||||
{2389A7CD-E0D3-4706-8294-092929A33A2D}.Release Dick|x86.ActiveCfg = Release Dick|x86
|
{2389A7CD-E0D3-4706-8294-092929A33A2D}.Release|x86.ActiveCfg = Release|x86
|
||||||
{2389A7CD-E0D3-4706-8294-092929A33A2D}.Release Dick|x86.Build.0 = Release Dick|x86
|
{2389A7CD-E0D3-4706-8294-092929A33A2D}.Release|x86.Build.0 = Release|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
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@@ -90,7 +90,7 @@ namespace TweetDck.Updates{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (e.Error != null){
|
else if (e.Error != null){
|
||||||
Program.Log(e.Error.ToString());
|
Program.Reporter.Log(e.Error.ToString());
|
||||||
|
|
||||||
if (MessageBox.Show("Could not download the update: "+e.Error.Message+"\r\n\r\nDo you want to open the website and try downloading the update manually?", "Update Has Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1) == DialogResult.Yes){
|
if (MessageBox.Show("Could not download the update: "+e.Error.Message+"\r\n\r\nDo you want to open the website and try downloading the update manually?", "Update Has Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1) == DialogResult.Yes){
|
||||||
BrowserUtils.OpenExternalBrowser(Program.Website);
|
BrowserUtils.OpenExternalBrowser(Program.Website);
|
||||||
|
@@ -1,9 +1,6 @@
|
|||||||
del "bin\x86\Release Dick\*.xml"
|
del "bin\x86\Release\*.xml"
|
||||||
del "bin\x86\Release Dick\devtools_resources.pak"
|
del "bin\x86\Release\devtools_resources.pak"
|
||||||
del "bin\x86\Release Duck\*.xml"
|
del "bin\x86\Release\d3dcompiler_43.dll"
|
||||||
del "bin\x86\Release Duck\devtools_resources.pak"
|
|
||||||
|
|
||||||
del "bin\x86\Release Dick\TweetDick.Browser.exe"
|
del "bin\x86\Release\TweetDuck.Browser.exe"
|
||||||
ren "bin\x86\Release Dick\CefSharp.BrowserSubprocess.exe" "TweetDick.Browser.exe"
|
ren "bin\x86\Release\CefSharp.BrowserSubprocess.exe" "TweetDuck.Browser.exe"
|
||||||
del "bin\x86\Release Duck\TweetDuck.Browser.exe"
|
|
||||||
ren "bin\x86\Release Duck\CefSharp.BrowserSubprocess.exe" "TweetDuck.Browser.exe"
|
|
Reference in New Issue
Block a user