Add files via upload

This commit is contained in:
Belim 2020-09-19 17:30:33 +02:00 committed by GitHub
parent 001e0fecf2
commit 3c1976330a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 50 additions and 69 deletions

View file

@ -17,27 +17,6 @@ namespace Privatezilla
{
public partial class MainWindow : Form
{
private readonly string _successApply = Properties.Resources.statusSuccessApply;
private readonly string _failedApply = Properties.Resources.statusFailedApply;
private readonly string _successConfigure = Properties.Resources.statusSuccessConfigure;
private readonly string _failedConfigure = Properties.Resources.statusFailedConfigure;
private readonly string _finishApply = Properties.Resources.statusFinishApply;
private readonly string _finishUndo = Properties.Resources.statusFinishUndo;
private readonly string _finishAnalyze = Properties.Resources.statusFinishAnalyze;
private readonly string _doWait = Properties.Resources.statusDoWait;
private readonly string _undoSettings = Properties.Resources.statusUndoSettings;
private readonly string _helpApp = Properties.Resources.helpApp.Replace("\\r\\n", "\r\n");
// Script strings (optional)
private readonly string _psSelect = Properties.Resources.msgPSSelect;
private readonly string _psInfo = Properties.Resources.PSInfo.Replace("\\r\\n", "\r\n");
private readonly string _psSuccess = Properties.Resources.msgPSSuccess;
private readonly string _psSave = Properties.Resources.msgPSSave;
private readonly string _infoApp = "Privatezilla" + "\nVersion " + Program.GetCurrentVersionTostring() + " (Phoenix)\r\n" +
Properties.Resources.infoApp.Replace("\\t", "\t");
// Setting progress
private int _progress = 0;
@ -47,9 +26,6 @@ namespace Privatezilla
// Update
private readonly string _releaseURL = "https://raw.githubusercontent.com/builtbybel/privatezilla/master/latest.txt";
private readonly string _releaseUpToDate = Properties.Resources.releaseUpToDate;
private readonly string _releaseUnofficial = Properties.Resources.releaseUnofficial;
public Version CurrentVersion = new Version(Application.ProductVersion);
public Version LatestVersion;
@ -79,11 +55,11 @@ namespace Privatezilla
if (equals == 0)
{
MessageBox.Show(_releaseUpToDate, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); // Up-to-date
MessageBox.Show(Properties.Resources.releaseUpToDate, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); // Up-to-date
}
else if (equals < 0)
{
MessageBox.Show(_releaseUnofficial, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); // Unofficial
MessageBox.Show(Properties.Resources.releaseUnofficial, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); // Unofficial
}
else // New release available!
{
@ -119,6 +95,7 @@ namespace Privatezilla
public MainWindow()
{
InitializeComponent();
// Initilize settings
@ -132,6 +109,8 @@ namespace Privatezilla
// GUI localization
Globalization();
}
public void InitializeSettings()
@ -357,7 +336,7 @@ namespace Privatezilla
private async void BtnSettingsAnalyze_Click(object sender, EventArgs e)
{
Reset();
LblStatus.Text = _doWait;
LblStatus.Text = Properties.Resources.statusDoWait;
BtnSettingsAnalyze.Enabled = false;
LvwStatus.BeginUpdate();
@ -374,12 +353,12 @@ namespace Privatezilla
if (shouldPerform)
{
state.SubItems.Add(_failedConfigure);
state.SubItems.Add(Properties.Resources.statusFailedConfigure);
state.BackColor = Color.LavenderBlush;
}
else
{
state.SubItems.Add(_successConfigure);
state.SubItems.Add(Properties.Resources.statusSuccessConfigure);
state.BackColor = Color.Honeydew;
}
@ -391,7 +370,7 @@ namespace Privatezilla
DoProgress(100);
// Summary
LblStatus.Text = _finishAnalyze;
LblStatus.Text = Properties.Resources.statusFinishAnalyze;
BtnSettingsAnalyze.Enabled = true;
LvwStatus.EndUpdate();
@ -410,7 +389,7 @@ namespace Privatezilla
foreach (SettingNode node in treeNodes)
{
// Add status info
LblStatus.Text = _doWait + " (" + node.Text + ")";
LblStatus.Text = Properties.Resources.statusDoWait + " (" + node.Text + ")";
var setting = node.Setting;
ConfiguredTaskAwaitable<bool> performTask = Task<bool>.Factory.StartNew(() => setting.DoSetting()).ConfigureAwait(true);
@ -420,12 +399,12 @@ namespace Privatezilla
var listItem = new ListViewItem(setting.ID());
if (result)
{
listItem.SubItems.Add(_successApply);
listItem.SubItems.Add(Properties.Resources.statusSuccessApply);
listItem.BackColor = Color.Honeydew;
}
else
{
listItem.SubItems.Add(_failedApply);
listItem.SubItems.Add(Properties.Resources.statusFailedApply);
listItem.BackColor = Color.LavenderBlush;
}
@ -435,7 +414,7 @@ namespace Privatezilla
DoProgress(100);
LblStatus.Text = _finishApply;
LblStatus.Text = Properties.Resources.statusFinishApply;
BtnSettingsDo.Enabled = true;
LvwStatus.EndUpdate();
@ -447,7 +426,7 @@ namespace Privatezilla
/// </summary>
private async void UndoSettings(List<SettingNode> treeNodes)
{
LblStatus.Text = _doWait;
LblStatus.Text = Properties.Resources.statusDoWait;
BtnSettingsUndo.Enabled = false;
LvwStatus.BeginUpdate();
@ -461,12 +440,12 @@ namespace Privatezilla
var listItem = new ListViewItem(setting.ID());
if (result)
{
listItem.SubItems.Add(_successApply);
listItem.SubItems.Add(Properties.Resources.statusSuccessApply);
listItem.BackColor = Color.Honeydew;
}
else
{
listItem.SubItems.Add(_failedApply);
listItem.SubItems.Add(Properties.Resources.statusFailedApply);
listItem.BackColor = Color.LavenderBlush;
}
@ -476,7 +455,7 @@ namespace Privatezilla
DoProgress(100);
LblStatus.Text = _finishUndo;
LblStatus.Text = Properties.Resources.statusFinishUndo;
BtnSettingsUndo.Enabled = true;
LvwStatus.EndUpdate();
@ -493,7 +472,7 @@ namespace Privatezilla
private void BtnSettingsUndo_Click(object sender, EventArgs e)
{
if (MessageBox.Show(_undoSettings, this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
if (MessageBox.Show(Properties.Resources.statusUndoSettings, this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
{
Reset();
@ -504,7 +483,8 @@ namespace Privatezilla
private void Info_Click(object sender, EventArgs e)
{
MessageBox.Show(_infoApp, "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("Privatezilla" + "\nVersion " + Program.GetCurrentVersionTostring() + " (Phoenix)\r\n" +
Properties.Resources.infoApp.Replace("\\t", "\t"), "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void LblMainMenu_Click(object sender, EventArgs e)
@ -514,7 +494,7 @@ namespace Privatezilla
private void Help_Click(object sender, EventArgs e)
{
MessageBox.Show(_helpApp, Help.Text, MessageBoxButtons.OK, MessageBoxIcon.Question);
MessageBox.Show(Properties.Resources.helpApp.Replace("\\r\\n", "\r\n"), Help.Text, MessageBoxButtons.OK, MessageBoxIcon.Question);
}
/// <summary>
@ -596,7 +576,7 @@ namespace Privatezilla
TxtConsolePS.Text = content.ToString();
// View Info
TxtPSInfo.Text = _psInfo + string.Join(Environment.NewLine, System.IO.File.ReadAllLines(psdir).Where(s => s.StartsWith("###")).Select(s => s.Substring(3).Replace("###", "\r\n\n")));
TxtPSInfo.Text = Properties.Resources.PSInfo.Replace("\\r\\n", "\r\n") + string.Join(Environment.NewLine, System.IO.File.ReadAllLines(psdir).Where(s => s.StartsWith("###")).Select(s => s.Substring(3).Replace("###", "\r\n\n")));
}
}
catch { }
@ -609,7 +589,7 @@ namespace Privatezilla
{
if (LstPS.CheckedItems.Count == 0)
{
MessageBox.Show(_psSelect, BtnDoPS.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show(Properties.Resources.msgPSSelect, BtnDoPS.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
for (int i = 0; i < LstPS.Items.Count; i++)
@ -637,7 +617,7 @@ namespace Privatezilla
}
// Done!
MessageBox.Show("Script " + "\"" + LstPS.Text + "\" " + _psSuccess, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("Script " + "\"" + LstPS.Text + "\" " + Properties.Resources.msgPSSuccess, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
@ -702,7 +682,7 @@ namespace Privatezilla
{
if (ChkCodePS.Checked == false)
{
MessageBox.Show(_psSave, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show(Properties.Resources.msgPSSave, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{

View file

@ -162,6 +162,7 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="Properties\Resources.zh-CN.resx" />
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>

View file

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.40.0")]
[assembly: AssemblyFileVersion("0.40.0")]
[assembly: AssemblyVersion("0.40.1")]
[assembly: AssemblyFileVersion("0.40.1")]

View file

@ -1471,7 +1471,7 @@ namespace Privatezilla.Properties {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Do you really want to revert all selected settings to Windows 10 default state?&quot; ähnelt.
/// Sucht eine lokalisierte Zeichenfolge, die Do you really want to revert all selected settings to Windows 10 default state? ähnelt.
/// </summary>
internal static string statusUndoSettings {
get {

View file

@ -718,7 +718,7 @@ You can also follow me on
<value>Configured</value>
</data>
<data name="statusUndoSettings" xml:space="preserve">
<value>Do you really want to revert all selected settings to Windows 10 default state?"</value>
<value>Do you really want to revert all selected settings to Windows 10 default state?</value>
</data>
<data name="TxtPSInfo" xml:space="preserve">
<value>Welcome to the Modern Policy Editor, which allows you to apply group policies and custom settings in the form of PowerShell scripts and templates (bundled scripts).

View file

@ -59,7 +59,7 @@
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
@ -591,9 +591,6 @@
<data name="statusDoPSProcessing" xml:space="preserve">
<value>处理中</value>
</data>
<data name="statusDoSettings" xml:space="preserve">
<value>您真的想要将所有选定的设置还原到 Windows 10 默认状态吗?</value>
</data>
<data name="statusDoWait" xml:space="preserve">
<value>请稍候...</value>
</data>
@ -618,6 +615,9 @@
<data name="statusSuccessConfigure" xml:space="preserve">
<value>已配置</value>
</data>
<data name="statusUndoSettings" xml:space="preserve">
<value>您真的想要将所有选定的设置还原到 Windows 10 默认状态吗?</value>
</data>
<data name="TxtPSInfo" xml:space="preserve">
<value>欢迎使用现代政策编辑器,它将允许您以 PowerShell 脚本和模板(捆绑脚本)的形式应用组策略和自定义设置