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

Compare commits

..

24 Commits

Author SHA1 Message Date
6eaafd883b Release 1.18.4 2020-04-25 06:35:43 +02:00
5961a80b23 Fix blank notifications on certain hardware configurations w/ disabled acceleration
Closes #274
2020-04-25 05:47:17 +02:00
f41c6fe533 Unify all exe & dll versions 2020-04-25 05:05:05 +02:00
65b8efe13c Fix non-quoted tweet links opening in browser despite also opening in the column
Closes #273
2020-04-25 03:48:20 +02:00
89529f9c96 Add $TD.makeGetRequest and fix template plugin AJAX
Closes #272
2020-04-25 03:15:52 +02:00
e90f6ebc63 Add 'Copy image' to context menu
Closes #287
2020-04-25 02:43:12 +02:00
5888d540a6 Move clipboard utils into ClipboardManager & add SetImage 2020-04-25 02:33:39 +02:00
ae8b740600 Reorganize namespaces in main project 2020-04-25 02:16:57 +02:00
ab4e2f5bda Add error message to template plugin when AJAX request fails 2020-04-25 00:19:29 +02:00
1091b6d232 Fix IDE warnings (dispose, lang features) & nullability settings 2020-04-24 23:14:22 +02:00
fc89744238 Apparently video duration minus 0.05 causes complete hangs in short videos... 2020-03-07 01:40:07 +01:00
34e049a002 Work around video player black screen when looping & reduce player polling 2020-03-05 13:26:08 +01:00
980bf2c307 Release 1.18.3 2020-02-16 18:04:21 +01:00
762aea1e20 Add option to set first day of week in date picker
Closes #276
2020-02-16 15:47:26 +01:00
c1aefc7163 Add a way to register callbacks when $TDX property object gets updated 2020-02-16 14:39:15 +01:00
9480ba26e0 Move system tray options to a separate tab & reorganize General tab 2020-02-16 14:39:15 +01:00
c2c9160ed9 Allow dragging Twitter account links onto the app to view their profile
Closes #288
2020-02-16 11:35:20 +01:00
175b067a17 Add missing tooltip on custom video player selection 2020-02-16 11:27:46 +01:00
9d8656ca20 Add option for whether dev tools window should stay on top 2020-02-16 11:15:25 +01:00
0863001c80 Add option for custom video player executable & arguments 2020-02-15 21:17:44 +01:00
0ee22a30ad Add option for custom browser args w/ new dialog & disallow quotes in URLs 2020-02-15 20:26:07 +01:00
447697ba45 Add StringUtils.NullIfEmpty & update existing code to use it 2020-02-15 17:25:00 +01:00
aea77ff909 Make dev tools dialog a proper window that appears in taskbar 2020-02-15 15:18:16 +01:00
af5da76f72 Make video player open tweet URL instead of video URL if playback fails 2020-02-15 14:34:19 +01:00
140 changed files with 1826 additions and 1034 deletions

View File

