mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-15 07:48:29 -04:00
Added "skip tutorial" button.
This commit is contained in:
parent
396154cccc
commit
736c9323cf
@ -29,6 +29,7 @@ import de.neemann.gui.Screen;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.util.ArrayList;
|
||||
@ -171,6 +172,12 @@ public class InitialTutorial extends JDialog implements CircuitComponent.Tutoria
|
||||
text.setPreferredSize(new Dimension(300, 400));
|
||||
|
||||
getContentPane().add(new JScrollPane(text));
|
||||
getContentPane().add(new JButton(new AbstractAction(Lang.get("tutorialNotNeeded")) {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
disableTutorial();
|
||||
}
|
||||
}), BorderLayout.SOUTH);
|
||||
|
||||
pack();
|
||||
|
||||
@ -182,11 +189,15 @@ public class InitialTutorial extends JDialog implements CircuitComponent.Tutoria
|
||||
|
||||
}
|
||||
|
||||
private void disableTutorial() {
|
||||
Settings.getInstance().getAttributes().set(Keys.SETTINGS_SHOW_TUTORIAL, false);
|
||||
dispose();
|
||||
}
|
||||
|
||||
private void incIndex() {
|
||||
stepIndex++;
|
||||
if (stepIndex == STEPS.size()) {
|
||||
Settings.getInstance().getAttributes().set(Keys.SETTINGS_SHOW_TUTORIAL, false);
|
||||
dispose();
|
||||
disableTutorial();
|
||||
} else {
|
||||
setTextByID(STEPS.get(stepIndex).getId());
|
||||
}
|
||||
|
@ -2008,4 +2008,7 @@ Daher steht auch das Signal 'D_out' zur Verfügung, um in diesem Fall den Wert z
|
||||
<string name="tutorialUniqueIdents">
|
||||
Die Ein- und Ausgänge sollten eindeutig benannt sein.
|
||||
</string>
|
||||
<string name="tutorialNotNeeded">
|
||||
Tutorial überspringen
|
||||
</string>
|
||||
</resources>
|
||||
|
@ -1968,5 +1968,7 @@ Therefore, the signal 'D_out' is also available to check the value in this case.
|
||||
<string name="tutorialUniqueIdents">
|
||||
The inputs and outputs should be uniquely named.
|
||||
</string>
|
||||
|
||||
<string name="tutorialNotNeeded">
|
||||
Skip Tutorial
|
||||
</string>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user