mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-06 05:34:05 +02:00
Remove legacy notification loading option
This commit is contained in:
parent
89854d527c
commit
7ff9e23283
Configuration
Core
@ -27,7 +27,6 @@ sealed class UserConfig{
|
||||
public int NotificationEdgeDistance { get; set; }
|
||||
public int NotificationDisplay { get; set; }
|
||||
public int NotificationDurationValue { get; set; }
|
||||
public bool NotificationLegacyLoad { get; set; }
|
||||
|
||||
public bool EnableSpellCheck { get; set; }
|
||||
public bool ExpandLinksOnHover { get; set; }
|
||||
|
@ -118,9 +118,7 @@ public void OnTweetSound(){
|
||||
}
|
||||
|
||||
public void OnNotificationReady(){
|
||||
if (!Program.UserConfig.NotificationLegacyLoad){
|
||||
notification.InvokeSafe(notification.OnNotificationReady);
|
||||
}
|
||||
}
|
||||
|
||||
public void DisplayTooltip(string text, bool showInNotification){
|
||||
|
@ -85,7 +85,6 @@ protected override bool ShowWithoutActivation{
|
||||
public string CurrentQuotedTweetUrl { get; set; }
|
||||
|
||||
public EventHandler Initialized;
|
||||
private bool isInitialized;
|
||||
|
||||
private int pauseCounter;
|
||||
private bool pausedDuringNotification;
|
||||
@ -223,16 +222,7 @@ private void Browser_IsBrowserInitializedChanged(object sender, IsBrowserInitial
|
||||
}
|
||||
|
||||
private void Browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e){
|
||||
if (!e.Frame.IsMain)return;
|
||||
|
||||
if (!isInitialized && !Program.UserConfig.NotificationLegacyLoad){
|
||||
isInitialized = true;
|
||||
|
||||
if (Initialized != null){
|
||||
Initialized(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
else if (notificationJS != null && browser.Address != "about:blank" && !flags.HasFlag(NotificationFlags.DisableScripts)){
|
||||
if (e.Frame.IsMain && notificationJS != null && browser.Address != "about:blank" && !flags.HasFlag(NotificationFlags.DisableScripts)){
|
||||
ScriptLoader.ExecuteScript(e.Frame, notificationJS, NotificationScriptIdentifier);
|
||||
|
||||
if (plugins != null && plugins.HasAnyPlugin(PluginEnvironment.Notification)){
|
||||
@ -282,7 +272,7 @@ public void ShowNotificationForSettings(bool reset){
|
||||
}
|
||||
|
||||
public void HideNotification(bool loadBlank){
|
||||
if (loadBlank || Program.UserConfig.NotificationLegacyLoad){
|
||||
if (loadBlank){
|
||||
browser.LoadHtml("", "about:blank");
|
||||
}
|
||||
|
||||
@ -350,10 +340,6 @@ private void LoadTweet(TweetNotification tweet){
|
||||
string bodyClasses = browser.Bounds.Contains(PointToClient(Cursor.Position)) ? "td-hover" : string.Empty;
|
||||
|
||||
browser.LoadHtml(tweet.GenerateHtml(bodyClasses), "http://tweetdeck.twitter.com/?"+DateTime.Now.Ticks);
|
||||
|
||||
if (Program.UserConfig.NotificationLegacyLoad){
|
||||
OnNotificationReady();
|
||||
}
|
||||
}
|
||||
|
||||
private void PrepareAndDisplayWindow(){
|
||||
|
@ -44,13 +44,12 @@ private void InitializeComponent() {
|
||||
this.trackBarDuration = new System.Windows.Forms.TrackBar();
|
||||
this.groupUserInterface = new System.Windows.Forms.GroupBox();
|
||||
this.checkTimerCountDown = new System.Windows.Forms.CheckBox();
|
||||
this.checkLegacyLoad = new System.Windows.Forms.CheckBox();
|
||||
this.checkNotificationTimer = new System.Windows.Forms.CheckBox();
|
||||
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.groupCustomSound = new System.Windows.Forms.GroupBox();
|
||||
this.tbCustomSound = new System.Windows.Forms.TextBox();
|
||||
this.btnBrowseSound = new System.Windows.Forms.Button();
|
||||
this.btnResetSound = new System.Windows.Forms.Button();
|
||||
this.btnBrowseSound = new System.Windows.Forms.Button();
|
||||
this.tbCustomSound = new System.Windows.Forms.TextBox();
|
||||
this.groupNotificationLocation.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trackBarEdgeDistance)).BeginInit();
|
||||
this.groupNotificationDuration.SuspendLayout();
|
||||
@ -204,7 +203,7 @@ private void InitializeComponent() {
|
||||
this.groupNotificationDuration.Controls.Add(this.tableLayoutDurationButtons);
|
||||
this.groupNotificationDuration.Controls.Add(this.labelDurationValue);
|
||||
this.groupNotificationDuration.Controls.Add(this.trackBarDuration);
|
||||
this.groupNotificationDuration.Location = new System.Drawing.Point(9, 106);
|
||||
this.groupNotificationDuration.Location = new System.Drawing.Point(9, 83);
|
||||
this.groupNotificationDuration.Name = "groupNotificationDuration";
|
||||
this.groupNotificationDuration.Size = new System.Drawing.Size(183, 89);
|
||||
this.groupNotificationDuration.TabIndex = 9;
|
||||
@ -307,11 +306,10 @@ private void InitializeComponent() {
|
||||
// groupUserInterface
|
||||
//
|
||||
this.groupUserInterface.Controls.Add(this.checkTimerCountDown);
|
||||
this.groupUserInterface.Controls.Add(this.checkLegacyLoad);
|
||||
this.groupUserInterface.Controls.Add(this.checkNotificationTimer);
|
||||
this.groupUserInterface.Location = new System.Drawing.Point(9, 9);
|
||||
this.groupUserInterface.Name = "groupUserInterface";
|
||||
this.groupUserInterface.Size = new System.Drawing.Size(183, 91);
|
||||
this.groupUserInterface.Size = new System.Drawing.Size(183, 68);
|
||||
this.groupUserInterface.TabIndex = 10;
|
||||
this.groupUserInterface.TabStop = false;
|
||||
this.groupUserInterface.Text = "General";
|
||||
@ -328,19 +326,6 @@ private void InitializeComponent() {
|
||||
this.checkTimerCountDown.UseVisualStyleBackColor = true;
|
||||
this.checkTimerCountDown.CheckedChanged += new System.EventHandler(this.checkTimerCountDown_CheckedChanged);
|
||||
//
|
||||
// checkLegacyLoad
|
||||
//
|
||||
this.checkLegacyLoad.AutoSize = true;
|
||||
this.checkLegacyLoad.Location = new System.Drawing.Point(6, 67);
|
||||
this.checkLegacyLoad.Name = "checkLegacyLoad";
|
||||
this.checkLegacyLoad.Size = new System.Drawing.Size(139, 17);
|
||||
this.checkLegacyLoad.TabIndex = 5;
|
||||
this.checkLegacyLoad.Text = "Legacy Loading System";
|
||||
this.toolTip.SetToolTip(this.checkLegacyLoad, "Try enabling if notifications do not display.\r\nMight cause delays and visual arti" +
|
||||
"facts.");
|
||||
this.checkLegacyLoad.UseVisualStyleBackColor = true;
|
||||
this.checkLegacyLoad.CheckedChanged += new System.EventHandler(this.checkLegacyLoad_CheckedChanged);
|
||||
//
|
||||
// checkNotificationTimer
|
||||
//
|
||||
this.checkNotificationTimer.AutoSize = true;
|
||||
@ -359,19 +344,24 @@ private void InitializeComponent() {
|
||||
this.groupCustomSound.Controls.Add(this.btnResetSound);
|
||||
this.groupCustomSound.Controls.Add(this.btnBrowseSound);
|
||||
this.groupCustomSound.Controls.Add(this.tbCustomSound);
|
||||
this.groupCustomSound.Location = new System.Drawing.Point(9, 201);
|
||||
this.groupCustomSound.Location = new System.Drawing.Point(9, 178);
|
||||
this.groupCustomSound.Name = "groupCustomSound";
|
||||
this.groupCustomSound.Size = new System.Drawing.Size(183, 72);
|
||||
this.groupCustomSound.TabIndex = 11;
|
||||
this.groupCustomSound.TabStop = false;
|
||||
this.groupCustomSound.Text = "Custom Sound";
|
||||
//
|
||||
// tbCustomSound
|
||||
// btnResetSound
|
||||
//
|
||||
this.tbCustomSound.Location = new System.Drawing.Point(6, 19);
|
||||
this.tbCustomSound.Name = "tbCustomSound";
|
||||
this.tbCustomSound.Size = new System.Drawing.Size(170, 20);
|
||||
this.tbCustomSound.TabIndex = 0;
|
||||
this.btnResetSound.AutoSize = true;
|
||||
this.btnResetSound.Location = new System.Drawing.Point(126, 43);
|
||||
this.btnResetSound.Name = "btnResetSound";
|
||||
this.btnResetSound.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.btnResetSound.Size = new System.Drawing.Size(51, 23);
|
||||
this.btnResetSound.TabIndex = 2;
|
||||
this.btnResetSound.Text = "Reset";
|
||||
this.btnResetSound.UseVisualStyleBackColor = true;
|
||||
this.btnResetSound.Click += new System.EventHandler(this.btnResetSound_Click);
|
||||
//
|
||||
// btnBrowseSound
|
||||
//
|
||||
@ -385,17 +375,12 @@ private void InitializeComponent() {
|
||||
this.btnBrowseSound.UseVisualStyleBackColor = true;
|
||||
this.btnBrowseSound.Click += new System.EventHandler(this.btnBrowseSound_Click);
|
||||
//
|
||||
// btnResetSound
|
||||
// tbCustomSound
|
||||
//
|
||||
this.btnResetSound.AutoSize = true;
|
||||
this.btnResetSound.Location = new System.Drawing.Point(126, 43);
|
||||
this.btnResetSound.Name = "btnResetSound";
|
||||
this.btnResetSound.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.btnResetSound.Size = new System.Drawing.Size(51, 23);
|
||||
this.btnResetSound.TabIndex = 2;
|
||||
this.btnResetSound.Text = "Reset";
|
||||
this.btnResetSound.UseVisualStyleBackColor = true;
|
||||
this.btnResetSound.Click += new System.EventHandler(this.btnResetSound_Click);
|
||||
this.tbCustomSound.Location = new System.Drawing.Point(6, 19);
|
||||
this.tbCustomSound.Name = "tbCustomSound";
|
||||
this.tbCustomSound.Size = new System.Drawing.Size(170, 20);
|
||||
this.tbCustomSound.TabIndex = 0;
|
||||
//
|
||||
// TabSettingsNotifications
|
||||
//
|
||||
@ -440,7 +425,6 @@ private void InitializeComponent() {
|
||||
private System.Windows.Forms.CheckBox checkNotificationTimer;
|
||||
private System.Windows.Forms.ToolTip toolTip;
|
||||
private System.Windows.Forms.Label labelEdgeDistanceValue;
|
||||
private System.Windows.Forms.CheckBox checkLegacyLoad;
|
||||
private System.Windows.Forms.CheckBox checkTimerCountDown;
|
||||
private System.Windows.Forms.Label labelDurationValue;
|
||||
private System.Windows.Forms.TrackBar trackBarDuration;
|
||||
|
@ -54,7 +54,6 @@ public TabSettingsNotifications(FormNotification notification){
|
||||
checkNotificationTimer.Checked = Config.DisplayNotificationTimer;
|
||||
checkTimerCountDown.Enabled = checkNotificationTimer.Checked;
|
||||
checkTimerCountDown.Checked = Config.NotificationTimerCountDown;
|
||||
checkLegacyLoad.Checked = Config.NotificationLegacyLoad;
|
||||
|
||||
trackBarEdgeDistance.SetValueSafe(Config.NotificationEdgeDistance);
|
||||
labelEdgeDistanceValue.Text = trackBarEdgeDistance.Value.ToString(CultureInfo.InvariantCulture)+" px";
|
||||
@ -153,12 +152,6 @@ private void checkTimerCountDown_CheckedChanged(object sender, EventArgs e){
|
||||
notification.ShowNotificationForSettings(true);
|
||||
}
|
||||
|
||||
private void checkLegacyLoad_CheckedChanged(object sender, EventArgs e){
|
||||
if (!Ready)return;
|
||||
|
||||
Config.NotificationLegacyLoad = checkLegacyLoad.Checked;
|
||||
}
|
||||
|
||||
private void comboBoxDisplay_SelectedValueChanged(object sender, EventArgs e){
|
||||
if (!Ready)return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user