[jsword-svn]
bibledesktop/java/main/org/crosswire/bibledesktop/desktop s
jswordcvs at crosswire.org
jswordcvs at crosswire.org
Wed Feb 16 20:40:21 MST 2005
Update of /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/desktop
In directory www.crosswire.org:/tmp/cvs-serv10130/java/main/org/crosswire/bibledesktop/desktop
Modified Files:
DesktopActions.java Msg.properties Msg.java Desktop.java
Log Message:
Fix for JS-9.
Index: Msg.properties
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/desktop/Msg.properties,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Msg.properties 8 Sep 2004 19:57:58 -0000 1.7
--- Msg.properties 17 Feb 2005 03:40:19 -0000 1.8
***************
*** 13,16 ****
--- 13,19 ----
Desktop.VersionAppTitle={0} v{1}
+ # Property used by desktop for autosaving the config file
+ Desktop.ConfigFileFailed=Could not save config file: {0}
+
# Properties used by Desktop for hyperlinks
Desktop.UnknownProtocol=Unknown protocol {0}
Index: Desktop.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/desktop/Desktop.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** Desktop.java 28 Nov 2004 21:36:04 -0000 1.33
--- Desktop.java 17 Feb 2005 03:40:19 -0000 1.34
***************
*** 7,10 ****
--- 7,11 ----
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
+ import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
***************
*** 53,56 ****
--- 54,58 ----
import org.crosswire.common.util.CWClassLoader;
import org.crosswire.common.util.Logger;
+ import org.crosswire.common.util.LucidRuntimeException;
import org.crosswire.common.util.Reporter;
import org.crosswire.common.util.ResourceUtil;
***************
*** 61,64 ****
--- 63,68 ----
import org.crosswire.jsword.book.BookMetaData;
import org.crosswire.jsword.book.Books;
+ import org.crosswire.jsword.book.BooksEvent;
+ import org.crosswire.jsword.book.BooksListener;
import org.crosswire.jsword.book.readings.ReadingsBookDriver;
import org.crosswire.jsword.passage.Key;
***************
*** 158,161 ****
--- 162,180 ----
generateConfig();
+ // Listen for book changes so that the Options can be kept current
+ BooksListener cbl = new BooksListener()
+ {
+ public void bookAdded(BooksEvent ev)
+ {
+ generateConfig();
+ }
+
+ public void bookRemoved(BooksEvent ev)
+ {
+ generateConfig();
+ }
+ };
+ Books.installed().addBooksListener(cbl);
+
// Make this be the root frame of optiondialogs
JOptionPane.setRootFrame(this);
***************
*** 536,540 ****
{
fillChoiceFactory();
-
config = new Config(Msg.CONFIG_TITLE.toString());
Document xmlconfig = null;
--- 555,558 ----
***************
*** 566,570 ****
}
! config.localToApplication(true);
}
--- 584,598 ----
}
! URL configUrl = Project.instance().getWritablePropertiesURL("desktop"); //$NON-NLS-1$
! try
! {
! config.localToApplication();
! config.localToPermanent(configUrl);
! }
! catch (IOException ex)
! {
! throw new LucidRuntimeException(Msg.CONFIG_SAVE_FAILED, ex, new Object[] { configUrl });
! }
!
}
Index: DesktopActions.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/desktop/DesktopActions.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** DesktopActions.java 15 Feb 2005 02:08:59 -0000 1.17
--- DesktopActions.java 17 Feb 2005 03:40:19 -0000 1.18
***************
*** 27,33 ****
import org.crosswire.jsword.book.BookData;
import org.crosswire.jsword.book.BookMetaData;
- import org.crosswire.jsword.book.Books;
- import org.crosswire.jsword.book.BooksEvent;
- import org.crosswire.jsword.book.BooksListener;
import org.crosswire.jsword.passage.Key;
import org.crosswire.jsword.util.ConverterFactory;
--- 27,30 ----
***************
*** 285,307 ****
try
{
- desktop.fillChoiceFactory();
- BooksListener cbl = new BooksListener()
- {
- public void bookAdded(BooksEvent ev)
- {
- desktop.refreshBooks();
- }
-
- public void bookRemoved(BooksEvent ev)
- {
- desktop.refreshBooks();
- }
- };
- Books.installed().addBooksListener(cbl);
-
URL configUrl = Project.instance().getWritablePropertiesURL("desktop"); //$NON-NLS-1$
ConfigEditorFactory.showDialog(desktop.getConfig(), desktop, configUrl);
-
- Books.installed().removeBooksListener(cbl);
}
catch (Exception ex)
--- 282,287 ----
Index: Msg.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/desktop/Msg.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Msg.java 8 Sep 2004 19:57:58 -0000 1.11
--- Msg.java 17 Feb 2005 03:40:19 -0000 1.12
***************
*** 37,40 ****
--- 37,43 ----
static final Msg VERSION_APP_TITLE = new Msg("Desktop.VersionAppTitle"); //$NON-NLS-1$
+ // Auto save of config failed
+ static final Msg CONFIG_SAVE_FAILED = new Msg("Desktop.ConfigSaveFailed"); //$NON-NLS-1$
+
// Strings for hyperlink urls
static final Msg UNKNOWN_PROTOCOL = new Msg("Desktop.UnknownProtocol"); //$NON-NLS-1$
More information about the jsword-svn
mailing list