1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-23 02:34:08 +02:00

Move ITweetDeckBrowser and refactor some things

This commit is contained in:
chylex 2018-03-16 18:48:41 +01:00
parent 063d3a2637
commit 5add8a1d0e
9 changed files with 14 additions and 12 deletions

View File

@ -38,8 +38,7 @@ public bool IsWaiting{
} }
public string UpdateInstallerPath { get; private set; } public string UpdateInstallerPath { get; private set; }
public PluginManager PluginManager => plugins;
public AnalyticsFile AnalyticsFile => analytics?.File ?? AnalyticsFile.Dummy; public AnalyticsFile AnalyticsFile => analytics?.File ?? AnalyticsFile.Dummy;
private readonly TweetDeckBrowser browser; private readonly TweetDeckBrowser browser;

View File

@ -5,6 +5,7 @@
using TweetDuck.Core.Bridge; using TweetDuck.Core.Bridge;
using TweetDuck.Core.Controls; using TweetDuck.Core.Controls;
using TweetDuck.Core.Handling; using TweetDuck.Core.Handling;
using TweetDuck.Core.Other.Interfaces;
using TweetDuck.Core.Utils; using TweetDuck.Core.Utils;
using TweetDuck.Data; using TweetDuck.Data;
using TweetDuck.Plugins; using TweetDuck.Plugins;

View File

@ -36,7 +36,7 @@ public FormSettings(FormBrowser browser, PluginManager plugins, UpdateHandler up
this.buttonHeight = BrowserUtils.Scale(39, this.GetDPIScale()) | 1; this.buttonHeight = BrowserUtils.Scale(39, this.GetDPIScale()) | 1;
AddButton("General", () => new TabSettingsGeneral(this.browser, updates)); AddButton("General", () => new TabSettingsGeneral(this.browser.ReloadColumns, updates));
AddButton("Locales", () => new TabSettingsLocales()); AddButton("Locales", () => new TabSettingsLocales());
AddButton("System Tray", () => new TabSettingsTray()); AddButton("System Tray", () => new TabSettingsTray());
AddButton("Notifications", () => new TabSettingsNotifications(new FormNotificationExample(this.browser, this.plugins))); AddButton("Notifications", () => new TabSettingsNotifications(new FormNotificationExample(this.browser, this.plugins)));

View File

@ -1,7 +1,7 @@
using System; using System;
using CefSharp; using CefSharp;
namespace TweetDuck.Core{ namespace TweetDuck.Core.Other.Interfaces{
interface ITweetDeckBrowser{ interface ITweetDeckBrowser{
bool IsTweetDeckWebsite { get; } bool IsTweetDeckWebsite { get; }

View File

@ -9,18 +9,19 @@
namespace TweetDuck.Core.Other.Settings{ namespace TweetDuck.Core.Other.Settings{
sealed partial class TabSettingsGeneral : BaseTabSettings{ sealed partial class TabSettingsGeneral : BaseTabSettings{
private readonly FormBrowser browser; private readonly Action reloadColumns;
private readonly UpdateHandler updates; private readonly UpdateHandler updates;
private int updateCheckEventId = -1; private int updateCheckEventId = -1;
private readonly int browserListIndexDefault; private readonly int browserListIndexDefault;
private readonly int browserListIndexCustom; private readonly int browserListIndexCustom;
public TabSettingsGeneral(FormBrowser browser, UpdateHandler updates){ public TabSettingsGeneral(Action reloadColumns, UpdateHandler updates){
InitializeComponent(); InitializeComponent();
this.browser = browser; this.reloadColumns = reloadColumns;
this.updates = updates; this.updates = updates;
this.updates.CheckFinished += updates_CheckFinished; this.updates.CheckFinished += updates_CheckFinished;
Disposed += (sender, args) => this.updates.CheckFinished -= updates_CheckFinished; Disposed += (sender, args) => this.updates.CheckFinished -= updates_CheckFinished;
@ -98,7 +99,7 @@ private void checkBestImageQuality_CheckedChanged(object sender, EventArgs e){
private void checkAnimatedAvatars_CheckedChanged(object sender, EventArgs e){ private void checkAnimatedAvatars_CheckedChanged(object sender, EventArgs e){
Config.EnableAnimatedImages = checkAnimatedAvatars.Checked; Config.EnableAnimatedImages = checkAnimatedAvatars.Checked;
BrowserProcessHandler.UpdatePrefs().ContinueWith(task => browser.ReloadColumns()); BrowserProcessHandler.UpdatePrefs().ContinueWith(task => reloadColumns());
} }
private void checkSmoothScrolling_CheckedChanged(object sender, EventArgs e){ private void checkSmoothScrolling_CheckedChanged(object sender, EventArgs e){

View File

@ -8,6 +8,7 @@
using TweetDuck.Core.Handling; using TweetDuck.Core.Handling;
using TweetDuck.Core.Handling.General; using TweetDuck.Core.Handling.General;
using TweetDuck.Core.Notification; using TweetDuck.Core.Notification;
using TweetDuck.Core.Other.Interfaces;
using TweetDuck.Core.Utils; using TweetDuck.Core.Utils;
using TweetDuck.Resources; using TweetDuck.Resources;

View File

@ -4,7 +4,7 @@
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using TweetDuck.Core; using TweetDuck.Core.Other.Interfaces;
using TweetDuck.Data; using TweetDuck.Data;
using TweetDuck.Plugins.Enums; using TweetDuck.Plugins.Enums;
using TweetDuck.Plugins.Events; using TweetDuck.Plugins.Events;

View File

@ -107,7 +107,7 @@
<Compile Include="Core\Handling\RequestHandlerBase.cs" /> <Compile Include="Core\Handling\RequestHandlerBase.cs" />
<Compile Include="Core\Handling\RequestHandlerBrowser.cs" /> <Compile Include="Core\Handling\RequestHandlerBrowser.cs" />
<Compile Include="Core\Handling\ResourceHandlerNotification.cs" /> <Compile Include="Core\Handling\ResourceHandlerNotification.cs" />
<Compile Include="Core\ITweetDeckBrowser.cs" /> <Compile Include="Core\Other\Interfaces\ITweetDeckBrowser.cs" />
<Compile Include="Core\Management\ContextInfo.cs" /> <Compile Include="Core\Management\ContextInfo.cs" />
<Compile Include="Core\Notification\Example\FormNotificationExample.cs"> <Compile Include="Core\Notification\Example\FormNotificationExample.cs">
<SubType>Form</SubType> <SubType>Form</SubType>

View File

@ -1,8 +1,8 @@
using CefSharp; using CefSharp;
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core;
using TweetDuck.Core.Controls; using TweetDuck.Core.Controls;
using TweetDuck.Core.Other.Interfaces;
using TweetDuck.Core.Utils; using TweetDuck.Core.Utils;
using TweetDuck.Resources; using TweetDuck.Resources;