various fixes

This commit is contained in:
Zack Rauen 2019-05-24 23:46:28 -04:00
parent 2303d56d66
commit e8d6b4f247
5 changed files with 26 additions and 7 deletions

View File

@ -81,9 +81,6 @@
<Compile Include="Controls\Button.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\Button.Designer.cs">
<DependentUpon>Button.cs</DependentUpon>
</Compile>
<Compile Include="Controls\FlatCheckBox.cs">
<SubType>Component</SubType>
</Compile>
@ -214,7 +211,6 @@
</ItemGroup>
<ItemGroup>
<Content Include="BBD_small64.ico" />
<Content Include="fork.ico" />
<None Include="Resources\BBDVS.png" />
<None Include="Resources\delete_small.png" />
<None Include="Resources\build_small.png" />

View File

@ -1,9 +1,17 @@
using System.Drawing;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Text;
using System.Windows.Forms;
namespace BandagedBD.Controls {
class FlatCheckBox : CheckBox {
[Description("Background color for the CheckBox"), Category("Flatpak")]
public Color BoxBackColor { get; set; } = Color.FromArgb(60, 60, 60);
[Description("Foreground color for the CheckBox"), Category("Flatpak")]
public Color BoxForeColor { get; set; } = Properties.Settings.Default.Accent;
public FlatCheckBox() {
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
@ -11,10 +19,10 @@ namespace BandagedBD.Controls {
protected override void OnPaint(PaintEventArgs e) {
base.OnPaint(e);
e.Graphics.FillRectangle(new SolidBrush(Properties.Settings.Default.SecondaryBackground), new Rectangle(0, 0, 13, 14));
e.Graphics.FillRectangle(new SolidBrush(BoxBackColor), new Rectangle(0, 0, 13, 14));
if (Checked) {
e.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
e.Graphics.DrawString("\u2714", this.Font, new SolidBrush(Properties.Settings.Default.Accent), -1, 1);
e.Graphics.DrawString("\u2714", this.Font, new SolidBrush(BoxForeColor), -1, 1);
}
}
}

View File

@ -16,6 +16,7 @@ namespace BandagedBD.Panels {
public bool shouldRestart => cbShouldRestart.Checked;
public string[] paths => Utilities.GetLocalPaths(discordLocator.stable, discordLocator.canary, discordLocator.ptb);
public string[] executables => Utilities.GetExecutables(discordLocator.stable, discordLocator.canary, discordLocator.ptb);
public string[] roamings => Utilities.GetRoamingPaths(discordLocator.stable, discordLocator.canary, discordLocator.ptb);
public InstallConfigPanel() {
InitializeComponent();

View File

@ -138,6 +138,19 @@ namespace BandagedBD.Panels {
private int Verify(string installationPath) {
Append("Verifying installation");
Append("Checking for old style injection");
foreach (var roaming in config.roamings) {
var core = $"{roaming}\\modules\\discord_desktop_core\\core";
Append($"Checking for old injection {roaming}", true);
if (!Directory.Exists(core)) continue;
Append($"Deleting old injection {roaming}", true);
try {
Directory.Delete(roaming, true);
}
catch {
Append($"Please delete this folder: {roaming}");
}
}
var appFolder = $"{installationPath}\\resources\\app";
if (!Directory.Exists(appFolder)) {

View File

@ -133,6 +133,7 @@ namespace BandagedBD {
public static string GetLatestVersion(string path) {
if (path == string.Empty) return path;
if (!Directory.Exists(path)) return string.Empty;
var dirs = Directory.GetDirectories(path);
if (dirs.Length <= 0) return string.Empty;
var latest = Path.GetFileName(dirs[0]);