From: <al...@us...> - 2009-01-15 15:11:42
|
Revision: 1962 http://omegat.svn.sourceforge.net/omegat/?rev=1962&view=rev Author: alex73 Date: 2009-01-15 15:11:36 +0000 (Thu, 15 Jan 2009) Log Message: ----------- Fix 'config-dir' parameter usage Modified Paths: -------------- trunk/src/org/omegat/Main.java trunk/src/org/omegat/gui/main/ConsoleWindow.java trunk/src/org/omegat/util/Preferences.java trunk/src/org/omegat/util/StaticUtils.java Added Paths: ----------- trunk/src/org/omegat/util/RuntimePreferences.java Modified: trunk/src/org/omegat/Main.java =================================================================== --- trunk/src/org/omegat/Main.java 2009-01-14 15:22:54 UTC (rev 1961) +++ trunk/src/org/omegat/Main.java 2009-01-15 15:11:36 UTC (rev 1962) @@ -38,8 +38,8 @@ import org.omegat.core.data.RealProject; import org.omegat.util.Log; import org.omegat.util.OStrings; -import org.omegat.util.Preferences; import org.omegat.util.ProjectFileStorage; +import org.omegat.util.RuntimePreferences; import com.vlsolutions.swing.docking.DockingDesktop; @@ -71,9 +71,9 @@ projectLocation = arg.substring(8); runMode = RUN_MODE.CONSOLE_TRANSLATE; } else if (arg.startsWith("config-dir=")) { - Preferences.setConfigDir(arg.substring(11)); + RuntimePreferences.setConfigDir(arg.substring(12)); } else if (arg.startsWith("-quiet")) { - Preferences.setQuietMode(true); + RuntimePreferences.setQuietMode(true); } } Modified: trunk/src/org/omegat/gui/main/ConsoleWindow.java =================================================================== --- trunk/src/org/omegat/gui/main/ConsoleWindow.java 2009-01-14 15:22:54 UTC (rev 1961) +++ trunk/src/org/omegat/gui/main/ConsoleWindow.java 2009-01-15 15:11:36 UTC (rev 1962) @@ -29,7 +29,7 @@ import javax.swing.JFrame; import org.omegat.util.OStrings; -import org.omegat.util.Preferences; +import org.omegat.util.RuntimePreferences; import org.omegat.util.StaticUtils; import com.vlsolutions.swing.docking.Dockable; @@ -66,7 +66,7 @@ * Nothing is shown in quiet mode. */ public void showStatusMessageRB(String messageKey, Object... params) { - if (Preferences.isQuietMode()) return; + if (RuntimePreferences.isQuietMode()) return; final String msg; if (messageKey == null) { Modified: trunk/src/org/omegat/util/Preferences.java =================================================================== --- trunk/src/org/omegat/util/Preferences.java 2009-01-14 15:22:54 UTC (rev 1961) +++ trunk/src/org/omegat/util/Preferences.java 2009-01-15 15:11:36 UTC (rev 1962) @@ -441,25 +441,6 @@ // use array lists for orderly recovery of it for saving to disk private static List<String> m_nameList; private static List<String> m_valList; - private static Map<String,Integer> m_preferenceMap; - - /** Quiet mode. */ - private static boolean quietMode; - public static boolean isQuietMode() { - return quietMode; - } - public static void setQuietMode(boolean v) { - quietMode = v; - } - - /** Force use specified config dir. */ - private static String configDir; - public static String getConfigDir() { - return configDir; - } - public static void setConfigDir(String configDir) { - Preferences.configDir = configDir; - } - + private static Map<String,Integer> m_preferenceMap; } Added: trunk/src/org/omegat/util/RuntimePreferences.java =================================================================== --- trunk/src/org/omegat/util/RuntimePreferences.java (rev 0) +++ trunk/src/org/omegat/util/RuntimePreferences.java 2009-01-15 15:11:36 UTC (rev 1962) @@ -0,0 +1,56 @@ +/************************************************************************** + OmegaT - Computer Assisted Translation (CAT) tool + with fuzzy matching, translation memory, keyword search, + glossaries, and translation leveraging into updated projects. + + Copyright (C) 2008 Alex Buloichik + Home page: http://www.omegat.org/ + Support center: http://groups.yahoo.com/group/OmegaT/ + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + **************************************************************************/ + +package org.omegat.util; + +/** + * Class for store runtime-only preferences, which shouldn't be saved to config + * dir. + * + * @author Alex Buloichik <ale...@gm...> + */ +public class RuntimePreferences { + + /** Quiet mode. */ + private static boolean quietMode; + + /** Force use specified config dir. */ + private static String configDir; + + public static boolean isQuietMode() { + return quietMode; + } + + public static void setQuietMode(boolean v) { + quietMode = v; + } + + public static String getConfigDir() { + return configDir; + } + + public static void setConfigDir(String v) { + configDir = v; + } +} Property changes on: trunk/src/org/omegat/util/RuntimePreferences.java ___________________________________________________________________ Added: svn:mime-type + text/x-java Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/src/org/omegat/util/StaticUtils.java =================================================================== --- trunk/src/org/omegat/util/StaticUtils.java 2009-01-14 15:22:54 UTC (rev 1961) +++ trunk/src/org/omegat/util/StaticUtils.java 2009-01-15 15:11:36 UTC (rev 1962) @@ -378,7 +378,7 @@ if (m_configDir != null) return m_configDir; - String cd = Preferences.getConfigDir(); + String cd = RuntimePreferences.getConfigDir(); if (cd != null) { // use the forced specified directory m_configDir = new File(cd).getAbsolutePath() + File.separator; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |