Guided tour updates
authorplaa <plaa@180e2498-e6e9-4542-8430-84ac67f01cd8>
Sat, 10 Mar 2012 15:03:02 +0000 (15:03 +0000)
committerplaa <plaa@180e2498-e6e9-4542-8430-84ac67f01cd8>
Sat, 10 Mar 2012 15:03:02 +0000 (15:03 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@453 180e2498-e6e9-4542-8430-84ac67f01cd8

12 files changed:
core/.classpath
core/resources/datafiles/tours/introduction/introduction.tour
core/resources/datafiles/tours/introduction/introduction_es.tour
core/resources/datafiles/tours/introduction/introduction_fr.tour
core/resources/datafiles/tours/introduction/introduction_it.tour
core/resources/datafiles/tours/tours.txt
core/resources/l10n/messages.properties
core/src/net/sf/openrocket/gui/help/tours/GuidedTourSelectionDialog.java
core/src/net/sf/openrocket/gui/help/tours/Slide.java
core/src/net/sf/openrocket/gui/help/tours/SlideShowDialog.java
core/src/net/sf/openrocket/gui/help/tours/SlideShowLinkListener.java
core/src/net/sf/openrocket/gui/main/BasicFrame.java

index 712371a7a8bcd79b904a76266a89def675ca6389..10ef69c68136c740d1a14881d72754b76b29bd27 100644 (file)
@@ -3,7 +3,6 @@
        <classpathentry excluding="net/sf/openrocket/android/" kind="src" path="src"/>
        <classpathentry kind="src" path="src-extra"/>
        <classpathentry kind="src" path="test"/>
-       <classpathentry kind="src" path="resources"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
                <accessrules>
                        <accessrule kind="nonaccessible" pattern="com/sun/**"/>
@@ -25,5 +24,6 @@
        <classpathentry kind="lib" path="lib-test/jmock-junit4-2.6.0-RC2.jar"/>
        <classpathentry kind="lib" path="lib-test/junit-dep-4.8.2.jar"/>
        <classpathentry kind="lib" path="lib-test/uispec4j-2.3-jdk16.jar"/>
+       <classpathentry kind="lib" path="resources"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>
index e65ac1ac45f9a020f54568451dc71f283fb9577a..2672dcc107f38ac325aac724bd8bc2a663a8ac70 100644 (file)
@@ -16,14 +16,14 @@ overview of the OpenRocket screens and features.
 arrows</em> on your keyboard.
 
 
-[none]
-# FIXME: Add screenshot after dialog is complete
-
-<p>This is the startup screen from which you can create a new rocket
-design or open existing designs.
-
-<p>For this tour, let's open an example design called <em>A simple model
-rocket</em>.
+#[none]
+## FIXME: Add screenshot after dialog is complete
+#
+#<p>This is the startup screen from which you can create a new rocket
+#design or open existing designs.
+#
+#<p>For this tour, let's open an example design called <em>A simple model
+#rocket</em>.
 
 
 [main_window.jpg]
@@ -77,7 +77,7 @@ on the last two tabs you can plot or export the results.
 <p>Other advanced features include component analysis and automatic
 design optimization, which are covered by separate tours.
 
-<p>Next you can take a tour on <a href="FIXME">Creating a rocket
+<p>Next you can take a tour on <a href="creating_design/creating_design.tour">Creating a rocket
 design</a>, browse other tours or start experimenting with the
 software.
 
index c66fa7e0b877ec738ccead992193fd9bd1387004..a2bbc1738d1387b220574a1e6b31f7bd55493245 100644 (file)
@@ -11,12 +11,12 @@ Introducción
 <p>Puede navegar utilizando los botones <b>Siguiente</b> y <b>Anterior</b>, o utilizando las flechas de desplazamiento <b><em>izq.</em></b> y <b><em>der.</em></b> de su teclado.
 
 
-[none]
-# FIXME: Añadir pantallas después de completar el diálogo
-
-<p>Esta es la pantalla de inicio desde la cual puede crear un nuevo diseño de cohete, o abrir diseños ya existentes.
-
-<p>En esta ocasión abra un diseño de ejemplo llamado <b><em>A simple model rocket</em></b>.
+#[none]
+## FIXME: Añadir pantallas después de completar el diálogo
+#
+#<p>Esta es la pantalla de inicio desde la cual puede crear un nuevo diseño de cohete, o abrir diseños ya existentes.
+#
+#<p>En esta ocasión abra un diseño de ejemplo llamado <b><em>A simple model rocket</em></b>.
 
 
 [main_window.jpg]
@@ -56,7 +56,7 @@ Introducción
 
 <p>Otras características más avanzadas son: el <em>Análisis de componentes</em> y la <em>Optimización</em> automática del diseño.
 
-<p>Seguidamente puede hacer un recorrido por <a href="FIXME">Crear un diseño de cohete</a>, navegar por otros apartados, o comenzar a experimentar con la aplicación creando su propio diseño de cohete.
+<p>Seguidamente puede hacer un recorrido por <a href="creating_design/creating_design.tour">Crear un diseño de cohete</a>, navegar por otros apartados, o comenzar a experimentar con la aplicación creando su propio diseño de cohete.
 
 
 
index f32543a99d14200cdfff147992995f6b223700b1..12b47cc8d479780c25fd446107ff5084ed45e75e 100644 (file)
@@ -15,14 +15,14 @@ et <b>Précédant</b>, ou en utilisant les flèches <em>gauche</em> et <em>droit
 </em> sur votre clavier.
 
 
-[none]
-# FIXME: Add screenshot after dialog is complete
-
-<p>Ceci est l'écran de démarrage depuis lequel vous pouvez créer une nouvelle fusée
-ou ouvrir des projets existant.
-
-<p>Pour ce tour d'horizon, ouvrons le projet exemple nommé <em>A simple model
-rocket</em>.
+#[none]
+## FIXME: Add screenshot after dialog is complete
+#
+#<p>Ceci est l'écran de démarrage depuis lequel vous pouvez créer une nouvelle fusée
+#ou ouvrir des projets existant.
+#
+#<p>Pour ce tour d'horizon, ouvrons le projet exemple nommé <em>A simple model
+#rocket</em>.
 
 
 [main_window.jpg]
@@ -77,7 +77,7 @@ dans les deux derniers onglets vous pouvez tracer ou exporter les résultats.
 <p>D'autres fonctionnalités avancées incluant l'analyse des pièces et une
 optimisation automatique du projet sont traités dans d'autres tours d'horizon.
 
-<p>Ensuite vous pouvez voir <a href="FIXME">Créer un projet fusée
+<p>Ensuite vous pouvez voir <a href="creating_design/creating_design.tour">Créer un projet fusée
 </a>, survoler d'autres tours d'horizons ou commencer à expérimenter le
 logiciel.
 
index 4c6c07e4ee504360ddd646b26eb456dc46af2759..46b977a1d22b7add3a4f4128873a4e9412f51b50 100644 (file)
@@ -11,13 +11,13 @@ Introduzione
 <b>Precedente</b> , o usando le frecce <em>sinistra</em> e <em>destra</em> della tua tastiera.
 
 
-[none]
-# FIXME: Add screenshot after dialog is complete
-
-<p>Questa è la finestra di avvio dalla quale puoi creare il disegno di un nuovo razzo o aprirne uno esistente.
-
-<p>Per questo tour, lasciami aprire un esempio chiamato <em>A simple model
-rocket</em>.
+#[none]
+## FIXME: Add screenshot after dialog is complete
+#
+#<p>Questa è la finestra di avvio dalla quale puoi creare il disegno di un nuovo razzo o aprirne uno esistente.
+#
+#<p>Per questo tour, lasciami aprire un esempio chiamato <em>A simple model
+#rocket</em>.
 
 
 [main_window.jpg]
@@ -62,7 +62,7 @@ Mostra le connessioni tra i componenti.
 
 <p>Altri tour trattano nello specifico diverse caratteristiche avanzate tra le quali l'analisi dei compononti e l'ottimizzazione automatica del progetto.
 
-<p>Puoi cominciare un tour da <a href="FIXME">Creating a rocket
+<p>Puoi cominciare un tour da <a href="creating_design/creating_design.tour">Creating a rocket
 design</a>, fai altri tour e comincia a prendere confidenza col programma.
 
 
index dbc8845589116f170e6f2e83f6d5e360cd816534..fd2328b2a03ff9a86068f72253f51781447d66f3 100644 (file)
@@ -4,6 +4,3 @@
 introduction/introduction.tour
 creating_design/creating_design.tour
 
-test1/test.tour
-test2/test2.tour
-
index c97fca6c66c9a17029e1865c2b338bc6279cfb59..102fd94b54cd18644cb8b1b7115a9f69e4ece189 100644 (file)
@@ -1558,6 +1558,9 @@ CompassSelectionButton.lbl.NW = NW
 SlideShowDialog.btn.next = Next
 SlideShowDialog.btn.prev = Previous
 
+SlideShowLinkListener.error.title = Guided tour not found
+SlideShowLinkListener.error.msg = Sorry, the selected tour has not yet been written.
+
 GuidedTourSelectionDialog.title = Guided tours
 GuidedTourSelectionDialog.lbl.selectTour = Select guided tour:
 GuidedTourSelectionDialog.lbl.description = Tour description:
index baff4a5bbb9fa3822933599d79dbaa25fa918675..d3a74a3d4a32232e333310d57506cb9f6036fc77 100644 (file)
@@ -33,6 +33,7 @@ public class GuidedTourSelectionDialog extends JDialog {
        
        private static final Translator trans = Application.getTranslator();
        
+       private static GuidedTourSelectionDialog instance = null;
        
        
        private final SlideSetManager slideSetManager;
@@ -178,5 +179,14 @@ public class GuidedTourSelectionDialog extends JDialog {
        }
        
        
+       public static void showDialog(Window parent) {
+               if (instance != null && instance.isVisible()) {
+                       instance.setVisible(true);
+                       instance.toFront();
+               } else {
+                       instance = new GuidedTourSelectionDialog(parent);
+                       instance.setVisible(true);
+               }
+       }
        
 }
index c3c1fab871cc7e305cd7640a07977cf667cf9b98..45ec129ecf11821851c43e999731764bdb5d5187 100644 (file)
@@ -7,6 +7,8 @@ import java.net.URL;
 
 import javax.imageio.ImageIO;
 
+import net.sf.openrocket.util.BugException;
+
 /**
  * An individual slide in a guided tour.  It contains a image (or reference to an
  * image file) plus a text description (in HTML).
@@ -65,12 +67,10 @@ public class Slide {
                        if (url != null) {
                                img = ImageIO.read(url);
                        } else {
-                               //FIXME
-                               img = null;
+                               throw new BugException("Could not find image " + imageFile);
                        }
                } catch (IOException e) {
-                       // FIXME
-                       img = null;
+                       throw new BugException("Error reading image " + imageFile, e);
                }
                
                return img;
index 61936b911421575a34faee18f7c6037fec054a73..aa48ff9954f4f8a77896b093421fe9ef3c3e2de1 100644 (file)
@@ -42,7 +42,7 @@ public class SlideShowDialog extends JDialog {
                JPanel panel = new JPanel(new MigLayout("fill"));
                
                slideShowComponent = new SlideShowComponent();
-               slideShowComponent.addHyperlinkListener(new SlideShowLinkListener(parent));
+               slideShowComponent.addHyperlinkListener(new SlideShowLinkListener(this));
                panel.add(slideShowComponent, "spanx, grow, wrap para");
                
                
@@ -93,7 +93,7 @@ public class SlideShowDialog extends JDialog {
                nextButton.grabFocus();
                GUIUtil.rememberWindowPosition(this);
                GUIUtil.rememberWindowSize(this);
-               this.setAlwaysOnTop(true);
+               //              this.setAlwaysOnTop(true);
        }
        
        public void setSlideSet(SlideSet slideSet, int position) {
index 5fc1d888ac82af680d1d46cba724da5f4d97ddcb..6973b370d84cb477a5bb9055f1e03f02ad7b6595 100644 (file)
@@ -4,14 +4,20 @@ import java.awt.Desktop;
 import java.awt.Window;
 import java.net.URL;
 
+import javax.swing.JOptionPane;
 import javax.swing.event.HyperlinkEvent;
 import javax.swing.event.HyperlinkEvent.EventType;
 import javax.swing.event.HyperlinkListener;
 
+import net.sf.openrocket.l10n.Translator;
+import net.sf.openrocket.logging.LogHelper;
 import net.sf.openrocket.startup.Application;
 
 public class SlideShowLinkListener implements HyperlinkListener {
        
+       private static final LogHelper log = Application.getLogger();
+       private static final Translator trans = Application.getTranslator();
+       
        private final Window parent;
        
        public SlideShowLinkListener(Window parent) {
@@ -46,7 +52,9 @@ public class SlideShowLinkListener implements HyperlinkListener {
                                dialog.setSlideSet(ss, 0);
                                dialog.setVisible(true);
                        } catch (IllegalArgumentException e) {
-                               Application.getExceptionHandler().handleErrorCondition("Guided tour '" + name + "' not found.");
+                               log.warn("Guided tour '" + name + "' not found");
+                               JOptionPane.showMessageDialog(parent,
+                                               trans.get("error.msg"), trans.get("error.title"), JOptionPane.WARNING_MESSAGE);
                        }
                        
                }
index f9884900bdd4defeb4f8dcf01d3d3fbb3f8f4932..c522f2a22536dc318f2806eb64bb553865b8e44b 100644 (file)
@@ -683,8 +683,7 @@ public class BasicFrame extends JFrame {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                                log.user("Guided tours selected");
-                               // FIXME:  Singleton
-                               new GuidedTourSelectionDialog(BasicFrame.this).setVisible(true);
+                               GuidedTourSelectionDialog.showDialog(BasicFrame.this);
                        }
                });
                menu.add(item);