Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PythonInstaller to include new ui #349

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions Tunny/UI/LoadingInstruction.cs
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@ public class LoadingInstruction : GH_AssemblyPriority, IDisposable
private ToolStripMenuItem _tutorialStripMenuItem;
private ToolStripMenuItem _tunnyHelpStripMenuItem;
private ToolStripMenuItem _optunaDashboardToolStripMenuItem;
private ToolStripMenuItem _pythonInstallStripMenuItem;
private ToolStripMenuItem _ttDesignExplorerToolStripMenuItem;
private ToolStripMenuItem _aboutTunnyStripMenuItem;

@@ -83,11 +82,9 @@ private void AddTunnyMenuItems(ToolStripItemCollection dropDownItems)
_tunnyHelpStripMenuItem = new ToolStripMenuItem("Help", null, null, "TunnyHelpStripMenuItem");
_tutorialStripMenuItem = new ToolStripMenuItem("Tutorial Files", null, null, "TutorialStripMenuItem");
_optunaDashboardToolStripMenuItem = new ToolStripMenuItem("Run Optuna Dashboard...", Resource.optuna_dashboard, OptunaDashboardToolStripMenuItem_Click, "OptunaDashboardToolStripMenuItem");
_pythonInstallStripMenuItem = new ToolStripMenuItem("Install Python...", null, PythonInstallStripMenuItem_Click, "PythonInstallStripMenuItem");
_ttDesignExplorerToolStripMenuItem = new ToolStripMenuItem("Run TT DesignExplorer...", Resource.TTDesignExplorer, TTDesignExplorerToolStripMenuItem_Click, "TTDesignExplorerToolStripMenuItem");
_aboutTunnyStripMenuItem = new ToolStripMenuItem("About...", Resource.TunnyIcon, AboutTunnyStripMenuItem_Click, "AboutTunnyStripMenuItem");

SetHelpDropDownItems();
SetTutorialDropDownItems();

dropDownItems.AddRange(new ToolStripItem[] {
@@ -97,8 +94,6 @@ private void AddTunnyMenuItems(ToolStripItemCollection dropDownItems)
_optunaDashboardToolStripMenuItem,
_ttDesignExplorerToolStripMenuItem,
new ToolStripSeparator(),
_pythonInstallStripMenuItem,
new ToolStripSeparator(),
_aboutTunnyStripMenuItem
});
}
@@ -132,15 +127,6 @@ private static void SetMenuItemsFromFilePath(ToolStripMenuItem menuItem, string[
}
}

private void SetHelpDropDownItems()
{
TLog.MethodStart();
_tunnyHelpStripMenuItem.DropDownItems.AddRange(new[]{
new ToolStripMenuItem("Tunny Document", null, TunnyDocumentPageStripMenuItem_Click, "TunnyDocumentStripMenuItem"),
new ToolStripMenuItem("Optuna Sampler Document", null, OptunaSamplerPageStripMenuItem_Click, "OptunaTutorialStripMenuItem")
});
}

private void AboutTunnyStripMenuItem_Click(object sender, EventArgs e)
{
TLog.MethodStart();
@@ -152,37 +138,6 @@ private void AboutTunnyStripMenuItem_Click(object sender, EventArgs e)
MessageBoxImage.Information);
}

private void PythonInstallStripMenuItem_Click(object sender, EventArgs e)
{
TLog.MethodStart();
TLog.Debug("PythonInstallStripMenuItem Clicked");
if (Directory.Exists(TEnvVariables.PythonPath))
{
MessageBoxResult result = WPF.Common.TunnyMessageBox.Info_PythonAlreadyInstalled();
if (result == MessageBoxResult.Cancel)
{
TLog.Info("From menu item Python installation canceled by user.");
return;
}
}
TLog.Info("From menu item Python installation started.");
var pythonInstallDialog = new PythonInstallDialog();
pythonInstallDialog.ShowDialog();
TSettings.TryLoadFromJson(out TSettings settings);
settings.CheckPythonLibraries = false;
settings.Serialize(TEnvVariables.OptimizeSettingsPath);
}

private void TunnyDocumentPageStripMenuItem_Click(object sender, EventArgs e)
{
//OpenBrowser.TunnyDocumentPage();
}

private void OptunaSamplerPageStripMenuItem_Click(object sender, EventArgs e)
{
//OpenBrowser.OptunaSamplerPage();
}

private void OptunaDashboardToolStripMenuItem_Click(object sender, EventArgs e)
{
TLog.MethodStart();
@@ -258,7 +213,6 @@ public void Dispose()
_tunnyHelpStripMenuItem.Dispose();
_tutorialStripMenuItem.Dispose();
_optunaDashboardToolStripMenuItem.Dispose();
_pythonInstallStripMenuItem.Dispose();
_ttDesignExplorerToolStripMenuItem.Dispose();
_aboutTunnyStripMenuItem.Dispose();
GC.SuppressFinalize(this);
23 changes: 0 additions & 23 deletions Tunny/UI/OptimizationWindow.cs
Original file line number Diff line number Diff line change
@@ -34,7 +34,6 @@ public OptimizationWindow(OptimizeComponentBase component)
}
TSettings.TryLoadFromJson(out _settings);
SetUIValues();
RunPythonInstaller();
SetupTTDesignExplorer();
SetOptimizeBackgroundWorker();
SetOutputResultBackgroundWorker();
@@ -46,28 +45,6 @@ private static void SetupTTDesignExplorer()
DesignExplorer.SetupTTDesignExplorer();
}

private void RunPythonInstaller()
{
TLog.MethodStart();
string tunnyAssembleVersion = TEnvVariables.Version.ToString();
if (_settings.CheckPythonLibraries || _settings.Version != tunnyAssembleVersion)
{
TLog.Info("Run Python installer");
var installer = new PythonInstallDialog()
{
StartPosition = FormStartPosition.CenterScreen
};
installer.Show(Owner);
_settings.Version = tunnyAssembleVersion;
_settings.CheckPythonLibraries = false;
checkPythonLibrariesCheckBox.Checked = false;
}
else
{
TLog.Info("Skip Python installer");
}
}

private void SetOptimizeBackgroundWorker()
{
TLog.MethodStart();
105 changes: 0 additions & 105 deletions Tunny/UI/PythonInstallDialog.Designer.cs

This file was deleted.

55 changes: 0 additions & 55 deletions Tunny/UI/PythonInstallDialog.cs

This file was deleted.

Loading
Loading