Revise ManufacturerNameMapping DropList support
- Ensure list items use the ASCII file system values - Use mapped Unicode manufacturer names where appropriate
This commit is contained in:
parent
fb860d31f9
commit
ac279ccbe3
3 changed files with 8 additions and 15 deletions
|
|
@ -88,7 +88,7 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
else
|
||||
{
|
||||
ManufacturerDropList.AddItem(manufacturer);
|
||||
ManufacturerDropList.AddItem(manufacturer, folderName);
|
||||
if (selectedMake != null)
|
||||
{
|
||||
if (this.manufacturer == selectedMake)
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
|
||||
private void ManufacturerDropList_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
ActivePrinter.Make = ((DropDownList)sender).SelectedLabel;
|
||||
ActivePrinter.Make = ((DropDownList)sender).SelectedValue;
|
||||
ActivePrinter.Model = null;
|
||||
ReconstructModelSelector();
|
||||
SetElementState();
|
||||
|
|
@ -184,17 +184,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
//reconstruct model selector
|
||||
int currentIndex = contentRow.GetChildIndex(printerModelContainer);
|
||||
contentRow.RemoveChild(printerModelContainer);
|
||||
List<ManufacturerNameMapping> manufacturerNameMapping = OemSettings.Instance.ManufacturerNameMappings;
|
||||
|
||||
foreach(ManufacturerNameMapping mapping in manufacturerNameMapping)
|
||||
{
|
||||
|
||||
if (mapping.NameToDisplay == ActivePrinter.Make)
|
||||
{
|
||||
ActivePrinter.Make = mapping.NameOnDisk;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
printerModelContainer = createPrinterModelContainer(ActivePrinter.Make);
|
||||
|
|
@ -214,7 +204,10 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
SetElementState();
|
||||
if (usingDefaultName)
|
||||
{
|
||||
string printerInputName = String.Format("{0} {1}", this.ActivePrinter.Make, this.ActivePrinter.Model);
|
||||
// Use ManufacturerDropList.SelectedLabel instead of ActivePrinter.Make to ensure the mapped Unicode values are picked up
|
||||
string mappedMakeText = printerManufacturerSelector.ManufacturerDropList.SelectedLabel;
|
||||
|
||||
string printerInputName = String.Format("{0} {1}", mappedMakeText, this.ActivePrinter.Model);
|
||||
string query = "SELECT Name FROM Printer WHERE Name LIKE @printerName;";
|
||||
var names = Datastore.Instance.dbSQLite.Query<sqlName>(query, printerInputName + "%").Select(item => item.Name).ToList();
|
||||
|
||||
|
|
@ -231,7 +224,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
do
|
||||
{
|
||||
printerModelCount++;
|
||||
possiblePrinterName = String.Format("{0} ({1})", printerInputName, printerModelCount);
|
||||
possiblePrinterName = String.Format("{0} ({1})", printerInputName, printerModelCount);
|
||||
} while (names.Contains(possiblePrinterName));
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 9ef61224e980ab1d8587f9ae8985360d97799ed5
|
||||
Subproject commit 869d629c63d72a7a6e8ad004a86ac11283b199dc
|
||||
Loading…
Add table
Add a link
Reference in a new issue