Skip to content

Commit

Permalink
startMaximized config option
Browse files Browse the repository at this point in the history
  • Loading branch information
n00mkrad committed Sep 7, 2021
1 parent 5fd75a0 commit 1cf361e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 13 deletions.
24 changes: 24 additions & 0 deletions Code/Forms/SettingsForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Code/Forms/SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ void LoadSettings()
ConfigParser.LoadGuiElement(reloadImageBeforeUpscale);
ConfigParser.LoadComboxIndex(comparisonUseScaling);
ConfigParser.LoadGuiElement(modelSelectAutoExpand);
ConfigParser.LoadGuiElement(startMaximized);

// ESRGAN Pytorch
ConfigParser.LoadComboxIndex(esrganPytorchPythonRuntime);
Expand Down Expand Up @@ -115,6 +116,7 @@ void SaveSettings()
ConfigParser.SaveGuiElement(reloadImageBeforeUpscale);
ConfigParser.SaveComboxIndex(comparisonUseScaling);
ConfigParser.SaveGuiElement(modelSelectAutoExpand);
ConfigParser.SaveGuiElement(startMaximized);

// ESRGAN Pytorch
ConfigParser.SaveComboxIndex(esrganPytorchPythonRuntime);
Expand Down
17 changes: 6 additions & 11 deletions Code/IO/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,25 +233,20 @@ static void WriteIfDoesntExist(string key, string val)
public enum Type { String, Int, Float, Bool }
private static string WriteDefaultValIfExists(string key, Type type)
{
// General
if (key == "modelPath") return WriteDefault(key, Paths.defaultModelPath);
if (key == "tilesize") return WriteDefault(key, "1024");
if (key == "alpha") return WriteDefault(key, "False");
if (key == "alphaMode") return WriteDefault(key, "1");
if (key == "alphaDepth") return WriteDefault(key, "0");
if (key == "alphaBgColor") return WriteDefault(key, "000000FF");
if (key == "jpegExtension") return WriteDefault(key, "jpg");
if (key == "alphaMode") return WriteDefault(key, "1");
if (key == "modelSelectAutoExpand") return WriteDefault(key, "True");
if (key == "startMaximized") return WriteDefault(key, "True");
// Image Format Settings
if (key == "jpegQ") return WriteDefault(key, "95");
if (key == "useMozJpeg") return WriteDefault(key, "True");
if (key == "webpQ") return WriteDefault(key, "95");
if (key == "dxtMode") return WriteDefault(key, "BC1 (DXT1)");
if (key == "ddsEnableMips") return WriteDefault(key, "True");
if (key == "gpuId") return WriteDefault(key, "0");
if (key == "reloadImageBeforeUpscale") return WriteDefault(key, "False");
if (key == "cmdDebug") return WriteDefault(key, "False");
if (key == "flipTga") return WriteDefault(key, "True");
if (key == "logIo") return WriteDefault(key, "False");
if (key == "logStatus") return WriteDefault(key, "False");
if (key == "useMozJpeg") return WriteDefault(key, "True");
if (key == "modelSelectAutoExpand") return WriteDefault(key, "True");
// ESRGAN Pytorch
if (key == "esrganPytorchAlphaMode") return WriteDefault(key, "1");
if (key == "esrganPytorchFp16") return WriteDefault(key, "True");
Expand Down
4 changes: 2 additions & 2 deletions Code/Main/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public MainForm()
VideoUpscaleUI.Init(videoOutDir, videoLogBox, videoPathLabel, videoOutputFormat);
Program.mainForm = this;


WindowState = FormWindowState.Maximized;
if(Config.GetBool("startMaximized"))
WindowState = FormWindowState.Maximized;
}

private async void MainForm_Load(object sender, EventArgs e)
Expand Down

0 comments on commit 1cf361e

Please sign in to comment.