1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-09-14 19:32:10 +02:00

Compare commits

..

36 Commits
1.2.1 ... 1.2.3

Author SHA1 Message Date
5eb64829a5 Release 1.2.3 2016-05-28 13:43:11 +02:00
5648e9e806 Add 'Copy quoted tweet address' to context menu
Closes #29
2016-05-27 14:30:11 +02:00
2a65e20fb9 Rewrite update handling and add an update check button to Settings 2016-05-26 14:13:30 +02:00
1162e9b655 Reorganize layout elements in Settings Form for easier modifications 2016-05-25 18:49:11 +02:00
b8a5c2fb9b Add a delay to link expansion and fix tooltip issues 2016-05-25 18:34:59 +02:00
eccd37a3eb Fix clicking on tweet links both opening browser and showing the tweet in app 2016-05-25 18:21:49 +02:00
ee282713f8 Fix program not closing when updating if 'Close to tray' is enabled
Closes #34
2016-05-22 15:12:45 +02:00
c5edad9c4b Add a button to clear cache to the Settings Form 2016-05-14 15:18:57 +02:00
293c01b12f Rewrite exit procedure to only run once and refactor 2016-05-13 16:25:22 +02:00
162bbc3221 Add option to disable HTML5 hardware acceleration
Closes #30
2016-05-13 14:01:11 +02:00
9f27020993 Release 1.2.2 2016-05-12 21:09:55 +02:00
c540cf45ca Push unsaved change that was supposed to be in previous commit 2016-05-12 18:21:04 +02:00
8bf4789646 Make updates search for .Update.exe file to allow for smaller and faster updates 2016-05-12 16:58:17 +02:00
fd97c20d37 Add second tray icon for unread tweets when notifications are muted
Closes #7
2016-05-12 15:46:39 +02:00
7238e17b86 Add link expanding and tooltip support to popup notifications 2016-05-12 15:10:22 +02:00
4c44da7f4a Refactor and optimize event handling in notification.js 2016-05-12 14:25:00 +02:00
af7657e3f8 Add EventTarget.addBubbledEventListener to notification.js for convenience 2016-05-11 17:54:07 +02:00
bea158b0d9 Fix example notification not running notification.js script (breaking links) 2016-05-11 17:40:41 +02:00
40acb49011 Add scrollbar to large popup notifications and display quoted tweets in the notification
Closes #9
2016-05-11 16:59:06 +02:00
cc7fc7e994 Resize notification Form based on font size 2016-05-10 18:21:56 +02:00
ddec715dda Add support for back/forward mouse buttons 2016-05-10 13:31:18 +02:00
a1365a98c0 Pause notification timer when context menu is open, and optimize Settings notification tick 2016-05-09 20:14:23 +02:00
9a29d4ff18 Add context menu item to copy tweet address without focusing date link
Closes #24
2016-05-09 20:00:36 +02:00
39816eae76 Fix case in 'Mute notifications' context menu item 2016-05-09 18:13:01 +02:00
45a38d9570 Add tooltip for collapsed links when expanding is disabled
Closes #25
2016-05-09 14:44:04 +02:00
a230258bec Remove FormBrowser.InvokeSafe and use extension method instead 2016-05-09 13:32:20 +02:00
8543205b85 Remove 'Copy' option from TweetDeck Migration and update lnk description 2016-05-08 21:45:57 +02:00
1d169005da Hide default icon in Forms that do not have custom one properly 2016-05-08 20:57:53 +02:00
f5212d88f3 Redesign the About screen 2016-05-08 20:53:08 +02:00
03a93ad3f3 Move native methods to a NativeMethods class 2016-05-08 18:33:42 +02:00
3a66fa28ab Do minor code refactoring 2016-05-08 14:59:01 +02:00
5f79b286f1 Fix t.co bypass not working in popup notifications 2016-05-08 14:48:11 +02:00
f6a4e39cfc Add 'Skip tweet' and 'Freeze' context menu options to notifications 2016-05-08 14:24:53 +02:00
24d8444043 Tweak context menu (fix and add separators) 2016-05-08 13:08:56 +02:00
0b8205dc41 Fix simultaneous popup notification order
Closes #26
2016-05-08 12:47:36 +02:00
98197d1e86 Fix right-aligned actions menu in Direct Messages
Closes #27
2016-05-08 12:16:41 +02:00
47 changed files with 1561 additions and 348 deletions

View File

@@ -60,8 +60,6 @@ namespace TweetDck.Configuration{
if (foundProcess.ProcessName == currentProcess.ProcessName){ if (foundProcess.ProcessName == currentProcess.ProcessName){
lockingProcess = foundProcess; lockingProcess = foundProcess;
} }
currentProcess.Close();
} }
}catch(ArgumentException){} }catch(ArgumentException){}
@@ -82,13 +80,23 @@ namespace TweetDck.Configuration{
return false; return false;
} }
public void Unlock(){ public bool Unlock(){
bool result = true;
if (lockStream != null){ if (lockStream != null){
lockStream.Dispose(); lockStream.Dispose();
try{
File.Delete(file); File.Delete(file);
}catch(Exception e){
Program.Log(e.ToString());
result = false;
}
lockStream = null; lockStream = null;
} }
return result;
} }
public bool CloseLockingProcess(int timeout){ public bool CloseLockingProcess(int timeout){

View File

@@ -9,7 +9,7 @@ using TweetDck.Core.Handling;
namespace TweetDck.Configuration{ namespace TweetDck.Configuration{
[Serializable] [Serializable]
sealed class UserConfig{ sealed class UserConfig{
private static readonly IFormatter Formatter = new BinaryFormatter(){ private static readonly IFormatter Formatter = new BinaryFormatter{
Binder = new SerializationCompatibilityHandler() Binder = new SerializationCompatibilityHandler()
}; };

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDck.Core.Utils;
namespace TweetDck.Core.Controls{ namespace TweetDck.Core.Controls{
public partial class RichTextLabel : RichTextBox{ public partial class RichTextLabel : RichTextBox{
@@ -27,7 +28,7 @@ namespace TweetDck.Core.Controls{
get{ get{
CreateParams createParams = base.CreateParams; CreateParams createParams = base.CreateParams;
if (Program.LoadLibrary("msftedit.dll") != IntPtr.Zero){ if (NativeMethods.LoadLibrary("msftedit.dll") != IntPtr.Zero){
createParams.ClassName = "RICHEDIT50W"; createParams.ClassName = "RICHEDIT50W";
} }

View File

@@ -23,8 +23,10 @@
/// the contents of this method with the code editor. /// the contents of this method with the code editor.
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormBrowser)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormBrowser));
this.trayIcon = new TweetDck.Core.TrayIcon(); this.trayIcon = new TweetDck.Core.TrayIcon();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.SuspendLayout(); this.SuspendLayout();
// //
// trayIcon // trayIcon
@@ -51,6 +53,7 @@
#endregion #endregion
private TrayIcon trayIcon; private TrayIcon trayIcon;
private System.Windows.Forms.ToolTip toolTip;
} }
} }

View File

@@ -7,8 +7,9 @@ using TweetDck.Configuration;
using TweetDck.Core.Handling; using TweetDck.Core.Handling;
using TweetDck.Core.Other; using TweetDck.Core.Other;
using TweetDck.Resources; using TweetDck.Resources;
using TweetDck.Core.Utils;
using TweetDck.Core.Controls; using TweetDck.Core.Controls;
using System.Drawing;
using TweetDck.Updates;
namespace TweetDck.Core{ namespace TweetDck.Core{
sealed partial class FormBrowser : Form{ sealed partial class FormBrowser : Form{
@@ -23,6 +24,7 @@ namespace TweetDck.Core{
private readonly ChromiumWebBrowser browser; private readonly ChromiumWebBrowser browser;
private readonly TweetDeckBridge bridge; private readonly TweetDeckBridge bridge;
private readonly FormNotification notification; private readonly FormNotification notification;
private readonly UpdateHandler updates;
private FormSettings currentFormSettings; private FormSettings currentFormSettings;
private FormAbout currentFormAbout; private FormAbout currentFormAbout;
@@ -56,8 +58,12 @@ namespace TweetDck.Core{
UpdateTrayIcon(); UpdateTrayIcon();
notification = new FormNotification(this,bridge,true){ CanMoveWindow = () => false }; notification = CreateNotificationForm(true);
notification.CanMoveWindow = () => false;
notification.Show(); notification.Show();
updates = new UpdateHandler(browser,this);
updates.UpdateAccepted += updates_UpdateAccepted;
} }
private void ShowChildForm(Form form){ private void ShowChildForm(Form form){
@@ -65,6 +71,15 @@ namespace TweetDck.Core{
form.MoveToCenter(this); form.MoveToCenter(this);
} }
private void ForceClose(){
trayIcon.Visible = false; // checked in FormClosing event
Close();
}
public FormNotification CreateNotificationForm(bool autoHide){
return new FormNotification(this,bridge,trayIcon,autoHide);
}
// window setup // window setup
private void SetupWindow(){ private void SetupWindow(){
@@ -99,7 +114,7 @@ namespace TweetDck.Core{
private void Browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e){ private void Browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e){
if (e.Frame.IsMain){ if (e.Frame.IsMain){
foreach(string js in ScriptLoader.LoadResources("code.js","update.js").Where(js => js != null)){ foreach(string js in ScriptLoader.LoadResources("code.js").Where(js => js != null)){
browser.ExecuteScriptAsync(js); browser.ExecuteScriptAsync(js);
} }
} }
@@ -165,16 +180,39 @@ namespace TweetDck.Core{
private void trayIcon_ClickClose(object sender, EventArgs e){ private void trayIcon_ClickClose(object sender, EventArgs e){
if (!isLoaded)return; if (!isLoaded)return;
trayIcon.Visible = false; // checked in FormClosing event ForceClose();
Close(); }
private void updates_UpdateAccepted(object sender, UpdateAcceptedEventArgs e){
Hide();
FormUpdateDownload downloadForm = new FormUpdateDownload(e.UpdateInfo);
downloadForm.MoveToCenter(this);
downloadForm.ShowDialog();
if (downloadForm.UpdateStatus == FormUpdateDownload.Status.Succeeded){
UpdateInstallerPath = downloadForm.InstallerPath;
ForceClose();
}
else if (downloadForm.UpdateStatus == FormUpdateDownload.Status.Manual){
ForceClose();
}
else{
Show();
}
}
protected override void WndProc(ref Message m){
if (isLoaded && m.Msg == 0x210 && (m.WParam.ToInt32() & 0xFFFF) == 0x020B){ // WM_PARENTNOTIFY, WM_XBUTTONDOWN
browser.ExecuteScriptAsync("TDGF_onMouseClickExtra",(m.WParam.ToInt32() >> 16) & 0xFFFF);
return;
}
base.WndProc(ref m);
} }
// callback handlers // callback handlers
public void InvokeSafe(Action func){
ControlExtensions.InvokeSafe(this,func);
}
public void OpenSettings(){ public void OpenSettings(){
if (currentFormSettings != null){ if (currentFormSettings != null){
currentFormSettings.BringToFront(); currentFormSettings.BringToFront();
@@ -182,7 +220,7 @@ namespace TweetDck.Core{
else{ else{
bool prevEnableUpdateCheck = Config.EnableUpdateCheck; bool prevEnableUpdateCheck = Config.EnableUpdateCheck;
currentFormSettings = new FormSettings(this); currentFormSettings = new FormSettings(this,updates);
currentFormSettings.FormClosed += (sender, args) => { currentFormSettings.FormClosed += (sender, args) => {
currentFormSettings = null; currentFormSettings = null;
@@ -190,8 +228,7 @@ namespace TweetDck.Core{
if (!prevEnableUpdateCheck && Config.EnableUpdateCheck){ if (!prevEnableUpdateCheck && Config.EnableUpdateCheck){
Config.DismissedUpdate = string.Empty; Config.DismissedUpdate = string.Empty;
Config.Save(); Config.Save();
updates.Check(false);
browser.ExecuteScriptAsync("TDGF_runUpdateCheck",new object[0]);
} }
}; };
@@ -218,6 +255,22 @@ namespace TweetDck.Core{
} }
public void DisplayTooltip(string text, bool showInNotification){
if (showInNotification){
notification.DisplayTooltip(text);
return;
}
if (string.IsNullOrEmpty(text)){
toolTip.Hide(this);
}
else{
Point position = PointToClient(Cursor.Position);
position.Offset(20,10);
toolTip.Show(text,this,position);
}
}
public void OnImagePasted(){ public void OnImagePasted(){
browser.ExecuteScriptAsync("TDGF_tryPasteImage",new object[0]); browser.ExecuteScriptAsync("TDGF_tryPasteImage",new object[0]);
} }
@@ -225,24 +278,5 @@ namespace TweetDck.Core{
public void OnImagePastedFinish(){ public void OnImagePastedFinish(){
browser.ExecuteScriptAsync("TDGF_tryPasteImageFinish",new object[0]); browser.ExecuteScriptAsync("TDGF_tryPasteImageFinish",new object[0]);
} }
public void BeginUpdateProcess(string versionTag, string downloadUrl){
Hide();
FormUpdateDownload downloadForm = new FormUpdateDownload(new UpdateInfo(versionTag,downloadUrl));
downloadForm.MoveToCenter(this);
downloadForm.ShowDialog();
if (downloadForm.UpdateStatus == FormUpdateDownload.Status.Succeeded){
UpdateInstallerPath = downloadForm.InstallerPath;
Close();
}
else if (downloadForm.UpdateStatus == FormUpdateDownload.Status.Manual){
Close();
}
else{
Show();
}
}
} }
} }

View File

@@ -120,6 +120,9 @@
<metadata name="trayIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="trayIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>112, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>

View File

@@ -29,11 +29,13 @@ namespace TweetDck.Core {
this.panelBrowser = new System.Windows.Forms.Panel(); this.panelBrowser = new System.Windows.Forms.Panel();
this.timerProgress = new System.Windows.Forms.Timer(this.components); this.timerProgress = new System.Windows.Forms.Timer(this.components);
this.progressBarTimer = new TweetDck.Core.Controls.FlatProgressBar(); this.progressBarTimer = new TweetDck.Core.Controls.FlatProgressBar();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.SuspendLayout(); this.SuspendLayout();
// //
// panelBrowser // panelBrowser
// //
this.panelBrowser.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.panelBrowser.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))); | System.Windows.Forms.AnchorStyles.Right)));
this.panelBrowser.BackColor = System.Drawing.Color.White; this.panelBrowser.BackColor = System.Drawing.Color.White;
this.panelBrowser.Location = new System.Drawing.Point(0, 0); this.panelBrowser.Location = new System.Drawing.Point(0, 0);
@@ -49,6 +51,8 @@ namespace TweetDck.Core {
// //
// progressBarTimer // progressBarTimer
// //
this.progressBarTimer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.progressBarTimer.BackColor = System.Drawing.SystemColors.Control; this.progressBarTimer.BackColor = System.Drawing.SystemColors.Control;
this.progressBarTimer.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(99)))), ((int)(((byte)(153))))); this.progressBarTimer.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(99)))), ((int)(((byte)(153)))));
this.progressBarTimer.Location = new System.Drawing.Point(0, 118); this.progressBarTimer.Location = new System.Drawing.Point(0, 118);
@@ -71,6 +75,7 @@ namespace TweetDck.Core {
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "FormNotification"; this.Name = "FormNotification";
this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormNotification_FormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormNotification_FormClosing);
@@ -83,5 +88,6 @@ namespace TweetDck.Core {
private System.Windows.Forms.Panel panelBrowser; private System.Windows.Forms.Panel panelBrowser;
private Controls.FlatProgressBar progressBarTimer; private Controls.FlatProgressBar progressBarTimer;
private System.Windows.Forms.Timer timerProgress; private System.Windows.Forms.Timer timerProgress;
private System.Windows.Forms.ToolTip toolTip;
} }
} }

View File

@@ -7,12 +7,14 @@ using CefSharp.WinForms;
using TweetDck.Configuration; using TweetDck.Configuration;
using TweetDck.Core.Handling; using TweetDck.Core.Handling;
using TweetDck.Resources; using TweetDck.Resources;
using TweetDck.Core.Utils;
namespace TweetDck.Core{ namespace TweetDck.Core{
sealed partial class FormNotification : Form{ sealed partial class FormNotification : Form{
public Func<bool> CanMoveWindow = () => true; public Func<bool> CanMoveWindow = () => true;
private readonly Form owner; private readonly Form owner;
private readonly TrayIcon trayIcon;
private readonly ChromiumWebBrowser browser; private readonly ChromiumWebBrowser browser;
private readonly Queue<TweetNotification> tweetQueue = new Queue<TweetNotification>(4); private readonly Queue<TweetNotification> tweetQueue = new Queue<TweetNotification>(4);
@@ -27,24 +29,40 @@ namespace TweetDck.Core{
} }
} }
public FormNotification(Form owner, TweetDeckBridge bridge, bool autoHide){ public bool FreezeTimer { get; set; }
public bool ContextMenuOpen { get; set; }
public string CurrentUrl { get; private set; }
private static int BaseClientWidth{
get{
int level = TweetNotification.FontSizeLevel;
return level == 0 ? 284 : (int)Math.Round(284.0*(1.0+0.05*level));
}
}
private static int BaseClientHeight{
get{
int level = TweetNotification.FontSizeLevel;
return level == 0 ? 118 : (int)Math.Round(118.0*(1.0+0.075*level));
}
}
public FormNotification(Form owner, TweetDeckBridge bridge, TrayIcon trayIcon, bool autoHide){
InitializeComponent(); InitializeComponent();
Text = Program.BrandName; Text = Program.BrandName;
this.owner = owner; this.owner = owner;
this.trayIcon = trayIcon;
this.autoHide = autoHide; this.autoHide = autoHide;
owner.FormClosed += (sender, args) => Close(); owner.FormClosed += (sender, args) => Close();
notificationJS = ScriptLoader.LoadResource("notification.js"); notificationJS = ScriptLoader.LoadResource("notification.js");
browser = new ChromiumWebBrowser("about:blank"){ MenuHandler = new ContextMenuNotification() }; browser = new ChromiumWebBrowser("about:blank"){ MenuHandler = new ContextMenuNotification(this,autoHide) };
browser.FrameLoadEnd += Browser_FrameLoadEnd; browser.FrameLoadEnd += Browser_FrameLoadEnd;
if (bridge != null){
browser.RegisterJsObject("$TD",bridge); browser.RegisterJsObject("$TD",bridge);
}
panelBrowser.Controls.Add(browser); panelBrowser.Controls.Add(browser);
@@ -56,8 +74,6 @@ namespace TweetDck.Core{
Disposed += (sender, args) => browser.Dispose(); Disposed += (sender, args) => browser.Dispose();
} }
public FormNotification(Form owner, bool autoHide) : this(owner,null,autoHide){}
protected override void WndProc(ref Message m){ protected override void WndProc(ref Message m){
if (m.Msg == 0x0112 && (m.WParam.ToInt32() & 0xFFF0) == 0xF010 && !CanMoveWindow()){ // WM_SYSCOMMAND, SC_MOVE if (m.Msg == 0x0112 && (m.WParam.ToInt32() & 0xFFF0) == 0xF010 && !CanMoveWindow()){ // WM_SYSCOMMAND, SC_MOVE
return; return;
@@ -69,18 +85,13 @@ namespace TweetDck.Core{
// event handlers // event handlers
private void timerHideProgress_Tick(object sender, EventArgs e){ private void timerHideProgress_Tick(object sender, EventArgs e){
if (Bounds.Contains(Cursor.Position))return; if (Bounds.Contains(Cursor.Position) || FreezeTimer || ContextMenuOpen)return;
timeLeft -= timerProgress.Interval; timeLeft -= timerProgress.Interval;
progressBarTimer.SetValueInstant((int)Math.Min(1000,Math.Round(1050.0*(totalTime-timeLeft)/totalTime))); progressBarTimer.SetValueInstant((int)Math.Min(1000,Math.Round(1050.0*(totalTime-timeLeft)/totalTime)));
if (timeLeft <= 0){ if (timeLeft <= 0){
if (tweetQueue.Count > 0){ FinishCurrentTweet();
LoadNextNotification();
}
else if (autoHide){
HideNotification();
}
} }
} }
@@ -93,6 +104,8 @@ namespace TweetDck.Core{
MoveToVisibleLocation(); MoveToVisibleLocation();
LoadNextNotification(); LoadNextNotification();
} }
trayIcon.HasNotifications = false;
} }
} }
@@ -115,6 +128,7 @@ namespace TweetDck.Core{
public void ShowNotification(TweetNotification notification){ public void ShowNotification(TweetNotification notification){
if (Program.UserConfig.MuteNotifications){ if (Program.UserConfig.MuteNotifications){
tweetQueue.Enqueue(notification); tweetQueue.Enqueue(notification);
trayIcon.HasNotifications = true;
} }
else{ else{
MoveToVisibleLocation(); MoveToVisibleLocation();
@@ -135,9 +149,7 @@ namespace TweetDck.Core{
} }
if (reset){ if (reset){
browser.LoadHtml(TweetNotification.ExampleTweet.GenerateHtml(),"http://tweetdeck.twitter.com/"); LoadTweet(TweetNotification.ExampleTweet);
totalTime = timeLeft = TweetNotification.ExampleTweet.GetDisplayDuration(Program.UserConfig.NotificationDuration);
timerProgress.Start(); timerProgress.Start();
} }
@@ -147,9 +159,22 @@ namespace TweetDck.Core{
public void HideNotification(){ public void HideNotification(){
browser.LoadHtml("","about:blank"); browser.LoadHtml("","about:blank");
Location = new Point(-32000,-32000); Location = new Point(-32000,-32000);
progressBarTimer.Value = 0;
timerProgress.Stop(); timerProgress.Stop();
} }
public void FinishCurrentTweet(){
if (tweetQueue.Count > 0){
LoadNextNotification();
}
else if (autoHide){
HideNotification();
}
else{
timerProgress.Stop();
}
}
private void LoadNextNotification(){ private void LoadNextNotification(){
TweetNotification tweet = tweetQueue.Dequeue(); TweetNotification tweet = tweetQueue.Dequeue();
@@ -157,15 +182,22 @@ namespace TweetDck.Core{
browser.Load("about:blank"); // required, otherwise shit breaks browser.Load("about:blank"); // required, otherwise shit breaks
} }
browser.LoadHtml(tweet.GenerateHtml(),"http://tweetdeck.twitter.com/"); LoadTweet(tweet);
totalTime = timeLeft = tweet.GetDisplayDuration(Program.UserConfig.NotificationDuration);
timerProgress.Stop(); timerProgress.Stop();
timerProgress.Start(); timerProgress.Start();
UpdateTitle(); UpdateTitle();
} }
private void LoadTweet(TweetNotification tweet){
browser.LoadHtml(tweet.GenerateHtml(),"http://tweetdeck.twitter.com/");
totalTime = timeLeft = tweet.GetDisplayDuration(Program.UserConfig.NotificationDuration);
progressBarTimer.Value = 0;
CurrentUrl = tweet.Url;
}
private void MoveToVisibleLocation(){ private void MoveToVisibleLocation(){
bool needsReactivating = Location.X == -32000; bool needsReactivating = Location.X == -32000;
@@ -173,11 +205,11 @@ namespace TweetDck.Core{
Screen screen = Screen.FromControl(owner); Screen screen = Screen.FromControl(owner);
if (config.DisplayNotificationTimer){ if (config.DisplayNotificationTimer){
ClientSize = new Size(ClientSize.Width,122); ClientSize = new Size(BaseClientWidth,BaseClientHeight+4);
progressBarTimer.Visible = true; progressBarTimer.Visible = true;
} }
else{ else{
ClientSize = new Size(ClientSize.Width,118); ClientSize = new Size(BaseClientWidth,BaseClientHeight);
progressBarTimer.Visible = false; progressBarTimer.Visible = false;
} }
@@ -215,12 +247,23 @@ namespace TweetDck.Core{
} }
if (needsReactivating){ if (needsReactivating){
Program.SetWindowPos(Handle.ToInt32(),-1,Left,Top,Width,Height,0x0010); // HWND_TOPMOST, SWP_NOACTIVATE NativeMethods.SetFormPos(this,NativeMethods.HWND_TOPMOST,NativeMethods.SWP_NOACTIVATE);
} }
} }
private void UpdateTitle(){ private void UpdateTitle(){
Text = tweetQueue.Count > 0 ? Program.BrandName+" ("+tweetQueue.Count+" more left)" : Program.BrandName; Text = tweetQueue.Count > 0 ? Program.BrandName+" ("+tweetQueue.Count+" more left)" : Program.BrandName;
} }
public void DisplayTooltip(string text){
if (string.IsNullOrEmpty(text)){
toolTip.Hide(this);
}
else{
Point position = PointToClient(Cursor.Position);
position.Offset(20,5);
toolTip.Show(text,this,position);
}
}
} }
} }

View File

@@ -12,8 +12,6 @@ namespace TweetDck.Core.Handling{
private const int MenuCopyImageUrl = 26504; private const int MenuCopyImageUrl = 26504;
public virtual void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model){ public virtual void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model){
RemoveSeparatorIfLast(model);
if (parameters.TypeFlags.HasFlag(ContextMenuType.Link) && !parameters.UnfilteredLinkUrl.EndsWith("tweetdeck.twitter.com/#")){ if (parameters.TypeFlags.HasFlag(ContextMenuType.Link) && !parameters.UnfilteredLinkUrl.EndsWith("tweetdeck.twitter.com/#")){
model.AddItem((CefMenuCommand)MenuOpenUrlInBrowser,"Open in browser"); model.AddItem((CefMenuCommand)MenuOpenUrlInBrowser,"Open in browser");
model.AddItem((CefMenuCommand)MenuCopyUrl,"Copy link address"); model.AddItem((CefMenuCommand)MenuCopyUrl,"Copy link address");
@@ -79,12 +77,6 @@ namespace TweetDck.Core.Handling{
return false; return false;
} }
protected void RemoveSeparatorIfFirst(IMenuModel model){
if (model.Count > 0 && model.GetTypeAt(model.Count-1) == MenuItemType.Separator){
model.RemoveAt(model.Count-1);
}
}
protected void RemoveSeparatorIfLast(IMenuModel model){ protected void RemoveSeparatorIfLast(IMenuModel model){
if (model.Count > 0 && model.GetTypeAt(model.Count-1) == MenuItemType.Separator){ if (model.Count > 0 && model.GetTypeAt(model.Count-1) == MenuItemType.Separator){
model.RemoveAt(model.Count-1); model.RemoveAt(model.Count-1);

View File

@@ -1,10 +1,14 @@
using CefSharp; using CefSharp;
using System.Windows.Forms;
using TweetDck.Core.Controls;
namespace TweetDck.Core.Handling{ namespace TweetDck.Core.Handling{
class ContextMenuBrowser : ContextMenuBase{ class ContextMenuBrowser : ContextMenuBase{
private const int MenuSettings = 26600; private const int MenuSettings = 26600;
private const int MenuAbout = 26601; private const int MenuAbout = 26601;
private const int MenuMute = 26602; private const int MenuMute = 26602;
private const int MenuCopyTweetUrl = 26603;
private const int MenuCopyTweetEmbeddedUrl = 26604;
private readonly FormBrowser form; private readonly FormBrowser form;
@@ -17,13 +21,27 @@ namespace TweetDck.Core.Handling{
model.Remove(CefMenuCommand.Forward); model.Remove(CefMenuCommand.Forward);
model.Remove(CefMenuCommand.Print); model.Remove(CefMenuCommand.Print);
model.Remove(CefMenuCommand.ViewSource); model.Remove(CefMenuCommand.ViewSource);
RemoveSeparatorIfLast(model);
RemoveSeparatorIfFirst(model); if (!string.IsNullOrEmpty(TweetDeckBridge.LastHighlightedTweet)){
model.AddItem((CefMenuCommand)MenuCopyTweetUrl,"Copy tweet address");
if (!string.IsNullOrEmpty(TweetDeckBridge.LastHighlightedTweetEmbedded)){
model.AddItem((CefMenuCommand)MenuCopyTweetEmbeddedUrl,"Copy quoted tweet address");
}
model.AddSeparator();
}
base.OnBeforeContextMenu(browserControl,browser,frame,parameters,model); base.OnBeforeContextMenu(browserControl,browser,frame,parameters,model);
if (model.Count > 0){
RemoveSeparatorIfLast(model);
model.AddSeparator();
}
model.AddItem(CefMenuCommand.Reload,"Reload"); model.AddItem(CefMenuCommand.Reload,"Reload");
model.AddCheckItem((CefMenuCommand)MenuMute,"Mute Notifications"); model.AddCheckItem((CefMenuCommand)MenuMute,"Mute notifications");
model.SetChecked((CefMenuCommand)MenuMute,Program.UserConfig.MuteNotifications); model.SetChecked((CefMenuCommand)MenuMute,Program.UserConfig.MuteNotifications);
model.AddSeparator(); model.AddSeparator();
@@ -41,17 +59,11 @@ namespace TweetDck.Core.Handling{
switch((int)commandId){ switch((int)commandId){
case MenuSettings: case MenuSettings:
form.InvokeSafe(() => { form.InvokeSafe(form.OpenSettings);
form.OpenSettings();
});
return true; return true;
case MenuAbout: case MenuAbout:
form.InvokeSafe(() => { form.InvokeSafe(form.OpenAbout);
form.OpenAbout();
});
return true; return true;
case MenuMute: case MenuMute:
@@ -61,6 +73,14 @@ namespace TweetDck.Core.Handling{
}); });
return true; return true;
case MenuCopyTweetUrl:
Clipboard.SetText(TweetDeckBridge.LastHighlightedTweet,TextDataFormat.UnicodeText);
return true;
case MenuCopyTweetEmbeddedUrl:
Clipboard.SetText(TweetDeckBridge.LastHighlightedTweetEmbedded,TextDataFormat.UnicodeText);
return true;
} }
return false; return false;

View File

@@ -1,12 +1,77 @@
using CefSharp; using System.Windows.Forms;
using CefSharp;
using TweetDck.Core.Controls;
namespace TweetDck.Core.Handling{ namespace TweetDck.Core.Handling{
class ContextMenuNotification : ContextMenuBase{ class ContextMenuNotification : ContextMenuBase{
private const int MenuSkipTweet = 26600;
private const int MenuFreeze = 26601;
private const int MenuCopyTweetUrl = 26602;
private const int MenuCopyTweetEmbeddedUrl = 26603;
private readonly FormNotification form;
private readonly bool enableCustomMenu;
public ContextMenuNotification(FormNotification form, bool enableCustomMenu){
this.form = form;
this.enableCustomMenu = enableCustomMenu;
}
public override void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model){ public override void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model){
model.Clear(); model.Clear();
if (enableCustomMenu){
model.AddItem((CefMenuCommand)MenuSkipTweet,"Skip tweet");
model.AddCheckItem((CefMenuCommand)MenuFreeze,"Freeze");
model.SetChecked((CefMenuCommand)MenuFreeze,form.FreezeTimer);
model.AddSeparator();
if (!string.IsNullOrEmpty(form.CurrentUrl)){
model.AddItem((CefMenuCommand)MenuCopyTweetUrl,"Copy tweet address");
if (!string.IsNullOrEmpty(TweetDeckBridge.NotificationTweetEmbedded)){
model.AddItem((CefMenuCommand)MenuCopyTweetEmbeddedUrl,"Copy quoted tweet address");
}
model.AddSeparator();
}
}
base.OnBeforeContextMenu(browserControl,browser,frame,parameters,model); base.OnBeforeContextMenu(browserControl,browser,frame,parameters,model);
RemoveSeparatorIfLast(model); RemoveSeparatorIfLast(model);
form.InvokeSafe(() => form.ContextMenuOpen = true);
}
public override bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags){
if (base.OnContextMenuCommand(browserControl,browser,frame,parameters,commandId,eventFlags)){
return true;
}
switch((int)commandId){
case MenuSkipTweet:
form.InvokeSafe(form.FinishCurrentTweet);
return true;
case MenuFreeze:
form.InvokeSafe(() => form.FreezeTimer = !form.FreezeTimer);
return true;
case MenuCopyTweetUrl:
Clipboard.SetText(form.CurrentUrl,TextDataFormat.UnicodeText);
return true;
case MenuCopyTweetEmbeddedUrl:
Clipboard.SetText(TweetDeckBridge.NotificationTweetEmbedded,TextDataFormat.UnicodeText);
return true;
}
return false;
}
public override void OnContextMenuDismissed(IWebBrowser browserControl, IBrowser browser, IFrame frame){
base.OnContextMenuDismissed(browserControl,browser,frame);
form.InvokeSafe(() => form.ContextMenuOpen = false);
} }
} }
} }

View File

@@ -1,5 +1,6 @@
using CefSharp; using CefSharp;
using System.Collections.Generic; using System.Collections.Generic;
using TweetDck.Core.Controls;
namespace TweetDck.Core.Handling{ namespace TweetDck.Core.Handling{
class DialogHandlerBrowser : IDialogHandler{ class DialogHandlerBrowser : IDialogHandler{

View File

@@ -4,10 +4,14 @@ using System.Drawing.Imaging;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDck.Core.Utils; using TweetDck.Core.Utils;
using TweetDck.Core.Controls;
namespace TweetDck.Core.Handling{ namespace TweetDck.Core.Handling{
class TweetDeckBridge{ class TweetDeckBridge{
public static string LastRightClickedLink = string.Empty; public static string LastRightClickedLink = string.Empty;
public static string LastHighlightedTweet = string.Empty;
public static string LastHighlightedTweetEmbedded = string.Empty;
public static string NotificationTweetEmbedded = string.Empty;
public static string ClipboardImagePath = string.Empty; public static string ClipboardImagePath = string.Empty;
private readonly FormBrowser form; private readonly FormBrowser form;
@@ -30,24 +34,12 @@ namespace TweetDck.Core.Handling{
} }
} }
public bool UpdateCheckEnabled{
get{
return Program.UserConfig.EnableUpdateCheck;
}
}
public bool ExpandLinksOnHover{ public bool ExpandLinksOnHover{
get{ get{
return Program.UserConfig.ExpandLinksOnHover; return Program.UserConfig.ExpandLinksOnHover;
} }
} }
public string DismissedVersionTag{
get{
return Program.UserConfig.DismissedUpdate ?? string.Empty;
}
}
public TweetDeckBridge(FormBrowser form){ public TweetDeckBridge(FormBrowser form){
this.form = form; this.form = form;
} }
@@ -65,39 +57,37 @@ namespace TweetDck.Core.Handling{
} }
public void SetLastRightClickedLink(string link){ public void SetLastRightClickedLink(string link){
form.InvokeSafe(() => LastRightClickedLink = link);
}
public void SetLastHighlightedTweet(string link, string embeddedLink){
form.InvokeSafe(() => { form.InvokeSafe(() => {
LastRightClickedLink = link; LastHighlightedTweet = link;
LastHighlightedTweetEmbedded = embeddedLink;
}); });
} }
public void SetNotificationTweetEmbedded(string link){
form.InvokeSafe(() => NotificationTweetEmbedded = link);
}
public void OpenSettingsMenu(){ public void OpenSettingsMenu(){
form.InvokeSafe(() => { form.InvokeSafe(form.OpenSettings);
form.OpenSettings();
});
} }
public void OnTweetPopup(string tweetHtml, int tweetCharacters){ public void OnTweetPopup(string tweetHtml, string tweetUrl, int tweetCharacters){
form.InvokeSafe(() => { form.InvokeSafe(() => {
form.OnTweetPopup(new TweetNotification(tweetHtml,tweetCharacters)); form.OnTweetPopup(new TweetNotification(tweetHtml,tweetUrl,tweetCharacters));
}); });
} }
public void OnTweetSound(){ public void OnTweetSound(){
form.InvokeSafe(() => { form.InvokeSafe(form.OnTweetSound);
form.OnTweetSound();
});
} }
public void OnUpdateAccepted(string versionTag, string downloadUrl){ public void DisplayTooltip(string text, bool showInNotification){
form.InvokeSafe(() => { form.InvokeSafe(() => {
form.BeginUpdateProcess(versionTag,downloadUrl); form.DisplayTooltip(text,showInNotification);
});
}
public void OnUpdateDismissed(string versionTag){
form.InvokeSafe(() => {
Program.UserConfig.DismissedUpdate = versionTag;
Program.UserConfig.Save();
}); });
} }
@@ -126,10 +116,9 @@ namespace TweetDck.Core.Handling{
Point prevPos = Cursor.Position; Point prevPos = Cursor.Position;
Cursor.Position = form.PointToScreen(new Point(offsetX,offsetY)); Cursor.Position = form.PointToScreen(new Point(offsetX,offsetY));
Program.mouse_event(SystemInformation.MouseButtonsSwapped ? 0x08 : 0x02,Cursor.Position.X,Cursor.Position.Y,0,0); // MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_LEFTDOWN NativeMethods.SimulateMouseClick(NativeMethods.MouseButton.Left);
Program.mouse_event(SystemInformation.MouseButtonsSwapped ? 0x10 : 0x04,Cursor.Position.X,Cursor.Position.Y,0,0); // MOUSEEVENTF_RIGHTUP | MOUSEEVENTF_LEFTUP
Cursor.Position = prevPos; Cursor.Position = prevPos;
form.OnImagePastedFinish(); form.OnImagePastedFinish();
}); });
} }

View File

@@ -12,6 +12,18 @@ namespace TweetDck.Core.Handling{
} }
} }
public static int FontSizeLevel{
get{
switch(FontSizeClass){
case "largest": return 4;
case "large": return 3;
case "medium": return 2;
case "small": return 1;
default: return 0;
}
}
}
public static TweetNotification ExampleTweet{ public static TweetNotification ExampleTweet{
get{ get{
StringBuilder build = new StringBuilder(); StringBuilder build = new StringBuilder();
@@ -26,7 +38,7 @@ namespace TweetDck.Core.Handling{
build.Append(@"<div class='tweet-body'><p class='js-tweet-text tweet-text with-linebreaks'>This is an example tweet, which lets you test the location and duration of popup notifications.</p></div>"); build.Append(@"<div class='tweet-body'><p class='js-tweet-text tweet-text with-linebreaks'>This is an example tweet, which lets you test the location and duration of popup notifications.</p></div>");
build.Append(@"</div></div></article>"); build.Append(@"</div></div></article>");
return new TweetNotification(build.ToString(),95); return new TweetNotification(build.ToString(),"",95);
} }
} }
@@ -46,11 +58,19 @@ namespace TweetDck.Core.Handling{
Short, Medium, Long, VeryLong Short, Medium, Long, VeryLong
} }
public string Url{
get{
return url;
}
}
private readonly string html; private readonly string html;
private readonly string url;
private readonly int characters; private readonly int characters;
public TweetNotification(string html, int characters){ public TweetNotification(string html, string url, int characters){
this.html = html; this.html = html;
this.url = url;
this.characters = characters; this.characters = characters;
} }
@@ -72,7 +92,7 @@ namespace TweetDck.Core.Handling{
build.Append("<!DOCTYPE html>"); build.Append("<!DOCTYPE html>");
build.Append("<html class='os-windows txt-base-").Append(FontSizeClass).Append("'>"); build.Append("<html class='os-windows txt-base-").Append(FontSizeClass).Append("'>");
build.Append("<head>").Append(HeadTag).Append("</head>"); build.Append("<head>").Append(HeadTag).Append("</head>");
build.Append("<body class='hearty'><div class='app-columns-container'><div class='column' style='width:100%'>"); build.Append("<body class='hearty'><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>");

View File

@@ -25,44 +25,131 @@ namespace TweetDck.Core.Other {
/// the contents of this method with the code editor. /// the contents of this method with the code editor.
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this.labelAbout = new TweetDck.Core.Controls.RichTextLabel(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAbout));
this.pictureLogo = new System.Windows.Forms.PictureBox();
this.labelDescription = new System.Windows.Forms.Label();
this.labelSourceCode = new System.Windows.Forms.LinkLabel();
this.labelWebsite = new System.Windows.Forms.LinkLabel();
this.tablePanelLinks = new System.Windows.Forms.TableLayoutPanel();
this.labelIssues = new System.Windows.Forms.LinkLabel();
((System.ComponentModel.ISupportInitialize)(this.pictureLogo)).BeginInit();
this.tablePanelLinks.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// labelAbout // pictureLogo
// //
this.labelAbout.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.pictureLogo.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.pictureLogo.ErrorImage = null;
this.pictureLogo.Image = ((System.Drawing.Image)(resources.GetObject("pictureLogo.Image")));
this.pictureLogo.InitialImage = null;
this.pictureLogo.Location = new System.Drawing.Point(12, 12);
this.pictureLogo.Name = "pictureLogo";
this.pictureLogo.Size = new System.Drawing.Size(96, 96);
this.pictureLogo.TabIndex = 0;
this.pictureLogo.TabStop = false;
//
// labelDescription
//
this.labelDescription.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.labelAbout.BackColor = System.Drawing.Color.White; this.labelDescription.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.labelAbout.BorderStyle = System.Windows.Forms.BorderStyle.None; this.labelDescription.Location = new System.Drawing.Point(114, 12);
this.labelAbout.Location = new System.Drawing.Point(12, 12); this.labelDescription.Name = "labelDescription";
this.labelAbout.Name = "labelAbout"; this.labelDescription.Size = new System.Drawing.Size(232, 109);
this.labelAbout.ReadOnly = true; this.labelDescription.TabIndex = 1;
this.labelAbout.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None; //
this.labelAbout.Size = new System.Drawing.Size(360, 126); // labelSourceCode
this.labelAbout.TabIndex = 0; //
this.labelAbout.TabStop = false; this.labelSourceCode.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelAbout.Text = ""; this.labelSourceCode.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.labelAbout.Click += new System.EventHandler(this.labelAbout_Click); this.labelSourceCode.LinkArea = new System.Windows.Forms.LinkArea(0, 0);
this.labelSourceCode.Location = new System.Drawing.Point(117, 0);
this.labelSourceCode.Margin = new System.Windows.Forms.Padding(0);
this.labelSourceCode.Name = "labelSourceCode";
this.labelSourceCode.Size = new System.Drawing.Size(99, 16);
this.labelSourceCode.TabIndex = 3;
this.labelSourceCode.Text = "Source Code";
this.labelSourceCode.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.labelSourceCode.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnLinkClicked);
//
// labelWebsite
//
this.labelWebsite.AutoSize = true;
this.labelWebsite.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelWebsite.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.labelWebsite.LinkArea = new System.Windows.Forms.LinkArea(0, 0);
this.labelWebsite.Location = new System.Drawing.Point(0, 0);
this.labelWebsite.Margin = new System.Windows.Forms.Padding(0);
this.labelWebsite.Name = "labelWebsite";
this.labelWebsite.Size = new System.Drawing.Size(117, 16);
this.labelWebsite.TabIndex = 2;
this.labelWebsite.Text = "Official Website";
this.labelWebsite.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.labelWebsite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnLinkClicked);
//
// tablePanelLinks
//
this.tablePanelLinks.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tablePanelLinks.ColumnCount = 3;
this.tablePanelLinks.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35.16F));
this.tablePanelLinks.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 29.7F));
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.labelWebsite, 0, 0);
this.tablePanelLinks.Controls.Add(this.labelSourceCode, 1, 0);
this.tablePanelLinks.Location = new System.Drawing.Point(12, 124);
this.tablePanelLinks.Name = "tablePanelLinks";
this.tablePanelLinks.RowCount = 1;
this.tablePanelLinks.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tablePanelLinks.Size = new System.Drawing.Size(334, 16);
this.tablePanelLinks.TabIndex = 4;
//
// labelIssues
//
this.labelIssues.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelIssues.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.labelIssues.LinkArea = new System.Windows.Forms.LinkArea(0, 0);
this.labelIssues.Location = new System.Drawing.Point(216, 0);
this.labelIssues.Margin = new System.Windows.Forms.Padding(0);
this.labelIssues.Name = "labelIssues";
this.labelIssues.Size = new System.Drawing.Size(118, 16);
this.labelIssues.TabIndex = 4;
this.labelIssues.Text = "Report an Issue";
this.labelIssues.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.labelIssues.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnLinkClicked);
// //
// FormAbout // FormAbout
// //
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.BackColor = System.Drawing.Color.White; this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(384, 150); this.ClientSize = new System.Drawing.Size(358, 152);
this.Controls.Add(this.labelAbout); this.Controls.Add(this.tablePanelLinks);
this.Controls.Add(this.labelDescription);
this.Controls.Add(this.pictureLogo);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "FormAbout"; this.Name = "FormAbout";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
((System.ComponentModel.ISupportInitialize)(this.pictureLogo)).EndInit();
this.tablePanelLinks.ResumeLayout(false);
this.tablePanelLinks.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
#endregion #endregion
private Controls.RichTextLabel labelAbout; private System.Windows.Forms.PictureBox pictureLogo;
private System.Windows.Forms.Label labelDescription;
private System.Windows.Forms.LinkLabel labelSourceCode;
private System.Windows.Forms.LinkLabel labelWebsite;
private System.Windows.Forms.TableLayoutPanel tablePanelLinks;
private System.Windows.Forms.LinkLabel labelIssues;
} }
} }

