Implemented run as admin and randomize window title option - #146
Merged
Merged
Conversation
KN4CK3R
reviewed
Feb 15, 2020
| InitializeComponent(); | ||
|
|
||
| Text = $"{Constants.ApplicationName} ({Constants.Platform})"; | ||
| string randomWindowTitle = Utils.RandomString(Program.GlobalRandom.Next(15, 20)); |
Member
There was a problem hiding this comment.
Could you replace the three changes with a single (inline) method? Possible implementation:
void SetWindowTitle(string extra = null)
{
var title = $"{(Program.Settings.RandomizeWindowTitle ? Utils.RandomString(Program.GlobalRandom.Next(15, 20)) : Constants.ApplicationName)} ({Constants.Platform})";
if (!string.IsNullOrEmpty(extra))
{
title += $" - {extra}";
}
Text = title;
}
KN4CK3R
reviewed
Feb 15, 2020
|
|
||
| if (runAsAdminCheckBox.Checked && !WinUtil.IsAdministrator) | ||
| { | ||
| var msgboxResult = MessageBox.Show("Would you like to restart ReClass.NET as administrator now?", "ReClass.NET", MessageBoxButtons.YesNo, MessageBoxIcon.Information); |
Member
There was a problem hiding this comment.
Maybe just notify the user that he has to restart ReClass to apply the change. This would remove the logic code from the settings form.
KN4CK3R
reviewed
Feb 15, 2020
| Settings = SettingsSerializer.Load(); | ||
| Logger = new GuiLogger(); | ||
|
|
||
| if(Settings.RunAsAdmin && !WinUtil.IsAdministrator) |
Member
There was a problem hiding this comment.
Please add NativeMethods.IsUnix(). Otherwise this will fail on unix systems.
KN4CK3R
reviewed
Feb 15, 2020
| SetBinding(functionPtrTypeTextBox, nameof(TextBox.Text), typeMapping, nameof(CppTypeMapping.TypeFunctionPtr)); | ||
| } | ||
|
|
||
| private void runAsAdminCheckBox_CheckedChanged(object sender, EventArgs e) |
Member
There was a problem hiding this comment.
Maybe the checkboxes should be disabled if NativeMethods.IsUnix().
Member
|
Thank you for the changes! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
only thing im not sure about is using MainForm.Close for leaving the checkbox event