[jsword-svn] r1672 - in trunk: bibledesktop/src/main/java/org/crosswire/bibledesktop/book bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop bibledesktop/src/main/resources common/src/main/java/org/crosswire/common/util common-swing/src/main/java/org/crosswire/common/config/swing common-swing/src/main/java/org/crosswire/common/swing jsword/src/main/java/org/crosswire/jsword/util

dmsmith at www.crosswire.org dmsmith at www.crosswire.org
Wed Aug 8 11:40:45 MST 2007


Author: dmsmith
Date: 2007-08-08 11:40:44 -0700 (Wed, 08 Aug 2007)
New Revision: 1672

Added:
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InternetWarning.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InternetWarning.properties
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InternetWarning_fa.properties
   trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg_de.properties
   trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg_fa.properties
   trunk/jsword/src/main/java/org/crosswire/jsword/util/WebWarning.java
Modified:
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/AdvancedSearchPane.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/PassageSelectionPane.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/EditSitePane.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitePane.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitesPane.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SwordSiteEditor.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/AboutPane.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/DesktopActions.java
   trunk/bibledesktop/src/main/resources/config.properties
   trunk/bibledesktop/src/main/resources/config.xml
   trunk/bibledesktop/src/main/resources/config_de.properties
   trunk/bibledesktop/src/main/resources/config_fa.properties
   trunk/bibledesktop/src/main/resources/config_fa.txt
   trunk/common-swing/src/main/java/org/crosswire/common/config/swing/AbstractConfigEditor.java
   trunk/common-swing/src/main/java/org/crosswire/common/config/swing/WizardConfigEditor.java
   trunk/common-swing/src/main/java/org/crosswire/common/swing/FontChooser.java
   trunk/common/src/main/java/org/crosswire/common/util/Msg.java
   trunk/common/src/main/java/org/crosswire/common/util/Msg.properties
   trunk/common/src/main/java/org/crosswire/common/util/Msg_fa.properties
   trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg.java
   trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg.properties
Log:
Final, I hope, changes for first release of BD in Farsi.

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/AdvancedSearchPane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/AdvancedSearchPane.java	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/AdvancedSearchPane.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -25,6 +25,7 @@
 import java.awt.Color;
 import java.awt.Component;
 import java.awt.Font;
+import java.awt.Frame;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.Insets;
@@ -294,7 +295,10 @@
     {
         txtSummary.setText(search);
 
-        dlgMain = new JDialog(JOptionPane.getFrameForComponent(parent));
+        Frame root = JOptionPane.getFrameForComponent(parent);
+        dlgMain = new JDialog(root);
+        dlgMain.setComponentOrientation(root.getComponentOrientation());
+ 
         KeyStroke esc = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
         bailout = true;
 

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/PassageSelectionPane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/PassageSelectionPane.java	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/PassageSelectionPane.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -23,6 +23,7 @@
 
 import java.awt.BorderLayout;
 import java.awt.Component;
+import java.awt.Frame;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.Insets;
@@ -289,7 +290,10 @@
         treeSelected();
         listSelected();
 
-        dlgMain = new JDialog(JOptionPane.getFrameForComponent(parent));
+        Frame root = JOptionPane.getFrameForComponent(parent);
+        dlgMain = new JDialog(root);
+        dlgMain.setComponentOrientation(root.getComponentOrientation());
+
         JPanel pnlAction = new JPanel();
         KeyStroke esc = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
         bailout = true;

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/EditSitePane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/EditSitePane.java	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/EditSitePane.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -25,6 +25,7 @@
 import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.FlowLayout;
+import java.awt.Frame;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.Insets;
@@ -213,7 +214,9 @@
      */
     public void showInDialog(Component parent)
     {
-        dlgMain = new JDialog(JOptionPane.getFrameForComponent(parent));
+        Frame root = JOptionPane.getFrameForComponent(parent);
+        dlgMain = new JDialog(root);
+        dlgMain.setComponentOrientation(root.getComponentOrientation());
 
         ActionListener closer = new ActionListener()
         {
@@ -596,7 +599,7 @@
 
     /*
      * Components for the dialog box including the button bar at the bottom.
-     * These are separaed in this way in case this component is reused in a
+     * These are separated in this way in case this component is reused in a
      * larger context.
      */
     protected JDialog dlgMain;

Added: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InternetWarning.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InternetWarning.java	                        (rev 0)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InternetWarning.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -0,0 +1,176 @@
+/**
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2005
+ *     The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: FontChooser.java 1605 2007-08-03 21:34:46Z dmsmith $
+ */
+package org.crosswire.bibledesktop.book.install;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.GridLayout;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+
+import org.crosswire.common.swing.ActionFactory;
+import org.crosswire.common.swing.GuiUtil;
+import org.crosswire.jsword.util.WebWarning;
+
+/**
+ * InternetWarning is used to request permission of the user to access
+ * the Internet. An option allows them to request that they are not asked
+ * again. The default for the option is to be asked every time.
+ *
+ * @see gnu.lgpl.License for license details.
+ *      The copyright to this program is held by it's authors.
+ * @author DM Smith [dmsmith555 at yahoo dot com]
+ */
+public class InternetWarning extends JPanel
+{
+    /**
+     * Create a WebWarningDialog.
+     */
+    public InternetWarning()
+    {
+        actions = new ActionFactory(InternetWarning.class, this);
+
+        ItemListener changer = new ItemListener()
+        {
+            public void itemStateChanged(ItemEvent ev)
+            {
+                fireStateChange();
+            }
+        };
+
+        setLayout(new GridLayout(2, 1, 5, 5));
+
+        add(new JLabel(WebWarning.instance().getWarning()));
+
+        showWarning = new JCheckBox(WebWarning.instance().getShownWarningLabel());
+        showWarning.setSelected(true);
+        showWarning.addItemListener(changer);
+
+        add(showWarning);
+        GuiUtil.applyDefaultOrientation(this);
+    }
+
+    /**
+     * Display a InternetWarning as a dialog
+     */
+    public static int showDialog(Component parent, String title)
+    {
+        final InternetWarning webWarning = new InternetWarning();
+
+        JPanel buttons = new JPanel();
+        JButton yesButton = new JButton(webWarning.actions.getAction("Yes")); //$NON-NLS-1$
+        JButton noButton = new JButton(webWarning.actions.getAction("No")); //$NON-NLS-1$
+        buttons.add(yesButton);
+        buttons.add(noButton);
+
+        Component root = SwingUtilities.getRoot(parent);
+
+        JDialog dialog = (root instanceof JFrame)
+                      ? new JDialog((JFrame) root, title, true)
+                      : new JDialog((JDialog) root, title, true);
+
+        dialog.setComponentOrientation(root.getComponentOrientation());
+
+        webWarning.dialog = dialog;
+        webWarning.choice = InternetWarning.DENIED;
+
+        dialog.getRootPane().setDefaultButton(yesButton);
+
+        Container content = dialog.getContentPane();
+        content.setLayout(new BorderLayout());
+        content.add(webWarning, BorderLayout.NORTH);
+        content.add(buttons, BorderLayout.SOUTH);
+        dialog.pack();
+        GuiUtil.centerWindow(dialog);
+        GuiUtil.applyDefaultOrientation(dialog);
+        dialog.setVisible(true);
+
+        dialog.dispose();
+
+        return webWarning.choice;
+    }
+
+    public void doYes()
+    {
+        dialog.setVisible(false);
+        choice = InternetWarning.GRANTED;        
+    }
+
+    public void doNo()
+    {
+        dialog.setVisible(false);
+        choice = InternetWarning.DENIED;        
+    }
+
+    /**
+     * When something changes we must inform out listeners.
+     */
+    protected void fireStateChange()
+    {
+        WebWarning.instance().setShown(showWarning.isSelected());
+    }
+
+    /**
+     * Access to the Internet is granted.
+     */
+    public static final int    GRANTED = 0;
+
+    /**
+     * Access to the Internet is denied.
+     */
+    public static final int    DENIED  = 1;
+
+    /*
+     * The ActionFactory holding the actions used by this
+     * EditSite.
+     */
+    private transient ActionFactory actions;
+
+    /**
+     * The user's choice.
+     */
+    protected int choice;
+
+    /**
+     * The dialog box
+     */
+    protected JDialog dialog;
+
+    /**
+     * Bold font?
+     */
+    protected JCheckBox showWarning;
+
+    /**
+     * Serialization ID
+     */
+    private static final long serialVersionUID = 3978992071925250097L;
+}

Added: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InternetWarning.properties
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InternetWarning.properties	                        (rev 0)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InternetWarning.properties	2007-08-08 18:40:44 UTC (rev 1672)
@@ -0,0 +1,20 @@
+
+Yes.Enabled=true
+Yes.Name=Yes
+Yes.ShortDescription=
+Yes.LongDescription=
+Yes.SmallIcon=
+Yes.LargeIcon=
+Yes.MnemonicKey=Y
+Yes.AcceleratorKey=
+Yes.AcceleratorKey.Modifiers=
+
+No.Enabled=true
+No.Name=No
+No.ShortDescription=
+No.LongDescription=
+No.SmallIcon=
+No.LargeIcon=
+No.MnemonicKey=N
+No.AcceleratorKey=
+No.AcceleratorKey.Modifiers=

Added: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InternetWarning_fa.properties
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InternetWarning_fa.properties	                        (rev 0)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/InternetWarning_fa.properties	2007-08-08 18:40:44 UTC (rev 1672)
@@ -0,0 +1,5 @@
+Yes.Name=\u0628\u0644\u06D5
+Yes.MnemonicKey=
+
+No.Name=\u0631\u062F
+No.MnemonicKey=

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitePane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitePane.java	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitePane.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -66,6 +66,7 @@
 import org.crosswire.jsword.book.install.Installer;
 import org.crosswire.jsword.index.IndexManager;
 import org.crosswire.jsword.index.IndexManagerFactory;
+import org.crosswire.jsword.util.WebWarning;
 
 /**
  * A panel for use within a SitesPane to display one set of Books that are
@@ -108,8 +109,8 @@
         BookList bl = installer;
         if (bl == null)
         {
-            bl = Books.installed();
-            bl.addBooksListener(new CustomBooksListener());
+                bl = Books.installed();
+                bl.addBooksListener(new CustomBooksListener());
         }
 
         initialize(labelAcronymn, bl);
@@ -410,8 +411,17 @@
         {
             try
             {
-                installer.reloadBookList();
-                setTreeModel(installer);
+                int webAccess = InternetWarning.GRANTED;
+                if (WebWarning.instance().isShown())
+                {
+                    webAccess = InternetWarning.showDialog(this, "?"); //$NON-NLS-1$
+                }
+
+                if (webAccess == InternetWarning.GRANTED)
+                {
+                    installer.reloadBookList();
+                    setTreeModel(installer);
+                }
             }
             catch (InstallException ex)
             {
@@ -436,6 +446,17 @@
             return;
         }
 
+        int webAccess = InternetWarning.GRANTED;
+        if (WebWarning.instance().isShown())
+        {
+            webAccess = InternetWarning.showDialog(this, "?"); //$NON-NLS-1$
+        }
+
+        if (webAccess != InternetWarning.GRANTED)
+        {
+            return;
+        }
+
         Object last = path.getLastPathComponent();
         Book name = getBook(last);
 

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitesPane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitesPane.java	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitesPane.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -25,6 +25,7 @@
 import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.FlowLayout;
+import java.awt.Frame;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
 import java.io.IOException;
@@ -144,7 +145,9 @@
      */
     public void showInDialog(Component parent)
     {
-        dlgMain = new JDialog(JOptionPane.getFrameForComponent(parent));
+        Frame root = JOptionPane.getFrameForComponent(parent);
+        dlgMain = new JDialog(root);
+        dlgMain.setComponentOrientation(root.getComponentOrientation());
         dlgMain.setSize(new Dimension(750, 500));
         dlgMain.getContentPane().setLayout(new BorderLayout());
         dlgMain.getContentPane().add(this, BorderLayout.CENTER);

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SwordSiteEditor.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SwordSiteEditor.java	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SwordSiteEditor.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -39,7 +39,7 @@
  * 
  * @see gnu.gpl.License for license details.
  *      The copyright to this program is held by it's authors.
- * @author DM Smith [ dmsmith555 at yahoo dot com]
+ * @author DM Smith [dmsmith555 at yahoo dot com]
  */
 public class SwordSiteEditor extends JPanel implements SiteEditor
 {

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/AboutPane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/AboutPane.java	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/AboutPane.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -27,6 +27,7 @@
 import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.Font;
+import java.awt.Frame;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
 
@@ -179,7 +180,10 @@
      */
     public void showInDialog(Component parent)
     {
-        dlgMain = new JDialog(JOptionPane.getFrameForComponent(parent));
+        Frame root = JOptionPane.getFrameForComponent(parent);
+        dlgMain = new JDialog(root);
+        dlgMain.setComponentOrientation(root.getComponentOrientation());
+
         dlgMain.getContentPane().add(pnlMain);
         dlgMain.setTitle(Msg.getAboutInfo());
         dlgMain.setModal(true);

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/DesktopActions.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/DesktopActions.java	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/DesktopActions.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -33,6 +33,7 @@
 import javax.swing.ToolTipManager;
 
 import org.crosswire.bibledesktop.book.BibleViewPane;
+import org.crosswire.bibledesktop.book.install.InternetWarning;
 import org.crosswire.bibledesktop.book.install.SitesPane;
 import org.crosswire.bibledesktop.display.BookDataDisplay;
 import org.crosswire.bibledesktop.display.basic.SplitBookDataDisplay;
@@ -48,6 +49,7 @@
 import org.crosswire.jsword.passage.Key;
 import org.crosswire.jsword.passage.NoSuchVerseException;
 import org.crosswire.jsword.util.Project;
+import org.crosswire.jsword.util.WebWarning;
 
 /**
  * DesktopAction is nothing more than a holder of the behavior
@@ -118,7 +120,7 @@
     {
         if (sites == null)
         {
-            sites = new SitesPane();
+                sites = new SitesPane();
         }
         return sites;
     }
@@ -411,7 +413,16 @@
      */
     public void doBooks()
     {
-        getSites().showInDialog(getDesktop());
+        int webAccess = InternetWarning.GRANTED;
+        if (WebWarning.instance().isShown())
+        {
+            webAccess = InternetWarning.showDialog(desktop, "?"); //$NON-NLS-1$
+        }
+
+        if (webAccess == InternetWarning.GRANTED)
+        {
+            getSites().showInDialog(getDesktop());
+        }
     }
 
     /**

Modified: trunk/bibledesktop/src/main/resources/config.properties
===================================================================
--- trunk/bibledesktop/src/main/resources/config.properties	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/bibledesktop/src/main/resources/config.properties	2007-08-08 18:40:44 UTC (rev 1672)
@@ -77,6 +77,8 @@
 Application.MaxWidth.help=The maximum width you want the window to be
 Application.UIFont.name=General Font
 Application.UIFont.help=The font for the application (Requires restart)
+Application.WebWarning.name=Internet Warning
+Application.WebWarning.help=Internet Warning
 
 # The following are not for general use and are hidden from view
 BibleDisplay.CSSOverride.hidden=true

Modified: trunk/bibledesktop/src/main/resources/config.xml
===================================================================
--- trunk/bibledesktop/src/main/resources/config.xml	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/bibledesktop/src/main/resources/config.xml	2007-08-08 18:40:44 UTC (rev 1672)
@@ -223,6 +223,10 @@
     <introspect class="org.crosswire.common.swing.LookAndFeelUtil" property="Font"/>
   </option>
 
+  <option key="Application.WebWarning" type="boolean">
+    <introspect class="org.crosswire.jsword.util.WebWarning" property="WarningShown"/>
+  </option>
+
 <!-- This really only useful for developers -->
   <option key="Advanced.SourcePath" type="path">
     <introspect class="org.crosswire.common.swing.ExceptionPane" property="SourcePath"/>

Modified: trunk/bibledesktop/src/main/resources/config_de.properties
===================================================================
--- trunk/bibledesktop/src/main/resources/config_de.properties	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/bibledesktop/src/main/resources/config_de.properties	2007-08-08 18:40:44 UTC (rev 1672)
@@ -75,6 +75,8 @@
 Application.MaxWidth.help=The maximum width you want the window to be
 Application.UIFont.name=General Font
 Application.UIFont.help=The font for the application (Requires restart)
+Application.WebWarning.name=Internet Warning
+Application.WebWarning.help=Internet Warning
 
 # The following are not for general use and are hidden from view
 BibleDisplay.CSSOverride.name=CSS Override

Modified: trunk/bibledesktop/src/main/resources/config_fa.properties
===================================================================
--- trunk/bibledesktop/src/main/resources/config_fa.properties	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/bibledesktop/src/main/resources/config_fa.properties	2007-08-08 18:40:44 UTC (rev 1672)
@@ -80,6 +80,8 @@
 Application.MaxWidth.help=
 Application.UIFont.name=\u0641\u0648\u0646\u062A \u0639\u0645\u0648\u0645\u06CC
 Application.UIFont.help=\u0641\u0648\u0646\u062A \u0639\u0645\u0648\u0645\u06CC \u0628\u0631\u0646\u0627\u0645\u0647
+Application.WebWarning.name=\u0627\u062E\u0637\u0627\u0631 \u0627\u06CC\u0646\u062A\u0631\u0646\u062A
+Application.WebWarning.help=
 
 # The following are not for general use and are hidden from view
 #BibleDisplay.CSSOverride.name=CSS Override

Modified: trunk/bibledesktop/src/main/resources/config_fa.txt
===================================================================
--- trunk/bibledesktop/src/main/resources/config_fa.txt	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/bibledesktop/src/main/resources/config_fa.txt	2007-08-08 18:40:44 UTC (rev 1672)
@@ -80,6 +80,8 @@
 Application.MaxWidth.help=
 Application.UIFont.name=فونت عمومی
 Application.UIFont.help=فونت عمومی برنامه
+Application.WebWarning.name=اخطار اینترنت
+Application.WebWarning.help=
 
 # The following are not for general use and are hidden from view
 #BibleDisplay.CSSOverride.name=CSS Override

Modified: trunk/common/src/main/java/org/crosswire/common/util/Msg.java
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/util/Msg.java	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/common/src/main/java/org/crosswire/common/util/Msg.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -45,9 +45,6 @@
     static final Msg NOT_ASSIGNABLE = new Msg("ResourceUtil.NotAssignable"); //$NON-NLS-1$
     static final Msg MISSING_FILE = new Msg("WebResource.MissingFile"); //$NON-NLS-1$
     static final Msg UNEXPECTED_ERROR = new Msg("Reporter.Unexpected"); //$NON-NLS-1$
-    static final Msg INTERNET_WARNING = new Msg("Internet.Warning"); //$NON-NLS-1$
-    static final Msg INTERNET_SHOW_WARNING = new Msg("Internet.ShowWarning"); //$NON-NLS-1$
-    static final Msg INTERNET_SWITCH = new Msg("Internet.Switch"); //$NON-NLS-1$
 
     /**
      * Passthrough ctor

Modified: trunk/common/src/main/java/org/crosswire/common/util/Msg.properties
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/util/Msg.properties	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/common/src/main/java/org/crosswire/common/util/Msg.properties	2007-08-08 18:40:44 UTC (rev 1672)
@@ -19,10 +19,3 @@
 ResourceUtil.NotAssignable=Class {0} does not implement {1}
 WebResource.MissingFile=Unable to find: {0}
 Reporter.Unexpected=Unexpected internal problem. You may need to restart.
-
-# Peter, the following will go in a dialog box, with OK and Cancel.
-# and there will be a checkbox in front of the Internet.Show
-Internet.Warning=You are about to access the Internet. Are you sure you want to do this?
-Internet.ShowWarning=Show this warning every time the Internet is accessed.
-# This will be on the config screens. I'll move it to the right location later.
-Internet.Switch=Internet Warning

Modified: trunk/common/src/main/java/org/crosswire/common/util/Msg_fa.properties
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/util/Msg_fa.properties	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/common/src/main/java/org/crosswire/common/util/Msg_fa.properties	2007-08-08 18:40:44 UTC (rev 1672)
@@ -19,10 +19,3 @@
 ResourceUtil.NotAssignable=Class {0} does not implement {1}
 WebResource.MissingFile=Unable to find: {0}
 Reporter.Unexpected=Unexpected internal problem. You may need to restart.
-
-# Peter, the following will go in a dialog box, with OK and Cancel.
-# and there will be a checkbox in front of the Internet.Show
-Internet.Warning= \u0642\u0628\u0644 \u0627\u0632 \u062F\u0627\u0646\u0644\u0648\u062F \u062E\u0648\u0627\u0647\u0634 \u0645\u06CC\u06A9\u0646\u0645 \u0642\u0628\u0648\u0644 \u06A9\u0646\u06CC\u062F \u06A9\u0647 \u0628\u0627 \u0627\u06CC\u0646\u062A\u0631\u0646\u062A \u0648\u0632\u0644 \u0628\u0634\u0648\u06CC\u062F. .
-Internet.ShowWarning=\u0647\u0631 \u0648\u0642\u062A \u06A9\u0647 \u0628\u0647 \u0627\u06CC\u0646\u062A\u0631\u0646\u062A \u0648\u0632\u0644 \u0634\u0648\u06CC\u062F \u060C \u0627\u0632 \u0634\u0645\u0627 \u0633\u0627\u0639\u0644 \u06A9\u0646\u06CC\u0645\u061F 
-# This will be on the config screens. I'll move it to the right location later.
-Internet.Switch=\u0627\u062E\u0637\u0627\u0631 \u0627\u06CC\u0646\u062A\u0631\u0646\u062A

Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/AbstractConfigEditor.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/AbstractConfigEditor.java	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/AbstractConfigEditor.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -99,7 +99,9 @@
 
         if (dialog == null)
         {
-            dialog = new JDialog((JFrame) SwingUtilities.getRoot(parent));
+            Component root =  SwingUtilities.getRoot(parent);
+            dialog = new JDialog((JFrame) root);
+            dialog.setComponentOrientation(root.getComponentOrientation());
 
             dialog.getContentPane().add(this);
 

Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/WizardConfigEditor.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/WizardConfigEditor.java	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/WizardConfigEditor.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -259,7 +259,9 @@
      */
     public void showDialog(Component parent)
     {
-        dialog = new JDialog((JFrame) SwingUtilities.getRoot(parent));
+        Component root = SwingUtilities.getRoot(parent);
+        dialog = new JDialog((JFrame) root);
+        dialog.setComponentOrientation(root.getComponentOrientation());
         dialog.getRootPane().setDefaultButton(next);
         dialog.getContentPane().add(this);
         dialog.setTitle(config.getTitle());

Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/FontChooser.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/FontChooser.java	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/FontChooser.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -96,6 +96,7 @@
         add(size);
         add(bold);
         add(italic);
+        GuiUtil.applyDefaultOrientation(this);
     }
 
     /**
@@ -115,6 +116,8 @@
                       ? new JDialog((JFrame) root, title, true)
                       : new JDialog((JDialog) root, title, true);
 
+        fontc.dialog.setComponentOrientation(root.getComponentOrientation());
+
         fontc.name.setSelectedItem(initial != null ? initial : DEFAULT_FONT.getFont());
 
         buttons.setLayout(new FlowLayout());
@@ -146,6 +149,7 @@
         fontc.dialog.setSize(800, 500);
         fontc.dialog.pack();
         GuiUtil.centerWindow(fontc.dialog);
+        GuiUtil.applyDefaultOrientation(fontc.dialog);
         fontc.dialog.setVisible(true);
 
         // Why is this only available in Frames?

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg.java	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -29,10 +29,14 @@
  * @see gnu.lgpl.License for license details.
  *      The copyright to this program is held by it's authors.
  * @author Joe Walker [joe at eireneh dot com]
+ * @author DM Smith [dmsmith555 at yahoo dot com]
  */
 public final class Msg extends MsgBase
 {
-    static final Msg NO_CONVERTER = new Msg("ConverterFactory.NoConverter"); //$NON-NLS-1$
+    static final Msg NO_CONVERTER     = new Msg("ConverterFactory.NoConverter"); //$NON-NLS-1$
+    static final Msg WEB_WARNING      = new Msg("WebWarning.Warning");          //$NON-NLS-1$
+    static final Msg WEB_SHOW_WARNING = new Msg("WebWarning.ShowWarning");      //$NON-NLS-1$
+    static final Msg WEB_SWITCH       = new Msg("WebWarning.Switch");           //$NON-NLS-1$
 
     /**
      * Passthrough ctor

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg.properties
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg.properties	2007-08-08 11:37:04 UTC (rev 1671)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg.properties	2007-08-08 18:40:44 UTC (rev 1672)
@@ -5,4 +5,8 @@
 # The MessageName should be mixed case, with a leading capital.
 # It should have no spaces or other punctuation (e.g. _, -, ', ...)
 
+WebWarning.Warning=You are about to access the Internet. Are you sure you want to do this?
+WebWarning.ShowWarning=Show this warning every time the Internet is accessed.
+
+# The following would be an internal error
 ConverterFactory.NoConverter=No converter called: {0}

Added: trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg_de.properties
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg_de.properties	                        (rev 0)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg_de.properties	2007-08-08 18:40:44 UTC (rev 1672)
@@ -0,0 +1,12 @@
+# The naming convention for the keys in the file is ClassName.MessageName
+# Where ClassName is the name of the class using the property.
+# When the resource is used by more than one class it should be the one
+# that the resource is most closely associated.
+# The MessageName should be mixed case, with a leading capital.
+# It should have no spaces or other punctuation (e.g. _, -, ', ...)
+
+WebWarning.Warning=You are about to access the Internet. Are you sure you want to do this?
+WebWarning.ShowWarning=Show this warning every time the Internet is accessed.
+
+# The following would be an internal error
+ConverterFactory.NoConverter=No converter called: {0}

Added: trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg_fa.properties
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg_fa.properties	                        (rev 0)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/util/Msg_fa.properties	2007-08-08 18:40:44 UTC (rev 1672)
@@ -0,0 +1,12 @@
+# The naming convention for the keys in the file is ClassName.MessageName
+# Where ClassName is the name of the class using the property.
+# When the resource is used by more than one class it should be the one
+# that the resource is most closely associated.
+# The MessageName should be mixed case, with a leading capital.
+# It should have no spaces or other punctuation (e.g. _, -, ', ...)
+
+WebWarning.Warning= \u0642\u0628\u0644 \u0627\u0632 \u062F\u0627\u0646\u0644\u0648\u062F \u062E\u0648\u0627\u0647\u0634 \u0645\u06CC\u06A9\u0646\u0645 \u0642\u0628\u0648\u0644 \u06A9\u0646\u06CC\u062F \u06A9\u0647 \u0628\u0627 \u0627\u06CC\u0646\u062A\u0631\u0646\u062A \u0648\u0632\u0644 \u0628\u0634\u0648\u06CC\u062F. .
+WebWarning.ShowWarning=\u0647\u0631 \u0648\u0642\u062A \u06A9\u0647 \u0628\u0647 \u0627\u06CC\u0646\u062A\u0631\u0646\u062A \u0648\u0632\u0644 \u0634\u0648\u06CC\u062F \u060C \u0627\u0632 \u0634\u0645\u0627 \u0633\u0627\u0639\u0644 \u06A9\u0646\u06CC\u0645\u061F 
+
+# The following would be an internal error
+ConverterFactory.NoConverter=No converter called: {0}

Added: trunk/jsword/src/main/java/org/crosswire/jsword/util/WebWarning.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/util/WebWarning.java	                        (rev 0)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/util/WebWarning.java	2007-08-08 18:40:44 UTC (rev 1672)
@@ -0,0 +1,121 @@
+/**
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2007
+ *     The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: org.eclipse.jdt.ui.prefs 1178 2006-11-06 12:48:02Z dmsmith $
+ */
+package org.crosswire.jsword.util;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.Properties;
+
+import org.crosswire.common.util.NetUtil;
+
+/**
+ * Provide a configurable warning that the Internet is going to be accessed.
+ * This is important in places where Internet activity may be monitored and
+ * Christians may be persecuted.
+ * 
+ * @see gnu.lgpl.License for license details.<br>
+ *      The copyright to this program is held by it's authors.
+ * @author DM Smith [dmsmith555 at yahoo dot com]
+ */
+public class WebWarning
+{
+    /**
+     * This is a utility class, thus it's constructor is private.
+     */
+    private WebWarning()
+    {
+        try
+        {
+            URI inputURI = Project.instance().getWritablePropertiesURI(getClass().getName());
+            Properties props = NetUtil.loadProperties(inputURI);
+            shown = Boolean.valueOf(props.getProperty(SHOWN_KEY, Boolean.valueOf(DEFAULT_SHOWN).toString())).booleanValue();
+        }
+        catch (IOException e)
+        {
+            shown = DEFAULT_SHOWN;
+        }
+    }
+
+    /**
+     * All access to WebWarning is through this single instance.
+     * 
+     * @return the singleton instance
+     */
+    public static WebWarning instance()
+    {
+        return instance;
+    }
+
+  /**
+     * @param newShown Whether this WebWarning should be shown.
+     */
+    public void setShown(boolean newShown)
+    {
+        shown = newShown;
+    }
+
+    /**
+     * @return Whether this WebWarning should be shown.
+     */
+    public boolean isShown()
+    {
+        return shown;
+    }
+
+    /**
+     * @param newShown Whether this WebWarning should be shown.
+     */
+    public static void setWarningShown(boolean newShown)
+    {
+        WebWarning.instance().setShown(newShown);
+    }
+
+    /**
+     * @return Whether this WebWarning should be shown.
+     */
+    public static boolean isWarningShown()
+    {
+        return WebWarning.instance().isShown();
+    }
+
+    /**
+     * @return a warning that the Internet is about to be accessed
+     */
+    public String getWarning()
+    {
+        return Msg.WEB_WARNING.toString();
+    }
+
+    /**
+     * @return indicate that the warning will be shown again
+     */
+    public String getShownWarningLabel()
+    {
+        return Msg.WEB_SHOW_WARNING.toString();
+    }
+
+    private static WebWarning instance = new WebWarning();
+
+    private static final String  SHOWN_KEY     = "shown"; //$NON-NLS-1$
+    private static final boolean DEFAULT_SHOWN = true;
+    private boolean              shown;
+}




More information about the jsword-svn mailing list