View File

@@ -1,43 +1,25 @@
using System; using System.Windows.Forms;
using System.Text;
using System.Windows.Forms;
using TweetDck.Core.Controls;
using TweetDck.Core.Utils; 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 GitHubLink = "https://github.com/chylex/TweetDuck";
private const string IssuesLink = "https://github.com/chylex/TweetDuck/issues";
public FormAbout(){ public FormAbout(){
InitializeComponent(); InitializeComponent();
Text = "About "+Program.BrandName+" "+Program.VersionTag; Text = "About "+Program.BrandName+" "+Program.VersionTag;
StringBuilder build = new StringBuilder(); 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.";
build.Append(@"\fs22").Append(Program.BrandName).Append(@" was created by chylex as a replacement to the discontinued TweetDeck client for Windows, and is released under the MIT license.\par ");
build.Append(@"Official Website: ").Append(RichTextLabel.AddLink(Program.Website)).Append(@"\line ");
build.Append(@"Source Code: ").Append(RichTextLabel.AddLink(GitHubLink));
labelAbout.Rtf = RichTextLabel.Wrap(build.ToString()); labelWebsite.Links.Add(new LinkLabel.Link(0,labelWebsite.Text.Length,Program.Website));
labelSourceCode.Links.Add(new LinkLabel.Link(0,labelSourceCode.Text.Length,GitHubLink));
labelIssues.Links.Add(new LinkLabel.Link(0,labelIssues.Text.Length,IssuesLink));
} }
private void labelAbout_Click(object sender, EventArgs e){ // LinkClicked isn't working so fuck that private void OnLinkClicked(object sender, LinkLabelLinkClickedEventArgs e){
if (Cursor.Current != Cursors.Hand)return; BrowserUtils.OpenExternalBrowser(e.Link.LinkData as string);
// I don't even give a fuck, someone else PR a proper fix please
int index = labelAbout.GetCharIndexFromPosition(((MouseEventArgs)e).Location);
if (IsClickingOn(index,Program.Website)){
BrowserUtils.OpenExternalBrowser(Program.Website);
}
else if (IsClickingOn(index,GitHubLink)){
BrowserUtils.OpenExternalBrowser(GitHubLink);
}
}
private bool IsClickingOn(int index, string substringSearch){
int substringIndex = labelAbout.Text.IndexOf(substringSearch,StringComparison.Ordinal);
return index >= substringIndex && index <= substringIndex+substringSearch.Length;
} }
} }
} }

