From: <aki...@us...> - 2008-09-07 11:04:34
|
Revision: 5056 http://gridarta.svn.sourceforge.net/gridarta/?rev=5056&view=rev Author: akirschbaum Date: 2008-09-07 11:04:42 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Move DevPrefs to common code base; add 'Developers' pane to Crossfire's options dialog. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/action.properties trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties trunk/daimonin/src/daieditor/messages_fr.properties trunk/daimonin/src/daieditor/messages_sv.properties trunk/src/app/net/sf/gridarta/action.properties trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Added Paths: ----------- trunk/crossfire/resource/icons/development/Server24.gif trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java Removed Paths: ------------- trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/crossfire/ChangeLog 2008-09-07 11:04:42 UTC (rev 5056) @@ -1,3 +1,7 @@ +2008-09-07 Andreas Kirschbaum + + * Add options pane "Developers". + 2008-09-06 Andreas Kirschbaum * Hide system game object matchers from the GUI. Property changes on: trunk/crossfire/resource/icons/development/Server24.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:mergeinfo + Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-09-07 11:04:42 UTC (rev 5056) @@ -64,6 +64,7 @@ import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.objectchooser.DefaultObjectChooser; import net.sf.gridarta.gui.objectchooser.ObjectChooser; +import net.sf.gridarta.gui.prefs.DevPrefs; import net.sf.gridarta.gui.prefs.MapValidatorPrefs; import net.sf.gridarta.gui.prefs.MiscPrefs; import net.sf.gridarta.gui.prefs.UpdatePrefs; @@ -324,6 +325,7 @@ new ResPrefs((GlobalSettingsImpl) globalSettings), new GUIPrefs(), new MiscPrefs(), + new DevPrefs(), new UpdatePrefs(), new MapValidatorPrefs<GameObject, MapArchObject, Archetype>("cfeditor", validators, PREFS_VALIDATOR_AUTO_DEFAULT) ); // prefsGroup Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-09-07 11:04:42 UTC (rev 5056) @@ -30,7 +30,6 @@ import daieditor.gui.map.CMapViewBasic; import daieditor.gui.map.DefaultRendererFactory; import daieditor.gui.prefs.AppPrefs; -import daieditor.gui.prefs.DevPrefs; import daieditor.gui.prefs.GUIPrefs; import daieditor.gui.prefs.NetPrefs; import daieditor.gui.prefs.ResPrefs; @@ -70,6 +69,7 @@ import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.objectchooser.DefaultObjectChooser; import net.sf.gridarta.gui.objectchooser.ObjectChooser; +import net.sf.gridarta.gui.prefs.DevPrefs; import net.sf.gridarta.gui.prefs.MapValidatorPrefs; import net.sf.gridarta.gui.prefs.MiscPrefs; import net.sf.gridarta.gui.prefs.UpdatePrefs; Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/daimonin/src/daieditor/action.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -139,7 +139,6 @@ prefsApp.icon=development/Application24 -prefsDev.icon=development/Server24 prefsRes.icon=general/Save24 prefsGUI.icon=development/Host24 Deleted: trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java 2008-09-07 11:04:42 UTC (rev 5056) @@ -1,108 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package daieditor.gui.prefs; - -import java.awt.Component; -import java.util.prefs.Preferences; -import javax.swing.Box; -import javax.swing.JCheckBox; -import javax.swing.border.Border; -import javax.swing.border.CompoundBorder; -import javax.swing.border.TitledBorder; -import net.sf.gridarta.AbstractMainControl; -import net.sf.gridarta.MainControl; -import net.sf.gridarta.gui.GUIConstants; -import net.sf.japi.swing.ActionFactory; -import net.sf.japi.swing.prefs.AbstractPrefs; - -/** - * Preferences Module for developer preferences. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @serial exclude - */ -public final class DevPrefs extends AbstractPrefs { - - /** The serial version UID. */ - private static final long serialVersionUID = 1; - - /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); - - /** Preferences. */ - private static final Preferences PREFS = Preferences.userNodeForPackage(MainControl.class); - - /** Use Systme.exit() for exiting the program. */ - private JCheckBox systemExit; - - /** Create a DevPrefs pane. */ - public DevPrefs() { - setListLabelText(ACTION_FACTORY.getString("prefsDev.title")); - setListLabelIcon(ACTION_FACTORY.getIcon("prefsDev.icon")); - - add(createMiscPanel()); - add(Box.createVerticalGlue()); - } - - /** - * Create a titled border. - * @param titleKey Action Key for border title - * @return titled border - */ - private static Border createTitledBorder(final String titleKey) { - return new CompoundBorder(new TitledBorder(ACTION_FACTORY.getString(titleKey)), GUIConstants.DIALOG_BORDER); - } - - /** {@inheritDoc} */ - public void apply() { - PREFS.putBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, systemExit.isSelected()); - } - - /** {@inheritDoc} */ - public void revert() { - systemExit.setSelected(PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT)); - } - - /** {@inheritDoc} */ - public void defaults() { - systemExit.setSelected(true); - } - - /** {@inheritDoc} */ - public boolean isChanged() { - return !( - systemExit.isSelected() == PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT) - ); - } - - /** - * Creates the subpanel with the misc settings. - * @return subpanel - */ - private Component createMiscPanel() { - final Box miscPanel = Box.createVerticalBox(); - miscPanel.setBorder(createTitledBorder("optionsMisc")); - - systemExit = new JCheckBox(ACTION_FACTORY.createAction(false, "optionsSystemExit")); - systemExit.setSelected(PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT)); - miscPanel.add(systemExit); - return miscPanel; - } - -} // class DevPrefs Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/daimonin/src/daieditor/messages.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -84,8 +84,6 @@ optionsLoadArchColl.text=Load Arches from Collection optionsResMedia=Media optionsResMedia.shortdescription=<html>The media directory is for choosing background sounds for maps.<br>Please know that you cannot simply choose any media directory you want.<br>The background sound will only work if the files exist on the client as well.<br>Therefore, choosing a standard daimonin media directory is crucial.</html> -optionsSystemExit.text=Use System.exit() for exiting -optionsSystemExit.shortdescription=<html><strong>Developers</strong> should uncheck this and report when the application does not exit gracefully without using System.exit().</html> optionsApps=External Applications optionsAppServer=Server optionsAppClient=Client @@ -326,7 +324,6 @@ # Preference Modules prefsApp.title=External applications -prefsDev.title=Developers ################# Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/daimonin/src/daieditor/messages_de.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -84,8 +84,6 @@ optionsLoadArchColl.text=Vorbereitete Archetypen laden #optionsResMedia= #optionsResMedia.shortdescription= -#optionsSystemExit.text= -#optionsSystemExit.shortdescription= #optionsApps= #optionsAppServer= #optionsAppClient= @@ -294,7 +292,6 @@ # Preference Modules #prefsApp.title= -#prefsDev.title= ################# Modified: trunk/daimonin/src/daieditor/messages_fr.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_fr.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/daimonin/src/daieditor/messages_fr.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -85,8 +85,6 @@ #optionsLoadArchColl.text= #optionsResMedia= #optionsResMedia.shortdescription= -#optionsSystemExit.text= -#optionsSystemExit.shortdescription= #optionsApps= #optionsAppServer= #optionsAppClient= @@ -291,7 +289,6 @@ # Preference Modules #prefsApp.title= -#prefsDev.title= ################# Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -84,8 +84,6 @@ optionsLoadArchColl.text=L\xE4s arketyper fr\xE5n samling optionsResMedia=Media optionsResMedia.shortdescription=<html>Mediakatalogen anv\xE4nds f\xF6r att v\xE4lja bakgrundsljud till kartor.<br>Observera att det inte g\xE5r att v\xE4lja vilka filer som helst.<br>Bakgrundsljud fungerar enbart om filen finns i klienten ocks\xE5.<br>D\xE4rf\xF6r \xE4r det viktigt att v\xE4lja en Daimonin standardkatalog f\xF6r media.</html> -optionsSystemExit.text=Anv\xE4nd System.exit() f\xF6r avslutning -optionsSystemExit.shortdescription=<html><strong>Utvecklare</strong> b\xF6r avmarkera detta och rapportera n\xE4r applikationen inte avslutar korrekt utan att anv\xE4nda System.exit().</html> optionsApps=Externa applikationer optionsAppServer=Server optionsAppClient=Klient @@ -292,7 +290,6 @@ # Preference Modules prefsApp.title=Externa applikationer -prefsDev.title=Utvecklare ################# Modified: trunk/src/app/net/sf/gridarta/action.properties =================================================================== --- trunk/src/app/net/sf/gridarta/action.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/src/app/net/sf/gridarta/action.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -77,6 +77,7 @@ prefsMisc.icon=general/Preferences24 prefsMapValidator.icon=general/Search24 +prefsDev.icon=development/Server24 prefsUpdate.icon=general/Search24 mapTileRevert.icon=general/Undo16 Copied: trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java (from rev 5053, trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java 2008-09-07 11:04:42 UTC (rev 5056) @@ -0,0 +1,108 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.prefs; + +import java.awt.Component; +import java.util.prefs.Preferences; +import javax.swing.Box; +import javax.swing.JCheckBox; +import javax.swing.border.Border; +import javax.swing.border.CompoundBorder; +import javax.swing.border.TitledBorder; +import net.sf.gridarta.AbstractMainControl; +import net.sf.gridarta.MainControl; +import net.sf.gridarta.gui.GUIConstants; +import net.sf.japi.swing.ActionFactory; +import net.sf.japi.swing.prefs.AbstractPrefs; + +/** + * Preferences Module for developer preferences. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @serial exclude + */ +public final class DevPrefs extends AbstractPrefs { + + /** The serial version UID. */ + private static final long serialVersionUID = 1; + + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); + + /** Preferences. */ + private static final Preferences PREFS = Preferences.userNodeForPackage(MainControl.class); + + /** Use Systme.exit() for exiting the program. */ + private JCheckBox systemExit; + + /** Create a DevPrefs pane. */ + public DevPrefs() { + setListLabelText(ACTION_FACTORY.getString("prefsDev.title")); + setListLabelIcon(ACTION_FACTORY.getIcon("prefsDev.icon")); + + add(createMiscPanel()); + add(Box.createVerticalGlue()); + } + + /** + * Create a titled border. + * @param titleKey Action Key for border title + * @return titled border + */ + private static Border createTitledBorder(final String titleKey) { + return new CompoundBorder(new TitledBorder(ACTION_FACTORY.getString(titleKey)), GUIConstants.DIALOG_BORDER); + } + + /** {@inheritDoc} */ + public void apply() { + PREFS.putBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, systemExit.isSelected()); + } + + /** {@inheritDoc} */ + public void revert() { + systemExit.setSelected(PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT)); + } + + /** {@inheritDoc} */ + public void defaults() { + systemExit.setSelected(true); + } + + /** {@inheritDoc} */ + public boolean isChanged() { + return !( + systemExit.isSelected() == PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT) + ); + } + + /** + * Creates the subpanel with the misc settings. + * @return subpanel + */ + private Component createMiscPanel() { + final Box miscPanel = Box.createVerticalBox(); + miscPanel.setBorder(createTitledBorder("optionsMisc")); + + systemExit = new JCheckBox(ACTION_FACTORY.createAction(false, "optionsSystemExit")); + systemExit.setSelected(PREFS.getBoolean(AbstractMainControl.PREFS_SYSTEM_EXIT, AbstractMainControl.PREFS_SYSTEM_EXIT_DEFAULT)); + miscPanel.add(systemExit); + return miscPanel; + } + +} // class DevPrefs Property changes on: trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/src/app/net/sf/gridarta/messages.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -732,6 +732,7 @@ prefsRes.title=Paths & resources prefsGUI.title=Appearance +prefsDev.title=Developers prefsUpdate.title=Update autoUpdate.text=Automatically check for updates on startup? @@ -759,6 +760,8 @@ optionsRestart.title=Warning optionsRestart.message=Most options require restarting the editor to take effect. optionsLoadArchColl.text=Load Arches from Collection +optionsSystemExit.text=Use System.exit() for exiting +optionsSystemExit.shortdescription=<html><strong>Developers</strong> should uncheck this and report when the application does not exit gracefully without using System.exit().</html> arcDoc.htmlText=<html><head><meta name="Gridarta" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Functionality of {0}:</h3><p>{1}</p><h3 style="colour:navy;">Notes on Usage:</h3><p>{2}</p></body></html> Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -687,6 +687,7 @@ prefsRes.title=Pfade & Ressourcen prefsGUI.title=Aussehen +prefsDev.title=Entwickler prefsUpdate.title=Update autoUpdate.text=Beim Programmstart automatisch auf Updates pr\xFCfen? @@ -714,6 +715,8 @@ optionsRestart.title=Warnung optionsRestart.message=Viele Optionen erfordern einen Programmneustart, um effektiv zu werden. optionsLoadArchColl.text=Vorbereitete Archetypen laden +#optionsSystemExit.text= +#optionsSystemExit.shortdescription= arcDoc.htmlText=<html><head meta name="Gridarta" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Funktionalität von {0}:</h3><p>{1}</p><h3 style="colour:navy;">Nutzungshinweise:</h3><p>{2}</p></body></html> Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -686,6 +686,7 @@ #prefsRes.title= #prefsGUI.title= +#prefsDev.title= #prefsUpdate.title= #autoUpdate.text= @@ -713,6 +714,8 @@ #optionsRestart.title= #optionsRestart.message= #optionsLoadArchColl.text= +#optionsSystemExit.text= +#optionsSystemExit.shortdescription= arcDoc.htmlText=<html><head><meta name="Gridarta" contents="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Fonctionalit\xE9s de {0}</h3><p>{1}</p><h3 style="colour:navy;">Notes d'utilisation:</h3><p>{2}</p></body></html> Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2008-09-07 10:45:57 UTC (rev 5055) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2008-09-07 11:04:42 UTC (rev 5056) @@ -690,6 +690,7 @@ prefsRes.title=S\xF6kv\xE4gar och resurser prefsGUI.title=Utseende +prefsDev.title=Utvecklare prefsUpdate.title=Uppdatering autoUpdate.text=Automatiskt leta efter uppdateringar vid uppstart? @@ -717,6 +718,8 @@ optionsRestart.title=Varning optionsRestart.message=De flesta inst\xE4llningarna kr\xE4ver att editor startas om f\xF6r att g\xE4lla. optionsLoadArchColl.text=L\xE4s arketyper fr\xE5n samling +optionsSystemExit.text=Anv\xE4nd System.exit() f\xF6r avslutning +optionsSystemExit.shortdescription=<html><strong>Utvecklare</strong> b\xF6r avmarkera detta och rapportera n\xE4r applikationen inte avslutar korrekt utan att anv\xE4nda System.exit().</html> arcDoc.htmlText=<html><head name="Gridarta" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Funktionalitet f\xF6r {0}</h3><p>{1}</p><h3 style="colour:navy;">Tips f\xF6r anv\xE4ndning:</h3><p>{2}</p></body></html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |