Merge pull request #79 from mmoening/development
Added feature to replace "Default Printer" with the Make and Model of th...
This commit is contained in:
commit
cde58a3148
2 changed files with 14 additions and 0 deletions
|
|
@ -425,6 +425,10 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
|
||||
void NextButton_Click(object sender, EventArgs mouseEvent)
|
||||
{
|
||||
if(printerNameInput.Text == "Default Printer ({0})".FormatWith(ExistingPrinterCount() + 1))
|
||||
{
|
||||
printerNameInput.Text = String.Format ("{0} {1} ({2})", this.ActivePrinter.Make, this.ActivePrinter.Model, ExistingPrinterCount () + 1);
|
||||
}
|
||||
bool canContinue = this.OnSave();
|
||||
if (canContinue)
|
||||
{
|
||||
|
|
@ -432,6 +436,13 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
UiThread.RunOnIdle(MoveToNextWidget);
|
||||
}
|
||||
}
|
||||
|
||||
public int ExistingPrinterCount()
|
||||
{
|
||||
string query = string.Format("SELECT COUNT(*) FROM Printer;");
|
||||
string result = Datastore.Instance.dbSQLite.ExecuteScalar<string>(query);
|
||||
return Convert.ToInt32(result);
|
||||
}
|
||||
|
||||
void LoadSlicePresets()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue