UI related updates. Work on formatting of print history and print library items. Made slice settings import work asynchronously.

This commit is contained in:
Kevin Pope 2014-10-09 12:23:31 -07:00
parent de16a4d30f
commit 3f0850a752
12 changed files with 94 additions and 60 deletions

View file

@ -30,7 +30,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<ReleaseVersion>0.8.2</ReleaseVersion>
<ReleaseVersion>1.1.4</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@ -115,6 +115,8 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|x86'">
<DebugSymbols>true</DebugSymbols>
@ -127,6 +129,8 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
@ -138,6 +142,8 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
@ -148,6 +154,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64|x64'">
<OutputPath>bin\x64\Release64\</OutputPath>
@ -163,6 +170,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|x64'">
<DebugSymbols>true</DebugSymbols>
@ -174,6 +182,8 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

View file

@ -91,11 +91,15 @@ namespace MatterHackers.MatterControl
}
}
public bool GetChildClicks = false;
override public void OnMouseUp(MouseEventArgs mouseEvent)
{
if (PositionWithinLocalBounds(mouseEvent.X, mouseEvent.Y) && this.MouseCaptured == true)
if (PositionWithinLocalBounds(mouseEvent.X, mouseEvent.Y))
{
ClickButton(mouseEvent);
if (GetChildClicks || this.MouseCaptured == true)
{
ClickButton(mouseEvent);
}
}
base.OnMouseUp(mouseEvent);

View file

@ -13,7 +13,7 @@ namespace MatterHackers.MatterControl
Stopwatch timeHasBeenChanging = new Stopwatch();
public SlideWidget()
:base(0,0)
:base(0.0,0.0)
{
}

View file

@ -38,6 +38,7 @@
<BootstrapperEnabled>true</BootstrapperEnabled>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ReleaseVersion>1.1.4</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@ -351,10 +352,6 @@
<Project>{D3ABF72C-64C2-4E51-A119-E077210FA990}</Project>
<Name>SerialPortCommunication</Name>
</ProjectReference>
<ProjectReference Include="..\agg-sharp\WindowsFileDialogs\WindowsFileDialogs.csproj">
<Project>{A526DC5D-65F3-461B-805F-D3AC9665F5C9}</Project>
<Name>WindowsFileDialogs</Name>
</ProjectReference>
<ProjectReference Include="..\MatterSlice\MatterSlice.csproj">
<Project>{C46CA728-DD2F-4DD1-971A-AAA89D9DFF95}</Project>
<Name>MatterSlice</Name>
@ -371,10 +368,6 @@
<Project>{F1653F20-D47D-4F29-8C55-3C835542AF5F}</Project>
<Name>Community.CsharpSqlite</Name>
</ProjectReference>
<ProjectReference Include="Launcher\Launcher.csproj">
<Project>{3DF4CB3D-9A03-4256-9A81-70523AAD828B}</Project>
<Name>Launcher</Name>
</ProjectReference>
<ProjectReference Include="PrinterDriverInstaller\InfInstaller.csproj">
<Project>{990A9AD3-B6A4-407B-9DFC-9C722AF7C9B9}</Project>
<Name>InfInstaller</Name>
@ -395,17 +388,17 @@
<Project>{670BDDFF-927B-425D-9DD1-22ACB14356EB}</Project>
<Name>PlatformWin32</Name>
</ProjectReference>
<ProjectReference Include="..\agg-sharp\Localizations\Localizations.csproj">
<Project>{CA96058C-1A37-465D-A357-D6D695B13D25}</Project>
<Name>Localizations</Name>
</ProjectReference>
<ProjectReference Include="PluginSystem\MatterControlPluginSystem.csproj">
<Project>{865172A0-A1A9-49C2-9386-F2FDB4E141B7}</Project>
<Name>MatterControlPluginSystem</Name>
</ProjectReference>
<ProjectReference Include="..\agg-sharp\Agg\Agg.csproj">
<ProjectReference Include="..\agg-sharp\agg\Agg.csproj">
<Project>{657DBC6D-C3EA-4398-A3FA-DDB73C14F71B}</Project>
<Name>Agg</Name>
</ProjectReference>
<ProjectReference Include="..\agg-sharp\Localizations\Localizations.csproj">
<Project>{CA96058C-1A37-465D-A357-D6D695B13D25}</Project>
<Name>Localizations</Name>
</ProjectReference>
</ItemGroup>
</Project>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{865172A0-A1A9-49C2-9386-F2FDB4E141B7}</ProjectGuid>
<OutputType>Library</OutputType>
@ -15,6 +15,7 @@
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
<ReleaseVersion>1.1.4</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@ -54,6 +55,7 @@
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
@ -65,6 +67,8 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
@ -76,6 +80,8 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
@ -87,6 +93,7 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64|x64'">
<OutputPath>bin\x64\Release64\</OutputPath>
@ -103,6 +110,7 @@
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|x64'">
<DebugSymbols>true</DebugSymbols>
@ -115,6 +123,8 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

View file

@ -158,7 +158,7 @@ namespace MatterHackers.MatterControl.PrintHistory
actionButtonContainer = new SlideWidget();
actionButtonContainer.VAnchor = VAnchor.ParentBottomTop;
actionButtonContainer.Width = 160;
actionButtonContainer.Width = 200;
actionButtonContainer.Visible = false;
FlowLayoutWidget rightMiddleColumnContainer = new FlowLayoutWidget(Agg.UI.FlowDirection.LeftToRight);
@ -167,7 +167,7 @@ namespace MatterHackers.MatterControl.PrintHistory
ClickWidget viewButton = new ClickWidget();
viewButton.VAnchor = VAnchor.ParentBottomTop;
viewButton.BackgroundColor = ActiveTheme.Instance.SecondaryAccentColor;
viewButton.Width = 80;
viewButton.Width = 100;
TextWidget viewLabel = new TextWidget("View".Localize());
viewLabel.TextColor = RGBA_Bytes.White;
@ -181,7 +181,7 @@ namespace MatterHackers.MatterControl.PrintHistory
ClickWidget printButton = new ClickWidget();
printButton.VAnchor = VAnchor.ParentBottomTop;
printButton.BackgroundColor = ActiveTheme.Instance.PrimaryAccentColor;
printButton.Width = 80;
printButton.Width = 100;
TextWidget printLabel = new TextWidget("Print".Localize());
printLabel.TextColor = RGBA_Bytes.White;

View file

@ -142,7 +142,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
selectionCheckBox.HAnchor = HAnchor.ParentCenter;
selectionCheckBoxContainer.AddChild(selectionCheckBox);
GuiWidget middleColumn = new GuiWidget(0, 0);
GuiWidget middleColumn = new GuiWidget(0.0, 0.0);
middleColumn.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
middleColumn.VAnchor = Agg.UI.VAnchor.ParentBottomTop;
middleColumn.Margin = new BorderDouble(10, 6);
@ -191,7 +191,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
ClickWidget printButton = new ClickWidget();
printButton.VAnchor = VAnchor.ParentBottomTop;
printButton.BackgroundColor = ActiveTheme.Instance.PrimaryAccentColor;
printButton.Width = 80;
printButton.Width = 100;
TextWidget printLabel = new TextWidget("Print".Localize());
printLabel.TextColor = RGBA_Bytes.White;
@ -209,21 +209,21 @@ namespace MatterHackers.MatterControl.PrintLibrary
ClickWidget editButton = new ClickWidget();
editButton.VAnchor = VAnchor.ParentBottomTop;
editButton.BackgroundColor = ActiveTheme.Instance.SecondaryAccentColor;
editButton.Width = 80;
editButton.Width = 100;
TextWidget editLabel = new TextWidget("Edit".Localize());
TextWidget editLabel = new TextWidget("View".Localize());
editLabel.TextColor = RGBA_Bytes.White;
editLabel.VAnchor = VAnchor.ParentCenter;
editLabel.HAnchor = HAnchor.ParentCenter;
editButton.AddChild(editLabel);
editButton.Click += onEditPartClick;
editButton.Click += onViewPartClick;
buttonFlowContainer.AddChild(editButton);
buttonFlowContainer.AddChild(printButton);
buttonContainer.AddChild(buttonFlowContainer);
buttonContainer.Width = 160;
buttonContainer.Width = 200;
return buttonContainer;
}
@ -232,7 +232,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
{
//this.VAnchor = Agg.UI.VAnchor.FitToChildren;
this.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
this.Height = 50;
this.Height = 65;
this.Padding = new BorderDouble(0);
this.Margin = new BorderDouble(6, 0, 6, 6);
}
@ -273,10 +273,10 @@ namespace MatterHackers.MatterControl.PrintLibrary
{
if (this.libraryDataView.EditMode == false)
{
UiThread.RunOnIdle((state) =>
{
openPartView(state);
});
//UiThread.RunOnIdle((state) =>
//{
// openPartView(state);
//});
}
else
{
@ -331,11 +331,11 @@ namespace MatterHackers.MatterControl.PrintLibrary
});
}
private void onEditPartClick(object sender, MouseEventArgs e)
private void onViewPartClick(object sender, MouseEventArgs e)
{
UiThread.RunOnIdle((state) =>
{
openPartView(state, true);
openPartView(state, false);
});
}

