mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-15 15:58:41 -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 javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -171,6 +172,12 @@ public class InitialTutorial extends JDialog implements CircuitComponent.Tutoria
|
|||||||
text.setPreferredSize(new Dimension(300, 400));
|
text.setPreferredSize(new Dimension(300, 400));
|
||||||
|
|
||||||
getContentPane().add(new JScrollPane(text));
|
getContentPane().add(new JScrollPane(text));
|
||||||
|
getContentPane().add(new JButton(new AbstractAction(Lang.get("tutorialNotNeeded")) {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent actionEvent) {
|
||||||
|
disableTutorial();
|
||||||
|
}
|
||||||
|
}), BorderLayout.SOUTH);
|
||||||
|
|
||||||
pack();
|
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() {
|
private void incIndex() {
|
||||||
stepIndex++;
|
stepIndex++;
|
||||||
if (stepIndex == STEPS.size()) {
|
if (stepIndex == STEPS.size()) {
|
||||||
Settings.getInstance().getAttributes().set(Keys.SETTINGS_SHOW_TUTORIAL, false);
|
disableTutorial();
|
||||||
dispose();
|
|
||||||
} else {
|
} else {
|
||||||
setTextByID(STEPS.get(stepIndex).getId());
|
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">
|
<string name="tutorialUniqueIdents">
|
||||||
Die Ein- und Ausgänge sollten eindeutig benannt sein.
|
Die Ein- und Ausgänge sollten eindeutig benannt sein.
|
||||||
</string>
|
</string>
|
||||||
|
<string name="tutorialNotNeeded">
|
||||||
|
Tutorial überspringen
|
||||||
|
</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1968,5 +1968,7 @@ Therefore, the signal 'D_out' is also available to check the value in this case.
|
|||||||
<string name="tutorialUniqueIdents">
|
<string name="tutorialUniqueIdents">
|
||||||
The inputs and outputs should be uniquely named.
|
The inputs and outputs should be uniquely named.
|
||||||
</string>
|
</string>
|
||||||
|
<string name="tutorialNotNeeded">
|
||||||
|
Skip Tutorial
|
||||||
|
</string>
|
||||||
</resources>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user