1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-29 11:34:13 +02:00

Fix quoted tweet link in notification window not resetting

Closes 
This commit is contained in:
chylex 2016-10-21 06:50:34 +02:00
parent 334793c6f6
commit 87fd2a521e
4 changed files with 10 additions and 9 deletions

View File

@ -62,6 +62,7 @@ protected override bool ShowWithoutActivation{
public bool FreezeTimer { get; set; } public bool FreezeTimer { get; set; }
public bool ContextMenuOpen { get; set; } public bool ContextMenuOpen { get; set; }
public string CurrentUrl { get; private set; } public string CurrentUrl { get; private set; }
public string CurrentQuotedTweetUrl { get; set; }
public EventHandler Initialized; public EventHandler Initialized;
private bool isInitialized; private bool isInitialized;
@ -277,6 +278,7 @@ private void LoadNextNotification(){
private void LoadTweet(TweetNotification tweet){ private void LoadTweet(TweetNotification tweet){
CurrentUrl = tweet.Url; CurrentUrl = tweet.Url;
CurrentQuotedTweetUrl = string.Empty; // load from JS
timerProgress.Stop(); timerProgress.Stop();
totalTime = timeLeft = tweet.GetDisplayDuration(Program.UserConfig.NotificationDurationValue); totalTime = timeLeft = tweet.GetDisplayDuration(Program.UserConfig.NotificationDurationValue);

View File

@ -7,7 +7,7 @@ class ContextMenuNotification : ContextMenuBase{
private const int MenuSkipTweet = 26600; private const int MenuSkipTweet = 26600;
private const int MenuFreeze = 26601; private const int MenuFreeze = 26601;
private const int MenuCopyTweetUrl = 26602; private const int MenuCopyTweetUrl = 26602;
private const int MenuCopyTweetEmbeddedUrl = 26603; private const int MenuCopyQuotedTweetUrl = 26603;
private readonly FormNotification form; private readonly FormNotification form;
private readonly bool enableCustomMenu; private readonly bool enableCustomMenu;
@ -29,8 +29,8 @@ public override void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser br
if (!string.IsNullOrEmpty(form.CurrentUrl)){ if (!string.IsNullOrEmpty(form.CurrentUrl)){
model.AddItem((CefMenuCommand)MenuCopyTweetUrl, "Copy tweet address"); model.AddItem((CefMenuCommand)MenuCopyTweetUrl, "Copy tweet address");
if (!string.IsNullOrEmpty(TweetDeckBridge.NotificationTweetEmbedded)){ if (!string.IsNullOrEmpty(form.CurrentQuotedTweetUrl)){
model.AddItem((CefMenuCommand)MenuCopyTweetEmbeddedUrl, "Copy quoted tweet address"); model.AddItem((CefMenuCommand)MenuCopyQuotedTweetUrl, "Copy quoted tweet address");
} }
model.AddSeparator(); model.AddSeparator();
@ -61,8 +61,8 @@ public override bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser b
Clipboard.SetText(form.CurrentUrl, TextDataFormat.UnicodeText); Clipboard.SetText(form.CurrentUrl, TextDataFormat.UnicodeText);
return true; return true;
case MenuCopyTweetEmbeddedUrl: case MenuCopyQuotedTweetUrl:
Clipboard.SetText(TweetDeckBridge.NotificationTweetEmbedded, TextDataFormat.UnicodeText); Clipboard.SetText(form.CurrentQuotedTweetUrl, TextDataFormat.UnicodeText);
return true; return true;
} }

View File

@ -11,7 +11,6 @@ class TweetDeckBridge{
public static string LastRightClickedLink = string.Empty; public static string LastRightClickedLink = string.Empty;
public static string LastHighlightedTweet = string.Empty; public static string LastHighlightedTweet = string.Empty;
public static string LastHighlightedQuotedTweet = string.Empty; public static string LastHighlightedQuotedTweet = 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;
@ -81,8 +80,8 @@ public void SetLastHighlightedTweet(string link, string quotedLink){
}); });
} }
public void SetNotificationTweetEmbedded(string link){ public void SetNotificationQuotedTweet(string link){
form.InvokeSafe(() => NotificationTweetEmbedded = link); notification.InvokeSafe(() => notification.CurrentQuotedTweetUrl = link);
} }
public void OpenSettingsMenu(){ public void OpenSettingsMenu(){

View File

@ -114,7 +114,7 @@
var account = embedded[0].getElementsByClassName("account-link"); var account = embedded[0].getElementsByClassName("account-link");
if (account.length === 0)return; if (account.length === 0)return;
$TD.setNotificationTweetEmbedded(account[0].getAttribute("href")+"/status/"+tweetId); $TD.setNotificationQuotedTweet(account[0].getAttribute("href")+"/status/"+tweetId);
})(); })();
// //