@@ -1,10 +1,10 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
using TweetLib.Core.Application; using TweetLib.Core.Application;
namespace TweetDuck.Impl{ namespace TweetDuck.Application{
class LockHandler : IAppLockHandler{ class LockHandler : IAppLockHandler{
private const int WaitRetryDelay = 250; private const int WaitRetryDelay = 250;
private const int RestoreFailTimeout = 2000; private const int RestoreFailTimeout = 2000;

View File

@@ -2,7 +2,7 @@
using System.IO; using System.IO;
using TweetLib.Core.Application; using TweetLib.Core.Application;
namespace TweetDuck.Impl{ namespace TweetDuck.Application{
class SystemHandler : IAppSystemHandler{ class SystemHandler : IAppSystemHandler{
void IAppSystemHandler.OpenFileExplorer(string path){ void IAppSystemHandler.OpenFileExplorer(string path){
if (File.Exists(path)){ if (File.Exists(path)){

View File

@@ -2,7 +2,7 @@
using CefSharp; using CefSharp;
using TweetLib.Core.Browser; using TweetLib.Core.Browser;
namespace TweetDuck.Core.Adapters{ namespace TweetDuck.Browser.Adapters{
sealed class CefScriptExecutor : IScriptExecutor{ sealed class CefScriptExecutor : IScriptExecutor{
private readonly IWebBrowser browser; private readonly IWebBrowser browser;

View File

@@ -1,7 +1,9 @@
using System.Text; using System.Text;
using TweetDuck.Configuration; using TweetDuck.Configuration;
using TweetLib.Core;
using TweetLib.Core.Utils;
namespace TweetDuck.Core.Bridge{ namespace TweetDuck.Browser.Bridge{
static class PropertyBridge{ static class PropertyBridge{
public enum Environment{ public enum Environment{
Browser, Notification Browser, Notification
@@ -12,7 +14,7 @@ namespace TweetDuck.Core.Bridge{
static string Str(string value) => $"\"{value}\";"; static string Str(string value) => $"\"{value}\";";
UserConfig config = Program.Config.User; UserConfig config = Program.Config.User;
StringBuilder build = new StringBuilder(128).Append("(function(x){"); StringBuilder build = new StringBuilder(384).Append("(function(x){");
build.Append("x.expandLinksOnHover=").Append(Bool(config.ExpandLinksOnHover)); build.Append("x.expandLinksOnHover=").Append(Bool(config.ExpandLinksOnHover));
@@ -23,13 +25,14 @@ namespace TweetDuck.Core.Bridge{
build.Append("x.muteNotifications=").Append(Bool(config.MuteNotifications)); build.Append("x.muteNotifications=").Append(Bool(config.MuteNotifications));
build.Append("x.notificationMediaPreviews=").Append(Bool(config.NotificationMediaPreviews)); build.Append("x.notificationMediaPreviews=").Append(Bool(config.NotificationMediaPreviews));
build.Append("x.translationTarget=").Append(Str(config.TranslationTarget)); build.Append("x.translationTarget=").Append(Str(config.TranslationTarget));
build.Append("x.firstDayOfWeek=").Append(config.CalendarFirstDay == -1 ? LocaleUtils.GetJQueryDayOfWeek(Lib.Culture.DateTimeFormat.FirstDayOfWeek) : config.CalendarFirstDay);
} }
if (environment == Environment.Notification){ if (environment == Environment.Notification){
build.Append("x.skipOnLinkClick=").Append(Bool(config.NotificationSkipOnLinkClick)); build.Append("x.skipOnLinkClick=").Append(Bool(config.NotificationSkipOnLinkClick));
} }
return build.Append("})(window.$TDX=window.$TDX||{})").ToString(); return build.Append("})(window.$TDX=window.$TDX||{});if(window.TDGF_onPropertiesUpdated)window.TDGF_onPropertiesUpdated()").ToString();
} }
} }
} }

View File

@@ -1,13 +1,18 @@
using System.Diagnostics.CodeAnalysis; using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using CefSharp;
using TweetDuck.Core.Handling; using TweetDuck.Browser.Handling;
using TweetDuck.Core.Notification; using TweetDuck.Browser.Notification;
using TweetDuck.Core.Other; using TweetDuck.Controls;
using TweetDuck.Core.Utils; using TweetDuck.Dialogs;
using TweetDuck.Management;
using TweetDuck.Utils;
using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Notifications;
using TweetLib.Core.Utils;
namespace TweetDuck.Core.Bridge{ namespace TweetDuck.Browser.Bridge{
[SuppressMessage("ReSharper", "UnusedMember.Global")] [SuppressMessage("ReSharper", "UnusedMember.Global")]
class TweetDeckBridge{ class TweetDeckBridge{
public static void ResetStaticProperties(){ public static void ResetStaticProperties(){
@@ -37,9 +42,7 @@ namespace TweetDuck.Core.Bridge{
} }
public void OnIntroductionClosed(bool showGuide, bool allowDataCollection){ public void OnIntroductionClosed(bool showGuide, bool allowDataCollection){
form.InvokeAsyncSafe(() => { form.InvokeAsyncSafe(() => form.OnIntroductionClosed(showGuide, allowDataCollection));
form.OnIntroductionClosed(showGuide, allowDataCollection);
});
} }
public void LoadNotificationLayout(string fontSize, string headLayout){ public void LoadNotificationLayout(string fontSize, string headLayout){
@@ -100,18 +103,39 @@ namespace TweetDuck.Core.Bridge{
form.InvokeAsyncSafe(() => form.OnTweetScreenshotReady(html, width)); form.InvokeAsyncSafe(() => form.OnTweetScreenshotReady(html, width));
} }
public void PlayVideo(string url, string username){ public void PlayVideo(string videoUrl, string tweetUrl, string username, IJavascriptCallback callShowOverlay){
form.InvokeAsyncSafe(() => form.PlayVideo(url, username)); form.InvokeAsyncSafe(() => form.PlayVideo(videoUrl, tweetUrl, username, callShowOverlay));
}
public void StopVideo(){
form.InvokeAsyncSafe(form.StopVideo);
} }
public void FixClipboard(){ public void FixClipboard(){
form.InvokeAsyncSafe(WindowsUtils.ClipboardStripHtmlStyles); form.InvokeAsyncSafe(ClipboardManager.StripHtmlStyles);
} }
public void OpenBrowser(string url){ public void OpenBrowser(string url){
form.InvokeAsyncSafe(() => BrowserUtils.OpenExternalBrowser(url)); form.InvokeAsyncSafe(() => BrowserUtils.OpenExternalBrowser(url));
} }
public void MakeGetRequest(string url, IJavascriptCallback onSuccess, IJavascriptCallback onError){
Task.Run(async () => {
var client = WebUtils.NewClient(BrowserUtils.UserAgentVanilla);
try{
var result = await client.DownloadStringTaskAsync(url);
await onSuccess.ExecuteAsync(result);
}catch(Exception e){
await onError.ExecuteAsync(e.Message);
}finally{
onSuccess.Dispose();
onError.Dispose();
client.Dispose();
}
});
}
public int GetIdleSeconds(){ public int GetIdleSeconds(){
return NativeMethods.GetIdleSeconds(); return NativeMethods.GetIdleSeconds();
} }

View File

@@ -1,10 +1,10 @@
using System; using System;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetLib.Core.Features.Updates; using TweetLib.Core.Features.Updates;
namespace TweetDuck.Core.Bridge{ namespace TweetDuck.Browser.Bridge{
[SuppressMessage("ReSharper", "UnusedMember.Global")] [SuppressMessage("ReSharper", "UnusedMember.Global")]
class UpdateBridge{ class UpdateBridge{
private readonly UpdateHandler updates; private readonly UpdateHandler updates;

View File

@@ -2,7 +2,7 @@
using CefSharp; using CefSharp;
using TweetLib.Core.Utils; using TweetLib.Core.Utils;
namespace TweetDuck.Core.Management{ namespace TweetDuck.Browser.Data{
sealed class ContextInfo{ sealed class ContextInfo{
private LinkInfo link; private LinkInfo link;
private ChirpInfo? chirp; private ChirpInfo? chirp;

View File

@@ -1,6 +1,6 @@
using CefSharp; using CefSharp;
namespace TweetDuck.Data{ namespace TweetDuck.Browser.Data{
sealed class ResourceLink{ sealed class ResourceLink{
public string Url { get; } public string Url { get; }
public IResourceHandler Handler { get; } public IResourceHandler Handler { get; }

View File

@@ -1,10 +1,10 @@
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetLib.Core.Serialization.Converters; using TweetLib.Core.Serialization.Converters;
using TweetLib.Core.Utils; using TweetLib.Core.Utils;
namespace TweetDuck.Data{ namespace TweetDuck.Browser.Data{
sealed class WindowState{ sealed class WindowState{
private Rectangle rect; private Rectangle rect;
private bool isMaximized; private bool isMaximized;

View File

@@ -1,21 +1,10 @@
namespace TweetDuck.Core { namespace TweetDuck.Browser {
sealed partial class FormBrowser { sealed partial class FormBrowser {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
/// </summary> /// </summary>
private System.ComponentModel.IContainer components = null; private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code #region Windows Form Designer generated code
/// <summary> /// <summary>
@@ -24,7 +13,7 @@
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.trayIcon = new TweetDuck.Core.Other.TrayIcon(this.components); this.trayIcon = new TrayIcon(this.components);
this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.timerResize = new System.Windows.Forms.Timer(this.components); this.timerResize = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout(); this.SuspendLayout();
@@ -38,10 +27,10 @@
// //
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 = TweetDuck.Core.Utils.TwitterUtils.BackgroundColor; this.BackColor = TweetDuck.Utils.TwitterUtils.BackgroundColor;
this.ClientSize = new System.Drawing.Size(1008, 730); this.ClientSize = new System.Drawing.Size(1008, 730);
this.Icon = Properties.Resources.icon; this.Icon = Properties.Resources.icon;
this.Location = TweetDuck.Core.Controls.ControlExtensions.InvisibleLocation; this.Location = TweetDuck.Controls.ControlExtensions.InvisibleLocation;
this.MinimumSize = new System.Drawing.Size(348, 424); this.MinimumSize = new System.Drawing.Size(348, 424);
this.Name = "FormBrowser"; this.Name = "FormBrowser";
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
@@ -57,7 +46,7 @@
#endregion #endregion
private TweetDuck.Core.Other.TrayIcon trayIcon; private TrayIcon trayIcon;
private System.Windows.Forms.ToolTip toolTip; private System.Windows.Forms.ToolTip toolTip;
private System.Windows.Forms.Timer timerResize; private System.Windows.Forms.Timer timerResize;
} }

View File

@@ -1,26 +1,28 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using CefSharp;
using TweetDuck.Browser.Bridge;
using TweetDuck.Browser.Handling;
using TweetDuck.Browser.Handling.General;
using TweetDuck.Browser.Notification;
using TweetDuck.Browser.Notification.Screenshot;
using TweetDuck.Configuration; using TweetDuck.Configuration;
using TweetDuck.Core.Bridge; using TweetDuck.Controls;
using TweetDuck.Core.Controls; using TweetDuck.Dialogs;
using TweetDuck.Core.Handling; using TweetDuck.Dialogs.Settings;
using TweetDuck.Core.Handling.General; using TweetDuck.Management;
using TweetDuck.Core.Management; using TweetDuck.Management.Analytics;
using TweetDuck.Core.Notification;
using TweetDuck.Core.Notification.Screenshot;
using TweetDuck.Core.Other;
using TweetDuck.Core.Other.Analytics;
using TweetDuck.Core.Other.Settings.Dialogs;
using TweetDuck.Core.Utils;
using TweetDuck.Updates; using TweetDuck.Updates;
using TweetDuck.Utils;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
using TweetLib.Core.Features.Plugins.Events; using TweetLib.Core.Features.Plugins.Events;
using TweetLib.Core.Features.Updates; using TweetLib.Core.Features.Updates;
namespace TweetDuck.Core{ namespace TweetDuck.Browser{
sealed partial class FormBrowser : Form, AnalyticsFile.IProvider{ sealed partial class FormBrowser : Form, AnalyticsFile.IProvider{
private static UserConfig Config => Program.Config.User; private static UserConfig Config => Program.Config.User;
@@ -88,14 +90,6 @@ namespace TweetDuck.Core{
Disposed += (sender, args) => { Disposed += (sender, args) => {
Config.MuteToggled -= Config_MuteToggled; Config.MuteToggled -= Config_MuteToggled;
Config.TrayBehaviorChanged -= Config_TrayBehaviorChanged; Config.TrayBehaviorChanged -= Config_TrayBehaviorChanged;
browser.Dispose();
updates.Dispose();
contextMenu.Dispose();
notificationScreenshotManager?.Dispose();
videoPlayer?.Dispose();
analytics?.Dispose();
}; };
Config.MuteToggled += Config_MuteToggled; Config.MuteToggled += Config_MuteToggled;
@@ -117,6 +111,23 @@ namespace TweetDuck.Core{
RestoreWindow(); RestoreWindow();
} }
protected override void Dispose(bool disposing){
if (disposing){
components?.Dispose();
browser.Dispose();
updates.Dispose();
notification.Dispose();
contextMenu.Dispose();
notificationScreenshotManager?.Dispose();
videoPlayer?.Dispose();
analytics?.Dispose();
}
base.Dispose(disposing);
}
private void ShowChildForm(Form form){ private void ShowChildForm(Form form){
form.VisibleChanged += (sender, args) => form.MoveToCenter(this); form.VisibleChanged += (sender, args) => form.MoveToCenter(this);
form.Show(this); form.Show(this);
@@ -150,7 +161,9 @@ namespace TweetDuck.Core{
} }
private void FormBrowser_Activated(object sender, EventArgs e){ private void FormBrowser_Activated(object sender, EventArgs e){
if (!isLoaded)return; if (!isLoaded){
return;
}
trayIcon.HasNotifications = false; trayIcon.HasNotifications = false;
@@ -160,14 +173,18 @@ namespace TweetDuck.Core{
} }
private void FormBrowser_LocationChanged(object sender, EventArgs e){ private void FormBrowser_LocationChanged(object sender, EventArgs e){
if (!isLoaded)return; if (!isLoaded){
return;
}
timerResize.Stop(); timerResize.Stop();
timerResize.Start(); timerResize.Start();
} }
private void FormBrowser_Resize(object sender, EventArgs e){ private void FormBrowser_Resize(object sender, EventArgs e){
if (!isLoaded)return; if (!isLoaded){
return;
}
if (WindowState != prevState){ if (WindowState != prevState){
prevState = WindowState; prevState = WindowState;
@@ -188,7 +205,9 @@ namespace TweetDuck.Core{
} }
private void FormBrowser_ResizeEnd(object sender, EventArgs e){ // also triggers when the window moves private void FormBrowser_ResizeEnd(object sender, EventArgs e){ // also triggers when the window moves
if (!isLoaded)return; if (!isLoaded){
return;
}
timerResize.Stop(); timerResize.Stop();
@@ -199,7 +218,9 @@ namespace TweetDuck.Core{
} }
private void FormBrowser_FormClosing(object sender, FormClosingEventArgs e){ private void FormBrowser_FormClosing(object sender, FormClosingEventArgs e){
if (!isLoaded)return; if (!isLoaded){
return;
}
if (Config.TrayBehavior.ShouldHideOnClose() && trayIcon.Visible && e.CloseReason == CloseReason.UserClosing){ if (Config.TrayBehavior.ShouldHideOnClose() && trayIcon.Visible && e.CloseReason == CloseReason.UserClosing){
Hide(); // hides taskbar too?! welp that works I guess Hide(); // hides taskbar too?! welp that works I guess
@@ -489,14 +510,14 @@ namespace TweetDuck.Core{
public void OpenProfileImport(){ public void OpenProfileImport(){
FormManager.TryFind<FormSettings>()?.Close(); FormManager.TryFind<FormSettings>()?.Close();
using(DialogSettingsManage dialog = new DialogSettingsManage(plugins, true)){ using DialogSettingsManage dialog = new DialogSettingsManage(plugins, true);
if (!dialog.IsDisposed && dialog.ShowDialog() == DialogResult.OK && !dialog.IsRestarting){ // needs disposal check because the dialog may be closed in constructor if (!dialog.IsDisposed && dialog.ShowDialog() == DialogResult.OK && !dialog.IsRestarting){ // needs disposal check because the dialog may be closed in constructor
BrowserProcessHandler.UpdatePrefs(); BrowserProcessHandler.UpdatePrefs();
FormManager.TryFind<FormPlugins>()?.Close(); FormManager.TryFind<FormPlugins>()?.Close();
plugins.Reload(); // also reloads the browser plugins.Reload(); // also reloads the browser
} }
} }
}
public void OnTweetNotification(){ // may be called multiple times, once for each type of notification public void OnTweetNotification(){ // may be called multiple times, once for each type of notification
if (Config.EnableTrayHighlight && !ContainsFocus){ if (Config.EnableTrayHighlight && !ContainsFocus){
@@ -508,24 +529,40 @@ namespace TweetDuck.Core{
AnalyticsFile.SoundNotifications.Trigger(); AnalyticsFile.SoundNotifications.Trigger();
} }
public void PlayVideo(string url, string username){ public void PlayVideo(string videoUrl, string tweetUrl, string username, IJavascriptCallback callShowOverlay){
if (string.IsNullOrEmpty(url)){ string playerPath = Config.VideoPlayerPath;
videoPlayer?.Close();
return;
}
if (playerPath == null || !File.Exists(playerPath)){
if (videoPlayer == null){ if (videoPlayer == null){
videoPlayer = new VideoPlayer(this); videoPlayer = new VideoPlayer(this);
videoPlayer.ProcessExited += (sender, args) => browser.HideVideoOverlay(true);
videoPlayer.ProcessExited += (sender, args) => { }
browser.HideVideoOverlay(true);
}; callShowOverlay.ExecuteAsync();
callShowOverlay.Dispose();
videoPlayer.Launch(videoUrl, tweetUrl, username);
}
else{
callShowOverlay.Dispose();
string quotedUrl = '"' + videoUrl + '"';
string playerArgs = Config.VideoPlayerPathArgs == null ? quotedUrl : Config.VideoPlayerPathArgs + ' ' + quotedUrl;
try{
using(Process.Start(playerPath, playerArgs)){}
}catch(Exception e){
Program.Reporter.HandleException("Error Opening Video Player", "Could not open the video player.", true, e);
}
} }
videoPlayer.Launch(url, username);
AnalyticsFile.VideoPlays.Trigger(); AnalyticsFile.VideoPlays.Trigger();
} }
public void StopVideo(){
videoPlayer?.Close();
}
public bool ProcessBrowserKey(Keys key){ public bool ProcessBrowserKey(Keys key){
if (videoPlayer != null && videoPlayer.Running){ if (videoPlayer != null && videoPlayer.Running){
videoPlayer.SendKeyEvent(key); videoPlayer.SendKeyEvent(key);

View File

@@ -1,20 +1,21 @@
using System; using System;
using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Windows.Forms; using System.Windows.Forms;
using CefSharp; using CefSharp;
using TweetDuck.Core.Controls; using TweetDuck.Browser.Adapters;
using TweetDuck.Core.Utils; using TweetDuck.Browser.Data;
using System.Linq; using TweetDuck.Browser.Notification;
using TweetDuck.Configuration; using TweetDuck.Configuration;
using TweetDuck.Core.Adapters; using TweetDuck.Controls;
using TweetDuck.Core.Management; using TweetDuck.Dialogs;
using TweetDuck.Core.Notification; using TweetDuck.Management;
using TweetDuck.Core.Other; using TweetDuck.Management.Analytics;
using TweetDuck.Core.Other.Analytics; using TweetDuck.Utils;
using TweetLib.Core.Features.Twitter; using TweetLib.Core.Features.Twitter;
using TweetLib.Core.Utils; using TweetLib.Core.Utils;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Browser.Handling{
abstract class ContextMenuBase : IContextMenuHandler{ abstract class ContextMenuBase : IContextMenuHandler{
public static ContextInfo CurrentInfo { get; } = new ContextInfo(); public static ContextInfo CurrentInfo { get; } = new ContextInfo();
@@ -27,10 +28,11 @@ namespace TweetDuck.Core.Handling{
private const CefMenuCommand MenuViewImage = (CefMenuCommand)26503; private const CefMenuCommand MenuViewImage = (CefMenuCommand)26503;
private const CefMenuCommand MenuOpenMediaUrl = (CefMenuCommand)26504; private const CefMenuCommand MenuOpenMediaUrl = (CefMenuCommand)26504;
private const CefMenuCommand MenuCopyMediaUrl = (CefMenuCommand)26505; private const CefMenuCommand MenuCopyMediaUrl = (CefMenuCommand)26505;
private const CefMenuCommand MenuSaveMedia = (CefMenuCommand)26506; private const CefMenuCommand MenuCopyImage = (CefMenuCommand)26506;
private const CefMenuCommand MenuSaveTweetImages = (CefMenuCommand)26507; private const CefMenuCommand MenuSaveMedia = (CefMenuCommand)26507;
private const CefMenuCommand MenuSearchInBrowser = (CefMenuCommand)26508; private const CefMenuCommand MenuSaveTweetImages = (CefMenuCommand)26508;
private const CefMenuCommand MenuReadApplyROT13 = (CefMenuCommand)26509; private const CefMenuCommand MenuSearchInBrowser = (CefMenuCommand)26509;
private const CefMenuCommand MenuReadApplyROT13 = (CefMenuCommand)26510;
private const CefMenuCommand MenuOpenDevTools = (CefMenuCommand)26599; private const CefMenuCommand MenuOpenDevTools = (CefMenuCommand)26599;
protected ContextInfo.ContextData Context { get; private set; } protected ContextInfo.ContextData Context { get; private set; }
@@ -84,6 +86,7 @@ namespace TweetDuck.Core.Handling{
model.AddItem(MenuViewImage, "View image in photo viewer"); model.AddItem(MenuViewImage, "View image in photo viewer");
model.AddItem(MenuOpenMediaUrl, TextOpen("image")); model.AddItem(MenuOpenMediaUrl, TextOpen("image"));
model.AddItem(MenuCopyMediaUrl, TextCopy("image")); model.AddItem(MenuCopyMediaUrl, TextCopy("image"));
model.AddItem(MenuCopyImage, "Copy image");
model.AddItem(MenuSaveMedia, TextSave("image")); model.AddItem(MenuSaveMedia, TextSave("image"));
if (Context.Chirp.Images.Length > 1){ if (Context.Chirp.Images.Length > 1){
@@ -123,6 +126,16 @@ namespace TweetDuck.Core.Handling{
SetClipboardText(control, TwitterUrls.GetMediaLink(Context.MediaUrl, ImageQuality)); SetClipboardText(control, TwitterUrls.GetMediaLink(Context.MediaUrl, ImageQuality));
break; break;
case MenuCopyImage: {
string url = Context.MediaUrl;
control.InvokeAsyncSafe(() => {
TwitterUtils.CopyImage(url, ImageQuality);
});
break;
}
case MenuViewImage: { case MenuViewImage: {
string url = Context.MediaUrl; string url = Context.MediaUrl;
@@ -178,7 +191,7 @@ namespace TweetDuck.Core.Handling{
break; break;
case MenuOpenDevTools: case MenuOpenDevTools:
browserControl.ShowDevTools(); browserControl.OpenDevToolsCustom();
break; break;
} }
@@ -202,7 +215,7 @@ namespace TweetDuck.Core.Handling{
} }
protected static void SetClipboardText(Control control, string text){ protected static void SetClipboardText(Control control, string text){
control.InvokeAsyncSafe(() => WindowsUtils.SetClipboard(text, TextDataFormat.UnicodeText)); control.InvokeAsyncSafe(() => ClipboardManager.SetText(text, TextDataFormat.UnicodeText));
} }
protected static void InsertSelectionSearchItem(IMenuModel model, CefMenuCommand insertCommand, string insertLabel){ protected static void InsertSelectionSearchItem(IMenuModel model, CefMenuCommand insertCommand, string insertLabel){

View File

@@ -1,10 +1,10 @@
using CefSharp; using System.Windows.Forms;
using System.Windows.Forms; using CefSharp;
using TweetDuck.Core.Controls; using TweetDuck.Browser.Data;
using TweetDuck.Core.Management; using TweetDuck.Controls;
using TweetLib.Core.Features.Twitter; using TweetLib.Core.Features.Twitter;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Browser.Handling{
sealed class ContextMenuBrowser : ContextMenuBase{ sealed class ContextMenuBrowser : ContextMenuBase{
private const CefMenuCommand MenuGlobal = (CefMenuCommand)26600; private const CefMenuCommand MenuGlobal = (CefMenuCommand)26600;
private const CefMenuCommand MenuMute = (CefMenuCommand)26601; private const CefMenuCommand MenuMute = (CefMenuCommand)26601;

View File

@@ -1,7 +1,7 @@
using CefSharp; using CefSharp;
using TweetDuck.Core.Other.Analytics; using TweetDuck.Management.Analytics;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Browser.Handling{
sealed class ContextMenuGuide : ContextMenuBase{ sealed class ContextMenuGuide : ContextMenuBase{
public ContextMenuGuide(AnalyticsFile.IProvider analytics) : base(analytics){} public ContextMenuGuide(AnalyticsFile.IProvider analytics) : base(analytics){}

View File

@@ -1,8 +1,8 @@
using CefSharp; using CefSharp;
using TweetDuck.Core.Controls; using TweetDuck.Browser.Notification;
using TweetDuck.Core.Notification; using TweetDuck.Controls;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Browser.Handling{
sealed class ContextMenuNotification : ContextMenuBase{ sealed class ContextMenuNotification : ContextMenuBase{
private const CefMenuCommand MenuViewDetail = (CefMenuCommand)26600; private const CefMenuCommand MenuViewDetail = (CefMenuCommand)26600;
private const CefMenuCommand MenuSkipTweet = (CefMenuCommand)26601; private const CefMenuCommand MenuSkipTweet = (CefMenuCommand)26601;

View File

@@ -2,7 +2,7 @@
using CefSharp; using CefSharp;
using CefSharp.Enums; using CefSharp.Enums;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Browser.Handling{
sealed class DragHandlerBrowser : IDragHandler{ sealed class DragHandlerBrowser : IDragHandler{
private readonly RequestHandlerBrowser requestHandler; private readonly RequestHandlerBrowser requestHandler;

View File

@@ -3,7 +3,7 @@ using System.IO;
using System.Text; using System.Text;
using CefSharp; using CefSharp;
namespace TweetDuck.Core.Handling.Filters{ namespace TweetDuck.Browser.Handling.Filters{
abstract class ResponseFilterBase : IResponseFilter{ abstract class ResponseFilterBase : IResponseFilter{
private enum State{ private enum State{
Reading, Writing, Done Reading, Writing, Done

View File

@@ -1,7 +1,7 @@
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace TweetDuck.Core.Handling.Filters{ namespace TweetDuck.Browser.Handling.Filters{
sealed class ResponseFilterVendor : ResponseFilterBase{ sealed class ResponseFilterVendor : ResponseFilterBase{
private static readonly Regex RegexRestoreJQuery = new Regex(@"(\w+)\.fn=\1\.prototype", RegexOptions.Compiled); private static readonly Regex RegexRestoreJQuery = new Regex(@"(\w+)\.fn=\1\.prototype", RegexOptions.Compiled);

View File

@@ -3,7 +3,7 @@ using System.Threading.Tasks;
using CefSharp; using CefSharp;
using TweetDuck.Configuration; using TweetDuck.Configuration;
namespace TweetDuck.Core.Handling.General{ namespace TweetDuck.Browser.Handling.General{
sealed class BrowserProcessHandler : IBrowserProcessHandler{ sealed class BrowserProcessHandler : IBrowserProcessHandler{
public static Task UpdatePrefs(){ public static Task UpdatePrefs(){
return Cef.UIThreadTaskFactory.StartNew(UpdatePrefsInternal); return Cef.UIThreadTaskFactory.StartNew(UpdatePrefsInternal);

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using CefSharp; using CefSharp;
namespace TweetDuck.Core.Handling.General{ namespace TweetDuck.Browser.Handling.General{
sealed class FileDialogHandler : IDialogHandler{ sealed class FileDialogHandler : IDialogHandler{
public bool OnFileDialog(IWebBrowser browserControl, IBrowser browser, CefFileDialogMode mode, CefFileDialogFlags flags, string title, string defaultFilePath, List<string> acceptFilters, int selectedAcceptFilter, IFileDialogCallback callback){ public bool OnFileDialog(IWebBrowser browserControl, IBrowser browser, CefFileDialogMode mode, CefFileDialogFlags flags, string title, string defaultFilePath, List<string> acceptFilters, int selectedAcceptFilter, IFileDialogCallback callback){
if (mode == CefFileDialogMode.Open || mode == CefFileDialogMode.OpenMultiple){ if (mode == CefFileDialogMode.Open || mode == CefFileDialogMode.OpenMultiple){

View File

@@ -1,11 +1,11 @@
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using CefSharp; using CefSharp;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetDuck.Core.Other; using TweetDuck.Dialogs;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
namespace TweetDuck.Core.Handling.General{ namespace TweetDuck.Browser.Handling.General{
sealed class JavaScriptDialogHandler : IJsDialogHandler{ sealed class JavaScriptDialogHandler : IJsDialogHandler{
private static FormMessage CreateMessageForm(string caption, string text){ private static FormMessage CreateMessageForm(string caption, string text){
MessageBoxIcon icon = MessageBoxIcon.None; MessageBoxIcon icon = MessageBoxIcon.None;

View File

@@ -1,8 +1,8 @@
using CefSharp; using CefSharp;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
namespace TweetDuck.Core.Handling.General{ namespace TweetDuck.Browser.Handling.General{
sealed class LifeSpanHandler : ILifeSpanHandler{ sealed class LifeSpanHandler : ILifeSpanHandler{
private static bool IsPopupAllowed(string url){ private static bool IsPopupAllowed(string url){
return url.StartsWith("https://twitter.com/teams/authorize?"); return url.StartsWith("https://twitter.com/teams/authorize?");

View File

@@ -1,15 +1,15 @@
using System.Windows.Forms; using System.Windows.Forms;
using CefSharp; using CefSharp;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetDuck.Core.Other; using TweetDuck.Dialogs;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Browser.Handling{
class KeyboardHandlerBase : IKeyboardHandler{ class KeyboardHandlerBase : IKeyboardHandler{
protected virtual bool HandleRawKey(IWebBrowser browserControl, IBrowser browser, Keys key, CefEventFlags modifiers){ protected virtual bool HandleRawKey(IWebBrowser browserControl, IBrowser browser, Keys key, CefEventFlags modifiers){
if (modifiers == (CefEventFlags.ControlDown | CefEventFlags.ShiftDown) && key == Keys.I){ if (modifiers == (CefEventFlags.ControlDown | CefEventFlags.ShiftDown) && key == Keys.I){
if (BrowserUtils.HasDevTools){ if (BrowserUtils.HasDevTools){
browser.ShowDevTools(); browserControl.OpenDevToolsCustom();
} }
else{ else{
browserControl.AsControl().InvokeSafe(() => { browserControl.AsControl().InvokeSafe(() => {

View File

@@ -1,7 +1,7 @@
using System.Windows.Forms; using System.Windows.Forms;
using CefSharp; using CefSharp;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Browser.Handling{
sealed class KeyboardHandlerBrowser : KeyboardHandlerBase{ sealed class KeyboardHandlerBrowser : KeyboardHandlerBase{
private readonly FormBrowser form; private readonly FormBrowser form;

View File

@@ -1,9 +1,9 @@
using CefSharp; using System.Windows.Forms;
using System.Windows.Forms; using CefSharp;
using TweetDuck.Core.Controls; using TweetDuck.Browser.Notification;
using TweetDuck.Core.Notification; using TweetDuck.Controls;
namespace TweetDuck.Core.Handling { namespace TweetDuck.Browser.Handling{
sealed class KeyboardHandlerNotification : KeyboardHandlerBase{ sealed class KeyboardHandlerNotification : KeyboardHandlerBase{
private readonly FormNotificationBase notification; private readonly FormNotificationBase notification;

View File

@@ -5,11 +5,11 @@ using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using CefSharp; using CefSharp;
using CefSharp.Handler; using CefSharp.Handler;
using TweetDuck.Core.Handling.General; using TweetDuck.Browser.Handling.General;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
using TweetLib.Core.Utils; using TweetLib.Core.Utils;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Browser.Handling{
class RequestHandlerBase : DefaultRequestHandler{ class RequestHandlerBase : DefaultRequestHandler{
private static readonly Regex TweetDeckResourceUrl = new Regex(@"/dist/(.*?)\.(.*?)\.(css|js)$"); private static readonly Regex TweetDeckResourceUrl = new Regex(@"/dist/(.*?)\.(.*?)\.(css|js)$");
private static readonly SortedList<string, string> TweetDeckHashes = new SortedList<string, string>(4); private static readonly SortedList<string, string> TweetDeckHashes = new SortedList<string, string>(4);

View File

@@ -1,10 +1,10 @@
using System.Collections.Specialized; using System.Collections.Specialized;
using CefSharp; using CefSharp;
using TweetDuck.Core.Handling.Filters; using TweetDuck.Browser.Handling.Filters;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
using TweetLib.Core.Features.Twitter; using TweetLib.Core.Features.Twitter;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Browser.Handling{
sealed class RequestHandlerBrowser : RequestHandlerBase{ sealed class RequestHandlerBrowser : RequestHandlerBase{
private const string UrlVendorResource = "/dist/vendor"; private const string UrlVendorResource = "/dist/vendor";
private const string UrlLoadingSpinner = "/backgrounds/spinner_blue"; private const string UrlLoadingSpinner = "/backgrounds/spinner_blue";

View File

@@ -1,9 +1,9 @@
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using CefSharp; using CefSharp;
using TweetDuck.Data; using TweetDuck.Browser.Data;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Browser.Handling{
sealed class ResourceHandlerFactory : IResourceHandlerFactory{ sealed class ResourceHandlerFactory : IResourceHandlerFactory{
public bool HasHandlers => !handlers.IsEmpty; public bool HasHandlers => !handlers.IsEmpty;

View File

@@ -1,9 +1,9 @@
using CefSharp; using System.Collections.Specialized;
using System.Collections.Specialized;
using System.IO; using System.IO;
using System.Text; using System.Text;
using CefSharp;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Browser.Handling{
sealed class ResourceHandlerNotification : IResourceHandler{ sealed class ResourceHandlerNotification : IResourceHandler{
private readonly NameValueCollection headers = new NameValueCollection(0); private readonly NameValueCollection headers = new NameValueCollection(0);
private MemoryStream dataIn; private MemoryStream dataIn;

View File

@@ -1,11 +1,11 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using CefSharp; using CefSharp;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Notifications;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
namespace TweetDuck.Core.Notification.Example{ namespace TweetDuck.Browser.Notification.Example{
sealed class FormNotificationExample : FormNotificationMain{ sealed class FormNotificationExample : FormNotificationMain{
public override bool RequiresResize => true; public override bool RequiresResize => true;
protected override bool CanDragWindow => Config.NotificationPosition == DesktopNotification.Position.Custom; protected override bool CanDragWindow => Config.NotificationPosition == DesktopNotification.Position.Custom;

View File

@@ -1,21 +1,10 @@
namespace TweetDuck.Core.Notification { namespace TweetDuck.Browser.Notification {
partial class FormNotificationBase { partial class FormNotificationBase {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
/// </summary> /// </summary>
private System.ComponentModel.IContainer components = null; private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code #region Windows Form Designer generated code
/// <summary> /// <summary>
@@ -34,7 +23,7 @@
this.BackColor = System.Drawing.SystemColors.Control; this.BackColor = System.Drawing.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(284, 122); this.ClientSize = new System.Drawing.Size(284, 122);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Location = TweetDuck.Core.Controls.ControlExtensions.InvisibleLocation; this.Location = TweetDuck.Controls.ControlExtensions.InvisibleLocation;
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "FormNotification"; this.Name = "FormNotification";

View File

@@ -1,18 +1,18 @@
using CefSharp.WinForms; using System.Drawing;
using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using CefSharp; using CefSharp;
using CefSharp.WinForms;
using TweetDuck.Browser.Data;
using TweetDuck.Browser.Handling;
using TweetDuck.Browser.Handling.General;
using TweetDuck.Configuration; using TweetDuck.Configuration;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetDuck.Core.Handling; using TweetDuck.Management.Analytics;
using TweetDuck.Core.Handling.General; using TweetDuck.Utils;
using TweetDuck.Core.Other.Analytics;
using TweetDuck.Core.Utils;
using TweetDuck.Data;
using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Notifications;
using TweetLib.Core.Features.Twitter; using TweetLib.Core.Features.Twitter;
namespace TweetDuck.Core.Notification{ namespace TweetDuck.Browser.Notification{
abstract partial class FormNotificationBase : Form, AnalyticsFile.IProvider{ abstract partial class FormNotificationBase : Form, AnalyticsFile.IProvider{
public static readonly ResourceLink AppLogo = new ResourceLink("https://ton.twimg.com/tduck/avatar", ResourceHandler.FromByteArray(Properties.Resources.avatar, "image/png")); public static readonly ResourceLink AppLogo = new ResourceLink("https://ton.twimg.com/tduck/avatar", ResourceHandler.FromByteArray(Properties.Resources.avatar, "image/png"));
@@ -144,11 +144,7 @@ namespace TweetDuck.Core.Notification{
this.browser.SetupZoomEvents(); this.browser.SetupZoomEvents();
Controls.Add(browser); Controls.Add(browser);
Disposed += (sender, args) => this.owner.FormClosed -= owner_FormClosed;
Disposed += (sender, args) => {
this.browser.Dispose();
this.owner.FormClosed -= owner_FormClosed;
};
DpiScale = this.GetDPIScale(); DpiScale = this.GetDPIScale();
@@ -156,6 +152,16 @@ namespace TweetDuck.Core.Notification{
UpdateTitle(); UpdateTitle();
} }
protected override void Dispose(bool disposing){
if (disposing){
components?.Dispose();
browser.Dispose();
resourceHandler.Dispose();
}
base.Dispose(disposing);
}
protected override void WndProc(ref Message m){ protected override void WndProc(ref Message m){
if (m.Msg == 0x0112 && (m.WParam.ToInt32() & 0xFFF0) == 0xF010 && !CanDragWindow){ // WM_SYSCOMMAND, SC_MOVE if (m.Msg == 0x0112 && (m.WParam.ToInt32() & 0xFFF0) == 0xF010 && !CanDragWindow){ // WM_SYSCOMMAND, SC_MOVE
return; return;

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Notification { namespace TweetDuck.Browser.Notification {
partial class FormNotificationMain { partial class FormNotificationMain {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@@ -26,7 +26,7 @@
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.timerDisplayDelay = new System.Windows.Forms.Timer(this.components); this.timerDisplayDelay = new System.Windows.Forms.Timer(this.components);
this.timerProgress = new System.Windows.Forms.Timer(this.components); this.timerProgress = new System.Windows.Forms.Timer(this.components);
this.progressBarTimer = new TweetDuck.Core.Controls.FlatProgressBar(); this.progressBarTimer = new TweetDuck.Controls.FlatProgressBar();
this.SuspendLayout(); this.SuspendLayout();
// //
// timerDisplayDelay // timerDisplayDelay

View File

@@ -1,19 +1,19 @@
using CefSharp; using System;
using System;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Adapters; using CefSharp;
using TweetDuck.Core.Bridge; using TweetDuck.Browser.Adapters;
using TweetDuck.Core.Controls; using TweetDuck.Browser.Bridge;
using TweetDuck.Core.Handling; using TweetDuck.Browser.Handling;
using TweetDuck.Core.Utils; using TweetDuck.Controls;
using TweetDuck.Plugins; using TweetDuck.Plugins;
using TweetDuck.Utils;
using TweetLib.Core.Data; using TweetLib.Core.Data;
using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Notifications;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
using TweetLib.Core.Features.Plugins.Enums; using TweetLib.Core.Features.Plugins.Enums;
namespace TweetDuck.Core.Notification{ namespace TweetDuck.Browser.Notification{
abstract partial class FormNotificationMain : FormNotificationBase{ abstract partial class FormNotificationMain : FormNotificationBase{
private readonly PluginManager plugins; private readonly PluginManager plugins;
private readonly int timerBarHeight; private readonly int timerBarHeight;

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Notification { namespace TweetDuck.Browser.Notification {
partial class FormNotificationTweet { partial class FormNotificationTweet {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@@ -2,11 +2,11 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Notifications;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
namespace TweetDuck.Core.Notification{ namespace TweetDuck.Browser.Notification{
sealed partial class FormNotificationTweet : FormNotificationMain{ sealed partial class FormNotificationTweet : FormNotificationMain{
private const int NonIntrusiveIdleLimit = 30; private const int NonIntrusiveIdleLimit = 30;
private const int TrimMinimum = 32; private const int TrimMinimum = 32;

View File

@@ -3,15 +3,15 @@ using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.Windows.Forms; using System.Windows.Forms;
using CefSharp; using CefSharp;
using TweetDuck.Core.Adapters; using TweetDuck.Browser.Adapters;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetDuck.Core.Other; using TweetDuck.Dialogs;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
using TweetLib.Core.Data; using TweetLib.Core.Data;
using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Notifications;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
namespace TweetDuck.Core.Notification.Screenshot{ namespace TweetDuck.Browser.Notification.Screenshot{
sealed class FormNotificationScreenshotable : FormNotificationBase{ sealed class FormNotificationScreenshotable : FormNotificationBase{
protected override bool CanDragWindow => false; protected override bool CanDragWindow => false;
@@ -82,7 +82,8 @@ namespace TweetDuck.Core.Notification.Screenshot{
return false; return false;
} }
else{ else{
using(Bitmap bmp = new Bitmap(ClientSize.Width, Math.Max(1, height), PixelFormat.Format32bppRgb)){ using Bitmap bmp = new Bitmap(ClientSize.Width, Math.Max(1, height), PixelFormat.Format32bppRgb);
try{ try{
NativeMethods.RenderSourceIntoBitmap(context, bmp); NativeMethods.RenderSourceIntoBitmap(context, bmp);
}finally{ }finally{
@@ -94,5 +95,4 @@ namespace TweetDuck.Core.Notification.Screenshot{
} }
} }
} }
}
} }

View File

@@ -1,9 +1,9 @@
using System; using System;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
namespace TweetDuck.Core.Notification.Screenshot{ namespace TweetDuck.Browser.Notification.Screenshot{
[SuppressMessage("ReSharper", "UnusedMember.Global")] [SuppressMessage("ReSharper", "UnusedMember.Global")]
sealed class ScreenshotBridge{ sealed class ScreenshotBridge{
private readonly Control owner; private readonly Control owner;

View File

@@ -8,7 +8,7 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
#if GEN_SCREENSHOT_FRAMES #if GEN_SCREENSHOT_FRAMES
@@ -17,7 +17,7 @@ using System.IO;
using TweetDuck.Core.Utils; using TweetDuck.Core.Utils;
#endif #endif
namespace TweetDuck.Core.Notification.Screenshot{ namespace TweetDuck.Browser.Notification.Screenshot{
sealed class TweetScreenshotManager : IDisposable{ sealed class TweetScreenshotManager : IDisposable{
private readonly FormBrowser owner; private readonly FormBrowser owner;
private readonly PluginManager plugins; private readonly PluginManager plugins;

View File

@@ -2,11 +2,12 @@
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using CefSharp; using CefSharp;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetDuck.Core.Other; using TweetDuck.Dialogs;
using TweetDuck.Core.Other.Settings; using TweetDuck.Dialogs.Settings;
using TweetDuck.Management;
namespace TweetDuck.Core.Notification{ namespace TweetDuck.Browser.Notification{
static class SoundNotification{ static class SoundNotification{
public const string SupportedFormats = "*.wav;*.ogg;*.mp3;*.flac;*.opus;*.weba;*.webm"; public const string SupportedFormats = "*.wav;*.ogg;*.mp3;*.flac;*.opus;*.weba;*.webm";
@@ -28,7 +29,7 @@ namespace TweetDuck.Core.Notification{
FormBrowser browser = FormManager.TryFind<FormBrowser>(); FormBrowser browser = FormManager.TryFind<FormBrowser>();
browser?.InvokeAsyncSafe(() => { browser?.InvokeAsyncSafe(() => {
using(FormMessage form = new FormMessage("Sound Notification Error", "Could not find custom notification sound file:\n" + path, MessageBoxIcon.Error)){ using FormMessage form = new FormMessage("Sound Notification Error", "Could not find custom notification sound file:\n" + path, MessageBoxIcon.Error);
form.AddButton(FormMessage.Ignore, ControlType.Cancel | ControlType.Focused); form.AddButton(FormMessage.Ignore, ControlType.Cancel | ControlType.Focused);
Button btnViewOptions = form.AddButton("View Options"); Button btnViewOptions = form.AddButton("View Options");
@@ -38,7 +39,6 @@ namespace TweetDuck.Core.Notification{
if (form.ShowDialog() == DialogResult.OK && form.ClickedButton == btnViewOptions){ if (form.ShowDialog() == DialogResult.OK && form.ClickedButton == btnViewOptions){
browser.OpenSettings(typeof(TabSettingsSounds)); browser.OpenSettings(typeof(TabSettingsSounds));
} }
}
}); });
return null; return null;

View File

@@ -1,21 +1,10 @@
namespace TweetDuck.Core.Other { namespace TweetDuck.Browser {
partial class TrayIcon { partial class TrayIcon {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
/// </summary> /// </summary>
private System.ComponentModel.IContainer components = null; private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code #region Component Designer generated code
/// <summary> /// <summary>

View File

@@ -4,7 +4,7 @@ using System.Windows.Forms;
using TweetDuck.Configuration; using TweetDuck.Configuration;
using Res = TweetDuck.Properties.Resources; using Res = TweetDuck.Properties.Resources;
namespace TweetDuck.Core.Other{ namespace TweetDuck.Browser{
sealed partial class TrayIcon : Component{ sealed partial class TrayIcon : Component{
public enum Behavior{ // keep order public enum Behavior{ // keep order
Disabled, DisplayOnly, MinimizeToTray, CloseToTray, Combined Disabled, DisplayOnly, MinimizeToTray, CloseToTray, Combined
@@ -63,6 +63,15 @@ namespace TweetDuck.Core.Other{
container.Add(this); container.Add(this);
} }
protected override void Dispose(bool disposing){
if (disposing){
components?.Dispose();
contextMenu.Dispose();
}
base.Dispose(disposing);
}
private void UpdateIcon(){ private void UpdateIcon(){
if (Visible){ if (Visible){
notifyIcon.Icon = hasNotifications ? Res.icon_tray_new : Config.MuteNotifications ? Res.icon_tray_muted : Res.icon_tray; notifyIcon.Icon = hasNotifications ? Res.icon_tray_new : Config.MuteNotifications ? Res.icon_tray_muted : Res.icon_tray;

View File

@@ -4,21 +4,21 @@ using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using CefSharp; using CefSharp;
using CefSharp.WinForms; using CefSharp.WinForms;
using TweetDuck.Browser.Adapters;
using TweetDuck.Browser.Bridge;
using TweetDuck.Browser.Handling;
using TweetDuck.Browser.Handling.General;
using TweetDuck.Browser.Notification;
using TweetDuck.Configuration; using TweetDuck.Configuration;
using TweetDuck.Core.Adapters; using TweetDuck.Controls;
using TweetDuck.Core.Bridge;
using TweetDuck.Core.Controls;
using TweetDuck.Core.Handling;
using TweetDuck.Core.Handling.General;
using TweetDuck.Core.Notification;
using TweetDuck.Core.Utils;
using TweetDuck.Plugins; using TweetDuck.Plugins;
using TweetDuck.Utils;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
using TweetLib.Core.Features.Plugins.Enums; using TweetLib.Core.Features.Plugins.Enums;
using TweetLib.Core.Features.Twitter; using TweetLib.Core.Features.Twitter;
using TweetLib.Core.Utils; using TweetLib.Core.Utils;
namespace TweetDuck.Core{ namespace TweetDuck.Browser{
sealed class TweetDeckBrowser : IDisposable{ sealed class TweetDeckBrowser : IDisposable{
private static UserConfig Config => Program.Config.User; private static UserConfig Config => Program.Config.User;
@@ -273,7 +273,7 @@ namespace TweetDuck.Core{
} }
public void OpenDevTools(){ public void OpenDevTools(){
browser.ShowDevTools(); browser.OpenDevToolsCustom();
} }
} }
} }

View File

@@ -1,6 +1,6 @@
using System; using System;
using System.Drawing; using System.Drawing;
using TweetDuck.Data; using TweetDuck.Browser.Data;
using TweetLib.Core.Features.Configuration; using TweetLib.Core.Features.Configuration;
using TweetLib.Core.Features.Plugins.Config; using TweetLib.Core.Features.Plugins.Config;
using TweetLib.Core.Serialization.Converters; using TweetLib.Core.Serialization.Converters;

View File

@@ -1,8 +1,8 @@
using System; using System;
using System.Drawing; using System.Drawing;
using TweetDuck.Core.Controls; using TweetDuck.Browser;
using TweetDuck.Core.Other; using TweetDuck.Browser.Data;
using TweetDuck.Data; using TweetDuck.Controls;
using TweetLib.Core.Features.Configuration; using TweetLib.Core.Features.Configuration;
using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Notifications;
using TweetLib.Core.Features.Twitter; using TweetLib.Core.Features.Twitter;
@@ -30,16 +30,20 @@ namespace TweetDuck.Configuration{
private string _customCefArgs = null; private string _customCefArgs = null;
public string BrowserPath { get; set; } = null; public string BrowserPath { get; set; } = null;
public string BrowserPathArgs { get; set; } = null;
public bool IgnoreTrackingUrlWarning { get; set; } = false; public bool IgnoreTrackingUrlWarning { get; set; } = false;
public string SearchEngineUrl { get; set; } = null; public string SearchEngineUrl { get; set; } = null;
private int _zoomLevel = 100; private int _zoomLevel = 100;
public string VideoPlayerPath { get; set; } = null;
public string VideoPlayerPathArgs { get; set; } = null;
public int VideoPlayerVolume { get; set; } = 50; public int VideoPlayerVolume { get; set; } = 50;
public bool EnableSpellCheck { get; set; } = false; public bool EnableSpellCheck { get; set; } = false;
private string _spellCheckLanguage = "en-US"; private string _spellCheckLanguage = "en-US";
public string TranslationTarget { get; set; } = "en"; public string TranslationTarget { get; set; } = "en";
public int CalendarFirstDay { get; set; } = -1;
private TrayIcon.Behavior _trayBehavior = TrayIcon.Behavior.Disabled; private TrayIcon.Behavior _trayBehavior = TrayIcon.Behavior.Disabled;
public bool EnableTrayHighlight { get; set; } = true; public bool EnableTrayHighlight { get; set; } = true;
@@ -74,6 +78,8 @@ namespace TweetDuck.Configuration{
public string CustomBrowserCSS { get; set; } = null; public string CustomBrowserCSS { get; set; } = null;
public string CustomNotificationCSS { get; set; } = null; public string CustomNotificationCSS { get; set; } = null;
public bool DevToolsWindowOnTop { get; set; } = true;
// SPECIAL PROPERTIES // SPECIAL PROPERTIES
public bool IsCustomNotificationPositionSet => CustomNotificationPosition != ControlExtensions.InvisibleLocation; public bool IsCustomNotificationPositionSet => CustomNotificationPosition != ControlExtensions.InvisibleLocation;

View File

@@ -3,7 +3,7 @@ using System.Drawing;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
namespace TweetDuck.Core.Controls{ namespace TweetDuck.Controls{
static class ControlExtensions{ static class ControlExtensions{
public static readonly Point InvisibleLocation = new Point(-32000, -32000); public static readonly Point InvisibleLocation = new Point(-32000, -32000);

View File

@@ -1,7 +1,7 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
namespace TweetDuck.Core.Controls{ namespace TweetDuck.Controls{
sealed class FlatButton : Button{ sealed class FlatButton : Button{
protected override bool ShowFocusCues => false; protected override bool ShowFocusCues => false;

View File

@@ -2,7 +2,7 @@
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
namespace TweetDuck.Core.Controls{ namespace TweetDuck.Controls{
sealed class FlatProgressBar : ProgressBar{ sealed class FlatProgressBar : ProgressBar{
private readonly SolidBrush brush; private readonly SolidBrush brush;

View File

@@ -1,7 +1,7 @@
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
namespace TweetDuck.Core.Controls{ namespace TweetDuck.Controls{
sealed class FlowLayoutPanelNoHScroll : FlowLayoutPanel{ sealed class FlowLayoutPanelNoHScroll : FlowLayoutPanel{
protected override void WndProc(ref Message m){ protected override void WndProc(ref Message m){
if (m.Msg == 0x85){ // WM_NCPAINT if (m.Msg == 0x85){ // WM_NCPAINT

View File

@@ -2,7 +2,7 @@
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
namespace TweetDuck.Core.Controls{ namespace TweetDuck.Controls{
sealed class LabelVertical : Label{ sealed class LabelVertical : Label{
public int LineHeight { get; set; } public int LineHeight { get; set; }

View File

@@ -1,7 +1,7 @@
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Forms; using System.Windows.Forms;
namespace TweetDuck.Core.Controls{ namespace TweetDuck.Controls{
sealed class NumericUpDownEx : NumericUpDown{ sealed class NumericUpDownEx : NumericUpDown{
public string TextSuffix { get; set ; } public string TextSuffix { get; set ; }

View File

@@ -1,36 +0,0 @@
using System.Collections.Generic;
using System.Windows.Forms;
using TweetDuck.Configuration;
namespace TweetDuck.Core.Other.Settings{
class BaseTabSettings : UserControl{
protected static UserConfig Config => Program.Config.User;
protected static SystemConfig SysConfig => Program.Config.System;
public IEnumerable<Control> InteractiveControls{
get{
static IEnumerable<Control> FindInteractiveControls(Control parent){
foreach(Control control in parent.Controls){
if (control is Panel subPanel){
foreach(Control subControl in FindInteractiveControls(subPanel)){
yield return subControl;
}
}
else{
yield return control;
}
}
}
return FindInteractiveControls(this);
}
}
protected BaseTabSettings(){
Padding = new Padding(6);
}
public virtual void OnReady(){}
public virtual void OnClosing(){}
}
}

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Other { namespace TweetDuck.Dialogs {
sealed partial class FormAbout { sealed partial class FormAbout {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@@ -2,9 +2,10 @@
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Utils; using TweetDuck.Management;
using TweetDuck.Utils;
namespace TweetDuck.Core.Other{ namespace TweetDuck.Dialogs{
sealed partial class FormAbout : Form, FormManager.IAppDialog{ sealed partial class FormAbout : Form, FormManager.IAppDialog{
private const string TipsLink = "https://github.com/chylex/TweetDuck/wiki"; private const string TipsLink = "https://github.com/chylex/TweetDuck/wiki";
private const string IssuesLink = "https://github.com/chylex/TweetDuck/issues"; private const string IssuesLink = "https://github.com/chylex/TweetDuck/issues";

View File

@@ -1,21 +1,10 @@
namespace TweetDuck.Core.Other { namespace TweetDuck.Dialogs {
partial class FormGuide { partial class FormGuide {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
/// </summary> /// </summary>
private System.ComponentModel.IContainer components = null; private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code #region Windows Form Designer generated code
/// <summary> /// <summary>

View File

@@ -1,16 +1,18 @@
using System.Drawing; using System.Drawing;
using System.Text.RegularExpressions;
using System.Windows.Forms; using System.Windows.Forms;
using CefSharp; using CefSharp;
using CefSharp.WinForms; using CefSharp.WinForms;
using TweetDuck.Core.Controls; using TweetDuck.Browser;
using TweetDuck.Core.Handling; using TweetDuck.Browser.Adapters;
using TweetDuck.Core.Handling.General; using TweetDuck.Browser.Data;
using TweetDuck.Core.Utils; using TweetDuck.Browser.Handling;
using System.Text.RegularExpressions; using TweetDuck.Browser.Handling.General;
using TweetDuck.Core.Adapters; using TweetDuck.Controls;
using TweetDuck.Data; using TweetDuck.Management;
using TweetDuck.Utils;
namespace TweetDuck.Core.Other{ namespace TweetDuck.Dialogs{
sealed partial class FormGuide : Form, FormManager.IAppDialog{ sealed partial class FormGuide : Form, FormManager.IAppDialog{
private const string GuideUrl = "https://tweetduck.chylex.com/guide/v2/"; private const string GuideUrl = "https://tweetduck.chylex.com/guide/v2/";
private const string GuidePathRegex = @"^guide(?:/v\d+)?(?:/(#.*))?"; private const string GuidePathRegex = @"^guide(?:/v\d+)?(?:/(#.*))?";
@@ -85,10 +87,15 @@ namespace TweetDuck.Core.Other{
browser.SetupZoomEvents(); browser.SetupZoomEvents();
Controls.Add(browser); Controls.Add(browser);
}
Disposed += (sender, args) => { protected override void Dispose(bool disposing){
if (disposing){
components?.Dispose();
browser.Dispose(); browser.Dispose();
}; }
base.Dispose(disposing);
} }
private void Reload(string url){ private void Reload(string url){

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Other { namespace TweetDuck.Dialogs {
partial class FormMessage { partial class FormMessage {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@@ -1,10 +1,10 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
namespace TweetDuck.Core.Other{ namespace TweetDuck.Dialogs{
[Flags] [Flags]
enum ControlType{ enum ControlType{
None = 0, None = 0,
@@ -43,7 +43,8 @@ namespace TweetDuck.Core.Other{
} }
public static bool Show(string caption, string text, MessageBoxIcon icon, string buttonAccept, string buttonCancel){ public static bool Show(string caption, string text, MessageBoxIcon icon, string buttonAccept, string buttonCancel){
using(FormMessage message = new FormMessage(caption, text, icon)){ using FormMessage message = new FormMessage(caption, text, icon);
if (buttonCancel == null){ if (buttonCancel == null){
message.AddButton(buttonAccept, DialogResult.OK, ControlType.Cancel | ControlType.Focused); message.AddButton(buttonAccept, DialogResult.OK, ControlType.Cancel | ControlType.Focused);
} }
@@ -54,7 +55,6 @@ namespace TweetDuck.Core.Other{
return message.ShowDialog() == DialogResult.OK; return message.ShowDialog() == DialogResult.OK;
} }
}
// Instance // Instance

View File

@@ -1,6 +1,6 @@
using TweetDuck.Core.Controls; using TweetDuck.Controls;
namespace TweetDuck.Core.Other { namespace TweetDuck.Dialogs {
partial class FormPlugins { partial class FormPlugins {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@@ -3,11 +3,12 @@ using System.Drawing;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Configuration; using TweetDuck.Configuration;
using TweetDuck.Management;
using TweetDuck.Plugins; using TweetDuck.Plugins;
using TweetLib.Core; using TweetLib.Core;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
namespace TweetDuck.Core.Other{ namespace TweetDuck.Dialogs{
sealed partial class FormPlugins : Form, FormManager.IAppDialog{ sealed partial class FormPlugins : Form, FormManager.IAppDialog{
private static UserConfig Config => Program.Config.User; private static UserConfig Config => Program.Config.User;

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Other { namespace TweetDuck.Dialogs {
sealed partial class FormSettings { sealed partial class FormSettings {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@@ -2,17 +2,19 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using TweetDuck.Browser;
using TweetDuck.Core.Handling.General; using TweetDuck.Browser.Handling.General;
using TweetDuck.Core.Notification.Example; using TweetDuck.Browser.Notification.Example;
using TweetDuck.Core.Other.Analytics; using TweetDuck.Configuration;
using TweetDuck.Core.Other.Settings; using TweetDuck.Controls;
using TweetDuck.Core.Other.Settings.Dialogs; using TweetDuck.Dialogs.Settings;
using TweetDuck.Core.Utils; using TweetDuck.Management;
using TweetDuck.Management.Analytics;
using TweetDuck.Utils;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
using TweetLib.Core.Features.Updates; using TweetLib.Core.Features.Updates;
namespace TweetDuck.Core.Other{ namespace TweetDuck.Dialogs{
sealed partial class FormSettings : Form, FormManager.IAppDialog{ sealed partial class FormSettings : Form, FormManager.IAppDialog{
public bool ShouldReloadBrowser { get; private set; } public bool ShouldReloadBrowser { get; private set; }
@@ -41,6 +43,7 @@ namespace TweetDuck.Core.Other{
AddButton("General", () => new TabSettingsGeneral(this.browser.ReloadColumns, updates)); AddButton("General", () => new TabSettingsGeneral(this.browser.ReloadColumns, updates));
AddButton("Notifications", () => new TabSettingsNotifications(new FormNotificationExample(this.browser, this.plugins))); AddButton("Notifications", () => new TabSettingsNotifications(new FormNotificationExample(this.browser, this.plugins)));
AddButton("Sounds", () => new TabSettingsSounds(this.browser.PlaySoundNotification)); AddButton("Sounds", () => new TabSettingsSounds(this.browser.PlaySoundNotification));
AddButton("Tray", () => new TabSettingsTray());
AddButton("Feedback", () => new TabSettingsFeedback(analytics, AnalyticsReportGenerator.ExternalInfo.From(this.browser), this.plugins)); AddButton("Feedback", () => new TabSettingsFeedback(analytics, AnalyticsReportGenerator.ExternalInfo.From(this.browser), this.plugins));
AddButton("Advanced", () => new TabSettingsAdvanced(this.browser.ReinjectCustomCSS, this.browser.OpenDevTools)); AddButton("Advanced", () => new TabSettingsAdvanced(this.browser.ReinjectCustomCSS, this.browser.OpenDevTools));
@@ -79,7 +82,7 @@ namespace TweetDuck.Core.Other{
private void btnManageOptions_Click(object sender, EventArgs e){ private void btnManageOptions_Click(object sender, EventArgs e){
PrepareUnload(); PrepareUnload();
using(DialogSettingsManage dialog = new DialogSettingsManage(plugins)){ using DialogSettingsManage dialog = new DialogSettingsManage(plugins);
FormClosing -= FormSettings_FormClosing; FormClosing -= FormSettings_FormClosing;
if (dialog.ShowDialog() == DialogResult.OK){ if (dialog.ShowDialog() == DialogResult.OK){
@@ -99,13 +102,12 @@ namespace TweetDuck.Core.Other{
PrepareLoad(); PrepareLoad();
} }
} }
}
private void btnClose_Click(object sender, EventArgs e){ private void btnClose_Click(object sender, EventArgs e){
Close(); Close();
} }
private void AddButton<T>(string title, Func<T> constructor) where T : BaseTabSettings{ private void AddButton<T>(string title, Func<T> constructor) where T : BaseTab{
FlatButton btn = new FlatButton{ FlatButton btn = new FlatButton{
BackColor = SystemColors.Control, BackColor = SystemColors.Control,
FlatStyle = FlatStyle.Flat, FlatStyle = FlatStyle.Flat,
@@ -135,7 +137,7 @@ namespace TweetDuck.Core.Other{
btn.Click += (sender, args) => SelectTab<T>(); btn.Click += (sender, args) => SelectTab<T>();
} }
private void SelectTab<T>() where T : BaseTabSettings{ private void SelectTab<T>() where T : BaseTab{
SelectTab(tabs[typeof(T)]); SelectTab(tabs[typeof(T)]);
} }
@@ -195,16 +197,47 @@ namespace TweetDuck.Core.Other{
private sealed class SettingsTab{ private sealed class SettingsTab{
public Button Button { get; } public Button Button { get; }
public BaseTabSettings Control => control ??= constructor(); public BaseTab Control => control ??= constructor();
public bool IsInitialized => control != null; public bool IsInitialized => control != null;
private readonly Func<BaseTabSettings> constructor; private readonly Func<BaseTab> constructor;
private BaseTabSettings control; private BaseTab control;
public SettingsTab(Button button, Func<BaseTabSettings> constructor){ public SettingsTab(Button button, Func<BaseTab> constructor){
this.Button = button; this.Button = button;
this.constructor = constructor; this.constructor = constructor;
} }
} }
internal abstract class BaseTab : UserControl{
protected static UserConfig Config => Program.Config.User;
protected static SystemConfig SysConfig => Program.Config.System;
public IEnumerable<Control> InteractiveControls{
get{
static IEnumerable<Control> FindInteractiveControls(Control parent){
foreach(Control control in parent.Controls){
if (control is Panel subPanel){
foreach(Control subControl in FindInteractiveControls(subPanel)){
yield return subControl;
}
}
else{
yield return control;
}
}
}
return FindInteractiveControls(this);
}
}
protected BaseTab(){
Padding = new Padding(6);
}
public virtual void OnReady(){}
public virtual void OnClosing(){}
}
} }
} }

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Other.Settings.Dialogs { namespace TweetDuck.Dialogs.Settings {
partial class DialogSettingsAnalytics { partial class DialogSettingsAnalytics {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@@ -1,9 +1,9 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetDuck.Core.Other.Analytics; using TweetDuck.Management.Analytics;
namespace TweetDuck.Core.Other.Settings.Dialogs{ namespace TweetDuck.Dialogs.Settings{
sealed partial class DialogSettingsAnalytics : Form{ sealed partial class DialogSettingsAnalytics : Form{
public DialogSettingsAnalytics(AnalyticsReport report){ public DialogSettingsAnalytics(AnalyticsReport report){
InitializeComponent(); InitializeComponent();

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Other.Settings.Dialogs { namespace TweetDuck.Dialogs.Settings {
partial class DialogSettingsCSS { partial class DialogSettingsCSS {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@@ -2,10 +2,10 @@
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
namespace TweetDuck.Core.Other.Settings.Dialogs{ namespace TweetDuck.Dialogs.Settings{
sealed partial class DialogSettingsCSS : Form{ sealed partial class DialogSettingsCSS : Form{
public string BrowserCSS => textBoxBrowserCSS.Text; public string BrowserCSS => textBoxBrowserCSS.Text;
public string NotificationCSS => textBoxNotificationCSS.Text; public string NotificationCSS => textBoxNotificationCSS.Text;

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Other.Settings.Dialogs { namespace TweetDuck.Dialogs.Settings {
partial class DialogSettingsCefArgs { partial class DialogSettingsCefArgs {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@@ -1,10 +1,10 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
using TweetLib.Core.Collections; using TweetLib.Core.Collections;
namespace TweetDuck.Core.Other.Settings.Dialogs{ namespace TweetDuck.Dialogs.Settings{
sealed partial class DialogSettingsCefArgs : Form{ sealed partial class DialogSettingsCefArgs : Form{
public string CefArgs => textBoxArgs.Text; public string CefArgs => textBoxArgs.Text;

View File

@@ -0,0 +1,154 @@
namespace TweetDuck.Dialogs.Settings {
partial class DialogSettingsExternalProgram {
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.textBoxPath = new System.Windows.Forms.TextBox();
this.btnCancel = new System.Windows.Forms.Button();
this.btnApply = new System.Windows.Forms.Button();
this.labelPath = new System.Windows.Forms.Label();
this.labelArgs = new System.Windows.Forms.Label();
this.textBoxArgs = new System.Windows.Forms.TextBox();
this.btnBrowse = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBoxPath
//
this.textBoxPath.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.textBoxPath.Font = new System.Drawing.Font("Segoe UI", 9F);
this.textBoxPath.Location = new System.Drawing.Point(12, 30);
this.textBoxPath.Name = "textBoxPath";
this.textBoxPath.Size = new System.Drawing.Size(336, 23);
this.textBoxPath.TabIndex = 1;
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.AutoSize = true;
this.btnCancel.Font = new System.Drawing.Font("Segoe UI", 9F);
this.btnCancel.Location = new System.Drawing.Point(307, 118);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Padding = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.btnCancel.Size = new System.Drawing.Size(57, 25);
this.btnCancel.TabIndex = 6;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnApply
//
this.btnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnApply.AutoSize = true;
this.btnApply.Font = new System.Drawing.Font("Segoe UI", 9F);
this.btnApply.Location = new System.Drawing.Point(370, 118);
this.btnApply.Name = "btnApply";
this.btnApply.Padding = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.btnApply.Size = new System.Drawing.Size(52, 25);
this.btnApply.TabIndex = 5;
this.btnApply.Text = "Apply";
this.btnApply.UseVisualStyleBackColor = true;
this.btnApply.Click += new System.EventHandler(this.btnApply_Click);
//
// labelPath
//
this.labelPath.AutoSize = true;
this.labelPath.Font = new System.Drawing.Font("Segoe UI", 9F);
this.labelPath.Location = new System.Drawing.Point(12, 9);
this.labelPath.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.labelPath.Name = "labelPath";
this.labelPath.Size = new System.Drawing.Size(109, 15);
this.labelPath.TabIndex = 0;
this.labelPath.Text = "Path to Application";
//
// labelArgs
//
this.labelArgs.AutoSize = true;
this.labelArgs.Font = new System.Drawing.Font("Segoe UI", 9F);
this.labelArgs.Location = new System.Drawing.Point(12, 68);
this.labelArgs.Margin = new System.Windows.Forms.Padding(3, 12, 3, 3);
this.labelArgs.Name = "labelArgs";
this.labelArgs.Size = new System.Drawing.Size(124, 15);
this.labelArgs.TabIndex = 3;
this.labelArgs.Text = "Additional Arguments";
//
// textBoxArgs
//
this.textBoxArgs.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.textBoxArgs.Font = new System.Drawing.Font("Segoe UI", 9F);
this.textBoxArgs.Location = new System.Drawing.Point(12, 89);
this.textBoxArgs.Name = "textBoxArgs";
this.textBoxArgs.Size = new System.Drawing.Size(410, 23);
this.textBoxArgs.TabIndex = 4;
//
// btnBrowse
//
this.btnBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnBrowse.AutoSize = true;
this.btnBrowse.Font = new System.Drawing.Font("Segoe UI", 9F);
this.btnBrowse.Location = new System.Drawing.Point(354, 28);
this.btnBrowse.Name = "btnBrowse";
this.btnBrowse.Padding = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.btnBrowse.Size = new System.Drawing.Size(68, 25);
this.btnBrowse.TabIndex = 2;
this.btnBrowse.Text = "Browse...";
this.btnBrowse.UseVisualStyleBackColor = true;
this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
//
// DialogSettingsExternalProgram
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(434, 155);
this.Controls.Add(this.btnBrowse);
this.Controls.Add(this.textBoxArgs);
this.Controls.Add(this.labelArgs);
this.Controls.Add(this.labelPath);
this.Controls.Add(this.btnApply);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.textBoxPath);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "DialogSettingsExternalProgram";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBoxPath;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnApply;
private System.Windows.Forms.Label labelPath;
private System.Windows.Forms.Label labelArgs;
private System.Windows.Forms.TextBox textBoxArgs;
private System.Windows.Forms.Button btnBrowse;
}
}

View File

@@ -0,0 +1,55 @@
using System;
using System.Windows.Forms;
using TweetLib.Core.Utils;
using IOPath = System.IO.Path;
namespace TweetDuck.Dialogs.Settings{
sealed partial class DialogSettingsExternalProgram : Form{
public string Path{
get => StringUtils.NullIfEmpty(textBoxPath.Text);
set => textBoxPath.Text = value ?? string.Empty;
}
public string Args{
get => StringUtils.NullIfEmpty(textBoxArgs.Text);
set => textBoxArgs.Text = value ?? string.Empty;
}
private readonly string fileDialogTitle;
public DialogSettingsExternalProgram(string windowTitle, string fileDialogTitle){
InitializeComponent();
Text = Program.BrandName + " Options - " + windowTitle;
AcceptButton = btnApply;
CancelButton = btnCancel;
this.fileDialogTitle = fileDialogTitle;
}
private void btnBrowse_Click(object sender, EventArgs e){
using OpenFileDialog dialog = new OpenFileDialog{
AutoUpgradeEnabled = true,
DereferenceLinks = true,
InitialDirectory = IOPath.GetDirectoryName(Path), // returns null if argument is null
Title = fileDialogTitle,
Filter = "Executables (*.exe;*.bat;*.cmd)|*.exe;*.bat;*.cmd|All Files (*.*)|*.*"
};
if (dialog.ShowDialog() == DialogResult.OK && Path != dialog.FileName){
Path = dialog.FileName;
Args = string.Empty;
}
}
private void btnApply_Click(object sender, EventArgs e){
DialogResult = DialogResult.OK;
Close();
}
private void btnCancel_Click(object sender, EventArgs e){
DialogResult = DialogResult.Cancel;
Close();
}
}
}

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Other.Settings.Dialogs { namespace TweetDuck.Dialogs.Settings {
partial class DialogSettingsManage { partial class DialogSettingsManage {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@@ -3,11 +3,11 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Configuration; using TweetDuck.Configuration;
using TweetDuck.Core.Management; using TweetDuck.Management;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
using TweetLib.Core.Utils; using TweetLib.Core.Utils;
namespace TweetDuck.Core.Other.Settings.Dialogs{ namespace TweetDuck.Dialogs.Settings{
sealed partial class DialogSettingsManage : Form{ sealed partial class DialogSettingsManage : Form{
private enum State{ private enum State{
Deciding, Reset, Import, Export Deciding, Reset, Import, Export

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Other.Settings.Dialogs { namespace TweetDuck.Dialogs.Settings {
partial class DialogSettingsRestart { partial class DialogSettingsRestart {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@@ -3,7 +3,7 @@ using System.Windows.Forms;
using TweetDuck.Configuration; using TweetDuck.Configuration;
using TweetLib.Core.Collections; using TweetLib.Core.Collections;
namespace TweetDuck.Core.Other.Settings.Dialogs{ namespace TweetDuck.Dialogs.Settings{
sealed partial class DialogSettingsRestart : Form{ sealed partial class DialogSettingsRestart : Form{
public CommandLineArgs Args { get; private set; } public CommandLineArgs Args { get; private set; }
@@ -38,7 +38,7 @@ namespace TweetDuck.Core.Other.Settings.Dialogs{
Args.SetValue(Arguments.ArgDataFolder, tbDataFolder.Text); Args.SetValue(Arguments.ArgDataFolder, tbDataFolder.Text);
} }
tbShortcutTarget.Text = $@"""{Application.ExecutablePath}""{(Args.Count > 0 ? " " : "")}{Args}"; tbShortcutTarget.Text = $@"""{Program.ExecutablePath}""{(Args.Count > 0 ? " " : "")}{Args}";
tbShortcutTarget.Select(tbShortcutTarget.Text.Length, 0); tbShortcutTarget.Select(tbShortcutTarget.Text.Length, 0);
} }

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Other.Settings.Dialogs { namespace TweetDuck.Dialogs.Settings {
partial class DialogSettingsSearchEngine { partial class DialogSettingsSearchEngine {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@@ -1,7 +1,7 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
namespace TweetDuck.Core.Other.Settings.Dialogs{ namespace TweetDuck.Dialogs.Settings{
sealed partial class DialogSettingsSearchEngine : Form{ sealed partial class DialogSettingsSearchEngine : Form{
public string Url => textBoxUrl.Text; public string Url => textBoxUrl.Text;

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Other.Settings { namespace TweetDuck.Dialogs.Settings {
partial class TabSettingsAdvanced { partial class TabSettingsAdvanced {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@@ -32,7 +32,7 @@
this.btnRestart = new System.Windows.Forms.Button(); this.btnRestart = new System.Windows.Forms.Button();
this.btnOpenAppFolder = new System.Windows.Forms.Button(); this.btnOpenAppFolder = new System.Windows.Forms.Button();
this.btnOpenDataFolder = new System.Windows.Forms.Button(); this.btnOpenDataFolder = new System.Windows.Forms.Button();
this.numClearCacheThreshold = new TweetDuck.Core.Controls.NumericUpDownEx(); this.numClearCacheThreshold = new TweetDuck.Controls.NumericUpDownEx();
this.checkClearCacheAuto = new System.Windows.Forms.CheckBox(); this.checkClearCacheAuto = new System.Windows.Forms.CheckBox();
this.labelApp = new System.Windows.Forms.Label(); this.labelApp = new System.Windows.Forms.Label();
this.panelAppButtons = new System.Windows.Forms.Panel(); this.panelAppButtons = new System.Windows.Forms.Panel();
@@ -41,6 +41,8 @@
this.panelConfiguration = new System.Windows.Forms.Panel(); this.panelConfiguration = new System.Windows.Forms.Panel();
this.labelConfiguration = new System.Windows.Forms.Label(); this.labelConfiguration = new System.Windows.Forms.Label();
this.flowPanel = new System.Windows.Forms.FlowLayoutPanel(); this.flowPanel = new System.Windows.Forms.FlowLayoutPanel();
this.labelDevTools = new System.Windows.Forms.Label();
this.checkDevToolsWindowOnTop = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.numClearCacheThreshold)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numClearCacheThreshold)).BeginInit();
this.panelAppButtons.SuspendLayout(); this.panelAppButtons.SuspendLayout();
this.panelClearCacheAuto.SuspendLayout(); this.panelClearCacheAuto.SuspendLayout();
@@ -240,6 +242,8 @@
this.flowPanel.Controls.Add(this.panelClearCacheAuto); this.flowPanel.Controls.Add(this.panelClearCacheAuto);
this.flowPanel.Controls.Add(this.labelConfiguration); this.flowPanel.Controls.Add(this.labelConfiguration);
this.flowPanel.Controls.Add(this.panelConfiguration); this.flowPanel.Controls.Add(this.panelConfiguration);
this.flowPanel.Controls.Add(this.labelDevTools);
this.flowPanel.Controls.Add(this.checkDevToolsWindowOnTop);
this.flowPanel.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; this.flowPanel.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowPanel.Location = new System.Drawing.Point(9, 9); this.flowPanel.Location = new System.Drawing.Point(9, 9);
this.flowPanel.Name = "flowPanel"; this.flowPanel.Name = "flowPanel";
@@ -247,6 +251,29 @@
this.flowPanel.TabIndex = 0; this.flowPanel.TabIndex = 0;
this.flowPanel.WrapContents = false; this.flowPanel.WrapContents = false;
// //
// labelDevTools
//
this.labelDevTools.AutoSize = true;
this.labelDevTools.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold);
this.labelDevTools.Location = new System.Drawing.Point(0, 302);
this.labelDevTools.Margin = new System.Windows.Forms.Padding(0, 30, 0, 1);
this.labelDevTools.Name = "labelDevTools";
this.labelDevTools.Size = new System.Drawing.Size(156, 19);
this.labelDevTools.TabIndex = 7;
this.labelDevTools.Text = "DEVELOPMENT TOOLS";
//
// checkDevToolsWindowOnTop
//
this.checkDevToolsWindowOnTop.AutoSize = true;
this.checkDevToolsWindowOnTop.Font = new System.Drawing.Font("Segoe UI", 9F);
this.checkDevToolsWindowOnTop.Location = new System.Drawing.Point(6, 328);
this.checkDevToolsWindowOnTop.Margin = new System.Windows.Forms.Padding(6, 6, 0, 2);
this.checkDevToolsWindowOnTop.Name = "checkDevToolsWindowOnTop";
this.checkDevToolsWindowOnTop.Size = new System.Drawing.Size(168, 19);
this.checkDevToolsWindowOnTop.TabIndex = 8;
this.checkDevToolsWindowOnTop.Text = "Dev Tools Window On Top";
this.checkDevToolsWindowOnTop.UseVisualStyleBackColor = true;
//
// TabSettingsAdvanced // TabSettingsAdvanced
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -284,5 +311,7 @@
private Controls.NumericUpDownEx numClearCacheThreshold; private Controls.NumericUpDownEx numClearCacheThreshold;
private System.Windows.Forms.CheckBox checkClearCacheAuto; private System.Windows.Forms.CheckBox checkClearCacheAuto;
private System.Windows.Forms.FlowLayoutPanel flowPanel; private System.Windows.Forms.FlowLayoutPanel flowPanel;
private System.Windows.Forms.Label labelDevTools;
private System.Windows.Forms.CheckBox checkDevToolsWindowOnTop;
} }
} }

View File

@@ -2,14 +2,13 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Configuration; using TweetDuck.Configuration;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetDuck.Core.Management; using TweetDuck.Management;
using TweetDuck.Core.Other.Settings.Dialogs; using TweetDuck.Utils;
using TweetDuck.Core.Utils;
using TweetLib.Core; using TweetLib.Core;
namespace TweetDuck.Core.Other.Settings{ namespace TweetDuck.Dialogs.Settings{
sealed partial class TabSettingsAdvanced : BaseTabSettings{ sealed partial class TabSettingsAdvanced : FormSettings.BaseTab{
private readonly Action<string> reinjectBrowserCSS; private readonly Action<string> reinjectBrowserCSS;
private readonly Action openDevTools; private readonly Action openDevTools;
@@ -44,6 +43,16 @@ namespace TweetDuck.Core.Other.Settings{
toolTip.SetToolTip(btnEditCefArgs, "Set custom command line arguments for Chromium Embedded Framework."); toolTip.SetToolTip(btnEditCefArgs, "Set custom command line arguments for Chromium Embedded Framework.");
toolTip.SetToolTip(btnEditCSS, "Set custom CSS for browser and notification windows."); toolTip.SetToolTip(btnEditCSS, "Set custom CSS for browser and notification windows.");
// development tools
toolTip.SetToolTip(checkDevToolsWindowOnTop, "Sets whether dev tool windows appears on top of other windows.");
checkDevToolsWindowOnTop.Checked = Config.DevToolsWindowOnTop;
if (!BrowserUtils.HasDevTools){
checkDevToolsWindowOnTop.Enabled = false;
}
} }
public override void OnReady(){ public override void OnReady(){
@@ -57,6 +66,8 @@ namespace TweetDuck.Core.Other.Settings{
btnEditCefArgs.Click += btnEditCefArgs_Click; btnEditCefArgs.Click += btnEditCefArgs_Click;
btnEditCSS.Click += btnEditCSS_Click; btnEditCSS.Click += btnEditCSS_Click;
checkDevToolsWindowOnTop.CheckedChanged += checkDevToolsWindowOnTop_CheckedChanged;
} }
public override void OnClosing(){ public override void OnClosing(){
@@ -79,12 +90,12 @@ namespace TweetDuck.Core.Other.Settings{
} }
private void btnRestartArgs_Click(object sender, EventArgs e){ private void btnRestartArgs_Click(object sender, EventArgs e){
using(DialogSettingsRestart dialog = new DialogSettingsRestart(Arguments.GetCurrentClean())){ using DialogSettingsRestart dialog = new DialogSettingsRestart(Arguments.GetCurrentClean());
if (dialog.ShowDialog() == DialogResult.OK){ if (dialog.ShowDialog() == DialogResult.OK){
Program.RestartWithArgs(dialog.Args); Program.RestartWithArgs(dialog.Args);
} }
} }
}
#endregion #endregion
#region Browser Cache #region Browser Cache
@@ -152,6 +163,13 @@ namespace TweetDuck.Core.Other.Settings{
} }
} }
#endregion
#region Development Tools
private void checkDevToolsWindowOnTop_CheckedChanged(object sender, EventArgs e){
Config.DevToolsWindowOnTop = checkDevToolsWindowOnTop.Checked;
}
#endregion #endregion
} }
} }

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Other.Settings { namespace TweetDuck.Dialogs.Settings {
partial class TabSettingsFeedback { partial class TabSettingsFeedback {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@@ -1,12 +1,11 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Other.Analytics; using TweetDuck.Management.Analytics;
using TweetDuck.Core.Other.Settings.Dialogs; using TweetDuck.Utils;
using TweetDuck.Core.Utils;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
namespace TweetDuck.Core.Other.Settings{ namespace TweetDuck.Dialogs.Settings{
sealed partial class TabSettingsFeedback : BaseTabSettings{ sealed partial class TabSettingsFeedback : FormSettings.BaseTab{
private readonly AnalyticsFile analyticsFile; private readonly AnalyticsFile analyticsFile;
private readonly AnalyticsReportGenerator.ExternalInfo analyticsInfo; private readonly AnalyticsReportGenerator.ExternalInfo analyticsInfo;
private readonly PluginManager plugins; private readonly PluginManager plugins;
@@ -50,10 +49,9 @@ namespace TweetDuck.Core.Other.Settings{
} }
private void btnViewReport_Click(object sender, EventArgs e){ private void btnViewReport_Click(object sender, EventArgs e){
using(DialogSettingsAnalytics dialog = new DialogSettingsAnalytics(AnalyticsReportGenerator.Create(analyticsFile, analyticsInfo, plugins))){ using DialogSettingsAnalytics dialog = new DialogSettingsAnalytics(AnalyticsReportGenerator.Create(analyticsFile, analyticsInfo, plugins));
dialog.ShowDialog(); dialog.ShowDialog();
} }
}
#endregion #endregion
} }

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Other.Settings { namespace TweetDuck.Dialogs.Settings {
partial class TabSettingsGeneral { partial class TabSettingsGeneral {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@@ -41,30 +41,37 @@
this.flowPanelLeft = new System.Windows.Forms.FlowLayoutPanel(); this.flowPanelLeft = new System.Windows.Forms.FlowLayoutPanel();
this.checkFocusDmInput = new System.Windows.Forms.CheckBox(); this.checkFocusDmInput = new System.Windows.Forms.CheckBox();
this.checkKeepLikeFollowDialogsOpen = new System.Windows.Forms.CheckBox(); this.checkKeepLikeFollowDialogsOpen = new System.Windows.Forms.CheckBox();
this.labelTray = new System.Windows.Forms.Label();
this.comboBoxTrayType = new System.Windows.Forms.ComboBox();
this.labelTrayIcon = new System.Windows.Forms.Label();
this.checkTrayHighlight = new System.Windows.Forms.CheckBox();
this.labelBrowserSettings = new System.Windows.Forms.Label(); this.labelBrowserSettings = new System.Windows.Forms.Label();
this.checkSmoothScrolling = new System.Windows.Forms.CheckBox(); this.checkSmoothScrolling = new System.Windows.Forms.CheckBox();
this.checkTouchAdjustment = new System.Windows.Forms.CheckBox(); this.checkTouchAdjustment = new System.Windows.Forms.CheckBox();
this.checkHardwareAcceleration = new System.Windows.Forms.CheckBox();
this.labelBrowserPath = new System.Windows.Forms.Label(); this.labelBrowserPath = new System.Windows.Forms.Label();
this.comboBoxBrowserPath = new System.Windows.Forms.ComboBox(); this.comboBoxCustomBrowser = new System.Windows.Forms.ComboBox();
this.labelSearchEngine = new System.Windows.Forms.Label(); this.labelSearchEngine = new System.Windows.Forms.Label();
this.comboBoxSearchEngine = new System.Windows.Forms.ComboBox(); this.comboBoxSearchEngine = new System.Windows.Forms.ComboBox();
this.flowPanelRight = new System.Windows.Forms.FlowLayoutPanel(); this.flowPanelRight = new System.Windows.Forms.FlowLayoutPanel();
this.checkHardwareAcceleration = new System.Windows.Forms.CheckBox();
this.labelLocales = new System.Windows.Forms.Label(); this.labelLocales = new System.Windows.Forms.Label();
this.checkSpellCheck = new System.Windows.Forms.CheckBox(); this.checkSpellCheck = new System.Windows.Forms.CheckBox();
this.labelSpellCheckLanguage = new System.Windows.Forms.Label(); this.labelSpellCheckLanguage = new System.Windows.Forms.Label();
this.comboBoxSpellCheckLanguage = new System.Windows.Forms.ComboBox(); this.comboBoxSpellCheckLanguage = new System.Windows.Forms.ComboBox();
this.labelTranslationTarget = new System.Windows.Forms.Label(); this.labelTranslationTarget = new System.Windows.Forms.Label();
this.comboBoxTranslationTarget = new System.Windows.Forms.ComboBox(); this.comboBoxTranslationTarget = new System.Windows.Forms.ComboBox();
this.labelFirstDayOfWeek = new System.Windows.Forms.Label();
this.comboBoxFirstDayOfWeek = new System.Windows.Forms.ComboBox();
this.labelExternalApplications = new System.Windows.Forms.Label();
this.panelCustomBrowser = new System.Windows.Forms.Panel();
this.btnCustomBrowserChange = new System.Windows.Forms.Button();
this.labelVideoPlayerPath = new System.Windows.Forms.Label();
this.panelCustomVideoPlayer = new System.Windows.Forms.Panel();
this.comboBoxCustomVideoPlayer = new System.Windows.Forms.ComboBox();
this.btnCustomVideoPlayerChange = new System.Windows.Forms.Button();
this.panelSeparator = new System.Windows.Forms.Panel(); this.panelSeparator = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.trackBarZoom)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBarZoom)).BeginInit();
this.panelZoom.SuspendLayout(); this.panelZoom.SuspendLayout();
this.flowPanelLeft.SuspendLayout(); this.flowPanelLeft.SuspendLayout();
this.flowPanelRight.SuspendLayout(); this.flowPanelRight.SuspendLayout();
this.panelCustomBrowser.SuspendLayout();
this.panelCustomVideoPlayer.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// checkExpandLinks // checkExpandLinks
@@ -83,7 +90,7 @@
// //
this.checkUpdateNotifications.AutoSize = true; this.checkUpdateNotifications.AutoSize = true;
this.checkUpdateNotifications.Font = new System.Drawing.Font("Segoe UI", 9F); this.checkUpdateNotifications.Font = new System.Drawing.Font("Segoe UI", 9F);
this.checkUpdateNotifications.Location = new System.Drawing.Point(6, 409); this.checkUpdateNotifications.Location = new System.Drawing.Point(6, 403);
this.checkUpdateNotifications.Margin = new System.Windows.Forms.Padding(6, 6, 3, 2); this.checkUpdateNotifications.Margin = new System.Windows.Forms.Padding(6, 6, 3, 2);
this.checkUpdateNotifications.Name = "checkUpdateNotifications"; this.checkUpdateNotifications.Name = "checkUpdateNotifications";
this.checkUpdateNotifications.Size = new System.Drawing.Size(182, 19); this.checkUpdateNotifications.Size = new System.Drawing.Size(182, 19);
@@ -95,7 +102,7 @@
// //
this.btnCheckUpdates.AutoSize = true; this.btnCheckUpdates.AutoSize = true;
this.btnCheckUpdates.Font = new System.Drawing.Font("Segoe UI", 9F); this.btnCheckUpdates.Font = new System.Drawing.Font("Segoe UI", 9F);
this.btnCheckUpdates.Location = new System.Drawing.Point(5, 433); this.btnCheckUpdates.Location = new System.Drawing.Point(5, 427);
this.btnCheckUpdates.Margin = new System.Windows.Forms.Padding(5, 3, 3, 3); this.btnCheckUpdates.Margin = new System.Windows.Forms.Padding(5, 3, 3, 3);
this.btnCheckUpdates.Name = "btnCheckUpdates"; this.btnCheckUpdates.Name = "btnCheckUpdates";
this.btnCheckUpdates.Padding = new System.Windows.Forms.Padding(2, 0, 2, 0); this.btnCheckUpdates.Padding = new System.Windows.Forms.Padding(2, 0, 2, 0);
@@ -159,11 +166,11 @@
// //
this.labelZoom.AutoSize = true; this.labelZoom.AutoSize = true;
this.labelZoom.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold); this.labelZoom.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold);
this.labelZoom.Location = new System.Drawing.Point(3, 179); this.labelZoom.Location = new System.Drawing.Point(3, 299);
this.labelZoom.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0); this.labelZoom.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
this.labelZoom.Name = "labelZoom"; this.labelZoom.Name = "labelZoom";
this.labelZoom.Size = new System.Drawing.Size(39, 15); this.labelZoom.Size = new System.Drawing.Size(39, 15);
this.labelZoom.TabIndex = 7; this.labelZoom.TabIndex = 11;
this.labelZoom.Text = "Zoom"; this.labelZoom.Text = "Zoom";
// //
// zoomUpdateTimer // zoomUpdateTimer
@@ -186,11 +193,11 @@
// //
this.panelZoom.Controls.Add(this.trackBarZoom); this.panelZoom.Controls.Add(this.trackBarZoom);
this.panelZoom.Controls.Add(this.labelZoomValue); this.panelZoom.Controls.Add(this.labelZoomValue);
this.panelZoom.Location = new System.Drawing.Point(0, 195); this.panelZoom.Location = new System.Drawing.Point(0, 315);
this.panelZoom.Margin = new System.Windows.Forms.Padding(0, 1, 0, 0); this.panelZoom.Margin = new System.Windows.Forms.Padding(0, 1, 0, 0);
this.panelZoom.Name = "panelZoom"; this.panelZoom.Name = "panelZoom";
this.panelZoom.Size = new System.Drawing.Size(300, 35); this.panelZoom.Size = new System.Drawing.Size(300, 35);
this.panelZoom.TabIndex = 8; this.panelZoom.TabIndex = 12;
// //
// checkAnimatedAvatars // checkAnimatedAvatars
// //
@@ -208,7 +215,7 @@
// //
this.labelUpdates.AutoSize = true; this.labelUpdates.AutoSize = true;
this.labelUpdates.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold); this.labelUpdates.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold);
this.labelUpdates.Location = new System.Drawing.Point(0, 383); this.labelUpdates.Location = new System.Drawing.Point(0, 377);
this.labelUpdates.Margin = new System.Windows.Forms.Padding(0, 27, 0, 1); this.labelUpdates.Margin = new System.Windows.Forms.Padding(0, 27, 0, 1);
this.labelUpdates.Name = "labelUpdates"; this.labelUpdates.Name = "labelUpdates";
this.labelUpdates.Size = new System.Drawing.Size(69, 19); this.labelUpdates.Size = new System.Drawing.Size(69, 19);
@@ -226,12 +233,12 @@
this.flowPanelLeft.Controls.Add(this.checkKeepLikeFollowDialogsOpen); this.flowPanelLeft.Controls.Add(this.checkKeepLikeFollowDialogsOpen);
this.flowPanelLeft.Controls.Add(this.checkBestImageQuality); this.flowPanelLeft.Controls.Add(this.checkBestImageQuality);
this.flowPanelLeft.Controls.Add(this.checkAnimatedAvatars); this.flowPanelLeft.Controls.Add(this.checkAnimatedAvatars);
this.flowPanelLeft.Controls.Add(this.labelBrowserSettings);
this.flowPanelLeft.Controls.Add(this.checkSmoothScrolling);
this.flowPanelLeft.Controls.Add(this.checkTouchAdjustment);
this.flowPanelLeft.Controls.Add(this.checkHardwareAcceleration);
this.flowPanelLeft.Controls.Add(this.labelZoom); this.flowPanelLeft.Controls.Add(this.labelZoom);
this.flowPanelLeft.Controls.Add(this.panelZoom); this.flowPanelLeft.Controls.Add(this.panelZoom);
this.flowPanelLeft.Controls.Add(this.labelTray);
this.flowPanelLeft.Controls.Add(this.comboBoxTrayType);
this.flowPanelLeft.Controls.Add(this.labelTrayIcon);
this.flowPanelLeft.Controls.Add(this.checkTrayHighlight);
this.flowPanelLeft.Controls.Add(this.labelUpdates); this.flowPanelLeft.Controls.Add(this.labelUpdates);
this.flowPanelLeft.Controls.Add(this.checkUpdateNotifications); this.flowPanelLeft.Controls.Add(this.checkUpdateNotifications);
this.flowPanelLeft.Controls.Add(this.btnCheckUpdates); this.flowPanelLeft.Controls.Add(this.btnCheckUpdates);
@@ -266,71 +273,26 @@
this.checkKeepLikeFollowDialogsOpen.Text = "Keep Like/Follow Dialogs Open"; this.checkKeepLikeFollowDialogsOpen.Text = "Keep Like/Follow Dialogs Open";
this.checkKeepLikeFollowDialogsOpen.UseVisualStyleBackColor = true; this.checkKeepLikeFollowDialogsOpen.UseVisualStyleBackColor = true;
// //
// labelTray
//
this.labelTray.AutoSize = true;
this.labelTray.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold);
this.labelTray.Location = new System.Drawing.Point(0, 255);
this.labelTray.Margin = new System.Windows.Forms.Padding(0, 25, 0, 1);
this.labelTray.Name = "labelTray";
this.labelTray.Size = new System.Drawing.Size(99, 19);
this.labelTray.TabIndex = 9;
this.labelTray.Text = "SYSTEM TRAY";
//
// comboBoxTrayType
//
this.comboBoxTrayType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxTrayType.Font = new System.Drawing.Font("Segoe UI", 9F);
this.comboBoxTrayType.FormattingEnabled = true;
this.comboBoxTrayType.Location = new System.Drawing.Point(5, 279);
this.comboBoxTrayType.Margin = new System.Windows.Forms.Padding(5, 4, 3, 3);
this.comboBoxTrayType.Name = "comboBoxTrayType";
this.comboBoxTrayType.Size = new System.Drawing.Size(144, 23);
this.comboBoxTrayType.TabIndex = 10;
//
// labelTrayIcon
//
this.labelTrayIcon.AutoSize = true;
this.labelTrayIcon.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold);
this.labelTrayIcon.Location = new System.Drawing.Point(3, 314);
this.labelTrayIcon.Margin = new System.Windows.Forms.Padding(3, 9, 3, 0);
this.labelTrayIcon.Name = "labelTrayIcon";
this.labelTrayIcon.Size = new System.Drawing.Size(56, 15);
this.labelTrayIcon.TabIndex = 11;
this.labelTrayIcon.Text = "Tray Icon";
//
// checkTrayHighlight
//
this.checkTrayHighlight.AutoSize = true;
this.checkTrayHighlight.Font = new System.Drawing.Font("Segoe UI", 9F);
this.checkTrayHighlight.Location = new System.Drawing.Point(6, 335);
this.checkTrayHighlight.Margin = new System.Windows.Forms.Padding(6, 6, 3, 2);
this.checkTrayHighlight.Name = "checkTrayHighlight";
this.checkTrayHighlight.Size = new System.Drawing.Size(114, 19);
this.checkTrayHighlight.TabIndex = 12;
this.checkTrayHighlight.Text = "Enable Highlight";
this.checkTrayHighlight.UseVisualStyleBackColor = true;
//
// labelBrowserSettings // labelBrowserSettings
// //
this.labelBrowserSettings.AutoSize = true; this.labelBrowserSettings.AutoSize = true;
this.labelBrowserSettings.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold); this.labelBrowserSettings.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold);
this.labelBrowserSettings.Location = new System.Drawing.Point(0, 0); this.labelBrowserSettings.Location = new System.Drawing.Point(0, 192);
this.labelBrowserSettings.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1); this.labelBrowserSettings.Margin = new System.Windows.Forms.Padding(0, 25, 0, 1);
this.labelBrowserSettings.Name = "labelBrowserSettings"; this.labelBrowserSettings.Name = "labelBrowserSettings";
this.labelBrowserSettings.Size = new System.Drawing.Size(143, 19); this.labelBrowserSettings.Size = new System.Drawing.Size(143, 19);
this.labelBrowserSettings.TabIndex = 0; this.labelBrowserSettings.TabIndex = 7;
this.labelBrowserSettings.Text = "BROWSER SETTINGS"; this.labelBrowserSettings.Text = "BROWSER SETTINGS";
// //
// checkSmoothScrolling // checkSmoothScrolling
// //
this.checkSmoothScrolling.AutoSize = true; this.checkSmoothScrolling.AutoSize = true;
this.checkSmoothScrolling.Font = new System.Drawing.Font("Segoe UI", 9F); this.checkSmoothScrolling.Font = new System.Drawing.Font("Segoe UI", 9F);
this.checkSmoothScrolling.Location = new System.Drawing.Point(6, 26); this.checkSmoothScrolling.Location = new System.Drawing.Point(6, 218);
this.checkSmoothScrolling.Margin = new System.Windows.Forms.Padding(6, 6, 3, 2); this.checkSmoothScrolling.Margin = new System.Windows.Forms.Padding(6, 6, 3, 2);
this.checkSmoothScrolling.Name = "checkSmoothScrolling"; this.checkSmoothScrolling.Name = "checkSmoothScrolling";
this.checkSmoothScrolling.Size = new System.Drawing.Size(117, 19); this.checkSmoothScrolling.Size = new System.Drawing.Size(117, 19);
this.checkSmoothScrolling.TabIndex = 1; this.checkSmoothScrolling.TabIndex = 8;
this.checkSmoothScrolling.Text = "Smooth Scrolling"; this.checkSmoothScrolling.Text = "Smooth Scrolling";
this.checkSmoothScrolling.UseVisualStyleBackColor = true; this.checkSmoothScrolling.UseVisualStyleBackColor = true;
// //
@@ -338,45 +300,57 @@
// //
this.checkTouchAdjustment.AutoSize = true; this.checkTouchAdjustment.AutoSize = true;
this.checkTouchAdjustment.Font = new System.Drawing.Font("Segoe UI", 9F); this.checkTouchAdjustment.Font = new System.Drawing.Font("Segoe UI", 9F);
this.checkTouchAdjustment.Location = new System.Drawing.Point(6, 50); this.checkTouchAdjustment.Location = new System.Drawing.Point(6, 242);
this.checkTouchAdjustment.Margin = new System.Windows.Forms.Padding(6, 3, 3, 2); this.checkTouchAdjustment.Margin = new System.Windows.Forms.Padding(6, 3, 3, 2);
this.checkTouchAdjustment.Name = "checkTouchAdjustment"; this.checkTouchAdjustment.Name = "checkTouchAdjustment";
this.checkTouchAdjustment.Size = new System.Drawing.Size(163, 19); this.checkTouchAdjustment.Size = new System.Drawing.Size(163, 19);
this.checkTouchAdjustment.TabIndex = 2; this.checkTouchAdjustment.TabIndex = 9;
this.checkTouchAdjustment.Text = "Touch Screen Adjustment"; this.checkTouchAdjustment.Text = "Touch Screen Adjustment";
this.checkTouchAdjustment.UseVisualStyleBackColor = true; this.checkTouchAdjustment.UseVisualStyleBackColor = true;
// //
// checkHardwareAcceleration
//
this.checkHardwareAcceleration.AutoSize = true;
this.checkHardwareAcceleration.Font = new System.Drawing.Font("Segoe UI", 9F);
this.checkHardwareAcceleration.Location = new System.Drawing.Point(6, 266);
this.checkHardwareAcceleration.Margin = new System.Windows.Forms.Padding(6, 3, 3, 2);
this.checkHardwareAcceleration.Name = "checkHardwareAcceleration";
this.checkHardwareAcceleration.Size = new System.Drawing.Size(146, 19);
this.checkHardwareAcceleration.TabIndex = 10;
this.checkHardwareAcceleration.Text = "Hardware Acceleration";
this.checkHardwareAcceleration.UseVisualStyleBackColor = true;
//
// labelBrowserPath // labelBrowserPath
// //
this.labelBrowserPath.AutoSize = true; this.labelBrowserPath.AutoSize = true;
this.labelBrowserPath.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold); this.labelBrowserPath.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold);
this.labelBrowserPath.Location = new System.Drawing.Point(3, 107); this.labelBrowserPath.Location = new System.Drawing.Point(3, 275);
this.labelBrowserPath.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0); this.labelBrowserPath.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
this.labelBrowserPath.Name = "labelBrowserPath"; this.labelBrowserPath.Name = "labelBrowserPath";
this.labelBrowserPath.Size = new System.Drawing.Size(104, 15); this.labelBrowserPath.Size = new System.Drawing.Size(104, 15);
this.labelBrowserPath.TabIndex = 4; this.labelBrowserPath.TabIndex = 9;
this.labelBrowserPath.Text = "Open Links With..."; this.labelBrowserPath.Text = "Open Links With...";
// //
// comboBoxBrowserPath // comboBoxCustomBrowser
// //
this.comboBoxBrowserPath.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxCustomBrowser.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxBrowserPath.Font = new System.Drawing.Font("Segoe UI", 9F); this.comboBoxCustomBrowser.Font = new System.Drawing.Font("Segoe UI", 9F);
this.comboBoxBrowserPath.FormattingEnabled = true; this.comboBoxCustomBrowser.FormattingEnabled = true;
this.comboBoxBrowserPath.Location = new System.Drawing.Point(5, 126); this.comboBoxCustomBrowser.Location = new System.Drawing.Point(5, 1);
this.comboBoxBrowserPath.Margin = new System.Windows.Forms.Padding(5, 4, 3, 3); this.comboBoxCustomBrowser.Margin = new System.Windows.Forms.Padding(5, 1, 3, 0);
this.comboBoxBrowserPath.Name = "comboBoxBrowserPath"; this.comboBoxCustomBrowser.Name = "comboBoxCustomBrowser";
this.comboBoxBrowserPath.Size = new System.Drawing.Size(173, 23); this.comboBoxCustomBrowser.Size = new System.Drawing.Size(173, 23);
this.comboBoxBrowserPath.TabIndex = 5; this.comboBoxCustomBrowser.TabIndex = 0;
// //
// labelSearchEngine // labelSearchEngine
// //
this.labelSearchEngine.AutoSize = true; this.labelSearchEngine.AutoSize = true;
this.labelSearchEngine.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold); this.labelSearchEngine.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold);
this.labelSearchEngine.Location = new System.Drawing.Point(3, 164); this.labelSearchEngine.Location = new System.Drawing.Point(3, 389);
this.labelSearchEngine.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0); this.labelSearchEngine.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
this.labelSearchEngine.Name = "labelSearchEngine"; this.labelSearchEngine.Name = "labelSearchEngine";
this.labelSearchEngine.Size = new System.Drawing.Size(82, 15); this.labelSearchEngine.Size = new System.Drawing.Size(82, 15);
this.labelSearchEngine.TabIndex = 6; this.labelSearchEngine.TabIndex = 13;
this.labelSearchEngine.Text = "Search Engine"; this.labelSearchEngine.Text = "Search Engine";
// //
// comboBoxSearchEngine // comboBoxSearchEngine
@@ -384,30 +358,31 @@
this.comboBoxSearchEngine.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxSearchEngine.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxSearchEngine.Font = new System.Drawing.Font("Segoe UI", 9F); this.comboBoxSearchEngine.Font = new System.Drawing.Font("Segoe UI", 9F);
this.comboBoxSearchEngine.FormattingEnabled = true; this.comboBoxSearchEngine.FormattingEnabled = true;
this.comboBoxSearchEngine.Location = new System.Drawing.Point(5, 183); this.comboBoxSearchEngine.Location = new System.Drawing.Point(5, 408);
this.comboBoxSearchEngine.Margin = new System.Windows.Forms.Padding(5, 4, 3, 3); this.comboBoxSearchEngine.Margin = new System.Windows.Forms.Padding(5, 4, 3, 3);
this.comboBoxSearchEngine.Name = "comboBoxSearchEngine"; this.comboBoxSearchEngine.Name = "comboBoxSearchEngine";
this.comboBoxSearchEngine.Size = new System.Drawing.Size(173, 23); this.comboBoxSearchEngine.Size = new System.Drawing.Size(173, 23);
this.comboBoxSearchEngine.TabIndex = 7; this.comboBoxSearchEngine.TabIndex = 14;
// //
// flowPanelRight // flowPanelRight
// //
this.flowPanelRight.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.flowPanelRight.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)));
this.flowPanelRight.Controls.Add(this.labelBrowserSettings);
this.flowPanelRight.Controls.Add(this.checkSmoothScrolling);
this.flowPanelRight.Controls.Add(this.checkTouchAdjustment);
this.flowPanelRight.Controls.Add(this.checkHardwareAcceleration);
this.flowPanelRight.Controls.Add(this.labelBrowserPath);
this.flowPanelRight.Controls.Add(this.comboBoxBrowserPath);
this.flowPanelRight.Controls.Add(this.labelSearchEngine);
this.flowPanelRight.Controls.Add(this.comboBoxSearchEngine);
this.flowPanelRight.Controls.Add(this.labelLocales); this.flowPanelRight.Controls.Add(this.labelLocales);
this.flowPanelRight.Controls.Add(this.checkSpellCheck); this.flowPanelRight.Controls.Add(this.checkSpellCheck);
this.flowPanelRight.Controls.Add(this.labelSpellCheckLanguage); this.flowPanelRight.Controls.Add(this.labelSpellCheckLanguage);
this.flowPanelRight.Controls.Add(this.comboBoxSpellCheckLanguage); this.flowPanelRight.Controls.Add(this.comboBoxSpellCheckLanguage);
this.flowPanelRight.Controls.Add(this.labelTranslationTarget); this.flowPanelRight.Controls.Add(this.labelTranslationTarget);
this.flowPanelRight.Controls.Add(this.comboBoxTranslationTarget); this.flowPanelRight.Controls.Add(this.comboBoxTranslationTarget);
this.flowPanelRight.Controls.Add(this.labelFirstDayOfWeek);
this.flowPanelRight.Controls.Add(this.comboBoxFirstDayOfWeek);
this.flowPanelRight.Controls.Add(this.labelExternalApplications);
this.flowPanelRight.Controls.Add(this.labelBrowserPath);
this.flowPanelRight.Controls.Add(this.panelCustomBrowser);
this.flowPanelRight.Controls.Add(this.labelVideoPlayerPath);
this.flowPanelRight.Controls.Add(this.panelCustomVideoPlayer);
this.flowPanelRight.Controls.Add(this.labelSearchEngine);
this.flowPanelRight.Controls.Add(this.comboBoxSearchEngine);
this.flowPanelRight.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; this.flowPanelRight.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowPanelRight.Location = new System.Drawing.Point(322, 9); this.flowPanelRight.Location = new System.Drawing.Point(322, 9);
this.flowPanelRight.Name = "flowPanelRight"; this.flowPanelRight.Name = "flowPanelRight";
@@ -415,38 +390,26 @@
this.flowPanelRight.TabIndex = 1; this.flowPanelRight.TabIndex = 1;
this.flowPanelRight.WrapContents = false; this.flowPanelRight.WrapContents = false;
// //
// checkHardwareAcceleration
//
this.checkHardwareAcceleration.AutoSize = true;
this.checkHardwareAcceleration.Font = new System.Drawing.Font("Segoe UI", 9F);
this.checkHardwareAcceleration.Location = new System.Drawing.Point(6, 74);
this.checkHardwareAcceleration.Margin = new System.Windows.Forms.Padding(6, 3, 3, 2);
this.checkHardwareAcceleration.Name = "checkHardwareAcceleration";
this.checkHardwareAcceleration.Size = new System.Drawing.Size(146, 19);
this.checkHardwareAcceleration.TabIndex = 3;
this.checkHardwareAcceleration.Text = "Hardware Acceleration";
this.checkHardwareAcceleration.UseVisualStyleBackColor = true;
//
// labelLocales // labelLocales
// //
this.labelLocales.AutoSize = true; this.labelLocales.AutoSize = true;
this.labelLocales.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold); this.labelLocales.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold);
this.labelLocales.Location = new System.Drawing.Point(0, 236); this.labelLocales.Location = new System.Drawing.Point(0, 0);
this.labelLocales.Margin = new System.Windows.Forms.Padding(0, 27, 0, 1); this.labelLocales.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1);
this.labelLocales.Name = "labelLocales"; this.labelLocales.Name = "labelLocales";
this.labelLocales.Size = new System.Drawing.Size(67, 19); this.labelLocales.Size = new System.Drawing.Size(67, 19);
this.labelLocales.TabIndex = 8; this.labelLocales.TabIndex = 0;
this.labelLocales.Text = "LOCALES"; this.labelLocales.Text = "LOCALES";
// //
// checkSpellCheck // checkSpellCheck
// //
this.checkSpellCheck.AutoSize = true; this.checkSpellCheck.AutoSize = true;
this.checkSpellCheck.Font = new System.Drawing.Font("Segoe UI", 9F); this.checkSpellCheck.Font = new System.Drawing.Font("Segoe UI", 9F);
this.checkSpellCheck.Location = new System.Drawing.Point(6, 262); this.checkSpellCheck.Location = new System.Drawing.Point(6, 26);
this.checkSpellCheck.Margin = new System.Windows.Forms.Padding(6, 6, 3, 2); this.checkSpellCheck.Margin = new System.Windows.Forms.Padding(6, 6, 3, 2);
this.checkSpellCheck.Name = "checkSpellCheck"; this.checkSpellCheck.Name = "checkSpellCheck";
this.checkSpellCheck.Size = new System.Drawing.Size(125, 19); this.checkSpellCheck.Size = new System.Drawing.Size(125, 19);
this.checkSpellCheck.TabIndex = 9; this.checkSpellCheck.TabIndex = 1;
this.checkSpellCheck.Text = "Enable Spell Check"; this.checkSpellCheck.Text = "Enable Spell Check";
this.checkSpellCheck.UseVisualStyleBackColor = true; this.checkSpellCheck.UseVisualStyleBackColor = true;
// //
@@ -454,11 +417,11 @@
// //
this.labelSpellCheckLanguage.AutoSize = true; this.labelSpellCheckLanguage.AutoSize = true;
this.labelSpellCheckLanguage.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold); this.labelSpellCheckLanguage.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold);
this.labelSpellCheckLanguage.Location = new System.Drawing.Point(3, 295); this.labelSpellCheckLanguage.Location = new System.Drawing.Point(3, 59);
this.labelSpellCheckLanguage.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0); this.labelSpellCheckLanguage.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
this.labelSpellCheckLanguage.Name = "labelSpellCheckLanguage"; this.labelSpellCheckLanguage.Name = "labelSpellCheckLanguage";
this.labelSpellCheckLanguage.Size = new System.Drawing.Size(123, 15); this.labelSpellCheckLanguage.Size = new System.Drawing.Size(123, 15);
this.labelSpellCheckLanguage.TabIndex = 10; this.labelSpellCheckLanguage.TabIndex = 2;
this.labelSpellCheckLanguage.Text = "Spell Check Language"; this.labelSpellCheckLanguage.Text = "Spell Check Language";
// //
// comboBoxSpellCheckLanguage // comboBoxSpellCheckLanguage
@@ -466,21 +429,21 @@
this.comboBoxSpellCheckLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxSpellCheckLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxSpellCheckLanguage.Font = new System.Drawing.Font("Segoe UI", 9F); this.comboBoxSpellCheckLanguage.Font = new System.Drawing.Font("Segoe UI", 9F);
this.comboBoxSpellCheckLanguage.FormattingEnabled = true; this.comboBoxSpellCheckLanguage.FormattingEnabled = true;
this.comboBoxSpellCheckLanguage.Location = new System.Drawing.Point(5, 314); this.comboBoxSpellCheckLanguage.Location = new System.Drawing.Point(5, 78);
this.comboBoxSpellCheckLanguage.Margin = new System.Windows.Forms.Padding(5, 4, 3, 3); this.comboBoxSpellCheckLanguage.Margin = new System.Windows.Forms.Padding(5, 4, 3, 3);
this.comboBoxSpellCheckLanguage.Name = "comboBoxSpellCheckLanguage"; this.comboBoxSpellCheckLanguage.Name = "comboBoxSpellCheckLanguage";
this.comboBoxSpellCheckLanguage.Size = new System.Drawing.Size(290, 23); this.comboBoxSpellCheckLanguage.Size = new System.Drawing.Size(290, 23);
this.comboBoxSpellCheckLanguage.TabIndex = 11; this.comboBoxSpellCheckLanguage.TabIndex = 3;
// //
// labelTranslationTarget // labelTranslationTarget
// //
this.labelTranslationTarget.AutoSize = true; this.labelTranslationTarget.AutoSize = true;
this.labelTranslationTarget.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold); this.labelTranslationTarget.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold);
this.labelTranslationTarget.Location = new System.Drawing.Point(3, 352); this.labelTranslationTarget.Location = new System.Drawing.Point(3, 116);
this.labelTranslationTarget.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0); this.labelTranslationTarget.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
this.labelTranslationTarget.Name = "labelTranslationTarget"; this.labelTranslationTarget.Name = "labelTranslationTarget";
this.labelTranslationTarget.Size = new System.Drawing.Size(142, 15); this.labelTranslationTarget.Size = new System.Drawing.Size(142, 15);
this.labelTranslationTarget.TabIndex = 12; this.labelTranslationTarget.TabIndex = 4;
this.labelTranslationTarget.Text = "Bing Translator Language"; this.labelTranslationTarget.Text = "Bing Translator Language";
// //
// comboBoxTranslationTarget // comboBoxTranslationTarget
@@ -488,11 +451,114 @@
this.comboBoxTranslationTarget.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxTranslationTarget.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxTranslationTarget.Font = new System.Drawing.Font("Segoe UI", 9F); this.comboBoxTranslationTarget.Font = new System.Drawing.Font("Segoe UI", 9F);
this.comboBoxTranslationTarget.FormattingEnabled = true; this.comboBoxTranslationTarget.FormattingEnabled = true;
this.comboBoxTranslationTarget.Location = new System.Drawing.Point(5, 371); this.comboBoxTranslationTarget.Location = new System.Drawing.Point(5, 135);
this.comboBoxTranslationTarget.Margin = new System.Windows.Forms.Padding(5, 4, 3, 3); this.comboBoxTranslationTarget.Margin = new System.Windows.Forms.Padding(5, 4, 3, 3);
this.comboBoxTranslationTarget.Name = "comboBoxTranslationTarget"; this.comboBoxTranslationTarget.Name = "comboBoxTranslationTarget";
this.comboBoxTranslationTarget.Size = new System.Drawing.Size(290, 23); this.comboBoxTranslationTarget.Size = new System.Drawing.Size(290, 23);
this.comboBoxTranslationTarget.TabIndex = 13; this.comboBoxTranslationTarget.TabIndex = 5;
//
// labelFirstDayOfWeek
//
this.labelFirstDayOfWeek.AutoSize = true;
this.labelFirstDayOfWeek.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold);
this.labelFirstDayOfWeek.Location = new System.Drawing.Point(3, 173);
this.labelFirstDayOfWeek.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
this.labelFirstDayOfWeek.Name = "labelFirstDayOfWeek";
this.labelFirstDayOfWeek.Size = new System.Drawing.Size(125, 15);
this.labelFirstDayOfWeek.TabIndex = 6;
this.labelFirstDayOfWeek.Text = "First Day Of The Week";
//
// comboBoxFirstDayOfWeek
//
this.comboBoxFirstDayOfWeek.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxFirstDayOfWeek.Font = new System.Drawing.Font("Segoe UI", 9F);
this.comboBoxFirstDayOfWeek.FormattingEnabled = true;
this.comboBoxFirstDayOfWeek.Location = new System.Drawing.Point(5, 192);
this.comboBoxFirstDayOfWeek.Margin = new System.Windows.Forms.Padding(5, 4, 3, 3);
this.comboBoxFirstDayOfWeek.Name = "comboBoxFirstDayOfWeek";
this.comboBoxFirstDayOfWeek.Size = new System.Drawing.Size(173, 23);
this.comboBoxFirstDayOfWeek.TabIndex = 7;
//
// labelExternalApplications
//
this.labelExternalApplications.AutoSize = true;
this.labelExternalApplications.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold);
this.labelExternalApplications.Location = new System.Drawing.Point(0, 243);
this.labelExternalApplications.Margin = new System.Windows.Forms.Padding(0, 25, 0, 1);
this.labelExternalApplications.Name = "labelExternalApplications";
this.labelExternalApplications.Size = new System.Drawing.Size(176, 19);
this.labelExternalApplications.TabIndex = 8;
this.labelExternalApplications.Text = "EXTERNAL APPLICATIONS";
//
// panelCustomBrowser
//
this.panelCustomBrowser.Controls.Add(this.comboBoxCustomBrowser);
this.panelCustomBrowser.Controls.Add(this.btnCustomBrowserChange);
this.panelCustomBrowser.Location = new System.Drawing.Point(0, 293);
this.panelCustomBrowser.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.panelCustomBrowser.Name = "panelCustomBrowser";
this.panelCustomBrowser.Size = new System.Drawing.Size(300, 24);
this.panelCustomBrowser.TabIndex = 10;
//
// btnCustomBrowserChange
//
this.btnCustomBrowserChange.AutoSize = true;
this.btnCustomBrowserChange.Font = new System.Drawing.Font("Segoe UI", 9F);
this.btnCustomBrowserChange.Location = new System.Drawing.Point(186, 0);
this.btnCustomBrowserChange.Margin = new System.Windows.Forms.Padding(5, 0, 3, 0);
this.btnCustomBrowserChange.Name = "btnCustomBrowserChange";
this.btnCustomBrowserChange.Padding = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.btnCustomBrowserChange.Size = new System.Drawing.Size(71, 25);
this.btnCustomBrowserChange.TabIndex = 1;
this.btnCustomBrowserChange.Text = "Change...";
this.btnCustomBrowserChange.UseVisualStyleBackColor = true;
this.btnCustomBrowserChange.Visible = false;
//
// labelVideoPlayerPath
//
this.labelVideoPlayerPath.AutoSize = true;
this.labelVideoPlayerPath.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold);
this.labelVideoPlayerPath.Location = new System.Drawing.Point(3, 332);
this.labelVideoPlayerPath.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
this.labelVideoPlayerPath.Name = "labelVideoPlayerPath";
this.labelVideoPlayerPath.Size = new System.Drawing.Size(106, 15);
this.labelVideoPlayerPath.TabIndex = 11;
this.labelVideoPlayerPath.Text = "Play Videos With...";
//
// panelCustomVideoPlayer
//
this.panelCustomVideoPlayer.Controls.Add(this.comboBoxCustomVideoPlayer);
this.panelCustomVideoPlayer.Controls.Add(this.btnCustomVideoPlayerChange);
this.panelCustomVideoPlayer.Location = new System.Drawing.Point(0, 350);
this.panelCustomVideoPlayer.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.panelCustomVideoPlayer.Name = "panelCustomVideoPlayer";
this.panelCustomVideoPlayer.Size = new System.Drawing.Size(300, 24);
this.panelCustomVideoPlayer.TabIndex = 12;
//
// comboBoxCustomVideoPlayer
//
this.comboBoxCustomVideoPlayer.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxCustomVideoPlayer.Font = new System.Drawing.Font("Segoe UI", 9F);
this.comboBoxCustomVideoPlayer.FormattingEnabled = true;
this.comboBoxCustomVideoPlayer.Location = new System.Drawing.Point(5, 1);
this.comboBoxCustomVideoPlayer.Margin = new System.Windows.Forms.Padding(5, 1, 3, 0);
this.comboBoxCustomVideoPlayer.Name = "comboBoxCustomVideoPlayer";
this.comboBoxCustomVideoPlayer.Size = new System.Drawing.Size(173, 23);
this.comboBoxCustomVideoPlayer.TabIndex = 0;
//
// btnCustomVideoPlayerChange
//
this.btnCustomVideoPlayerChange.AutoSize = true;
this.btnCustomVideoPlayerChange.Font = new System.Drawing.Font("Segoe UI", 9F);
this.btnCustomVideoPlayerChange.Location = new System.Drawing.Point(186, 0);
this.btnCustomVideoPlayerChange.Margin = new System.Windows.Forms.Padding(5, 0, 3, 0);
this.btnCustomVideoPlayerChange.Name = "btnCustomVideoPlayerChange";
this.btnCustomVideoPlayerChange.Padding = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.btnCustomVideoPlayerChange.Size = new System.Drawing.Size(71, 25);
this.btnCustomVideoPlayerChange.TabIndex = 1;
this.btnCustomVideoPlayerChange.Text = "Change...";
this.btnCustomVideoPlayerChange.UseVisualStyleBackColor = true;
this.btnCustomVideoPlayerChange.Visible = false;
// //
// panelSeparator // panelSeparator
// //
@@ -520,6 +586,10 @@
this.flowPanelLeft.PerformLayout(); this.flowPanelLeft.PerformLayout();
this.flowPanelRight.ResumeLayout(false); this.flowPanelRight.ResumeLayout(false);
this.flowPanelRight.PerformLayout(); this.flowPanelRight.PerformLayout();
this.panelCustomBrowser.ResumeLayout(false);
this.panelCustomBrowser.PerformLayout();
this.panelCustomVideoPlayer.ResumeLayout(false);
this.panelCustomVideoPlayer.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@@ -543,7 +613,7 @@
private System.Windows.Forms.FlowLayoutPanel flowPanelLeft; private System.Windows.Forms.FlowLayoutPanel flowPanelLeft;
private System.Windows.Forms.CheckBox checkKeepLikeFollowDialogsOpen; private System.Windows.Forms.CheckBox checkKeepLikeFollowDialogsOpen;
private System.Windows.Forms.Label labelBrowserPath; private System.Windows.Forms.Label labelBrowserPath;
private System.Windows.Forms.ComboBox comboBoxBrowserPath; private System.Windows.Forms.ComboBox comboBoxCustomBrowser;
private System.Windows.Forms.Label labelBrowserSettings; private System.Windows.Forms.Label labelBrowserSettings;
private System.Windows.Forms.CheckBox checkSmoothScrolling; private System.Windows.Forms.CheckBox checkSmoothScrolling;
private System.Windows.Forms.Label labelSearchEngine; private System.Windows.Forms.Label labelSearchEngine;
@@ -551,10 +621,6 @@
private System.Windows.Forms.CheckBox checkTouchAdjustment; private System.Windows.Forms.CheckBox checkTouchAdjustment;
private System.Windows.Forms.FlowLayoutPanel flowPanelRight; private System.Windows.Forms.FlowLayoutPanel flowPanelRight;
private System.Windows.Forms.Panel panelSeparator; private System.Windows.Forms.Panel panelSeparator;
private System.Windows.Forms.Label labelTray;
private System.Windows.Forms.ComboBox comboBoxTrayType;
private System.Windows.Forms.Label labelTrayIcon;
private System.Windows.Forms.CheckBox checkTrayHighlight;
private System.Windows.Forms.Label labelLocales; private System.Windows.Forms.Label labelLocales;
private System.Windows.Forms.CheckBox checkSpellCheck; private System.Windows.Forms.CheckBox checkSpellCheck;
private System.Windows.Forms.Label labelSpellCheckLanguage; private System.Windows.Forms.Label labelSpellCheckLanguage;
@@ -563,5 +629,14 @@
private System.Windows.Forms.ComboBox comboBoxTranslationTarget; private System.Windows.Forms.ComboBox comboBoxTranslationTarget;
private System.Windows.Forms.CheckBox checkHardwareAcceleration; private System.Windows.Forms.CheckBox checkHardwareAcceleration;
private System.Windows.Forms.CheckBox checkFocusDmInput; private System.Windows.Forms.CheckBox checkFocusDmInput;
private System.Windows.Forms.Panel panelCustomBrowser;
private System.Windows.Forms.Button btnCustomBrowserChange;
private System.Windows.Forms.Label labelVideoPlayerPath;
private System.Windows.Forms.Panel panelCustomVideoPlayer;
private System.Windows.Forms.ComboBox comboBoxCustomVideoPlayer;
private System.Windows.Forms.Button btnCustomVideoPlayerChange;
private System.Windows.Forms.Label labelExternalApplications;
private System.Windows.Forms.Label labelFirstDayOfWeek;
private System.Windows.Forms.ComboBox comboBoxFirstDayOfWeek;
} }
} }

View File

@@ -2,15 +2,14 @@
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using TweetDuck.Browser.Handling.General;
using TweetDuck.Core.Handling.General; using TweetDuck.Controls;
using TweetDuck.Core.Other.Settings.Dialogs; using TweetDuck.Utils;
using TweetDuck.Core.Utils;
using TweetLib.Core.Features.Updates; using TweetLib.Core.Features.Updates;
using TweetLib.Core.Utils; using TweetLib.Core.Utils;
namespace TweetDuck.Core.Other.Settings{ namespace TweetDuck.Dialogs.Settings{
sealed partial class TabSettingsGeneral : BaseTabSettings{ sealed partial class TabSettingsGeneral : FormSettings.BaseTab{
private readonly Action reloadColumns; private readonly Action reloadColumns;
private readonly UpdateHandler updates; private readonly UpdateHandler updates;
@@ -19,6 +18,9 @@ namespace TweetDuck.Core.Other.Settings{
private readonly int browserListIndexDefault; private readonly int browserListIndexDefault;
private readonly int browserListIndexCustom; private readonly int browserListIndexCustom;
private readonly int videoPlayerListIndexDefault;
private readonly int videoPlayerListIndexCustom;
private readonly int searchEngineIndexDefault; private readonly int searchEngineIndexDefault;
private readonly int searchEngineIndexCustom; private readonly int searchEngineIndexCustom;
@@ -53,21 +55,6 @@ namespace TweetDuck.Core.Other.Settings{
trackBarZoom.SetValueSafe(Config.ZoomLevel); trackBarZoom.SetValueSafe(Config.ZoomLevel);
labelZoomValue.Text = trackBarZoom.Value + "%"; labelZoomValue.Text = trackBarZoom.Value + "%";
// system tray
toolTip.SetToolTip(comboBoxTrayType, "Changes behavior of the Tray icon.\r\nRight-click the icon for an action menu.");
toolTip.SetToolTip(checkTrayHighlight, "Highlights the tray icon if there are new tweets.\r\nOnly works for columns with popup or audio notifications.\r\nThe icon resets when the main window is restored.");
comboBoxTrayType.Items.Add("Disabled");
comboBoxTrayType.Items.Add("Display Icon Only");
comboBoxTrayType.Items.Add("Minimize to Tray");
comboBoxTrayType.Items.Add("Close to Tray");
comboBoxTrayType.Items.Add("Combined");
comboBoxTrayType.SelectedIndex = Math.Min(Math.Max((int)Config.TrayBehavior, 0), comboBoxTrayType.Items.Count - 1);
checkTrayHighlight.Enabled = Config.TrayBehavior.ShouldDisplayIcon();
checkTrayHighlight.Checked = Config.EnableTrayHighlight;
// updates // updates
toolTip.SetToolTip(checkUpdateNotifications, "Checks for updates every hour.\r\nIf an update is dismissed, it will not appear again."); toolTip.SetToolTip(checkUpdateNotifications, "Checks for updates every hour.\r\nIf an update is dismissed, it will not appear again.");
@@ -80,7 +67,8 @@ namespace TweetDuck.Core.Other.Settings{
toolTip.SetToolTip(checkSmoothScrolling, "Toggles smooth mouse wheel scrolling."); toolTip.SetToolTip(checkSmoothScrolling, "Toggles smooth mouse wheel scrolling.");
toolTip.SetToolTip(checkTouchAdjustment, "Toggles Chromium touch screen adjustment.\r\nDisabled by default, because it is very imprecise with TweetDeck."); toolTip.SetToolTip(checkTouchAdjustment, "Toggles Chromium touch screen adjustment.\r\nDisabled by default, because it is very imprecise with TweetDeck.");
toolTip.SetToolTip(checkHardwareAcceleration, "Uses graphics card to improve performance.\r\nDisable if you experience visual glitches, or to save a small amount of RAM."); toolTip.SetToolTip(checkHardwareAcceleration, "Uses graphics card to improve performance.\r\nDisable if you experience visual glitches, or to save a small amount of RAM.");
toolTip.SetToolTip(comboBoxBrowserPath, "Sets the default browser for opening links."); toolTip.SetToolTip(comboBoxCustomBrowser, "Sets the default browser for opening links.");
toolTip.SetToolTip(comboBoxCustomVideoPlayer, "Sets the default application for playing videos.");
toolTip.SetToolTip(comboBoxSearchEngine, "Sets the default website for opening searches."); toolTip.SetToolTip(comboBoxSearchEngine, "Sets the default website for opening searches.");
checkSmoothScrolling.Checked = Config.EnableSmoothScrolling; checkSmoothScrolling.Checked = Config.EnableSmoothScrolling;
@@ -88,13 +76,17 @@ namespace TweetDuck.Core.Other.Settings{
checkHardwareAcceleration.Checked = SysConfig.HardwareAcceleration; checkHardwareAcceleration.Checked = SysConfig.HardwareAcceleration;
foreach(WindowsUtils.Browser browserInfo in WindowsUtils.FindInstalledBrowsers()){ foreach(WindowsUtils.Browser browserInfo in WindowsUtils.FindInstalledBrowsers()){
comboBoxBrowserPath.Items.Add(browserInfo); comboBoxCustomBrowser.Items.Add(browserInfo);
} }
browserListIndexDefault = comboBoxBrowserPath.Items.Add("(default browser)"); browserListIndexDefault = comboBoxCustomBrowser.Items.Add("(default browser)");
browserListIndexCustom = comboBoxBrowserPath.Items.Add("(custom program...)"); browserListIndexCustom = comboBoxCustomBrowser.Items.Add("(custom program...)");
UpdateBrowserPathSelection(); UpdateBrowserPathSelection();
videoPlayerListIndexDefault = comboBoxCustomVideoPlayer.Items.Add("(default TweetDuck player)");
videoPlayerListIndexCustom = comboBoxCustomVideoPlayer.Items.Add("(custom program...)");
UpdateVideoPlayerPathSelection();
comboBoxSearchEngine.Items.Add(new SearchEngine("DuckDuckGo", "https://duckduckgo.com/?q=")); comboBoxSearchEngine.Items.Add(new SearchEngine("DuckDuckGo", "https://duckduckgo.com/?q="));
comboBoxSearchEngine.Items.Add(new SearchEngine("Google", "https://www.google.com/search?q=")); comboBoxSearchEngine.Items.Add(new SearchEngine("Google", "https://www.google.com/search?q="));
comboBoxSearchEngine.Items.Add(new SearchEngine("Bing", "https://www.bing.com/search?q=")); comboBoxSearchEngine.Items.Add(new SearchEngine("Bing", "https://www.bing.com/search?q="));
@@ -108,6 +100,7 @@ namespace TweetDuck.Core.Other.Settings{
toolTip.SetToolTip(checkSpellCheck, "Underlines words that are spelled incorrectly."); toolTip.SetToolTip(checkSpellCheck, "Underlines words that are spelled incorrectly.");
toolTip.SetToolTip(comboBoxSpellCheckLanguage, "Language used for spell check."); toolTip.SetToolTip(comboBoxSpellCheckLanguage, "Language used for spell check.");
toolTip.SetToolTip(comboBoxTranslationTarget, "Language tweets are translated into."); toolTip.SetToolTip(comboBoxTranslationTarget, "Language tweets are translated into.");
toolTip.SetToolTip(comboBoxFirstDayOfWeek, "First day of week used in the date picker.");
checkSpellCheck.Checked = Config.EnableSpellCheck; checkSpellCheck.Checked = Config.EnableSpellCheck;
@@ -126,6 +119,17 @@ namespace TweetDuck.Core.Other.Settings{
} }
comboBoxTranslationTarget.SelectedItem = new LocaleUtils.Item(Config.TranslationTarget); comboBoxTranslationTarget.SelectedItem = new LocaleUtils.Item(Config.TranslationTarget);
var daysOfWeek = comboBoxFirstDayOfWeek.Items;
daysOfWeek.Add("(based on system locale)");
daysOfWeek.Add(new DayOfWeekItem("Monday", DayOfWeek.Monday));
daysOfWeek.Add(new DayOfWeekItem("Tuesday", DayOfWeek.Tuesday));
daysOfWeek.Add(new DayOfWeekItem("Wednesday", DayOfWeek.Wednesday));
daysOfWeek.Add(new DayOfWeekItem("Thursday", DayOfWeek.Thursday));
daysOfWeek.Add(new DayOfWeekItem("Friday", DayOfWeek.Friday));
daysOfWeek.Add(new DayOfWeekItem("Saturday", DayOfWeek.Saturday));
daysOfWeek.Add(new DayOfWeekItem("Sunday", DayOfWeek.Sunday));
comboBoxFirstDayOfWeek.SelectedItem = daysOfWeek.OfType<DayOfWeekItem>().FirstOrDefault(dow => dow.Id == Config.CalendarFirstDay) ?? daysOfWeek[0];
} }
public override void OnReady(){ public override void OnReady(){
@@ -137,21 +141,22 @@ namespace TweetDuck.Core.Other.Settings{
checkAnimatedAvatars.CheckedChanged += checkAnimatedAvatars_CheckedChanged; checkAnimatedAvatars.CheckedChanged += checkAnimatedAvatars_CheckedChanged;
trackBarZoom.ValueChanged += trackBarZoom_ValueChanged; trackBarZoom.ValueChanged += trackBarZoom_ValueChanged;
comboBoxTrayType.SelectedIndexChanged += comboBoxTrayType_SelectedIndexChanged;
checkTrayHighlight.CheckedChanged += checkTrayHighlight_CheckedChanged;
checkUpdateNotifications.CheckedChanged += checkUpdateNotifications_CheckedChanged; checkUpdateNotifications.CheckedChanged += checkUpdateNotifications_CheckedChanged;
btnCheckUpdates.Click += btnCheckUpdates_Click; btnCheckUpdates.Click += btnCheckUpdates_Click;
checkSmoothScrolling.CheckedChanged += checkSmoothScrolling_CheckedChanged; checkSmoothScrolling.CheckedChanged += checkSmoothScrolling_CheckedChanged;
checkTouchAdjustment.CheckedChanged += checkTouchAdjustment_CheckedChanged; checkTouchAdjustment.CheckedChanged += checkTouchAdjustment_CheckedChanged;
checkHardwareAcceleration.CheckedChanged += checkHardwareAcceleration_CheckedChanged; checkHardwareAcceleration.CheckedChanged += checkHardwareAcceleration_CheckedChanged;
comboBoxBrowserPath.SelectedIndexChanged += comboBoxBrowserPath_SelectedIndexChanged; comboBoxCustomBrowser.SelectedIndexChanged += comboBoxCustomBrowser_SelectedIndexChanged;
btnCustomBrowserChange.Click += btnCustomBrowserChange_Click;
comboBoxCustomVideoPlayer.SelectedIndexChanged += comboBoxCustomVideoPlayer_SelectedIndexChanged;
btnCustomVideoPlayerChange.Click += btnCustomVideoPlayerChange_Click;
comboBoxSearchEngine.SelectedIndexChanged += comboBoxSearchEngine_SelectedIndexChanged; comboBoxSearchEngine.SelectedIndexChanged += comboBoxSearchEngine_SelectedIndexChanged;
checkSpellCheck.CheckedChanged += checkSpellCheck_CheckedChanged; checkSpellCheck.CheckedChanged += checkSpellCheck_CheckedChanged;
comboBoxSpellCheckLanguage.SelectedValueChanged += comboBoxSpellCheckLanguage_SelectedValueChanged; comboBoxSpellCheckLanguage.SelectedValueChanged += comboBoxSpellCheckLanguage_SelectedValueChanged;
comboBoxTranslationTarget.SelectedValueChanged += comboBoxTranslationTarget_SelectedValueChanged; comboBoxTranslationTarget.SelectedValueChanged += comboBoxTranslationTarget_SelectedValueChanged;
comboBoxFirstDayOfWeek.SelectedValueChanged += comboBoxFirstDayOfWeek_SelectedValueChanged;
} }
public override void OnClosing(){ public override void OnClosing(){
@@ -198,18 +203,6 @@ namespace TweetDuck.Core.Other.Settings{
zoomUpdateTimer.Stop(); zoomUpdateTimer.Stop();
} }
#endregion
#region System Tray
private void comboBoxTrayType_SelectedIndexChanged(object sender, EventArgs e){
Config.TrayBehavior = (TrayIcon.Behavior)comboBoxTrayType.SelectedIndex;
checkTrayHighlight.Enabled = Config.TrayBehavior.ShouldDisplayIcon();
}
private void checkTrayHighlight_CheckedChanged(object sender, EventArgs e){
Config.EnableTrayHighlight = checkTrayHighlight.Checked;
}
#endregion #endregion
#region Updates #region Updates
@@ -253,43 +246,95 @@ namespace TweetDuck.Core.Other.Settings{
SysConfig.HardwareAcceleration = checkHardwareAcceleration.Checked; SysConfig.HardwareAcceleration = checkHardwareAcceleration.Checked;
} }
private void UpdateBrowserChangeButton(){
btnCustomBrowserChange.Visible = comboBoxCustomBrowser.SelectedIndex == browserListIndexCustom;
}
private void UpdateBrowserPathSelection(){ private void UpdateBrowserPathSelection(){
if (string.IsNullOrEmpty(Config.BrowserPath) || !File.Exists(Config.BrowserPath)){ if (string.IsNullOrEmpty(Config.BrowserPath) || !File.Exists(Config.BrowserPath)){
comboBoxBrowserPath.SelectedIndex = browserListIndexDefault; comboBoxCustomBrowser.SelectedIndex = browserListIndexDefault;
} }
else{ else{
WindowsUtils.Browser browserInfo = comboBoxBrowserPath.Items.OfType<WindowsUtils.Browser>().FirstOrDefault(browser => browser.Path == Config.BrowserPath); WindowsUtils.Browser browserInfo = comboBoxCustomBrowser.Items.OfType<WindowsUtils.Browser>().FirstOrDefault(browser => browser.Path == Config.BrowserPath);
if (browserInfo == null){ if (browserInfo == null || Config.BrowserPathArgs != null){
comboBoxBrowserPath.SelectedIndex = browserListIndexCustom; comboBoxCustomBrowser.SelectedIndex = browserListIndexCustom;
} }
else{ else{
comboBoxBrowserPath.SelectedItem = browserInfo; comboBoxCustomBrowser.SelectedItem = browserInfo;
}
} }
} }
private void comboBoxBrowserPath_SelectedIndexChanged(object sender, EventArgs e){ UpdateBrowserChangeButton();
if (comboBoxBrowserPath.SelectedIndex == browserListIndexCustom){ }
using(OpenFileDialog dialog = new OpenFileDialog{
AutoUpgradeEnabled = true, private void comboBoxCustomBrowser_SelectedIndexChanged(object sender, EventArgs e){
DereferenceLinks = true, if (comboBoxCustomBrowser.SelectedIndex == browserListIndexCustom){
InitialDirectory = Path.GetDirectoryName(Config.BrowserPath), // returns null if argument is null btnCustomBrowserChange_Click(sender, e);
Title = "Open Links With...", }
Filter = "Executables (*.exe;*.bat;*.cmd)|*.exe;*.bat;*.cmd|All Files (*.*)|*.*" else{
Config.BrowserPath = (comboBoxCustomBrowser.SelectedItem as WindowsUtils.Browser)?.Path; // default browser item is a string and casts to null
Config.BrowserPathArgs = null;
UpdateBrowserChangeButton();
}
}
private void btnCustomBrowserChange_Click(object sender, EventArgs e){
using(DialogSettingsExternalProgram dialog = new DialogSettingsExternalProgram("External Browser", "Open Links With..."){
Path = Config.BrowserPath,
Args = Config.BrowserPathArgs
}){ }){
if (dialog.ShowDialog() == DialogResult.OK){ if (dialog.ShowDialog() == DialogResult.OK){
Config.BrowserPath = dialog.FileName; Config.BrowserPath = dialog.Path;
Config.BrowserPathArgs = dialog.Args;
} }
} }
comboBoxBrowserPath.SelectedIndexChanged -= comboBoxBrowserPath_SelectedIndexChanged; comboBoxCustomBrowser.SelectedIndexChanged -= comboBoxCustomBrowser_SelectedIndexChanged;
UpdateBrowserPathSelection(); UpdateBrowserPathSelection();
comboBoxBrowserPath.SelectedIndexChanged += comboBoxBrowserPath_SelectedIndexChanged; comboBoxCustomBrowser.SelectedIndexChanged += comboBoxCustomBrowser_SelectedIndexChanged;
}
private void UpdateVideoPlayerChangeButton(){
btnCustomVideoPlayerChange.Visible = comboBoxCustomVideoPlayer.SelectedIndex == videoPlayerListIndexCustom;
}
private void UpdateVideoPlayerPathSelection(){
if (string.IsNullOrEmpty(Config.VideoPlayerPath) || !File.Exists(Config.VideoPlayerPath)){
comboBoxCustomVideoPlayer.SelectedIndex = videoPlayerListIndexDefault;
} }
else{ else{
Config.BrowserPath = (comboBoxBrowserPath.SelectedItem as WindowsUtils.Browser)?.Path; // default browser item is a string and casts to null comboBoxCustomVideoPlayer.SelectedIndex = videoPlayerListIndexCustom;
} }
UpdateVideoPlayerChangeButton();
}
private void comboBoxCustomVideoPlayer_SelectedIndexChanged(object sender, EventArgs e){
if (comboBoxCustomVideoPlayer.SelectedIndex == videoPlayerListIndexCustom){
btnCustomVideoPlayerChange_Click(sender, e);
}
else{
Config.VideoPlayerPath = null;
Config.VideoPlayerPathArgs = null;
UpdateVideoPlayerChangeButton();
}
}
private void btnCustomVideoPlayerChange_Click(object sender, EventArgs e){
using(DialogSettingsExternalProgram dialog = new DialogSettingsExternalProgram("External Video Player", "Play Videos With..."){
Path = Config.VideoPlayerPath,
Args = Config.VideoPlayerPathArgs
}){
if (dialog.ShowDialog() == DialogResult.OK){
Config.VideoPlayerPath = dialog.Path;
Config.VideoPlayerPathArgs = dialog.Args;
}
}
comboBoxCustomVideoPlayer.SelectedIndexChanged -= comboBoxCustomVideoPlayer_SelectedIndexChanged;
UpdateVideoPlayerPathSelection();
comboBoxCustomVideoPlayer.SelectedIndexChanged += comboBoxCustomVideoPlayer_SelectedIndexChanged;
} }
private void comboBoxSearchEngine_SelectedIndexChanged(object sender, EventArgs e){ private void comboBoxSearchEngine_SelectedIndexChanged(object sender, EventArgs e){
@@ -355,6 +400,24 @@ namespace TweetDuck.Core.Other.Settings{
Config.TranslationTarget = (comboBoxTranslationTarget.SelectedItem as LocaleUtils.Item)?.Code ?? "en"; Config.TranslationTarget = (comboBoxTranslationTarget.SelectedItem as LocaleUtils.Item)?.Code ?? "en";
} }
private void comboBoxFirstDayOfWeek_SelectedValueChanged(object sender, EventArgs e){
Config.CalendarFirstDay = (comboBoxFirstDayOfWeek.SelectedItem as DayOfWeekItem)?.Id ?? -1;
}
private sealed class DayOfWeekItem{
private string Name { get; }
public int Id { get; }
public DayOfWeekItem(string name, DayOfWeek dow){
Name = name;
Id = LocaleUtils.GetJQueryDayOfWeek(dow);
}
public override int GetHashCode() => Name.GetHashCode();
public override bool Equals(object obj) => obj is DayOfWeekItem other && Name == other.Name;
public override string ToString() => Name;
}
#endregion #endregion
} }
} }

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Other.Settings { namespace TweetDuck.Dialogs.Settings {
partial class TabSettingsNotifications { partial class TabSettingsNotifications {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@@ -35,9 +35,9 @@
this.radioLocTL = new System.Windows.Forms.RadioButton(); this.radioLocTL = new System.Windows.Forms.RadioButton();
this.trackBarEdgeDistance = new System.Windows.Forms.TrackBar(); this.trackBarEdgeDistance = new System.Windows.Forms.TrackBar();
this.tableLayoutDurationButtons = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutDurationButtons = new System.Windows.Forms.TableLayoutPanel();
this.btnDurationMedium = new TweetDuck.Core.Controls.FlatButton(); this.btnDurationMedium = new TweetDuck.Controls.FlatButton();
this.btnDurationLong = new TweetDuck.Core.Controls.FlatButton(); this.btnDurationLong = new TweetDuck.Controls.FlatButton();
this.btnDurationShort = new TweetDuck.Core.Controls.FlatButton(); this.btnDurationShort = new TweetDuck.Controls.FlatButton();
this.labelDurationValue = new System.Windows.Forms.Label(); this.labelDurationValue = new System.Windows.Forms.Label();
this.trackBarDuration = new System.Windows.Forms.TrackBar(); this.trackBarDuration = new System.Windows.Forms.TrackBar();
this.checkSkipOnLinkClick = new System.Windows.Forms.CheckBox(); this.checkSkipOnLinkClick = new System.Windows.Forms.CheckBox();
@@ -652,9 +652,9 @@
private System.Windows.Forms.Label labelDurationValue; private System.Windows.Forms.Label labelDurationValue;
private System.Windows.Forms.TrackBar trackBarDuration; private System.Windows.Forms.TrackBar trackBarDuration;
private System.Windows.Forms.TableLayoutPanel tableLayoutDurationButtons; private System.Windows.Forms.TableLayoutPanel tableLayoutDurationButtons;
private TweetDuck.Core.Controls.FlatButton btnDurationMedium; private TweetDuck.Controls.FlatButton btnDurationMedium;
private TweetDuck.Core.Controls.FlatButton btnDurationLong; private TweetDuck.Controls.FlatButton btnDurationLong;
private TweetDuck.Core.Controls.FlatButton btnDurationShort; private TweetDuck.Controls.FlatButton btnDurationShort;
private System.Windows.Forms.CheckBox checkNonIntrusive; private System.Windows.Forms.CheckBox checkNonIntrusive;
private System.Windows.Forms.Label labelIdlePause; private System.Windows.Forms.Label labelIdlePause;
private System.Windows.Forms.ComboBox comboBoxIdlePause; private System.Windows.Forms.ComboBox comboBoxIdlePause;

View File

@@ -1,11 +1,11 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using TweetDuck.Browser.Notification.Example;
using TweetDuck.Core.Notification.Example; using TweetDuck.Controls;
using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Notifications;
namespace TweetDuck.Core.Other.Settings{ namespace TweetDuck.Dialogs.Settings{
sealed partial class TabSettingsNotifications : BaseTabSettings{ sealed partial class TabSettingsNotifications : FormSettings.BaseTab{
private static readonly int[] IdlePauseSeconds = { 0, 30, 60, 120, 300 }; private static readonly int[] IdlePauseSeconds = { 0, 30, 60, 120, 300 };
private readonly FormNotificationExample notification; private readonly FormNotificationExample notification;
@@ -219,10 +219,18 @@ namespace TweetDuck.Core.Other.Settings{
#region Location #region Location
private void radioLoc_CheckedChanged(object sender, EventArgs e){ private void radioLoc_CheckedChanged(object sender, EventArgs e){
if (radioLocTL.Checked)Config.NotificationPosition = DesktopNotification.Position.TopLeft; if (radioLocTL.Checked){
else if (radioLocTR.Checked)Config.NotificationPosition = DesktopNotification.Position.TopRight; Config.NotificationPosition = DesktopNotification.Position.TopLeft;
else if (radioLocBL.Checked)Config.NotificationPosition = DesktopNotification.Position.BottomLeft; }
else if (radioLocBR.Checked)Config.NotificationPosition = DesktopNotification.Position.BottomRight; else if (radioLocTR.Checked){
Config.NotificationPosition = DesktopNotification.Position.TopRight;
}
else if (radioLocBL.Checked){
Config.NotificationPosition = DesktopNotification.Position.BottomLeft;
}
else if (radioLocBR.Checked){
Config.NotificationPosition = DesktopNotification.Position.BottomRight;
}
comboBoxDisplay.Enabled = trackBarEdgeDistance.Enabled = true; comboBoxDisplay.Enabled = trackBarEdgeDistance.Enabled = true;
notification.ShowExampleNotification(false); notification.ShowExampleNotification(false);

View File

@@ -1,4 +1,4 @@
namespace TweetDuck.Core.Other.Settings { namespace TweetDuck.Dialogs.Settings {
partial class TabSettingsSounds { partial class TabSettingsSounds {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@@ -2,12 +2,12 @@
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using TweetDuck.Browser.Notification;
using TweetDuck.Core.Notification; using TweetDuck.Controls;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
namespace TweetDuck.Core.Other.Settings{ namespace TweetDuck.Dialogs.Settings{
sealed partial class TabSettingsSounds : BaseTabSettings{ sealed partial class TabSettingsSounds : FormSettings.BaseTab{
private readonly Action playSoundNotification; private readonly Action playSoundNotification;
public TabSettingsSounds(Action playSoundNotification){ public TabSettingsSounds(Action playSoundNotification){
@@ -64,17 +64,17 @@ namespace TweetDuck.Core.Other.Settings{
} }
private void btnBrowseSound_Click(object sender, EventArgs e){ private void btnBrowseSound_Click(object sender, EventArgs e){
using(OpenFileDialog dialog = new OpenFileDialog{ using OpenFileDialog dialog = new OpenFileDialog{
AutoUpgradeEnabled = true, AutoUpgradeEnabled = true,
DereferenceLinks = true, DereferenceLinks = true,
Title = "Custom Notification Sound", Title = "Custom Notification Sound",
Filter = $"Sound file ({SoundNotification.SupportedFormats})|{SoundNotification.SupportedFormats}|All files (*.*)|*.*" Filter = $"Sound file ({SoundNotification.SupportedFormats})|{SoundNotification.SupportedFormats}|All files (*.*)|*.*"
}){ };
if (dialog.ShowDialog() == DialogResult.OK){ if (dialog.ShowDialog() == DialogResult.OK){
tbCustomSound.Text = dialog.FileName; tbCustomSound.Text = dialog.FileName;
} }
} }
}
private void btnResetSound_Click(object sender, EventArgs e){ private void btnResetSound_Click(object sender, EventArgs e){
tbCustomSound.Text = string.Empty; tbCustomSound.Text = string.Empty;

View File

@@ -0,0 +1,131 @@
namespace TweetDuck.Dialogs.Settings {
partial class TabSettingsTray {
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.components = new System.ComponentModel.Container();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.flowPanelLeft = new System.Windows.Forms.FlowLayoutPanel();
this.labelTray = new System.Windows.Forms.Label();
this.comboBoxTrayType = new System.Windows.Forms.ComboBox();
this.labelTrayIcon = new System.Windows.Forms.Label();
this.checkTrayHighlight = new System.Windows.Forms.CheckBox();
this.flowPanelRight = new System.Windows.Forms.FlowLayoutPanel();
this.flowPanelLeft.SuspendLayout();
this.SuspendLayout();
//
// flowPanelLeft
//
this.flowPanelLeft.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.flowPanelLeft.Controls.Add(this.labelTray);
this.flowPanelLeft.Controls.Add(this.comboBoxTrayType);
this.flowPanelLeft.Controls.Add(this.labelTrayIcon);
this.flowPanelLeft.Controls.Add(this.checkTrayHighlight);
this.flowPanelLeft.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowPanelLeft.Location = new System.Drawing.Point(9, 9);
this.flowPanelLeft.Name = "flowPanelLeft";
this.flowPanelLeft.Size = new System.Drawing.Size(300, 462);
this.flowPanelLeft.TabIndex = 0;
this.flowPanelLeft.WrapContents = false;
//
// labelTray
//
this.labelTray.AutoSize = true;
this.labelTray.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold);
this.labelTray.Location = new System.Drawing.Point(0, 0);
this.labelTray.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1);
this.labelTray.Name = "labelTray";
this.labelTray.Size = new System.Drawing.Size(99, 19);
this.labelTray.TabIndex = 0;
this.labelTray.Text = "SYSTEM TRAY";
//
// comboBoxTrayType
//
this.comboBoxTrayType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxTrayType.Font = new System.Drawing.Font("Segoe UI", 9F);
this.comboBoxTrayType.FormattingEnabled = true;
this.comboBoxTrayType.Location = new System.Drawing.Point(5, 24);
this.comboBoxTrayType.Margin = new System.Windows.Forms.Padding(5, 4, 3, 3);
this.comboBoxTrayType.Name = "comboBoxTrayType";
this.comboBoxTrayType.Size = new System.Drawing.Size(144, 23);
this.comboBoxTrayType.TabIndex = 1;
//
// labelTrayIcon
//
this.labelTrayIcon.AutoSize = true;
this.labelTrayIcon.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold);
this.labelTrayIcon.Location = new System.Drawing.Point(3, 59);
this.labelTrayIcon.Margin = new System.Windows.Forms.Padding(3, 9, 3, 0);
this.labelTrayIcon.Name = "labelTrayIcon";
this.labelTrayIcon.Size = new System.Drawing.Size(56, 15);
this.labelTrayIcon.TabIndex = 2;
this.labelTrayIcon.Text = "Tray Icon";
//
// checkTrayHighlight
//
this.checkTrayHighlight.AutoSize = true;
this.checkTrayHighlight.Font = new System.Drawing.Font("Segoe UI", 9F);
this.checkTrayHighlight.Location = new System.Drawing.Point(6, 80);
this.checkTrayHighlight.Margin = new System.Windows.Forms.Padding(6, 6, 3, 2);
this.checkTrayHighlight.Name = "checkTrayHighlight";
this.checkTrayHighlight.Size = new System.Drawing.Size(114, 19);
this.checkTrayHighlight.TabIndex = 3;
this.checkTrayHighlight.Text = "Enable Highlight";
this.checkTrayHighlight.UseVisualStyleBackColor = true;
//
// flowPanelRight
//
this.flowPanelRight.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.flowPanelRight.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowPanelRight.Location = new System.Drawing.Point(322, 9);
this.flowPanelRight.Name = "flowPanelRight";
this.flowPanelRight.Size = new System.Drawing.Size(300, 462);
this.flowPanelRight.TabIndex = 1;
this.flowPanelRight.WrapContents = false;
//
// TabSettingsTray
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.flowPanelRight);
this.Controls.Add(this.flowPanelLeft);
this.Name = "TabSettingsTray";
this.Size = new System.Drawing.Size(631, 480);
this.flowPanelLeft.ResumeLayout(false);
this.flowPanelLeft.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ToolTip toolTip;
private System.Windows.Forms.FlowLayoutPanel flowPanelLeft;
private System.Windows.Forms.Label labelTray;
private System.Windows.Forms.ComboBox comboBoxTrayType;
private System.Windows.Forms.Label labelTrayIcon;
private System.Windows.Forms.CheckBox checkTrayHighlight;
private System.Windows.Forms.FlowLayoutPanel flowPanelRight;
}
}

View File

@@ -0,0 +1,43 @@
using System;
using TweetDuck.Browser;
namespace TweetDuck.Dialogs.Settings{
sealed partial class TabSettingsTray : FormSettings.BaseTab{
public TabSettingsTray(){
InitializeComponent();
// system tray
toolTip.SetToolTip(comboBoxTrayType, "Changes behavior of the Tray icon.\r\nRight-click the icon for an action menu.");
toolTip.SetToolTip(checkTrayHighlight, "Highlights the tray icon if there are new tweets.\r\nOnly works for columns with popup or audio notifications.\r\nThe icon resets when the main window is restored.");
comboBoxTrayType.Items.Add("Disabled");
comboBoxTrayType.Items.Add("Display Icon Only");
comboBoxTrayType.Items.Add("Minimize to Tray");
comboBoxTrayType.Items.Add("Close to Tray");
comboBoxTrayType.Items.Add("Combined");
comboBoxTrayType.SelectedIndex = Math.Min(Math.Max((int)Config.TrayBehavior, 0), comboBoxTrayType.Items.Count - 1);
checkTrayHighlight.Enabled = Config.TrayBehavior.ShouldDisplayIcon();
checkTrayHighlight.Checked = Config.EnableTrayHighlight;
}
public override void OnReady(){
comboBoxTrayType.SelectedIndexChanged += comboBoxTrayType_SelectedIndexChanged;
checkTrayHighlight.CheckedChanged += checkTrayHighlight_CheckedChanged;
}
#region System Tray
private void comboBoxTrayType_SelectedIndexChanged(object sender, EventArgs e){
Config.TrayBehavior = (TrayIcon.Behavior)comboBoxTrayType.SelectedIndex;
checkTrayHighlight.Enabled = Config.TrayBehavior.ShouldDisplayIcon();
}
private void checkTrayHighlight_CheckedChanged(object sender, EventArgs e){
Config.EnableTrayHighlight = checkTrayHighlight.Checked;
}
#endregion
}
}

View File

@@ -5,7 +5,7 @@ using System.Reflection;
using TweetLib.Core.Serialization; using TweetLib.Core.Serialization;
using TweetLib.Core.Serialization.Converters; using TweetLib.Core.Serialization.Converters;
namespace TweetDuck.Core.Other.Analytics{ namespace TweetDuck.Management.Analytics{
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Local")] [SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Local")]
sealed class AnalyticsFile{ sealed class AnalyticsFile{
private static readonly FileSerializer<AnalyticsFile> Serializer = new FileSerializer<AnalyticsFile>(); private static readonly FileSerializer<AnalyticsFile> Serializer = new FileSerializer<AnalyticsFile>();

View File

@@ -6,13 +6,14 @@ using System;
using System.Net; using System.Net;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Timers; using System.Timers;
using TweetDuck.Core.Controls; using TweetDuck.Browser;
using TweetDuck.Core.Utils; using TweetDuck.Controls;
using TweetDuck.Utils;
using TweetLib.Core; using TweetLib.Core;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
using TweetLib.Core.Utils; using TweetLib.Core.Utils;
namespace TweetDuck.Core.Other.Analytics{ namespace TweetDuck.Management.Analytics{
sealed class AnalyticsManager : IDisposable{ sealed class AnalyticsManager : IDisposable{
private static readonly TimeSpan CollectionInterval = TimeSpan.FromDays(14); private static readonly TimeSpan CollectionInterval = TimeSpan.FromDays(14);
@@ -138,8 +139,7 @@ namespace TweetDuck.Core.Other.Analytics{
break; break;
case WebExceptionStatus.ProtocolError: case WebExceptionStatus.ProtocolError:
HttpWebResponse response = e.Response as HttpWebResponse; message = "HTTP Error " + (e.Response is HttpWebResponse response ? $"{(int)response.StatusCode} ({response.StatusDescription})" : "(unknown code)");
message = "HTTP Error " + (response != null ? $"{(int)response.StatusCode} ({response.StatusDescription})" : "(unknown code)");
break; break;
} }

View File

@@ -2,7 +2,7 @@
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Text; using System.Text;
namespace TweetDuck.Core.Other.Analytics{ namespace TweetDuck.Management.Analytics{
sealed class AnalyticsReport : IEnumerable{ sealed class AnalyticsReport : IEnumerable{
private OrderedDictionary data = new OrderedDictionary(32); private OrderedDictionary data = new OrderedDictionary(32);
private int separators; private int separators;

View File

@@ -2,20 +2,21 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Windows.Forms;
using Microsoft.Win32;
using TweetDuck.Configuration;
using System.Linq; using System.Linq;
using System.Management; using System.Management;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using TweetDuck.Core.Utils; using System.Windows.Forms;
using Microsoft.Win32;
using TweetDuck.Browser;
using TweetDuck.Configuration;
using TweetDuck.Utils;
using TweetLib.Core; using TweetLib.Core;
using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Notifications;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
using TweetLib.Core.Features.Plugins.Enums; using TweetLib.Core.Features.Plugins.Enums;
using TweetLib.Core.Utils; using TweetLib.Core.Utils;
namespace TweetDuck.Core.Other.Analytics{ namespace TweetDuck.Management.Analytics{
static class AnalyticsReportGenerator{ static class AnalyticsReportGenerator{
public static AnalyticsReport Create(AnalyticsFile file, ExternalInfo info, PluginManager plugins){ public static AnalyticsReport Create(AnalyticsFile file, ExternalInfo info, PluginManager plugins){
Dictionary<string, string> editLayoutDesign = EditLayoutDesignPluginData; Dictionary<string, string> editLayoutDesign = EditLayoutDesignPluginData;

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace TweetDuck.Core.Management{ namespace TweetDuck.Management{
static class BrowserCache{ static class BrowserCache{
public static string CacheFolder => Path.Combine(Program.StoragePath, "Cache"); public static string CacheFolder => Path.Combine(Program.StoragePath, "Cache");

View File

@@ -0,0 +1,55 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace TweetDuck.Management{
static class ClipboardManager{
private static readonly Lazy<Regex> RegexStripHtmlStyles = new Lazy<Regex>(() => new Regex(@"\s?(?:style|class)="".*?"""), false);
private static readonly Lazy<Regex> RegexOffsetClipboardHtml = new Lazy<Regex>(() => new Regex(@"(?<=EndHTML:|EndFragment:)(\d+)"), false);
public static void SetText(string text, TextDataFormat format){
if (string.IsNullOrEmpty(text)){
return;
}
DataObject obj = new DataObject();
obj.SetText(text, format);
SetClipboardData(obj);
}
public static void SetImage(Image image){
DataObject obj = new DataObject();
obj.SetImage(image);
SetClipboardData(obj);
}
private static void SetClipboardData(DataObject obj){
try{
Clipboard.SetDataObject(obj);
}catch(ExternalException e){
Program.Reporter.HandleException("Clipboard Error", "TweetDuck could not access the clipboard as it is currently used by another process.", true, e);
}
}
public static void StripHtmlStyles(){
if (!Clipboard.ContainsText(TextDataFormat.Html) || !Clipboard.ContainsText(TextDataFormat.UnicodeText)){
return;
}
string originalText = Clipboard.GetText(TextDataFormat.UnicodeText);
string originalHtml = Clipboard.GetText(TextDataFormat.Html);
string updatedHtml = RegexStripHtmlStyles.Value.Replace(originalHtml, string.Empty);
int removed = originalHtml.Length - updatedHtml.Length;
updatedHtml = RegexOffsetClipboardHtml.Value.Replace(updatedHtml, match => (int.Parse(match.Value) - removed).ToString().PadLeft(match.Value.Length, '0'));
DataObject obj = new DataObject();
obj.SetText(originalText, TextDataFormat.UnicodeText);
obj.SetText(updatedHtml, TextDataFormat.Html);
SetClipboardData(obj);
}
}
}

View File

@@ -1,10 +1,12 @@
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
namespace TweetDuck.Core{ namespace TweetDuck.Management{
static class FormManager{ static class FormManager{
private static FormCollection OpenForms => System.Windows.Forms.Application.OpenForms;
public static T TryFind<T>() where T : Form{ public static T TryFind<T>() where T : Form{
return Application.OpenForms.OfType<T>().FirstOrDefault(); return OpenForms.OfType<T>().FirstOrDefault();
} }
public static bool TryBringToFront<T>() where T : Form{ public static bool TryBringToFront<T>() where T : Form{
@@ -14,11 +16,13 @@ namespace TweetDuck.Core{
form.BringToFront(); form.BringToFront();
return true; return true;
} }
else return false; else{
return false;
}
} }
public static void CloseAllDialogs(){ public static void CloseAllDialogs(){
foreach(IAppDialog dialog in Application.OpenForms.OfType<IAppDialog>().Reverse()){ foreach(IAppDialog dialog in OpenForms.OfType<IAppDialog>().Reverse()){
((Form)dialog).Close(); ((Form)dialog).Close();
} }
} }

View File

@@ -2,12 +2,12 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using TweetDuck.Core.Other; using TweetDuck.Dialogs;
using TweetLib.Core.Data; using TweetLib.Core.Data;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
using TweetLib.Core.Features.Plugins.Enums; using TweetLib.Core.Features.Plugins.Enums;
namespace TweetDuck.Core.Management{ namespace TweetDuck.Management{
sealed class ProfileManager{ sealed class ProfileManager{
private static readonly string CookiesPath = Path.Combine(Program.StoragePath, "Cookies"); private static readonly string CookiesPath = Path.Combine(Program.StoragePath, "Cookies");
private static readonly string TempCookiesPath = Path.Combine(Program.StoragePath, "CookiesTmp"); private static readonly string TempCookiesPath = Path.Combine(Program.StoragePath, "CookiesTmp");

View File

@@ -2,13 +2,14 @@
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Browser;
using TweetDuck.Configuration; using TweetDuck.Configuration;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetDuck.Core.Other; using TweetDuck.Dialogs;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
using TweetLib.Communication; using TweetLib.Communication;
namespace TweetDuck.Core.Management{ namespace TweetDuck.Management{
sealed class VideoPlayer : IDisposable{ sealed class VideoPlayer : IDisposable{
private static UserConfig Config => Program.Config.User; private static UserConfig Config => Program.Config.User;
@@ -26,7 +27,7 @@ namespace TweetDuck.Core.Management{
this.owner.FormClosing += owner_FormClosing; this.owner.FormClosing += owner_FormClosing;
} }
public void Launch(string url, string username){ public void Launch(string videoUrl, string tweetUrl, string username){
if (Running){ if (Running){
Destroy(); Destroy();
isClosing = false; isClosing = false;
@@ -40,11 +41,11 @@ namespace TweetDuck.Core.Management{
if ((process = Process.Start(new ProcessStartInfo{ if ((process = Process.Start(new ProcessStartInfo{
FileName = Path.Combine(Program.ProgramPath, "TweetDuck.Video.exe"), FileName = Path.Combine(Program.ProgramPath, "TweetDuck.Video.exe"),
Arguments = $"{owner.Handle} {(int)Math.Floor(100F * owner.GetDPIScale())} {Config.VideoPlayerVolume} \"{url}\" \"{pipe.GenerateToken()}\"", Arguments = $"{owner.Handle} {(int)Math.Floor(100F * owner.GetDPIScale())} {Config.VideoPlayerVolume} \"{videoUrl}\" \"{pipe.GenerateToken()}\"",
UseShellExecute = false, UseShellExecute = false,
RedirectStandardOutput = true RedirectStandardOutput = true
})) != null){ })) != null){
currentInstance = new Instance(process, pipe, url, username); currentInstance = new Instance(process, pipe, videoUrl, tweetUrl, username);
process.EnableRaisingEvents = true; process.EnableRaisingEvents = true;
process.Exited += process_Exited; process.Exited += process_Exited;
@@ -81,7 +82,7 @@ namespace TweetDuck.Core.Management{
case "download": case "download":
if (currentInstance != null){ if (currentInstance != null){
owner.AnalyticsFile.DownloadedVideos.Trigger(); owner.AnalyticsFile.DownloadedVideos.Trigger();
TwitterUtils.DownloadVideo(currentInstance.Url, currentInstance.Username); TwitterUtils.DownloadVideo(currentInstance.VideoUrl, currentInstance.Username);
} }
break; break;
@@ -145,7 +146,7 @@ namespace TweetDuck.Core.Management{
} }
int exitCode = currentInstance.Process.ExitCode; int exitCode = currentInstance.Process.ExitCode;
string url = currentInstance.Url; string tweetUrl = currentInstance.TweetUrl;
currentInstance.Dispose(); currentInstance.Dispose();
currentInstance = null; currentInstance = null;
@@ -153,14 +154,14 @@ namespace TweetDuck.Core.Management{
switch(exitCode){ switch(exitCode){
case 3: // CODE_LAUNCH_FAIL case 3: // CODE_LAUNCH_FAIL
if (FormMessage.Error("Video Playback Error", "Error launching video player, this may be caused by missing Windows Media Player. Do you want to open the video in your browser?", FormMessage.Yes, FormMessage.No)){ if (FormMessage.Error("Video Playback Error", "Error launching video player, this may be caused by missing Windows Media Player. Do you want to open the video in your browser?", FormMessage.Yes, FormMessage.No)){
BrowserUtils.OpenExternalBrowser(url); BrowserUtils.OpenExternalBrowser(tweetUrl);
} }
break; break;
case 4: // CODE_MEDIA_ERROR case 4: // CODE_MEDIA_ERROR
if (FormMessage.Error("Video Playback Error", "The video could not be loaded, most likely due to unknown format. Do you want to open the video in your browser?", FormMessage.Yes, FormMessage.No)){ if (FormMessage.Error("Video Playback Error", "The video could not be loaded, most likely due to unknown format. Do you want to open the video in your browser?", FormMessage.Yes, FormMessage.No)){
BrowserUtils.OpenExternalBrowser(url); BrowserUtils.OpenExternalBrowser(tweetUrl);
} }
break; break;
@@ -184,13 +185,15 @@ namespace TweetDuck.Core.Management{
public Process Process { get; } public Process Process { get; }
public DuplexPipe.Server Pipe { get; } public DuplexPipe.Server Pipe { get; }
public string Url { get; } public string VideoUrl { get; }
public string TweetUrl { get; }
public string Username { get; } public string Username { get; }
public Instance(Process process, DuplexPipe.Server pipe, string url, string username){ public Instance(Process process, DuplexPipe.Server pipe, string videoUrl, string tweetUrl, string username){
this.Process = process; this.Process = process;
this.Pipe = pipe; this.Pipe = pipe;
this.Url = url; this.VideoUrl = videoUrl;
this.TweetUrl = tweetUrl;
this.Username = username; this.Username = username;
} }

View File

@@ -33,7 +33,7 @@
this.labelWebsite = new System.Windows.Forms.Label(); this.labelWebsite = new System.Windows.Forms.Label();
this.labelVersion = new System.Windows.Forms.Label(); this.labelVersion = new System.Windows.Forms.Label();
this.btnConfigure = new System.Windows.Forms.Button(); this.btnConfigure = new System.Windows.Forms.Button();
this.labelType = new TweetDuck.Core.Controls.LabelVertical(); this.labelType = new TweetDuck.Controls.LabelVertical();
this.timerLayout = new System.Windows.Forms.Timer(this.components); this.timerLayout = new System.Windows.Forms.Timer(this.components);
this.panelBorder = new System.Windows.Forms.Panel(); this.panelBorder = new System.Windows.Forms.Panel();
this.panelDescription.SuspendLayout(); this.panelDescription.SuspendLayout();
@@ -227,7 +227,7 @@
private System.Windows.Forms.Label labelWebsite; private System.Windows.Forms.Label labelWebsite;
private System.Windows.Forms.Label labelVersion; private System.Windows.Forms.Label labelVersion;
private System.Windows.Forms.Button btnConfigure; private System.Windows.Forms.Button btnConfigure;
private Core.Controls.LabelVertical labelType; private Controls.LabelVertical labelType;
private System.Windows.Forms.Timer timerLayout; private System.Windows.Forms.Timer timerLayout;
private System.Windows.Forms.Panel panelBorder; private System.Windows.Forms.Panel panelBorder;
} }

View File

@@ -1,8 +1,8 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using TweetDuck.Controls;
using TweetDuck.Core.Utils; using TweetDuck.Utils;
using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins;
using TweetLib.Core.Features.Plugins.Enums; using TweetLib.Core.Features.Plugins.Enums;

Some files were not shown because too many files have changed in this diff Show More