LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File ini-file.patch of Package project-x (Project home:archie172)

From: moyekj@yahoo.com
References: http://code.google.com/p/kmttg/wiki/linux_installation

Adds a properties file with reasonable defaults.

--- X.ini	2012-12-31 14:42:33.000000000 -0600
+++ X.ini	2011-11-18 22:41:30.000000000 -0600
@@ -0,0 +1,22 @@
+# Project-X INI
+# ProjectX 0.91.0.00 / 31.03.2011
+
+# Application
+Application.Agreement=1
+Application.Language=en
+Application.LookAndFeel=javax.swing.plaf.metal.MetalLookAndFeel
+
+# CollectionPanel
+CollectionPanel.CutMode=0
+
+# LogwindowPanel
+LogwindowPanel.showTtxHeader=0
+
+# MainPanel
+MainPanel.ConversionMode=2
+
+# WindowPosition
+WindowPosition.Main.Height=632
+WindowPosition.Main.Width=852
+WindowPosition.Main.X=344
+WindowPosition.Main.Y=43
--- src/net/sourceforge/dvb/projectx/common/Settings.java.orig	2012-12-31 15:16:39.000000000 -0600
+++ src/net/sourceforge/dvb/projectx/common/Settings.java	2012-12-31 15:21:24.000000000 -0600
@@ -33,6 +33,7 @@
 import java.io.BufferedReader;
 import	java.io.ByteArrayOutputStream;
 import java.io.InputStreamReader;
+import java.io.File;
 import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -58,6 +59,12 @@
 	/** the default ini filename */
 	private static final String DEFAULT_INI = "X.ini";
 
+    /** the default ini pathname */
+    private static final String DEFAULT_INI_PATH = Resource.workdir + Resource.filesep + DEFAULT_INI;
+
+    /** the backup ini pathname */
+    private static final String BACKUP_INI_PATH = "/usr/share/project-x/" + DEFAULT_INI;
+
 	/** the current ini filename */
 	private String inifile = "";
 
@@ -75,7 +82,7 @@
 	 */
 	public Settings()
 	{
-		this(Resource.workdir + Resource.filesep + DEFAULT_INI);
+        this(new File(DEFAULT_INI_PATH).exists() ? DEFAULT_INI_PATH : BACKUP_INI_PATH);
 	}
 
 	/**