1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-02-25 08:46:03 +01:00

Minor refactoring and code fixes

This commit is contained in:
chylex 2022-02-13 19:54:34 +01:00
parent 09fac63ffc
commit 45a3a7499f
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
9 changed files with 12 additions and 18 deletions
lib/TweetLib.Core
windows/TweetDuck

View File

@ -1,8 +1,6 @@
using TweetLib.Core.Systems.Dialogs;
namespace TweetLib.Core.Application {
public interface IAppMessageDialogs {
void Information(string caption, string text, string buttonAccept = Dialogs.OK);
void Error(string caption, string text, string buttonAccept = Dialogs.OK);
void Information(string caption, string text);
void Error(string caption, string text);
}
}

View File

@ -4,7 +4,7 @@
namespace TweetLib.Core.Features {
public interface ICommonInterface {
void Alert(string type, string contents);
void DisplayTooltip(string text);
void DisplayTooltip(string? text);
void FixClipboard();
int GetIdleSeconds();
void OnSoundNotification();

View File

@ -3,7 +3,7 @@ public interface INotificationInterface {
bool FreezeTimer { get; set; }
bool IsHovered { get; }
void DisplayTooltip(string text);
void DisplayTooltip(string? text);
void FinishCurrentNotification();
void ShowTweetDetail();
}

View File

@ -9,7 +9,7 @@ public NotificationBridgeObject(INotificationInterface notificationInterface, IC
this.i = notificationInterface;
}
public void DisplayTooltip(string text) {
public void DisplayTooltip(string? text) {
i.DisplayTooltip(text);
}

View File

@ -38,7 +38,7 @@ public void LoadNotificationLayout(string fontSize, string headLayout) {
NotificationBrowser.SetNotificationLayout(fontSize, headLayout);
}
public void DisplayTooltip(string text) {
public void DisplayTooltip(string? text) {
i.DisplayTooltip(text);
}

View File

@ -1,5 +0,0 @@
namespace TweetLib.Core.Systems.Dialogs {
internal static class Dialogs {
public const string OK = "OK";
}
}

View File

@ -4,12 +4,12 @@
namespace TweetDuck.Application {
sealed class MessageDialogs : IAppMessageDialogs {
public void Information(string caption, string text, string buttonAccept) {
FormManager.RunOnUIThreadAsync(() => FormMessage.Information(caption, text, buttonAccept));
public void Information(string caption, string text) {
FormManager.RunOnUIThreadAsync(() => FormMessage.Information(caption, text, FormMessage.OK));
}
public void Error(string caption, string text, string buttonAccept) {
FormManager.RunOnUIThreadAsync(() => FormMessage.Error(caption, text, buttonAccept));
public void Error(string caption, string text) {
FormManager.RunOnUIThreadAsync(() => FormMessage.Error(caption, text, FormMessage.OK));
}
}
}

View File

@ -79,6 +79,7 @@ bool IJsDialogHandler.OnJSDialog(IWebBrowser browserControl, IBrowser browser, s
input.Dispose();
}
callback.Dispose();
form.Dispose();
});

View File

@ -8,7 +8,7 @@
namespace TweetDuck.Management {
static class BrowserCache {
public static string CacheFolder => CefUtils.GetCacheFolder(App.StoragePath);
private static string CacheFolder => CefUtils.GetCacheFolder(App.StoragePath);
private static bool clearOnExit;
private static Timer autoClearTimer;