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

Merge pull request from chylex/remove_legacy

Remove legacy code (plugins and installers)
This commit is contained in:
Daniel Chýlek 2017-06-05 17:49:19 +02:00 committed by GitHub
commit 172ae87ac6
6 changed files with 6 additions and 49 deletions

View File

@ -45,8 +45,7 @@ public override Type BindToType(string assemblyName, string typeName){
public bool EnableUpdateCheck { get; set; } public bool EnableUpdateCheck { get; set; }
public string DismissedUpdate { get; set; } public string DismissedUpdate { get; set; }
[Obsolete] public PluginConfig Plugins { get; set; } // TODO remove eventually
public WindowState PluginsWindow { get; set; } public WindowState PluginsWindow { get; set; }
public string CustomCefArgs { get; set; } public string CustomCefArgs { get; set; }

View File

@ -5,9 +5,7 @@
using TweetDuck.Plugins.Events; using TweetDuck.Plugins.Events;
namespace TweetDuck.Plugins{ namespace TweetDuck.Plugins{
[Serializable]
sealed class PluginConfig{ sealed class PluginConfig{
[field:NonSerialized]
public event EventHandler<PluginChangedStateEventArgs> InternalPluginChangedState; // should only be accessed from PluginManager public event EventHandler<PluginChangedStateEventArgs> InternalPluginChangedState; // should only be accessed from PluginManager
public IEnumerable<string> DisabledPlugins => Disabled; public IEnumerable<string> DisabledPlugins => Disabled;
@ -18,14 +16,6 @@ sealed class PluginConfig{
"official/reply-account" "official/reply-account"
}; };
public void ImportLegacy(PluginConfig config){
Disabled.Clear();
foreach(string plugin in config.Disabled){
Disabled.Add(plugin);
}
}
public void SetEnabled(Plugin plugin, bool enabled){ public void SetEnabled(Plugin plugin, bool enabled){
if ((enabled && Disabled.Remove(plugin.Identifier)) || (!enabled && Disabled.Add(plugin.Identifier))){ if ((enabled && Disabled.Remove(plugin.Identifier)) || (!enabled && Disabled.Add(plugin.Identifier))){
InternalPluginChangedState?.Invoke(this, new PluginChangedStateEventArgs(plugin, enabled)); InternalPluginChangedState?.Invoke(this, new PluginChangedStateEventArgs(plugin, enabled));

View File

@ -42,29 +42,14 @@ public PluginManager(string rootPath, string configPath){
this.Config = new PluginConfig(); this.Config = new PluginConfig();
this.Bridge = new PluginBridge(this); this.Bridge = new PluginBridge(this);
LoadConfig(); Config.Load(configPath);
Config.InternalPluginChangedState += Config_InternalPluginChangedState; Config.InternalPluginChangedState += Config_InternalPluginChangedState;
Program.UserConfigReplaced += Program_UserConfigReplaced; Program.UserConfigReplaced += Program_UserConfigReplaced;
} }
private void LoadConfig(){
#pragma warning disable 612
if (Program.UserConfig.Plugins != null){
Config.ImportLegacy(Program.UserConfig.Plugins);
Config.Save(configPath);
Program.UserConfig.Plugins = null;
Program.UserConfig.Save();
}
#pragma warning restore 612
else{
Config.Load(configPath);
}
}
private void Program_UserConfigReplaced(object sender, EventArgs e){ private void Program_UserConfigReplaced(object sender, EventArgs e){
LoadConfig(); Config.Load(configPath);
Reload(); Reload();
} }

View File

@ -48,13 +48,10 @@ Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks:
[Run] [Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec skipifsilent Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec skipifsilent
[InstallDelete]
Type: files; Name: "{app}\td-log.txt"
Type: filesandordirs; Name: "{app}\plugins\official\design-revert"
Type: filesandordirs; Name: "{localappdata}\TD_Plugins\official\design-revert"
[UninstallDelete] [UninstallDelete]
Type: files; Name: "{app}\debug.log" Type: files; Name: "{app}\*.*"
Type: filesandordirs; Name: "{app}\locales"
Type: filesandordirs; Name: "{app}\scripts"
Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\Cache" Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\Cache"
Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\GPUCache" Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\GPUCache"

View File

@ -41,10 +41,6 @@ Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesu
[Run] [Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec skipifsilent Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec skipifsilent
[InstallDelete]
Type: filesandordirs; Name: "{app}\plugins\official\design-revert"
Type: filesandordirs; Name: "{app}\portable\storage\TD_Plugins\official\design-revert"
[Code] [Code]
var UpdatePath: String; var UpdatePath: String;

View File

@ -50,16 +50,6 @@ Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUnin
[Run] [Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Parameters: "{code:TDGetRunArgs}"; Flags: nowait postinstall shellexec Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Parameters: "{code:TDGetRunArgs}"; Flags: nowait postinstall shellexec
[InstallDelete]
Type: files; Name: "{app}\*.xml"
Type: files; Name: "{app}\*.js"
Type: files; Name: "{app}\d3dcompiler_43.dll"
Type: files; Name: "{app}\widevinecdmadapter.dll"
Type: files; Name: "{app}\CefSharp.BrowserSubprocess.exe"
Type: files; Name: "{app}\td-log.txt"
Type: files; Name: "{app}\debug.log"
Type: files; Name: "{localappdata}\{#MyAppName}\ChromeDWriteFontCache"
[UninstallDelete] [UninstallDelete]
Type: files; Name: "{app}\*.*" Type: files; Name: "{app}\*.*"
Type: filesandordirs; Name: "{app}\locales" Type: filesandordirs; Name: "{app}\locales"