mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-14 07:17:13 -04:00
Adds a "Start Tutorial" entry to the view menu, closes #366
This commit is contained in:
parent
e96d91742e
commit
a2373e39d7
@ -407,6 +407,16 @@ public final class Main extends JFrame implements ClosingWindowListener.ConfirmS
|
|||||||
});
|
});
|
||||||
treeCheckBox.setAccelerator(KeyStroke.getKeyStroke("F5"));
|
treeCheckBox.setAccelerator(KeyStroke.getKeyStroke("F5"));
|
||||||
|
|
||||||
|
ToolTipAction tutorial = new ToolTipAction(Lang.get("menu_tutorial")) {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (ClosingWindowListener.checkForSave(Main.this, Main.this)) {
|
||||||
|
clearPane();
|
||||||
|
new InitialTutorial(Main.this).setVisible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.setToolTip(Lang.get("menu_tutorial_tt"));
|
||||||
|
|
||||||
if (Settings.getInstance().get(Keys.SETTINGS_DEFAULT_TREESELECT))
|
if (Settings.getInstance().get(Keys.SETTINGS_DEFAULT_TREESELECT))
|
||||||
SwingUtilities.invokeLater(treeCheckBox::doClick);
|
SwingUtilities.invokeLater(treeCheckBox::doClick);
|
||||||
|
|
||||||
@ -423,9 +433,22 @@ public final class Main extends JFrame implements ClosingWindowListener.ConfirmS
|
|||||||
view.addSeparator();
|
view.addSeparator();
|
||||||
view.add(treeCheckBox);
|
view.add(treeCheckBox);
|
||||||
view.addSeparator();
|
view.addSeparator();
|
||||||
|
view.add(tutorial.createJMenuItem());
|
||||||
|
view.addSeparator();
|
||||||
view.add(viewHelp.createJMenuItem());
|
view.add(viewHelp.createJMenuItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void clearPane() {
|
||||||
|
circuitComponent.setCircuit(new Circuit());
|
||||||
|
setFilename(null, true);
|
||||||
|
windowPosManager.closeAll();
|
||||||
|
try {
|
||||||
|
library.setRootFilePath(null);
|
||||||
|
} catch (IOException e1) {
|
||||||
|
// can not happen, no folder is scanned
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the file menu and adds it to menu and toolbar
|
* Creates the file menu and adds it to menu and toolbar
|
||||||
*
|
*
|
||||||
@ -438,14 +461,7 @@ public final class Main extends JFrame implements ClosingWindowListener.ConfirmS
|
|||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (ClosingWindowListener.checkForSave(Main.this, Main.this)) {
|
if (ClosingWindowListener.checkForSave(Main.this, Main.this)) {
|
||||||
circuitComponent.setCircuit(new Circuit());
|
clearPane();
|
||||||
setFilename(null, true);
|
|
||||||
windowPosManager.closeAll();
|
|
||||||
try {
|
|
||||||
library.setRootFilePath(null);
|
|
||||||
} catch (IOException e1) {
|
|
||||||
// can not happen, no folder is scanned
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.setAcceleratorCTRLplus('N').setToolTip(Lang.get("menu_new_tt")).setEnabledChain(allowAll);
|
}.setAcceleratorCTRLplus('N').setToolTip(Lang.get("menu_new_tt")).setEnabledChain(allowAll);
|
||||||
|
@ -1644,6 +1644,8 @@ Sind evtl. die Namen der Variablen nicht eindeutig?</string>
|
|||||||
<string name="menu_labelPins">Ein- und Ausgänge benennen</string>
|
<string name="menu_labelPins">Ein- und Ausgänge benennen</string>
|
||||||
<string name="menu_labelPins_tt">Für alle unbenannten Ein- und Ausgänge eine Bezeichnung setzen.</string>
|
<string name="menu_labelPins_tt">Für alle unbenannten Ein- und Ausgänge eine Bezeichnung setzen.</string>
|
||||||
|
|
||||||
|
<string name="menu_tutorial">Tutorial starten</string>
|
||||||
|
<string name="menu_tutorial_tt">Startet das Anfänger-Tutorial.</string>
|
||||||
|
|
||||||
<string name="menu_stats">Schaltungsstatistik</string>
|
<string name="menu_stats">Schaltungsstatistik</string>
|
||||||
<string name="menu_stats_tt">Zeigt eine Liste der verwendeten Komponenten</string>
|
<string name="menu_stats_tt">Zeigt eine Liste der verwendeten Komponenten</string>
|
||||||
|
@ -1624,6 +1624,9 @@
|
|||||||
<string name="menu_labelPins">Label Inputs and Outputs</string>
|
<string name="menu_labelPins">Label Inputs and Outputs</string>
|
||||||
<string name="menu_labelPins_tt">Set a label to all inputs and outputs without a label.</string>
|
<string name="menu_labelPins_tt">Set a label to all inputs and outputs without a label.</string>
|
||||||
|
|
||||||
|
<string name="menu_tutorial">Start Tutorial</string>
|
||||||
|
<string name="menu_tutorial_tt">Starts the beginner tutorial.</string>
|
||||||
|
|
||||||
<string name="menu_stats">Circuit Statistics</string>
|
<string name="menu_stats">Circuit Statistics</string>
|
||||||
<string name="menu_stats_tt">Shows a list of used components.</string>
|
<string name="menu_stats_tt">Shows a list of used components.</string>
|
||||||
<string name="stat_number">Number</string>
|
<string name="stat_number">Number</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user