Skip to content

Commit

Permalink
Preserve the user entered text in the JobName TextField (#687)
Browse files Browse the repository at this point in the history
Preserve the value of the usr entered JobName TextField.

Currently visicut deletes the value, when a) the laser is changed, b) material is changed,
or c) the mapping is changed.
This makes it tedious, if I want to e.g. laser the same file different mappings, which I frequently do.
I'd prefer to just edit the prefix, instead of entering it again in full each time.
  • Loading branch information
jnweiger authored Nov 6, 2023
1 parent d98e82d commit 2c31b43
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/de/thomas_oster/visicut/gui/MainView.java
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,6 @@ public void refreshExecuteButtons(boolean skipLockCheck)
execute = false;
}
}
this.jTextFieldJobName.setText("");
this.exportGcodeMenuItem.setEnabled(execute);
this.calculateTimeButton.setEnabled(execute);
this.executeJobButton.setEnabled(execute);
Expand Down Expand Up @@ -2113,11 +2112,15 @@ private void aboutMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN
private String generateJobName() {
jobnumber++;
String nameprefix = jTextFieldJobName.getText();
if (nameprefix.length() > 0)
{
nameprefix = nameprefix + " "; // insert a whitespace after prefix to make it look nicer.
}
//
// Most simplistic implementation of user editable job names:
// - we just add a prefix, if any. (This is okay for Zing lasers that only display 16 chars.)
// Todo: Better compute the next proposed job name in e.g. refreshExecuteButtons() ahead of time
// and show it in jTextFieldJobName near the Execute button. When we come here, just retrieve the
// Todo: Better compute the next proposed job name in e.g. refreshExecuteButtons() ahead of time
// and show it in jTextFieldJobName near the Execute button. When we come here, just retrieve the
// (possibly edited) name from there.
//
String prefix = visicutModel1.getSelectedLaserDevice().getJobPrefix();
Expand Down Expand Up @@ -3653,7 +3656,7 @@ public synchronized void disableEditGuiForQRCodes(boolean disable)
executeJobButton.setEnabled(!disable);
executeJobMenuItem.setEnabled(!disable);
calculateTimeButton.setEnabled(!disable);
jTextFieldJobName.setText("");
// jTextFieldJobName.setText("");

// Message is automatically removed and closed, therefore no close button
Message m = new Message("Info", bundle.getString("QR_CODE_DETECTION_GUI_DISABLE_TEXT"), Message.Type.INFO, new de.thomas_oster.uicomponents.warnings.Action[]
Expand Down

0 comments on commit 2c31b43

Please sign in to comment.