mirror of
https://github.com/Ylianst/MeshCentralRouter
synced 2025-12-06 00:13:33 +00:00
Added customization support.
This commit is contained in:
@@ -1,11 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.IO;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace MeshCentralRouter
|
namespace MeshCentralRouter
|
||||||
@@ -15,6 +10,14 @@ namespace MeshCentralRouter
|
|||||||
public InstallForm()
|
public InstallForm()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// Load customizations
|
||||||
|
try { pictureBox1.Image = (Bitmap)Image.FromFile(@"customization\install.png"); } catch (Exception) { }
|
||||||
|
try {
|
||||||
|
string[] lines = File.ReadAllLines(@"customization\customize.txt");
|
||||||
|
if (lines[2] != "") { groupBox1.Text = lines[2]; }
|
||||||
|
if (lines[3] != "") { label1.Text = lines[3]; }
|
||||||
|
} catch (Exception) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void okButton_Click(object sender, EventArgs e)
|
private void okButton_Click(object sender, EventArgs e)
|
||||||
|
|||||||
14
MainForm.cs
14
MainForm.cs
@@ -251,6 +251,20 @@ namespace MeshCentralRouter
|
|||||||
// Right click action
|
// Right click action
|
||||||
deviceDoubleClickAction = int.Parse(Settings.GetRegValue("DevDoubleClickClickAction", "0"));
|
deviceDoubleClickAction = int.Parse(Settings.GetRegValue("DevDoubleClickClickAction", "0"));
|
||||||
setDoubleClickDeviceAction();
|
setDoubleClickDeviceAction();
|
||||||
|
|
||||||
|
// Load customizations
|
||||||
|
bool showLicense = true;
|
||||||
|
try { pictureBox1.Image = (Bitmap)Image.FromFile(@"customization\topbanner.png"); showLicense = false; } catch (Exception) { }
|
||||||
|
try { pictureBox2.Image = pictureBox6.Image = (Bitmap)Image.FromFile(@"customization\logo.png"); showLicense = false; } catch (Exception) { }
|
||||||
|
try { pictureBox3.Image = pictureBox4.Image = pictureBox5.Image = pictureBox7.Image = (Bitmap)Image.FromFile(@"customization\bottombanner.png"); showLicense = false; } catch (Exception) { }
|
||||||
|
licenseLinkLabel.Visible = showLicense;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string[] lines = File.ReadAllLines(@"customization\customize.txt");
|
||||||
|
if (lines[0] != "") { this.Text = lines[0]; }
|
||||||
|
if (lines[1] != "") { label1.Text = lines[1]; }
|
||||||
|
}
|
||||||
|
catch (Exception) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDoubleClickDeviceAction()
|
private void setDoubleClickDeviceAction()
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ namespace MeshCentralRouter
|
|||||||
public MappingHelpForm()
|
public MappingHelpForm()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// Load customizations
|
||||||
|
try { helpPictureBox.Image = (Bitmap)Image.FromFile(@"customization\help.png"); } catch (Exception) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
MeshCentralRouterCustomization.zip
Normal file
BIN
MeshCentralRouterCustomization.zip
Normal file
Binary file not shown.
@@ -26,6 +26,14 @@ namespace MeshCentralRouter
|
|||||||
this.size = size;
|
this.size = size;
|
||||||
this.args = args;
|
this.args = args;
|
||||||
this.serverTlsCertHash = serverhash;
|
this.serverTlsCertHash = serverhash;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string[] lines = File.ReadAllLines(@"customization\customize.txt");
|
||||||
|
if (lines[4] != "") { this.Text = lines[4]; }
|
||||||
|
if (lines[5] != "") { mainLabel.Text = lines[5]; }
|
||||||
|
}
|
||||||
|
catch (Exception) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void okButton_Click(object sender, EventArgs e)
|
private void okButton_Click(object sender, EventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user