Added "skip tutorial" button.

This commit is contained in:
hneemann 2019-07-17 09:10:58 +02:00
parent 396154cccc
commit 736c9323cf
3 changed files with 19 additions and 3 deletions

View File

@ -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());
}

View File

@ -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>

View File

@ -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>