View file

@ -83,7 +83,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
editButtonFactory.disabledTextColor = ActiveTheme.Instance.SecondaryAccentColor;
editButtonFactory.pressedTextColor = RGBA_Bytes.White;
editButtonFactory.borderWidth = 0;
editButtonFactory.FixedWidth = 50;
editButtonFactory.FixedWidth = 70;
FlowLayoutWidget allControls = new FlowLayoutWidget(FlowDirection.TopToBottom);
{

View file

@ -179,7 +179,7 @@ namespace MatterHackers.MatterControl.PrintQueue
ClickWidget printButton = new ClickWidget();
printButton.VAnchor = VAnchor.ParentBottomTop;
printButton.BackgroundColor = ActiveTheme.Instance.PrimaryAccentColor;
printButton.Width = 80;
printButton.Width = 100;
TextWidget printLabel = new TextWidget("Remove".Localize());
printLabel.TextColor = RGBA_Bytes.White;
@ -195,7 +195,7 @@ namespace MatterHackers.MatterControl.PrintQueue
ClickWidget editButton = new ClickWidget();
editButton.VAnchor = VAnchor.ParentBottomTop;
editButton.BackgroundColor = ActiveTheme.Instance.SecondaryAccentColor;
editButton.Width = 80;
editButton.Width = 100;
TextWidget editLabel = new TextWidget("Edit".Localize());
editLabel.TextColor = RGBA_Bytes.White;
@ -209,8 +209,8 @@ namespace MatterHackers.MatterControl.PrintQueue
buttonFlowContainer.AddChild(printButton);
buttonContainer.AddChild(buttonFlowContainer);
//buttonContainer.Width = 160;
buttonContainer.Width = 80;
//buttonContainer.Width = 200;
buttonContainer.Width = 100;
return buttonContainer;
}

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{990A9AD3-B6A4-407B-9DFC-9C722AF7C9B9}</ProjectGuid>
<OutputType>Exe</OutputType>
@ -16,7 +16,7 @@
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
<ReleaseVersion>0.8.2</ReleaseVersion>
<ReleaseVersion>1.1.4</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@ -54,6 +54,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
@ -65,6 +66,8 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
@ -76,6 +79,8 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
@ -87,6 +92,7 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64|x64'">
<OutputPath>bin\x64\Release64\</OutputPath>
@ -103,6 +109,7 @@
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|x64'">
<DebugSymbols>true</DebugSymbols>
@ -114,6 +121,8 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />

View file

@ -509,22 +509,25 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
this.activeSettingsLayers.Add(defaultSettingsLayer);
}
public bool LoadSettingsFromIni()
public void LoadSettingsFromIni(object state)
{
OpenFileDialogParams openParams = new OpenFileDialogParams("Load Slice Configuration|*.slice;*.ini");
openParams.ActionButtonLabel = "Load Configuration";
openParams.Title = "MatterControl: Select A File";
FileDialog.OpenFileDialog(ref openParams);
if (openParams.FileNames != null)
{
LoadConfigurationSettingsFromFileAsUnsaved(openParams.FileName);
return true;
}
FileDialog.OpenFileDialog(openParams, onSettingsFileSelected);
return false;
}
void onSettingsFileSelected(OpenFileDialogParams openParams)
{
if (openParams.FileNames != null)
{
LoadConfigurationSettingsFromFileAsUnsaved(openParams.FileName);
ApplicationController.Instance.ReloadAdvancedControlsPanel();
}
}
public SettingsLayer LoadConfigurationSettingsFromFile(string pathAndFileName, DataStorage.SliceSettingsCollection collection)
{
Dictionary<string, DataStorage.SliceSetting> settingsDictionary = new Dictionary<string, DataStorage.SliceSetting>();
@ -640,15 +643,19 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{
string documentsPath = System.Environment.GetFolderPath (System.Environment.SpecialFolder.Personal);
SaveFileDialogParams saveParams = new SaveFileDialogParams("Save Slice Configuration|*." + configFileExtension,documentsPath);
System.IO.Stream streamToSaveTo = FileDialog.SaveFileDialog (ref saveParams);
if (streamToSaveTo != null)
{
streamToSaveTo.Close();
GenerateConfigFile(saveParams.FileName);
}
saveParams.FileName = "default_settings.ini";
FileDialog.SaveFileDialog(saveParams, onExportFileSelected);
}
void onExportFileSelected(SaveFileDialogParams saveParams)
{
if (saveParams.FileName != null)
{
GenerateConfigFile(saveParams.FileName);
}
}
public override int GetHashCode()
{
if (this.settingsHashCode == 0)
@ -678,6 +685,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
}
string configFileAsString = string.Join("\n", configFileAsList.ToArray());
//To do - add file extension if it doesn't exist
FileStream fs = new FileStream(fileName, FileMode.Create);
StreamWriter sw = new System.IO.StreamWriter(fs);
sw.Write(configFileAsString);

View file

@ -83,7 +83,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
noConnectionMessageContainer = new AltGroupBox(new TextWidget(LocalizedString.Get("No Printer Selected"), pointSize: 18, textColor: ActiveTheme.Instance.SecondaryAccentColor));
noConnectionMessageContainer.Margin = new BorderDouble(top: 10);
noConnectionMessageContainer.TextColor = ActiveTheme.Instance.PrimaryTextColor;
noConnectionMessageContainer.BorderColor = ActiveTheme.Instance.PrimaryTextColor;
noConnectionMessageContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
noConnectionMessageContainer.Height = 80;