This commit is contained in:
Greg 2016-09-29 17:38:18 -07:00
commit b9f401624c
6 changed files with 49 additions and 14 deletions

View file

@ -407,22 +407,43 @@ namespace MatterHackers.MatterControl
return MakeValidFileName(AuthenticationData.Instance.ActiveSessionUsername);
}
bool pendingReloadRequest = false;
public void ReloadAll(object sender, EventArgs e)
{
if (!pendingReloadRequest
&& MainView != null)
{
pendingReloadRequest = true;
MainView.AfterDraw += DoReloadAll;
MainView.Invalidate();
}
}
static int reloadCount = 0;
private void DoReloadAll(GuiWidget drawingWidget, DrawEventArgs e)
{
UiThread.RunOnIdle(() =>
{
using (new PerformanceTimer("ReloadAll", "Total"))
if (MainView != null)
{
// give the widget a chance to hear about the close before they are actually closed.
PopOutManager.SaveIfClosed = false;
WidescreenPanel.PreChangePanels.CallEvents(this, null);
MainView?.CloseAllChildren();
using (new PerformanceTimer("ReloadAll", "AddElements"))
using (new QuickTimer($"ReloadAll_{reloadCount++}:"))
{
MainView?.AddElements();
// give the widget a chance to hear about the close before they are actually closed.
PopOutManager.SaveIfClosed = false;
WidescreenPanel.PreChangePanels.CallEvents(this, null);
MainView?.CloseAllChildren();
using (new QuickTimer("ReloadAll_AddElements"))
{
MainView?.AddElements();
}
PopOutManager.SaveIfClosed = true;
DoneReloadingAll?.CallEvents(null, null);
}
PopOutManager.SaveIfClosed = true;
DoneReloadingAll?.CallEvents(null, null);
MainView.AfterDraw -= DoReloadAll;
pendingReloadRequest = false;
}
});
}

View file

@ -34,6 +34,8 @@ using System.Collections.Generic;
using MatterHackers.MatterControl.SettingsManagement;
using System.IO;
using System.Linq;
using MatterHackers.Agg;
using System;
namespace MatterHackers.MatterControl
{
@ -72,6 +74,16 @@ namespace MatterHackers.MatterControl
Invalidate();
}
}
public override void OnDraw(Graphics2D graphics2D)
{
base.OnDraw(graphics2D);
if (Focused)
{
graphics2D.Rectangle(LocalBounds, RGBA_Bytes.Orange);
}
}
}
}

View file

@ -46,7 +46,8 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
HAnchor = HAnchor.ParentLeftRight,
Margin = elementMargin,
Name = "Select Make",
ListSource = OemSettings.Instance.AllOems
ListSource = OemSettings.Instance.AllOems,
TabStop = true
};
printerManufacturerSelector.SelectionChanged += ManufacturerDropList_SelectionChanged;
@ -66,6 +67,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
Name = "Select Model",
HAnchor = HAnchor.ParentLeftRight,
Margin = elementMargin,
TabStop = true
};
printerModelSelector.SelectionChanged += ModelDropList_SelectionChanged;

View file

@ -128,7 +128,7 @@ namespace MatterHackers.MatterControl
buttonContainer.AddChild(printerSelectorAndEditButton);
var printerSelector = new PrinterSelector();
printerSelector.AddPrinter += (s, e) => WizardPage.WizardWindow.ChangeToSetupPrinterForm();
printerSelector.AddPrinter += (s, e) => WizardPage.WizardWindow.ChangeToSetupPrinterForm(true);
printerSelectorAndEditButton.AddChild(printerSelector);
var editButton = TextImageButtonFactory.GetThemedEditButton();

View file

@ -70,8 +70,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
username = "guest";
}
// Append userName to ProfilesPath
string path = Path.Combine(userDataPath, "Profiles", username);
// Append userName to ProfilesPath (directory is Env specific with the addition of EnvironmentName)
string path = Path.Combine(userDataPath, "Profiles", ApplicationController.EnvironmentName + username);
// Ensure directory exists
Directory.CreateDirectory(path);

@ -1 +1 @@
Subproject commit 4f4cfaf5c5cb36de0c9d720b5b2bedf4cac37859
Subproject commit a5dd5f2c490013763dc7fb53358c22a255f2e108