246
Core/Other/FormAbout.resx Normal file
View File

@@ -0,0 +1,246 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureLogo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH
DwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUNDIHByb2Zp
bGUAAEjHnZZ3VFTXFofPvXd6oc0wAlKG3rvAANJ7k15FYZgZYCgDDjM0sSGiAhFFRJoiSFDEgNFQJFZE
sRAUVLAHJAgoMRhFVCxvRtaLrqy89/Ly++Osb+2z97n77L3PWhcAkqcvl5cGSwGQyhPwgzyc6RGRUXTs
AIABHmCAKQBMVka6X7B7CBDJy82FniFyAl8EAfB6WLwCcNPQM4BOB/+fpFnpfIHomAARm7M5GSwRF4g4
JUuQLrbPipgalyxmGCVmvihBEcuJOWGRDT77LLKjmNmpPLaIxTmns1PZYu4V8bZMIUfEiK+ICzO5nCwR
3xKxRoowlSviN+LYVA4zAwAUSWwXcFiJIjYRMYkfEuQi4uUA4EgJX3HcVyzgZAvEl3JJS8/hcxMSBXQd
li7d1NqaQffkZKVwBALDACYrmcln013SUtOZvBwAFu/8WTLi2tJFRbY0tba0NDQzMv2qUP91829K3NtF
ehn4uWcQrf+L7a/80hoAYMyJarPziy2uCoDOLQDI3fti0zgAgKSobx3Xv7oPTTwviQJBuo2xcVZWlhGX
wzISF/QP/U+Hv6GvvmckPu6P8tBdOfFMYYqALq4bKy0lTcinZ6QzWRy64Z+H+B8H/nUeBkGceA6fwxNF
hImmjMtLELWbx+YKuGk8Opf3n5r4D8P+pMW5FonS+BFQY4yA1HUqQH7tBygKESDR+8Vd/6NvvvgwIH55
4SqTi3P/7zf9Z8Gl4iWDm/A5ziUohM4S8jMX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vx4Q6YQ/ECm+5Cgm0jxl
8Y5lyhsfPw9zpyrzU3zyp8ndRUAbwFDrZViQdlvQ/NQ7kKPvNkYX3GuIKbpPWfrJFP7IFyXu4FQYM1V5
c//3lWV7p/A70JWobfcq4dlfN4Zn3WmYn3y7GseSgYCxulhW7Bb1p+YXb1Ev0uf+H9A3E1Z4VJUaAAAA
AElFTkSuQmCC
</value>
</data>
</root>

View File

@@ -26,7 +26,7 @@ namespace TweetDck.Core.Other {
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this.progressBarUseless = new System.Windows.Forms.ProgressBar(); this.progressBarUseless = new System.Windows.Forms.ProgressBar();
this.labelDescription = new RichTextLabel(); this.labelDescription = new TweetDck.Core.Controls.RichTextLabel();
this.SuspendLayout(); this.SuspendLayout();
// //
// progressBarUseless // progressBarUseless
@@ -64,6 +64,7 @@ namespace TweetDck.Core.Other {
this.Controls.Add(this.progressBarUseless); this.Controls.Add(this.progressBarUseless);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "FormBackgroundWork"; this.Name = "FormBackgroundWork";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "TweetDeck Migration"; this.Text = "TweetDeck Migration";
this.ResumeLayout(false); this.ResumeLayout(false);

View File

@@ -47,12 +47,23 @@
this.radioDurLong = new System.Windows.Forms.RadioButton(); this.radioDurLong = new System.Windows.Forms.RadioButton();
this.radioDurMedium = new System.Windows.Forms.RadioButton(); this.radioDurMedium = new System.Windows.Forms.RadioButton();
this.radioDurShort = new System.Windows.Forms.RadioButton(); this.radioDurShort = new System.Windows.Forms.RadioButton();
this.tableColumn3Panel = new System.Windows.Forms.Panel();
this.groupAdvancedSettings = new System.Windows.Forms.GroupBox();
this.btnClearCache = new System.Windows.Forms.Button();
this.labelMiscellaneous = new System.Windows.Forms.Label();
this.checkHardwareAcceleration = new System.Windows.Forms.CheckBox();
this.tableColumn1Panel = new System.Windows.Forms.Panel();
this.labelUpdateNotifications = new System.Windows.Forms.Label();
this.btnCheckUpdates = new System.Windows.Forms.Button();
this.groupNotificationLocation.SuspendLayout(); this.groupNotificationLocation.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.trackBarEdgeDistance)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBarEdgeDistance)).BeginInit();
this.tableLayout.SuspendLayout(); this.tableLayout.SuspendLayout();
this.tableColumn2Panel.SuspendLayout(); this.tableColumn2Panel.SuspendLayout();
this.groupUserInterface.SuspendLayout(); this.groupUserInterface.SuspendLayout();
this.groupNotificationDuration.SuspendLayout(); this.groupNotificationDuration.SuspendLayout();
this.tableColumn3Panel.SuspendLayout();
this.groupAdvancedSettings.SuspendLayout();
this.tableColumn1Panel.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// groupNotificationLocation // groupNotificationLocation
@@ -69,9 +80,9 @@
this.groupNotificationLocation.Controls.Add(this.radioLocBL); this.groupNotificationLocation.Controls.Add(this.radioLocBL);
this.groupNotificationLocation.Controls.Add(this.radioLocTR); this.groupNotificationLocation.Controls.Add(this.radioLocTR);
this.groupNotificationLocation.Controls.Add(this.radioLocTL); this.groupNotificationLocation.Controls.Add(this.radioLocTL);
this.groupNotificationLocation.Location = new System.Drawing.Point(6, 6); this.groupNotificationLocation.Location = new System.Drawing.Point(3, 3);
this.groupNotificationLocation.Name = "groupNotificationLocation"; this.groupNotificationLocation.Name = "groupNotificationLocation";
this.groupNotificationLocation.Size = new System.Drawing.Size(183, 278); this.groupNotificationLocation.Size = new System.Drawing.Size(183, 324);
this.groupNotificationLocation.TabIndex = 0; this.groupNotificationLocation.TabIndex = 0;
this.groupNotificationLocation.TabStop = false; this.groupNotificationLocation.TabStop = false;
this.groupNotificationLocation.Text = "Notification Location"; this.groupNotificationLocation.Text = "Notification Location";
@@ -79,7 +90,7 @@
// labelDisplay // labelDisplay
// //
this.labelDisplay.AutoSize = true; this.labelDisplay.AutoSize = true;
this.labelDisplay.Location = new System.Drawing.Point(6, 148); this.labelDisplay.Location = new System.Drawing.Point(3, 148);
this.labelDisplay.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0); this.labelDisplay.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
this.labelDisplay.Name = "labelDisplay"; this.labelDisplay.Name = "labelDisplay";
this.labelDisplay.Size = new System.Drawing.Size(41, 13); this.labelDisplay.Size = new System.Drawing.Size(41, 13);
@@ -92,16 +103,16 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.comboBoxDisplay.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxDisplay.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxDisplay.FormattingEnabled = true; this.comboBoxDisplay.FormattingEnabled = true;
this.comboBoxDisplay.Location = new System.Drawing.Point(9, 164); this.comboBoxDisplay.Location = new System.Drawing.Point(6, 164);
this.comboBoxDisplay.Name = "comboBoxDisplay"; this.comboBoxDisplay.Name = "comboBoxDisplay";
this.comboBoxDisplay.Size = new System.Drawing.Size(168, 21); this.comboBoxDisplay.Size = new System.Drawing.Size(171, 21);
this.comboBoxDisplay.TabIndex = 7; this.comboBoxDisplay.TabIndex = 7;
this.comboBoxDisplay.SelectedValueChanged += new System.EventHandler(this.comboBoxDisplay_SelectedValueChanged); this.comboBoxDisplay.SelectedValueChanged += new System.EventHandler(this.comboBoxDisplay_SelectedValueChanged);
// //
// labelEdgeDistance // labelEdgeDistance
// //
this.labelEdgeDistance.AutoSize = true; this.labelEdgeDistance.AutoSize = true;
this.labelEdgeDistance.Location = new System.Drawing.Point(6, 197); this.labelEdgeDistance.Location = new System.Drawing.Point(3, 197);
this.labelEdgeDistance.Margin = new System.Windows.Forms.Padding(3, 9, 3, 0); this.labelEdgeDistance.Margin = new System.Windows.Forms.Padding(3, 9, 3, 0);
this.labelEdgeDistance.Name = "labelEdgeDistance"; this.labelEdgeDistance.Name = "labelEdgeDistance";
this.labelEdgeDistance.Size = new System.Drawing.Size(103, 13); this.labelEdgeDistance.Size = new System.Drawing.Size(103, 13);
@@ -191,11 +202,13 @@
// //
// tableLayout // tableLayout
// //
this.tableLayout.ColumnCount = 2; this.tableLayout.ColumnCount = 3;
this.tableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33F));
this.tableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33F));
this.tableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.34F));
this.tableLayout.Controls.Add(this.tableColumn1Panel, 0, 0);
this.tableLayout.Controls.Add(this.tableColumn2Panel, 1, 0); this.tableLayout.Controls.Add(this.tableColumn2Panel, 1, 0);
this.tableLayout.Controls.Add(this.groupNotificationLocation, 0, 0); this.tableLayout.Controls.Add(this.tableColumn3Panel, 2, 0);
this.tableLayout.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayout.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayout.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize; this.tableLayout.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
this.tableLayout.Location = new System.Drawing.Point(0, 0); this.tableLayout.Location = new System.Drawing.Point(0, 0);
@@ -203,18 +216,18 @@
this.tableLayout.Padding = new System.Windows.Forms.Padding(3); this.tableLayout.Padding = new System.Windows.Forms.Padding(3);
this.tableLayout.RowCount = 1; this.tableLayout.RowCount = 1;
this.tableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayout.Size = new System.Drawing.Size(384, 290); this.tableLayout.Size = new System.Drawing.Size(576, 336);
this.tableLayout.TabIndex = 2; this.tableLayout.TabIndex = 2;
// //
// tableColumn2Panel // tableColumn2Panel
// //
this.tableColumn2Panel.Controls.Add(this.groupUserInterface);
this.tableColumn2Panel.Controls.Add(this.groupNotificationDuration); this.tableColumn2Panel.Controls.Add(this.groupNotificationDuration);
this.tableColumn2Panel.Controls.Add(this.groupUserInterface);
this.tableColumn2Panel.Dock = System.Windows.Forms.DockStyle.Fill; this.tableColumn2Panel.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableColumn2Panel.Location = new System.Drawing.Point(192, 3); this.tableColumn2Panel.Location = new System.Drawing.Point(192, 3);
this.tableColumn2Panel.Margin = new System.Windows.Forms.Padding(0); this.tableColumn2Panel.Margin = new System.Windows.Forms.Padding(0);
this.tableColumn2Panel.Name = "tableColumn2Panel"; this.tableColumn2Panel.Name = "tableColumn2Panel";
this.tableColumn2Panel.Size = new System.Drawing.Size(189, 284); this.tableColumn2Panel.Size = new System.Drawing.Size(189, 330);
this.tableColumn2Panel.TabIndex = 3; this.tableColumn2Panel.TabIndex = 3;
// //
// groupUserInterface // groupUserInterface
@@ -222,6 +235,8 @@
this.groupUserInterface.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.groupUserInterface.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.groupUserInterface.Controls.Add(this.btnCheckUpdates);
this.groupUserInterface.Controls.Add(this.labelUpdateNotifications);
this.groupUserInterface.Controls.Add(this.checkExpandLinks); this.groupUserInterface.Controls.Add(this.checkExpandLinks);
this.groupUserInterface.Controls.Add(this.comboBoxTrayType); this.groupUserInterface.Controls.Add(this.comboBoxTrayType);
this.groupUserInterface.Controls.Add(this.labelTrayType); this.groupUserInterface.Controls.Add(this.labelTrayType);
@@ -229,7 +244,7 @@
this.groupUserInterface.Controls.Add(this.checkNotificationTimer); this.groupUserInterface.Controls.Add(this.checkNotificationTimer);
this.groupUserInterface.Location = new System.Drawing.Point(3, 128); this.groupUserInterface.Location = new System.Drawing.Point(3, 128);
this.groupUserInterface.Name = "groupUserInterface"; this.groupUserInterface.Name = "groupUserInterface";
this.groupUserInterface.Size = new System.Drawing.Size(183, 153); this.groupUserInterface.Size = new System.Drawing.Size(183, 199);
this.groupUserInterface.TabIndex = 3; this.groupUserInterface.TabIndex = 3;
this.groupUserInterface.TabStop = false; this.groupUserInterface.TabStop = false;
this.groupUserInterface.Text = "User Interface"; this.groupUserInterface.Text = "User Interface";
@@ -252,17 +267,16 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.comboBoxTrayType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxTrayType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxTrayType.FormattingEnabled = true; this.comboBoxTrayType.FormattingEnabled = true;
this.comboBoxTrayType.Location = new System.Drawing.Point(9, 116); this.comboBoxTrayType.Location = new System.Drawing.Point(6, 92);
this.comboBoxTrayType.Margin = new System.Windows.Forms.Padding(3, 3, 3, 12);
this.comboBoxTrayType.Name = "comboBoxTrayType"; this.comboBoxTrayType.Name = "comboBoxTrayType";
this.comboBoxTrayType.Size = new System.Drawing.Size(168, 21); this.comboBoxTrayType.Size = new System.Drawing.Size(171, 21);
this.comboBoxTrayType.TabIndex = 10; this.comboBoxTrayType.TabIndex = 10;
this.comboBoxTrayType.SelectedIndexChanged += new System.EventHandler(this.comboBoxTrayType_SelectedIndexChanged); this.comboBoxTrayType.SelectedIndexChanged += new System.EventHandler(this.comboBoxTrayType_SelectedIndexChanged);
// //
// labelTrayType // labelTrayType
// //
this.labelTrayType.AutoSize = true; this.labelTrayType.AutoSize = true;
this.labelTrayType.Location = new System.Drawing.Point(6, 100); this.labelTrayType.Location = new System.Drawing.Point(3, 76);
this.labelTrayType.Margin = new System.Windows.Forms.Padding(3, 11, 3, 0); this.labelTrayType.Margin = new System.Windows.Forms.Padding(3, 11, 3, 0);
this.labelTrayType.Name = "labelTrayType"; this.labelTrayType.Name = "labelTrayType";
this.labelTrayType.Size = new System.Drawing.Size(52, 13); this.labelTrayType.Size = new System.Drawing.Size(52, 13);
@@ -272,12 +286,12 @@
// checkUpdateNotifications // checkUpdateNotifications
// //
this.checkUpdateNotifications.AutoSize = true; this.checkUpdateNotifications.AutoSize = true;
this.checkUpdateNotifications.Location = new System.Drawing.Point(6, 69); this.checkUpdateNotifications.Location = new System.Drawing.Point(6, 145);
this.checkUpdateNotifications.Margin = new System.Windows.Forms.Padding(3, 4, 3, 3); this.checkUpdateNotifications.Margin = new System.Windows.Forms.Padding(3, 5, 3, 3);
this.checkUpdateNotifications.Name = "checkUpdateNotifications"; this.checkUpdateNotifications.Name = "checkUpdateNotifications";
this.checkUpdateNotifications.Size = new System.Drawing.Size(115, 17); this.checkUpdateNotifications.Size = new System.Drawing.Size(165, 17);
this.checkUpdateNotifications.TabIndex = 5; this.checkUpdateNotifications.TabIndex = 5;
this.checkUpdateNotifications.Text = "Check for Updates"; this.checkUpdateNotifications.Text = "Check Updates Automatically";
this.checkUpdateNotifications.UseVisualStyleBackColor = true; this.checkUpdateNotifications.UseVisualStyleBackColor = true;
this.checkUpdateNotifications.CheckedChanged += new System.EventHandler(this.checkUpdateNotifications_CheckedChanged); this.checkUpdateNotifications.CheckedChanged += new System.EventHandler(this.checkUpdateNotifications_CheckedChanged);
// //
@@ -360,11 +374,98 @@
this.radioDurShort.CheckedChanged += new System.EventHandler(this.radioDur_CheckedChanged); this.radioDurShort.CheckedChanged += new System.EventHandler(this.radioDur_CheckedChanged);
this.radioDurShort.Click += new System.EventHandler(this.radioDur_Click); this.radioDurShort.Click += new System.EventHandler(this.radioDur_Click);
// //
// tableColumn3Panel
//
this.tableColumn3Panel.Controls.Add(this.groupAdvancedSettings);
this.tableColumn3Panel.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableColumn3Panel.Location = new System.Drawing.Point(381, 3);
this.tableColumn3Panel.Margin = new System.Windows.Forms.Padding(0);
this.tableColumn3Panel.Name = "tableColumn3Panel";
this.tableColumn3Panel.Size = new System.Drawing.Size(192, 330);
this.tableColumn3Panel.TabIndex = 4;
//
// groupAdvancedSettings
//
this.groupAdvancedSettings.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.groupAdvancedSettings.Controls.Add(this.btnClearCache);
this.groupAdvancedSettings.Controls.Add(this.labelMiscellaneous);
this.groupAdvancedSettings.Controls.Add(this.checkHardwareAcceleration);
this.groupAdvancedSettings.Location = new System.Drawing.Point(3, 3);
this.groupAdvancedSettings.Name = "groupAdvancedSettings";
this.groupAdvancedSettings.Size = new System.Drawing.Size(183, 324);
this.groupAdvancedSettings.TabIndex = 0;
this.groupAdvancedSettings.TabStop = false;
this.groupAdvancedSettings.Text = "Advanced Settings";
//
// btnClearCache
//
this.btnClearCache.Location = new System.Drawing.Point(9, 68);
this.btnClearCache.Name = "btnClearCache";
this.btnClearCache.Size = new System.Drawing.Size(171, 23);
this.btnClearCache.TabIndex = 11;
this.btnClearCache.Text = "Clear Cache (calculating)";
this.btnClearCache.UseVisualStyleBackColor = true;
this.btnClearCache.Click += new System.EventHandler(this.btnClearCache_Click);
//
// labelMiscellaneous
//
this.labelMiscellaneous.AutoSize = true;
this.labelMiscellaneous.Location = new System.Drawing.Point(6, 52);
this.labelMiscellaneous.Margin = new System.Windows.Forms.Padding(3, 11, 3, 0);
this.labelMiscellaneous.Name = "labelMiscellaneous";
this.labelMiscellaneous.Size = new System.Drawing.Size(74, 13);
this.labelMiscellaneous.TabIndex = 10;
this.labelMiscellaneous.Text = "Miscellaneous";
//
// checkHardwareAcceleration
//
this.checkHardwareAcceleration.AutoSize = true;
this.checkHardwareAcceleration.Location = new System.Drawing.Point(6, 21);
this.checkHardwareAcceleration.Margin = new System.Windows.Forms.Padding(3, 5, 3, 3);
this.checkHardwareAcceleration.Name = "checkHardwareAcceleration";
this.checkHardwareAcceleration.Size = new System.Drawing.Size(134, 17);
this.checkHardwareAcceleration.TabIndex = 5;
this.checkHardwareAcceleration.Text = "Hardware Acceleration";
this.checkHardwareAcceleration.UseVisualStyleBackColor = true;
this.checkHardwareAcceleration.CheckedChanged += new System.EventHandler(this.checkHardwareAcceleration_CheckedChanged);
//
// tableColumn1Panel
//
this.tableColumn1Panel.Controls.Add(this.groupNotificationLocation);
this.tableColumn1Panel.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableColumn1Panel.Location = new System.Drawing.Point(3, 3);
this.tableColumn1Panel.Margin = new System.Windows.Forms.Padding(0);
this.tableColumn1Panel.Name = "tableColumn1Panel";
this.tableColumn1Panel.Size = new System.Drawing.Size(189, 330);
this.tableColumn1Panel.TabIndex = 5;
//
// labelUpdateNotifications
//
this.labelUpdateNotifications.AutoSize = true;
this.labelUpdateNotifications.Location = new System.Drawing.Point(3, 127);
this.labelUpdateNotifications.Margin = new System.Windows.Forms.Padding(3, 11, 3, 0);
this.labelUpdateNotifications.Name = "labelUpdateNotifications";
this.labelUpdateNotifications.Size = new System.Drawing.Size(103, 13);
this.labelUpdateNotifications.TabIndex = 12;
this.labelUpdateNotifications.Text = "Update Notifications";
//
// btnCheckUpdates
//
this.btnCheckUpdates.Location = new System.Drawing.Point(6, 168);
this.btnCheckUpdates.Name = "btnCheckUpdates";
this.btnCheckUpdates.Size = new System.Drawing.Size(171, 23);
this.btnCheckUpdates.TabIndex = 13;
this.btnCheckUpdates.Text = "Check Updates Now";
this.btnCheckUpdates.UseVisualStyleBackColor = true;
this.btnCheckUpdates.Click += new System.EventHandler(this.btnCheckUpdates_Click);
//
// FormSettings // FormSettings
// //
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(384, 290); this.ClientSize = new System.Drawing.Size(576, 336);
this.Controls.Add(this.tableLayout); this.Controls.Add(this.tableLayout);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
@@ -382,6 +483,10 @@
this.groupUserInterface.PerformLayout(); this.groupUserInterface.PerformLayout();
this.groupNotificationDuration.ResumeLayout(false); this.groupNotificationDuration.ResumeLayout(false);
this.groupNotificationDuration.PerformLayout(); this.groupNotificationDuration.PerformLayout();
this.tableColumn3Panel.ResumeLayout(false);
this.groupAdvancedSettings.ResumeLayout(false);
this.groupAdvancedSettings.PerformLayout();
this.tableColumn1Panel.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@@ -411,5 +516,13 @@
private System.Windows.Forms.ComboBox comboBoxTrayType; private System.Windows.Forms.ComboBox comboBoxTrayType;
private System.Windows.Forms.Label labelTrayType; private System.Windows.Forms.Label labelTrayType;
private System.Windows.Forms.CheckBox checkExpandLinks; private System.Windows.Forms.CheckBox checkExpandLinks;
private System.Windows.Forms.Panel tableColumn3Panel;
private System.Windows.Forms.GroupBox groupAdvancedSettings;
private System.Windows.Forms.CheckBox checkHardwareAcceleration;
private System.Windows.Forms.Label labelMiscellaneous;
private System.Windows.Forms.Button btnClearCache;
private System.Windows.Forms.Panel tableColumn1Panel;
private System.Windows.Forms.Label labelUpdateNotifications;
private System.Windows.Forms.Button btnCheckUpdates;
} }
} }

View File

@@ -1,7 +1,11 @@
using System; using System;
using System.Diagnostics;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDck.Configuration; using TweetDck.Configuration;
using TweetDck.Core.Handling; using TweetDck.Core.Handling;
using TweetDck.Core.Utils;
using TweetDck.Core.Controls;
using TweetDck.Updates;
namespace TweetDck.Core.Other{ namespace TweetDck.Core.Other{
sealed partial class FormSettings : Form{ sealed partial class FormSettings : Form{
@@ -12,15 +16,24 @@ namespace TweetDck.Core.Other{
} }
private readonly FormNotification notification; private readonly FormNotification notification;
private bool isLoaded; private readonly UpdateHandler updates;
public FormSettings(FormBrowser browserForm){ private bool isLoaded;
private int updateCheckEventId;
public FormSettings(FormBrowser browserForm, UpdateHandler updates){
InitializeComponent(); InitializeComponent();
Shown += (sender, args) => isLoaded = true; Shown += (sender, args) => isLoaded = true;
Text = Program.BrandName+" Settings"; Text = Program.BrandName+" Settings";
notification = new FormNotification(browserForm,false){ CanMoveWindow = () => radioLocCustom.Checked }; this.updates = updates;
updates.CheckFinished += updates_CheckFinished;
Disposed += (sender, args) => updates.CheckFinished -= updates_CheckFinished;
notification = browserForm.CreateNotificationForm(false);
notification.CanMoveWindow = () => radioLocCustom.Checked;
notification.Move += (sender, args) => { notification.Move += (sender, args) => {
if (radioLocCustom.Checked){ if (radioLocCustom.Checked){
@@ -63,6 +76,16 @@ namespace TweetDck.Core.Other{
checkNotificationTimer.Checked = Config.DisplayNotificationTimer; checkNotificationTimer.Checked = Config.DisplayNotificationTimer;
checkExpandLinks.Checked = Config.ExpandLinksOnHover; checkExpandLinks.Checked = Config.ExpandLinksOnHover;
checkUpdateNotifications.Checked = Config.EnableUpdateCheck; checkUpdateNotifications.Checked = Config.EnableUpdateCheck;
checkHardwareAcceleration.Checked = HardwareAcceleration.IsEnabled;
BrowserCache.CalculateCacheSize(bytes => this.InvokeSafe(() => {
if (bytes == -1L){
btnClearCache.Text = "Clear Cache (unknown size)";
}
else{
btnClearCache.Text = "Clear Cache ("+(int)Math.Ceiling(bytes/(1024.0*1024.0))+" MB)";
}
}));
} }
private void FormSettings_FormClosing(object sender, FormClosingEventArgs e){ private void FormSettings_FormClosing(object sender, FormClosingEventArgs e){
@@ -149,5 +172,68 @@ namespace TweetDck.Core.Other{
Config.EnableUpdateCheck = checkUpdateNotifications.Checked; Config.EnableUpdateCheck = checkUpdateNotifications.Checked;
} }
private void checkHardwareAcceleration_CheckedChanged(object sender, EventArgs e){
if (!isLoaded)return;
bool succeeded = false;
if (checkHardwareAcceleration.Checked){
if (HardwareAcceleration.CanEnable){
succeeded = HardwareAcceleration.Enable();
}
else{
MessageBox.Show("Cannot enable hardware acceleration, the libraries libEGL.dll and libGLESv2.dll could not be restored.",Program.BrandName+" Settings",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}
else{
succeeded = HardwareAcceleration.Disable();
}
if (succeeded && 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){ // TODO
Process.Start(Application.ExecutablePath,"-restart");
Application.Exit();
}
else if (!succeeded){
checkHardwareAcceleration.CheckedChanged -= checkHardwareAcceleration_CheckedChanged;
checkHardwareAcceleration.Checked = HardwareAcceleration.IsEnabled;
checkHardwareAcceleration.CheckedChanged += checkHardwareAcceleration_CheckedChanged;
}
}
private void btnClearCache_Click(object sender, EventArgs e){
if (!isLoaded)return;
isLoaded = false;
btnClearCache.Enabled = false;
isLoaded = true; // OTHERWISE WINFORMS CALLS THE ONCLICK EVENT FOR A RANDOM RADIO BUTTON WHAT THE CUNTFUCK IS THIS
BrowserCache.SetClearOnExit();
MessageBox.Show("Cache will be automatically cleared when "+Program.BrandName+" exits.","Clear Cache",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
private void btnCheckUpdates_Click(object sender, EventArgs e){
if (!isLoaded)return;
Config.DismissedUpdate = string.Empty;
Config.Save();
updateCheckEventId = updates.Check(true);
isLoaded = false;
btnCheckUpdates.Enabled = false;
isLoaded = true; // SAME AS ABOVE
}
private void updates_CheckFinished(object sender, UpdateCheckEventArgs e){
if (e.EventId == updateCheckEventId){
btnCheckUpdates.Enabled = true;
if (!e.UpdateAvailable){
MessageBox.Show("Your version of "+Program.BrandName+" is up to date.","No Updates Available",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
}
}
} }
} }

View File

@@ -31,13 +31,13 @@
this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenu.SuspendLayout(); this.contextMenu.SuspendLayout();
// //
// trayIcon // notifyIcon
// //
this.notifyIcon.ContextMenuStrip = this.contextMenu; this.notifyIcon.ContextMenuStrip = this.contextMenu;
this.notifyIcon.Icon = global::TweetDck.Properties.Resources.icon; this.notifyIcon.Icon = global::TweetDck.Properties.Resources.icon_tray;
this.notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(this.trayIcon_MouseClick); this.notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(this.trayIcon_MouseClick);
// //
// contextMenuTray // contextMenu
// //
this.contextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.contextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.restoreToolStripMenuItem, this.restoreToolStripMenuItem,

View File

@@ -21,6 +21,21 @@ namespace TweetDck.Core{
} }
} }
public bool HasNotifications{
get{
return hasNotifications;
}
set{
if (hasNotifications != value){
notifyIcon.Icon = value ? Properties.Resources.icon_tray_new : Properties.Resources.icon_tray;
hasNotifications = value;
}
}
}
private bool hasNotifications;
public TrayIcon(){ public TrayIcon(){
InitializeComponent(); InitializeComponent();
notifyIcon.Text = Program.BrandName; notifyIcon.Text = Program.BrandName;

View File

@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using System.Linq;
namespace TweetDck.Core.Utils{
static class BrowserCache{
private static bool ClearOnExit { get; set; }
private static readonly string IndexFile = Path.Combine(Program.StoragePath,"index");
private static IEnumerable<string> CacheFiles{
get{
return 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[]{ IndexFile });
}
}
public static void CalculateCacheSize(Action<long> callbackBytes){
Task<long> task = new Task<long>(() => {
return CacheFiles.Select(file => {
try{
return new FileInfo(file).Length;
}catch{
return 0L;
}
}).Sum();
});
task.ContinueWith(originalTask => callbackBytes(originalTask.Exception == null ? originalTask.Result : -1L),TaskContinuationOptions.ExecuteSynchronously);
task.Start();
}
public static void SetClearOnExit(){
ClearOnExit = true;
}
public static void Exit(){
if (ClearOnExit){
foreach(string file in CacheFiles){
try{
File.Delete(file);
}catch{
// welp, too bad
}
}
}
}
}
}

View File

@@ -0,0 +1,60 @@
using System;
using System.IO;
namespace TweetDck.Core.Utils{
static class HardwareAcceleration{
private static readonly string LibEGL = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"libEGL.dll");
private static readonly string LibGLES = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"libGLESv2.dll");
private static readonly string DisabledLibEGL = LibEGL+".bak";
private static readonly string DisabledLibGLES = LibGLES+".bak";
public static bool IsEnabled{
get{
return File.Exists(LibEGL) && File.Exists(LibGLES);
}
}
public static bool CanEnable{
get{
return File.Exists(DisabledLibEGL) && File.Exists(DisabledLibGLES);
}
}
public static bool Enable(){
if (IsEnabled)return false;
try{
File.Move(DisabledLibEGL,LibEGL);
File.Move(DisabledLibGLES,LibGLES);
return true;
}catch{
return false;
}
}
public static bool Disable(){
if (!IsEnabled)return false;
try{
if (File.Exists(DisabledLibEGL)){
File.Delete(DisabledLibEGL);
}
if (File.Exists(DisabledLibGLES)){
File.Delete(DisabledLibGLES);
}
}catch{
// woops
}
try{
File.Move(LibEGL,DisabledLibEGL);
File.Move(LibGLES,DisabledLibGLES);
return true;
}catch{
return false;
}
}
}
}

View File

@@ -0,0 +1,56 @@
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace TweetDck.Core.Utils{
static class NativeMethods{
public const int HWND_TOPMOST = -1;
public const uint SWP_NOACTIVATE = 0x0010;
public const int MOUSEEVENTF_LEFTDOWN = 0x02;
public const int MOUSEEVENTF_LEFTUP = 0x04;
public const int MOUSEEVENTF_RIGHTDOWN = 0x08;
public const int MOUSEEVENTF_RIGHTUP = 0x10;
public enum MouseButton{
Left, Right
}
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr LoadLibrary(string name);
[DllImport("Shell32.dll")]
public static extern int SHChangeNotify(int eventId, int flags, IntPtr item1, IntPtr item2);
[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
public static extern bool SetWindowPos(int hWnd, int hWndOrder, int x, int y, int width, int height, uint flags);
[DllImport("user32.dll")]
public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
public static void SetFormPos(Form form, int hWndOrder, uint flags){
SetWindowPos(form.Handle.ToInt32(),hWndOrder,form.Left,form.Top,form.Width,form.Height,flags);
}
public static void SimulateMouseClick(MouseButton button){
int flagHold, flagRelease;
switch(button){
case MouseButton.Left:
flagHold = SystemInformation.MouseButtonsSwapped ? MOUSEEVENTF_RIGHTDOWN : MOUSEEVENTF_LEFTDOWN;
flagRelease = SystemInformation.MouseButtonsSwapped ? MOUSEEVENTF_RIGHTUP : MOUSEEVENTF_LEFTUP;
break;
case MouseButton.Right:
flagHold = SystemInformation.MouseButtonsSwapped ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_RIGHTDOWN;
flagRelease = SystemInformation.MouseButtonsSwapped ? MOUSEEVENTF_LEFTUP : MOUSEEVENTF_RIGHTUP;
break;
default: return;
}
mouse_event(flagHold,Cursor.Position.X,Cursor.Position.Y,0,0);
mouse_event(flagRelease,Cursor.Position.X,Cursor.Position.Y,0,0);
}
}
}

View File

@@ -28,10 +28,9 @@ namespace TweetDck.Migration {
this.btnIgnore = new System.Windows.Forms.Button(); this.btnIgnore = new System.Windows.Forms.Button();
this.panelButtons = new System.Windows.Forms.FlowLayoutPanel(); this.panelButtons = new System.Windows.Forms.FlowLayoutPanel();
this.btnAskLater = new System.Windows.Forms.Button(); this.btnAskLater = new System.Windows.Forms.Button();
this.btnCopy = new System.Windows.Forms.Button();
this.btnMigrate = new System.Windows.Forms.Button(); this.btnMigrate = new System.Windows.Forms.Button();
this.btnMigrateUninstall = new System.Windows.Forms.Button(); this.btnMigrateUninstall = new System.Windows.Forms.Button();
this.labelQuestion = new RichTextLabel(); this.labelQuestion = new TweetDck.Core.Controls.RichTextLabel();
this.panelButtons.SuspendLayout(); this.panelButtons.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
@@ -39,8 +38,8 @@ namespace TweetDck.Migration {
// //
this.btnIgnore.AutoSize = true; this.btnIgnore.AutoSize = true;
this.btnIgnore.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.btnIgnore.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.btnIgnore.Location = new System.Drawing.Point(356, 0); this.btnIgnore.Location = new System.Drawing.Point(353, 0);
this.btnIgnore.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0); this.btnIgnore.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.btnIgnore.Name = "btnIgnore"; this.btnIgnore.Name = "btnIgnore";
this.btnIgnore.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0); this.btnIgnore.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.btnIgnore.Size = new System.Drawing.Size(53, 23); this.btnIgnore.Size = new System.Drawing.Size(53, 23);
@@ -55,11 +54,10 @@ namespace TweetDck.Migration {
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.panelButtons.Controls.Add(this.btnAskLater); this.panelButtons.Controls.Add(this.btnAskLater);
this.panelButtons.Controls.Add(this.btnIgnore); this.panelButtons.Controls.Add(this.btnIgnore);
this.panelButtons.Controls.Add(this.btnCopy);
this.panelButtons.Controls.Add(this.btnMigrate); this.panelButtons.Controls.Add(this.btnMigrate);
this.panelButtons.Controls.Add(this.btnMigrateUninstall); this.panelButtons.Controls.Add(this.btnMigrateUninstall);
this.panelButtons.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; this.panelButtons.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
this.panelButtons.Location = new System.Drawing.Point(12, 87); this.panelButtons.Location = new System.Drawing.Point(12, 75);
this.panelButtons.Name = "panelButtons"; this.panelButtons.Name = "panelButtons";
this.panelButtons.Size = new System.Drawing.Size(480, 23); this.panelButtons.Size = new System.Drawing.Size(480, 23);
this.panelButtons.TabIndex = 0; this.panelButtons.TabIndex = 0;
@@ -78,25 +76,11 @@ namespace TweetDck.Migration {
this.btnAskLater.UseVisualStyleBackColor = true; this.btnAskLater.UseVisualStyleBackColor = true;
this.btnAskLater.Click += new System.EventHandler(this.btnAskLater_Click); this.btnAskLater.Click += new System.EventHandler(this.btnAskLater_Click);
// //
// btnCopy
//
this.btnCopy.AutoSize = true;
this.btnCopy.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.btnCopy.Location = new System.Drawing.Point(303, 0);
this.btnCopy.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.btnCopy.Name = "btnCopy";
this.btnCopy.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.btnCopy.Size = new System.Drawing.Size(47, 23);
this.btnCopy.TabIndex = 2;
this.btnCopy.Text = "Copy";
this.btnCopy.UseVisualStyleBackColor = true;
this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
//
// btnMigrate // btnMigrate
// //
this.btnMigrate.AutoSize = true; this.btnMigrate.AutoSize = true;
this.btnMigrate.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.btnMigrate.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.btnMigrate.Location = new System.Drawing.Point(239, 0); this.btnMigrate.Location = new System.Drawing.Point(289, 0);
this.btnMigrate.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); this.btnMigrate.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.btnMigrate.Name = "btnMigrate"; this.btnMigrate.Name = "btnMigrate";
this.btnMigrate.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0); this.btnMigrate.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
@@ -110,7 +94,7 @@ namespace TweetDck.Migration {
// //
this.btnMigrateUninstall.AutoSize = true; this.btnMigrateUninstall.AutoSize = true;
this.btnMigrateUninstall.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.btnMigrateUninstall.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.btnMigrateUninstall.Location = new System.Drawing.Point(135, 0); this.btnMigrateUninstall.Location = new System.Drawing.Point(185, 0);
this.btnMigrateUninstall.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); this.btnMigrateUninstall.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
this.btnMigrateUninstall.Name = "btnMigrateUninstall"; this.btnMigrateUninstall.Name = "btnMigrateUninstall";
this.btnMigrateUninstall.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0); this.btnMigrateUninstall.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
@@ -131,7 +115,7 @@ namespace TweetDck.Migration {
this.labelQuestion.Name = "labelQuestion"; this.labelQuestion.Name = "labelQuestion";
this.labelQuestion.ReadOnly = true; this.labelQuestion.ReadOnly = true;
this.labelQuestion.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None; this.labelQuestion.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
this.labelQuestion.Size = new System.Drawing.Size(443, 72); this.labelQuestion.Size = new System.Drawing.Size(443, 60);
this.labelQuestion.TabIndex = 2; this.labelQuestion.TabIndex = 2;
this.labelQuestion.TabStop = false; this.labelQuestion.TabStop = false;
this.labelQuestion.Text = ""; this.labelQuestion.Text = "";
@@ -140,13 +124,14 @@ namespace TweetDck.Migration {
// //
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(504, 122); this.ClientSize = new System.Drawing.Size(504, 110);
this.Controls.Add(this.labelQuestion); this.Controls.Add(this.labelQuestion);
this.Controls.Add(this.panelButtons); this.Controls.Add(this.panelButtons);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "FormMigrationQuestion"; this.Name = "FormMigrationQuestion";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "TweetDeck Migration"; this.Text = "TweetDeck Migration";
this.panelButtons.ResumeLayout(false); this.panelButtons.ResumeLayout(false);
@@ -159,7 +144,6 @@ namespace TweetDck.Migration {
private System.Windows.Forms.Button btnIgnore; private System.Windows.Forms.Button btnIgnore;
private System.Windows.Forms.FlowLayoutPanel panelButtons; private System.Windows.Forms.FlowLayoutPanel panelButtons;
private System.Windows.Forms.Button btnCopy;
private System.Windows.Forms.Button btnMigrate; private System.Windows.Forms.Button btnMigrate;
private RichTextLabel labelQuestion; private RichTextLabel labelQuestion;
private System.Windows.Forms.Button btnAskLater; private System.Windows.Forms.Button btnAskLater;

View File

@@ -10,7 +10,7 @@ namespace TweetDck.Migration{
public FormMigrationQuestion(){ public FormMigrationQuestion(){
InitializeComponent(); InitializeComponent();
labelQuestion.Rtf = RichTextLabel.Wrap(@"Hey there, I found some TweetDeck data! Do you want to \b Migrate\b0 it and delete the old data folder, \b Copy\b0 it and keep the folder, \b Ignore\b0 the request forever, or do you need some more time for the decision?\par You may also \b Migrate & Purge\b0 which uninstalls TweetDeck too!"); labelQuestion.Rtf = RichTextLabel.Wrap(@"Hey there, I found some TweetDeck data! Do you want to \b Migrate\b0 it and delete the old data folder, \b Ignore\b0 the request forever, or just try "+Program.BrandName+@" first?\par You may also \b Migrate & Purge\b0 which uninstalls TweetDeck too!");
} }
protected override void OnPaint(PaintEventArgs e){ protected override void OnPaint(PaintEventArgs e){
@@ -26,10 +26,6 @@ namespace TweetDck.Migration{
Close(MigrationDecision.Migrate); Close(MigrationDecision.Migrate);
} }
private void btnCopy_Click(object sender, EventArgs e){
Close(MigrationDecision.Copy);
}
private void btnIgnore_Click(object sender, EventArgs e){ private void btnIgnore_Click(object sender, EventArgs e){
Close(MigrationDecision.Ignore); Close(MigrationDecision.Ignore);
} }

View File

@@ -10,11 +10,6 @@
/// </summary> /// </summary>
MigratePurge, MigratePurge,
/// <summary>
/// Copies the important files without deleting the TweetDeck folder.
/// </summary>
Copy,
/// <summary> /// <summary>
/// Does not copy any files and does not ask the user about data migration again. /// Does not copy any files and does not ask the user about data migration again.
/// </summary> /// </summary>

View File

@@ -8,6 +8,7 @@ using System.Windows.Forms;
using Microsoft.Win32; using Microsoft.Win32;
using TweetDck.Core.Other; using TweetDck.Core.Other;
using TweetDck.Migration.Helpers; using TweetDck.Migration.Helpers;
using TweetDck.Core.Utils;
namespace TweetDck.Migration{ namespace TweetDck.Migration{
static class MigrationManager{ static class MigrationManager{
@@ -25,7 +26,6 @@ namespace TweetDck.Migration{
switch(decision){ switch(decision){
case MigrationDecision.MigratePurge: case MigrationDecision.MigratePurge:
case MigrationDecision.Migrate: case MigrationDecision.Migrate:
case MigrationDecision.Copy:
FormBackgroundWork formWait = new FormBackgroundWork(); FormBackgroundWork formWait = new FormBackgroundWork();
formWait.ShowWorkDialog(() => { formWait.ShowWorkDialog(() => {
@@ -66,7 +66,7 @@ namespace TweetDck.Migration{
} }
private static bool BeginMigration(MigrationDecision decision, Action<Exception> onFinished){ private static bool BeginMigration(MigrationDecision decision, Action<Exception> onFinished){
if (decision != MigrationDecision.MigratePurge && decision != MigrationDecision.Migrate && decision != MigrationDecision.Copy){ if (decision != MigrationDecision.MigratePurge && decision != MigrationDecision.Migrate){
return false; return false;
} }
@@ -117,7 +117,7 @@ namespace TweetDck.Migration{
if (decision == MigrationDecision.MigratePurge){ if (decision == MigrationDecision.MigratePurge){
// update the lnk files wherever possible (desktop icons, pinned taskbar, start menu) // update the lnk files wherever possible (desktop icons, pinned taskbar, start menu)
foreach(string location in GetLnkDirectories()){ foreach(string location in GetLnkDirectories()){
if (location == string.Empty)continue; if (string.IsNullOrEmpty(location))continue;
string linkFile = Path.Combine(location,"TweetDeck.lnk"); string linkFile = Path.Combine(location,"TweetDeck.lnk");
@@ -125,7 +125,7 @@ namespace TweetDck.Migration{
LnkEditor lnk = new LnkEditor(linkFile); LnkEditor lnk = new LnkEditor(linkFile);
lnk.SetPath(Application.ExecutablePath); lnk.SetPath(Application.ExecutablePath);
lnk.SetWorkingDirectory(Environment.CurrentDirectory); lnk.SetWorkingDirectory(Environment.CurrentDirectory);
lnk.SetComment(Program.BrandName); // TODO add a tagline lnk.SetComment(Program.BrandName+" client for Windows");
lnk.Save(); lnk.Save();
string renamed = Path.Combine(location,Program.BrandName+".lnk"); string renamed = Path.Combine(location,Program.BrandName+".lnk");
@@ -143,7 +143,7 @@ namespace TweetDck.Migration{
} }
} }
Program.SHChangeNotify(0x8000000,0x1000,IntPtr.Zero,IntPtr.Zero); // refreshes desktop NativeMethods.SHChangeNotify(0x8000000,0x1000,IntPtr.Zero,IntPtr.Zero); // refreshes desktop
// uninstall in the background // uninstall in the background
string guid = ProgramRegistrySearch.FindByDisplayName("TweetDeck"); string guid = ProgramRegistrySearch.FindByDisplayName("TweetDeck");
@@ -177,15 +177,6 @@ namespace TweetDck.Migration{
yield return Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); yield return Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
yield return Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory); yield return Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory);
yield return Environment.ExpandEnvironmentVariables(@"%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"); yield return Environment.ExpandEnvironmentVariables(@"%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar");
/* already handled by the installer
string startMenu = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);
string[] sub = Directory.GetDirectories(startMenu);
if (sub.Length > 0){
yield return Path.Combine(startMenu,sub[0],"TweetDeck");
}
*/
} }
private static void RunUninstaller(string guid, int timeout){ private static void RunUninstaller(string guid, int timeout){

View File

@@ -2,7 +2,6 @@
using System.Diagnostics; using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using CefSharp; using CefSharp;
@@ -10,6 +9,8 @@ using TweetDck.Configuration;
using TweetDck.Core; using TweetDck.Core;
using TweetDck.Migration; using TweetDck.Migration;
using TweetDck.Core.Utils; using TweetDck.Core.Utils;
using System.Linq;
using System.Threading;
[assembly: CLSCompliant(true)] [assembly: CLSCompliant(true)]
namespace TweetDck{ namespace TweetDck{
@@ -22,13 +23,14 @@ namespace TweetDck{
public const string Website = "http://tweetdick.chylex.com"; public const string Website = "http://tweetdick.chylex.com";
#endif #endif
public const string VersionTag = "1.2.1"; public const string VersionTag = "1.2.3";
public const string VersionFull = "1.2.1.0"; public const string VersionFull = "1.2.3.0";
public static readonly string StoragePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),BrandName); public static readonly string StoragePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),BrandName);
public static readonly string TemporaryPath = Path.Combine(Path.GetTempPath(),BrandName); public static readonly string TemporaryPath = Path.Combine(Path.GetTempPath(),BrandName);
private static readonly LockManager LockManager = new LockManager(Path.Combine(StoragePath,".lock")); private static readonly LockManager LockManager = new LockManager(Path.Combine(StoragePath,".lock"));
private static bool HasCleanedUp;
public static UserConfig UserConfig { get; private set; } public static UserConfig UserConfig { get; private set; }
@@ -38,23 +40,26 @@ namespace TweetDck{
} }
} }
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr LoadLibrary(string name);
[DllImport("Shell32.dll")]
public static extern int SHChangeNotify(int eventId, int flags, IntPtr item1, IntPtr item2);
[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
public static extern bool SetWindowPos(int hWnd, int hWndOrder, int x, int y, int width, int height, uint flags);
[DllImport("user32.dll")]
public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
[STAThread] [STAThread]
private static void Main(){ private static void Main(){
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
if (Environment.GetCommandLineArgs().Contains("-restart")){
for(int attempt = 0; attempt < 21; attempt++){
if (LockManager.Lock()){
break;
}
else if (attempt == 20){
MessageBox.Show(BrandName+" is taking too long to close, please wait and then start the application again manually.",BrandName+" Cannot Restart",MessageBoxButtons.OK,MessageBoxIcon.Error);
return;
}
else{
Thread.Sleep(500);
}
}
}
else{
if (!LockManager.Lock()){ if (!LockManager.Lock()){
if (MessageBox.Show("Another instance of "+BrandName+" is already running.\r\nDo you want to close it?",BrandName+" is Already Running",MessageBoxButtons.YesNo,MessageBoxIcon.Error,MessageBoxDefaultButton.Button2) == DialogResult.Yes){ if (MessageBox.Show("Another instance of "+BrandName+" is already running.\r\nDo you want to close it?",BrandName+" is Already Running",MessageBoxButtons.YesNo,MessageBoxIcon.Error,MessageBoxDefaultButton.Button2) == DialogResult.Yes){
if (!LockManager.CloseLockingProcess(10000)){ if (!LockManager.CloseLockingProcess(10000)){
@@ -66,6 +71,7 @@ namespace TweetDck{
} }
else return; else return;
} }
}
UserConfig = UserConfig.Load(Path.Combine(StoragePath,"TD_UserConfig.cfg")); UserConfig = UserConfig.Load(Path.Combine(StoragePath,"TD_UserConfig.cfg"));
@@ -96,11 +102,7 @@ namespace TweetDck{
} }
}; };
Application.ApplicationExit += (sender, args) => { Application.ApplicationExit += (sender, args) => ExitCleanup();
UserConfig.Save();
ExitCleanup();
Cef.Shutdown();
};
FormBrowser mainForm = new FormBrowser(); FormBrowser mainForm = new FormBrowser();
Application.Run(mainForm); Application.Run(mainForm);
@@ -139,8 +141,11 @@ namespace TweetDck{
} }
private static void ExitCleanup(){ private static void ExitCleanup(){
if (HasCleanedUp)return;
UserConfig.Save();
try{ try{
LockManager.Unlock();
Directory.Delete(TemporaryPath,true); Directory.Delete(TemporaryPath,true);
}catch(DirectoryNotFoundException){ }catch(DirectoryNotFoundException){
}catch(Exception e){ }catch(Exception e){
@@ -149,6 +154,10 @@ namespace TweetDck{
} }
Cef.Shutdown(); Cef.Shutdown();
BrowserCache.Exit();
LockManager.Unlock();
HasCleanedUp = true;
} }
} }
} }

View File

@@ -69,5 +69,25 @@ namespace TweetDck.Properties {
return ((System.Drawing.Icon)(obj)); return ((System.Drawing.Icon)(obj));
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon icon_tray {
get {
object obj = ResourceManager.GetObject("icon_tray", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon icon_tray_new {
get {
object obj = ResourceManager.GetObject("icon_tray_new", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
} }
} }

View File

@@ -121,4 +121,10 @@
<data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="icon_tray" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icon-tray.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icon_tray_new" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icon-tray-new.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

View File

@@ -16,8 +16,8 @@ namespace TweetDck.Resources{
} }
} }
public static IList<string> LoadResources(params string[] names){ public static IEnumerable<string> LoadResources(params string[] names){
return names.Select(LoadResource).ToList(); return names.Select(LoadResource);
} }
} }
} }

BIN
Resources/about.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@@ -4,6 +4,16 @@
// //
var isInitialized = false; var isInitialized = false;
//
// Variable: Current highlighted column jQuery object.
//
var highlightedColumnEle;
//
// Variable: Currently highlighted tweet jQuery object.
//
var highlightedTweetEle;
// //
// Function: Initializes TweetD*ck events. Called after the website app is loaded. // Function: Initializes TweetD*ck events. Called after the website app is loaded.
// //
@@ -30,10 +40,15 @@
},0); },0);
}); });
// Fix layout for right-aligned actions menu
$(document).on("uiShowActionsMenu",function(){
$(".js-dropdown.pos-r").toggleClass("pos-r pos-l");
});
// Notification handling // Notification handling
$.subscribe("/notifications/new",function(obj){ $.subscribe("/notifications/new",function(obj){
for(var item of obj.items){ for(let index = obj.items.length-1; index >= 0; index--){
onNewTweet(obj.column,item); onNewTweet(obj.column,obj.items[index]);
} }
}); });
@@ -76,18 +91,11 @@
})); }));
html.css("border","0"); html.css("border","0");
html.find(".tweet-body").first().children("footer").remove();
var body = html.find(".tweet-body").first(); var url = html.find("time").first().children("a").first().attr("href") || "";
body.children("div.js-quote-detail").each(function(){ $TD.onTweetPopup(html.html(),url,tweet.text.length); // TODO column
$(this).html("(quoted tweet)");
$(this).removeClass("padding-al");
$(this).css("padding","6px");
});
body.children("footer").remove();
$TD.onTweetPopup(html.html(),tweet.text.length); // TODO column
} }
else if (column.model.getHasSound()){ else if (column.model.getHasSound()){
$TD.onTweetSound(); // TODO disable original $TD.onTweetSound(); // TODO disable original
@@ -112,7 +120,7 @@
// //
var app = $("body").children(".js-app"); var app = $("body").children(".js-app");
new MutationObserver(function(mutations){ new MutationObserver(function(){
if (isInitialized && app.hasClass("is-hidden")){ if (isInitialized && app.hasClass("is-hidden")){
isInitialized = false; isInitialized = false;
} }
@@ -138,7 +146,7 @@
}); });
// //
// Block: Force popup notification settings // Block: Force popup notification settings.
// //
TD.controller.notifications.hasNotifications = function(){ TD.controller.notifications.hasNotifications = function(){
return true; return true;
@@ -149,7 +157,7 @@
}; };
// //
// Block: Hook into links to bypass default open function // Block: Hook into links to bypass default open function.
// //
(function(){ (function(){
var urlWait = false; var urlWait = false;
@@ -165,7 +173,7 @@
var me = $(this); var me = $(this);
var rel = me.attr("rel"); var rel = me.attr("rel");
if (!me.is(".link-complex") && !(rel === "mediaPreview" && me.closest("#open-modal").length === 0) && rel !== "list" && rel !== "user"){ if (!me.is(".link-complex") && !(rel === "mediaPreview" && me.closest("#open-modal").length === 0) && rel !== "list" && rel !== "user" && rel !== "tweet"){
$TD.openBrowser(me.attr("href")); $TD.openBrowser(me.attr("href"));
onUrlOpened(); onUrlOpened();
} }
@@ -194,18 +202,17 @@
})(); })();
// //
// Block: Expand shortened links on hover. // Block: Expand shortened links on hover or display tooltip.
// //
(function(){ (function(){
var cutStart = function(str, search){ var cutStart = function(str, search){
return _.startsWith(str,search) ? str.substr(search.length) : str; return str.startsWith(search) ? str.substr(search.length) : str;
}; };
$(document.body).delegate("a[data-full-url]","mouseenter mouseleave",function(e){ var prevMouseX = -1, prevMouseY = -1;
if (!$TD.expandLinksOnHover){ var tooltipTimer, tooltipDisplayed;
return;
}
$(document.body).delegate("a[data-full-url]","mouseenter mouseleave mousemove",function(e){
var me = $(this); var me = $(this);
if (e.type === "mouseenter"){ if (e.type === "mouseenter"){
@@ -215,6 +222,8 @@
return; return;
} }
if ($TD.expandLinksOnHover){
tooltipTimer = window.setTimeout(function(){
var expanded = me.attr("data-full-url"); var expanded = me.attr("data-full-url");
expanded = cutStart(expanded,"https://"); expanded = cutStart(expanded,"https://");
expanded = cutStart(expanded,"http://"); expanded = cutStart(expanded,"http://");
@@ -222,14 +231,38 @@
me.attr("td-prev-text",text); me.attr("td-prev-text",text);
me.text(expanded); me.text(expanded);
},200);
}
else{
tooltipTimer = window.setTimeout(function(){
$TD.displayTooltip(me.attr("data-full-url"),false);
tooltipDisplayed = true;
},400);
}
} }
else if (e.type === "mouseleave"){ else if (e.type === "mouseleave"){
if ($TD.expandLinksOnHover){
var prevText = me.attr("td-prev-text"); var prevText = me.attr("td-prev-text");
if (prevText){ if (prevText){
me.text(prevText); me.text(prevText);
} }
} }
window.clearTimeout(tooltipTimer);
if (tooltipDisplayed){
tooltipDisplayed = false;
$TD.displayTooltip(null,false);
}
}
else if (e.type === "mousemove"){
if (tooltipDisplayed && (prevMouseX != e.clientX || prevMouseY != e.clientY)){
$TD.displayTooltip(me.attr("data-full-url"),false);
prevMouseX = e.clientX;
prevMouseY = e.clientY;
}
}
}); });
})(); })();
@@ -256,7 +289,7 @@
};*/ };*/
// //
// Block: Hook into mp4 video element clicking // Block: Hook into mp4 video element clicking.
// //
$(document.body).delegate("video.js-media-gif","click",function(e){ $(document.body).delegate("video.js-media-gif","click",function(e){
var src = $(this).attr("src"); var src = $(this).attr("src");
@@ -267,6 +300,47 @@
} }
}); });
//
// Block: Update highlighted column
//
app.delegate("section","mouseenter mouseleave",function(e){
if (e.type === "mouseenter"){
highlightedColumnEle = $(this);
}
else if (e.type === "mouseleave"){
highlightedColumnEle = null;
}
});
//
// Block: Copy tweet address and update highlighted tweet.
//
(function(){
var lastTweet = "";
var updateHighlightedTweet = function(link, embeddedLink){
if (lastTweet != link){
$TD.setLastHighlightedTweet(link,embeddedLink);
lastTweet = link;
}
};
app.delegate("article.js-stream-item","mouseenter mouseleave",function(e){
if (e.type === "mouseenter"){
highlightedTweetEle = $(this);
var link = $(this).find("time").first().children("a").first();
var embedded = $(this).find(".quoted-tweet[data-tweet-id]").first();
updateHighlightedTweet(link.length > 0 ? link.attr("href") : "",embedded.length > 0 ? embedded.find(".account-link").first().attr("href")+"/status/"+embedded.attr("data-tweet-id") : "");
}
else if (e.type === "mouseleave"){
highlightedTweetEle = null;
updateHighlightedTweet("","");
}
});
})();
// //
// Block: Paste images when tweeting. // Block: Paste images when tweeting.
// //
@@ -291,7 +365,7 @@
$TD.clickUploadImage(Math.floor(buttonPos.left),Math.floor(buttonPos.top)); $TD.clickUploadImage(Math.floor(buttonPos.left),Math.floor(buttonPos.top));
}; };
$(".js-app").delegate(".js-compose-text","paste",function(e){ $(".js-app").delegate(".js-compose-text","paste",function(){
lastPasteElement = $(this); lastPasteElement = $(this);
$TD.tryPasteImage(); $TD.tryPasteImage();
}); });
@@ -340,7 +414,26 @@
})(); })();
// //
// Block: Inject custom CSS and layout into the page // Block: Support for extra mouse buttons
//
window.TDGF_onMouseClickExtra = function(button){
if (button === 1){ // back button
if (highlightedColumnEle && highlightedColumnEle.closest(".js-column").is(".is-shifted-1")){
highlightedColumnEle.find(".js-column-back").first().click();
}
else{
$(".js-column-back").click();
}
}
else if (button === 2){ // forward button
if (highlightedTweetEle){
highlightedTweetEle.children().first().click();
}
}
};
//
// Block: Inject custom CSS and layout into the page.
// //
(function(){ (function(){
var style = document.createElement("style"); var style = document.createElement("style");

BIN
Resources/icon-tray-new.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
Resources/icon-tray.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@@ -1,35 +1,117 @@
(function($TD){ (function($TD){
// //
// Function: Bubbles up the parents until it hits an element with the specified tag (includes the first element), and returns true if the search was successful. // Variable: Collection of all <a> tags.
// //
var bubbleParents = function(element, tag, callback){ var links = document.getElementsByTagName("A");
do{
if (element.tagName == "A"){
callback(element);
return true;
}
}while((element = element.parentElement) != null);
return false; //
// Function: Adds an event listener to all elements in the array or collection.
//
var addEventListener = function(collection, type, listener){
for(let index = 0; index < collection.length; index++){
collection[index].addEventListener(type,listener);
}
}; };
// //
// Block: Hook into links to bypass default open function. // Block: Hook into links to bypass default open function.
// //
document.body.addEventListener("click",function(e){ addEventListener(links,"click",function(e){
if (bubbleParents(e.target,"A",function(ele){ $TD.openBrowser(e.currentTarget.getAttribute("href"));
$TD.openBrowser(ele.getAttribute("href"));
})){
e.preventDefault(); e.preventDefault();
}
}); });
// //
// Block: Allow bypassing of t.co in context menus. // Block: Allow bypassing of t.co in context menus.
// //
document.body.addEventListener("contextmenu",function(e){ addEventListener(links,"contextmenu",function(e){
bubbleParents(e.target,"A",function(ele){ $TD.setLastRightClickedLink(e.currentTarget.getAttribute("data-full-url") || "");
$TD.setLastRightClickedLink(element.getAttribute("data-full-url") || "");
}); });
//
// Block: Expand shortened links on hover or display tooltip.
//
(function(){
var cutStart = function(str, search){
return str.startsWith(search) ? str.substr(search.length) : str;
};
var prevMouseX = -1, prevMouseY = -1;
var tooltipTimer, tooltipDisplayed;
addEventListener(links,"mouseenter",function(e){
var url = e.currentTarget.getAttribute("data-full-url");
if (!url)return;
var text = e.currentTarget.textContent;
if (text.charCodeAt(text.length-1) !== 8230){ // horizontal ellipsis
return;
}
if ($TD.expandLinksOnHover){
tooltipTimer = window.setTimeout(function(){
var expanded = url;
expanded = cutStart(expanded,"https://");
expanded = cutStart(expanded,"http://");
expanded = cutStart(expanded,"www.");
e.currentTarget.setAttribute("td-prev-text",text);
e.currentTarget.innerHTML = expanded;
},200);
}
else{
tooltipTimer = window.setTimeout(function(){
$TD.displayTooltip(url,true);
tooltipDisplayed = true;
},400);
}
}); });
addEventListener(links,"mouseleave",function(e){
if (!e.currentTarget.hasAttribute("data-full-url"))return;
if ($TD.expandLinksOnHover){
var prevText = e.currentTarget.getAttribute("td-prev-text");
if (prevText){
e.currentTarget.innerHTML = prevText;
}
}
window.clearTimeout(tooltipTimer);
if (tooltipDisplayed){
tooltipDisplayed = false;
$TD.displayTooltip(null,true);
}
});
addEventListener(links,"mousemove",function(e){
if (tooltipDisplayed && (prevMouseX != e.clientX || prevMouseY != e.clientY)){
var url = e.currentTarget.getAttribute("data-full-url");
if (!url)return;
$TD.displayTooltip(url,true);
prevMouseX = e.clientX;
prevMouseY = e.clientY;
}
});
})();
//
// Block: Setup embedded tweet address for context menu
//
(function(){
var embedded = document.getElementsByClassName("quoted-tweet");
if (embedded.length === 0)return;
var tweetId = embedded[0].getAttribute("data-tweet-id");
if (!tweetId)return;
var account = embedded[0].getElementsByClassName("account-link");
if (account.length === 0)return;
$TD.setNotificationTweetEmbedded(account[0].getAttribute("href")+"/status/"+tweetId);
})();
})($TD); })($TD);

View File

@@ -1,9 +1,19 @@
(function($,$TD){ (function($,$TDU){
// //
// Variable: Current timeout ID for update checking. // Variable: Current timeout ID for update checking.
// //
var updateCheckTimeoutID; var updateCheckTimeoutID;
//
// Constant: Update exe file name.
//
const updateFileName = $TDU.brandName+".Update.exe";
//
// Constant: Url that returns JSON data about latest version.
//
const updateCheckUrl = "https://api.github.com/repos/chylex/"+$TDU.brandName+"/releases/latest";
// //
// Function: Creates the update notification element. Removes the old one if already exists. // Function: Creates the update notification element. Removes the old one if already exists.
// //
@@ -17,7 +27,7 @@
var html = [ var html = [
"<div id='tweetdck-update'>", "<div id='tweetdck-update'>",
"<p class='tdu-title'>"+$TD.brandName+" Update</p>", "<p class='tdu-title'>"+$TDU.brandName+" Update</p>",
"<p class='tdu-info'>Version "+version+" is now available.</p>", "<p class='tdu-info'>Version "+version+" is now available.</p>",
"<div class='tdu-buttons'>", "<div class='tdu-buttons'>",
"<button class='btn btn-positive tdu-btn-download'><span class='label'>Download</button>", "<button class='btn btn-positive tdu-btn-download'><span class='label'>Download</button>",
@@ -80,11 +90,11 @@
buttonDiv.children(".tdu-btn-download").click(function(){ buttonDiv.children(".tdu-btn-download").click(function(){
ele.remove(); ele.remove();
$TD.onUpdateAccepted(version,download); $TDU.onUpdateAccepted(version,download);
}); });
buttonDiv.children(".tdu-btn-dismiss").click(function(){ buttonDiv.children(".tdu-btn-dismiss").click(function(){
$TD.onUpdateDismissed(version); $TDU.onUpdateDismissed(version);
ele.slideUp(function(){ ele.remove(); }); ele.slideUp(function(){ ele.remove(); });
}); });
@@ -96,19 +106,25 @@
}; };
// //
// Function: Runs an update check and updates all DOM elements appropriately // Function: Runs an update check and updates all DOM elements appropriately.
// //
var runUpdateCheck = function(){ var runUpdateCheck = function(force, eventID){
clearTimeout(updateCheckTimeoutID); clearTimeout(updateCheckTimeoutID);
updateCheckTimeoutID = setTimeout(runUpdateCheck,1000*60*60); // 1 hour updateCheckTimeoutID = setTimeout(runUpdateCheck,1000*60*60); // 1 hour
if (!$TD.updateCheckEnabled)return; if (!$TDU.updateCheckEnabled && !force)return;
$.getJSON("https://api.github.com/repos/chylex/"+$TD.brandName+"/releases/latest",function(response){ $.getJSON(updateCheckUrl,function(response){
var tagName = response.tag_name; var tagName = response.tag_name;
var hasUpdate = tagName !== $TDU.versionTag && tagName !== $TDU.dismissedVersionTag && response.assets.length > 0;
if (tagName != $TD.versionTag && tagName != $TD.dismissedVersionTag && response.assets.length > 0){ if (hasUpdate){
createUpdateNotificationElement(tagName,response.assets[0].browser_download_url); var obj = response.assets.find(asset => asset.name === updateFileName) || response.assets[0];
createUpdateNotificationElement(tagName,obj.browser_download_url);
}
if (eventID !== 0){
$TDU.onUpdateCheckFinished(eventID,hasUpdate,tagName);
} }
}); });
}; };
@@ -116,6 +132,6 @@
// //
// Block: Setup global functions. // Block: Setup global functions.
// //
window.TDGF_runUpdateCheck = runUpdateCheck; window.TDUF_runUpdateCheck = runUpdateCheck;
runUpdateCheck(); runUpdateCheck();
})($,$TD); })($,$TDU);

View File

@@ -126,10 +126,10 @@
<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="Core\Other\FormUpdateDownload.cs"> <Compile Include="Updates\FormUpdateDownload.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Core\Other\FormUpdateDownload.Designer.cs"> <Compile Include="Updates\FormUpdateDownload.Designer.cs">
<DependentUpon>FormUpdateDownload.cs</DependentUpon> <DependentUpon>FormUpdateDownload.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Core\TrayIcon.cs"> <Compile Include="Core\TrayIcon.cs">
@@ -138,8 +138,14 @@
<Compile Include="Core\TrayIcon.Designer.cs"> <Compile Include="Core\TrayIcon.Designer.cs">
<DependentUpon>TrayIcon.cs</DependentUpon> <DependentUpon>TrayIcon.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Core\Utils\BrowserCache.cs" />
<Compile Include="Core\Utils\BrowserUtils.cs" /> <Compile Include="Core\Utils\BrowserUtils.cs" />
<Compile Include="Core\Utils\UpdateInfo.cs" /> <Compile Include="Core\Utils\HardwareAcceleration.cs" />
<Compile Include="Core\Utils\NativeMethods.cs" />
<Compile Include="Updates\UpdateAcceptedEventArgs.cs" />
<Compile Include="Updates\UpdateCheckEventArgs.cs" />
<Compile Include="Updates\UpdateHandler.cs" />
<Compile Include="Updates\UpdateInfo.cs" />
<Compile Include="Migration\FormMigrationQuestion.cs"> <Compile Include="Migration\FormMigrationQuestion.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@@ -210,10 +216,13 @@
<EmbeddedResource Include="Core\FormBrowser.resx"> <EmbeddedResource Include="Core\FormBrowser.resx">
<DependentUpon>FormBrowser.cs</DependentUpon> <DependentUpon>FormBrowser.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Core\Other\FormAbout.resx">
<DependentUpon>FormAbout.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Core\Other\FormSettings.resx"> <EmbeddedResource Include="Core\Other\FormSettings.resx">
<DependentUpon>FormSettings.cs</DependentUpon> <DependentUpon>FormSettings.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Core\Other\FormUpdateDownload.resx"> <EmbeddedResource Include="Updates\FormUpdateDownload.resx">
<DependentUpon>FormUpdateDownload.cs</DependentUpon> <DependentUpon>FormUpdateDownload.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
@@ -236,6 +245,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Resources\icon-small.ico" /> <Content Include="Resources\icon-small.ico" />
<None Include="Resources\icon-tray-new.ico" />
<None Include="Resources\icon-tray.ico" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

View File

@@ -1,4 +1,4 @@
namespace TweetDck.Core.Other { namespace TweetDck.Updates {
partial class FormUpdateDownload { partial class FormUpdateDownload {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@@ -6,7 +6,7 @@ using System.Windows.Forms;
using TweetDck.Core.Controls; using TweetDck.Core.Controls;
using TweetDck.Core.Utils; using TweetDck.Core.Utils;
namespace TweetDck.Core.Other{ namespace TweetDck.Updates{
sealed partial class FormUpdateDownload : Form{ sealed partial class FormUpdateDownload : Form{
public string InstallerPath{ public string InstallerPath{
get{ get{

View File

@@ -0,0 +1,11 @@
using System;
namespace TweetDck.Updates{
class UpdateAcceptedEventArgs : EventArgs{
public readonly UpdateInfo UpdateInfo;
public UpdateAcceptedEventArgs(UpdateInfo info){
this.UpdateInfo = info;
}
}
}

View File

@@ -0,0 +1,15 @@
using System;
namespace TweetDck.Updates{
class UpdateCheckEventArgs : EventArgs{
public int EventId { get; private set; }
public bool UpdateAvailable { get; private set; }
public string LatestVersion { get; private set; }
public UpdateCheckEventArgs(int eventId, bool updateAvailable, string latestVersion){
EventId = eventId;
UpdateAvailable = updateAvailable;
LatestVersion = latestVersion;
}
}
}

98
Updates/UpdateHandler.cs Normal file
View File

@@ -0,0 +1,98 @@
using System;
using System.Linq;
using CefSharp;
using CefSharp.WinForms;
using TweetDck.Core;
using TweetDck.Core.Controls;
using TweetDck.Resources;
namespace TweetDck.Updates{
class UpdateHandler{
private readonly ChromiumWebBrowser browser;
private readonly FormBrowser form;
public event EventHandler<UpdateAcceptedEventArgs> UpdateAccepted;
public event EventHandler<UpdateCheckEventArgs> CheckFinished;
private int lastEventId;
public UpdateHandler(ChromiumWebBrowser browser, FormBrowser form){
this.browser = browser;
this.form = form;
browser.FrameLoadEnd += browser_FrameLoadEnd;
browser.RegisterJsObject("$TDU",new Bridge(this));
}
private void browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e){
if (e.Frame.IsMain){
foreach(string js in ScriptLoader.LoadResources("update.js").Where(js => js != null)){
browser.ExecuteScriptAsync(js);
}
}
}
public int Check(bool force){
browser.ExecuteScriptAsync("TDUF_runUpdateCheck",force,++lastEventId);
return lastEventId;
}
private void TriggerUpdateAcceptedEvent(UpdateAcceptedEventArgs args){
if (UpdateAccepted != null){
form.InvokeSafe(() => UpdateAccepted(this,args));
}
}
private void TriggerCheckFinishedEvent(UpdateCheckEventArgs args){
if (CheckFinished != null){
form.InvokeSafe(() => CheckFinished(this,args));
}
}
public class Bridge{
public string BrandName{
get{
return Program.BrandName;
}
}
public string VersionTag{
get{
return Program.VersionTag;
}
}
public bool UpdateCheckEnabled{
get{
return Program.UserConfig.EnableUpdateCheck;
}
}
public string DismissedVersionTag{
get{
return Program.UserConfig.DismissedUpdate ?? string.Empty;
}
}
private readonly UpdateHandler owner;
public Bridge(UpdateHandler owner){
this.owner = owner;
}
public void OnUpdateCheckFinished(int eventId, bool isUpdateAvailable, string latestVersion){
owner.TriggerCheckFinishedEvent(new UpdateCheckEventArgs(eventId,isUpdateAvailable,latestVersion));
}
public void OnUpdateAccepted(string versionTag, string downloadUrl){
owner.TriggerUpdateAcceptedEvent(new UpdateAcceptedEventArgs(new UpdateInfo(versionTag,downloadUrl)));
}
public void OnUpdateDismissed(string versionTag){
owner.form.InvokeSafe(() => {
Program.UserConfig.DismissedUpdate = versionTag;
Program.UserConfig.Save();
});
}
}
}
}

View File

@@ -1,4 +1,6 @@
namespace TweetDck.Core.Utils{ using TweetDck.Core.Utils;
namespace TweetDck.Updates{
class UpdateInfo{ class UpdateInfo{
public readonly string VersionTag; public readonly string VersionTag;
public readonly string DownloadUrl; public readonly string DownloadUrl;