From 5e07f647fd361b8a082d053606dd9d132224606a Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 30 Jul 2008 02:56:13 +0000 Subject: Client: Automated BDB Environment placing Instead of requiring a script (or human intervention) to place BDB's Environment, it is instead initalized to a folder in the current user's home directory called ".instadisc". This way, not only can each user on a computer can use InstaDisc seperatly, this rids the need to provide command-line arguments to InstaDisc (with the exception of -r, for external invoking of retained requesting). --- .../com/fourisland/instadisc/FirstRun/Step2.java | 1 + .../instadisc/IDItemListCellRenderer.java | 7 ----- .../src/com/fourisland/instadisc/InstaDiscApp.java | 34 +++++++++------------- .../com/fourisland/instadisc/InstaDiscView.java | 2 +- 4 files changed, 15 insertions(+), 29 deletions(-) (limited to 'client/trunk/src/com/fourisland') diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java index dfbc89e..7affbae 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java @@ -175,6 +175,7 @@ public class Step2 extends javax.swing.JDialog { Wrapper.setConfig("password", md5.hash()); Wrapper.setConfig("centralServerURL", jTextField3.getText()); Wrapper.setConfig("itemsToHold", "10"); + Wrapper.setConfig("initCheck", "done"); StepEndResults.ok = true; this.setVisible(false); diff --git a/client/trunk/src/com/fourisland/instadisc/IDItemListCellRenderer.java b/client/trunk/src/com/fourisland/instadisc/IDItemListCellRenderer.java index 3d057e2..644217f 100644 --- a/client/trunk/src/com/fourisland/instadisc/IDItemListCellRenderer.java +++ b/client/trunk/src/com/fourisland/instadisc/IDItemListCellRenderer.java @@ -19,13 +19,6 @@ import javax.swing.ListCellRenderer; * @author hatkirby */ public class IDItemListCellRenderer extends JLabel implements ListCellRenderer { - - String base; - - public IDItemListCellRenderer(String base) - { - this.base = base; - } public Component getListCellRendererComponent(JList arg0, Object arg1, int arg2, boolean arg3, boolean arg4) { Item item = (Item) arg1; diff --git a/client/trunk/src/com/fourisland/instadisc/InstaDiscApp.java b/client/trunk/src/com/fourisland/instadisc/InstaDiscApp.java index 789dc75..cd3f1dd 100644 --- a/client/trunk/src/com/fourisland/instadisc/InstaDiscApp.java +++ b/client/trunk/src/com/fourisland/instadisc/InstaDiscApp.java @@ -13,8 +13,6 @@ import org.jdesktop.application.SingleFrameApplication; * The main class of the application. */ public class InstaDiscApp extends SingleFrameApplication { - - public static String base; /** * At startup create and show the main frame of the application. @@ -45,28 +43,22 @@ public class InstaDiscApp extends SingleFrameApplication { * Main method launching the application. */ public static void main(String[] args) { - if (args.length > 0) { - base = args[0]; - - File db = new File(args[0] + "db"); - if (!db.exists()) { - db.mkdir(); - } - - Wrapper.init(args[0]); - if (args.length > 1) { - if (args[1].equals("-r")) { - XmlRpc xmlrpc = new XmlRpc("requestRetained"); - xmlrpc.execute(); - } else if (args[1].equals("-n")) { - Thread th = new Thread(new FirstRunWizard()); - th.start(); - } + File db = new File(System.getProperty("user.home") + File.separator + ".instadisc"); + if (!db.exists()) { + db.mkdir(); + } + + Wrapper.init(db.getAbsolutePath()); + if (!Wrapper.getConfig("initCheck").equals("done")) { + Thread th = new Thread(new FirstRunWizard()); + th.start(); + } else { + if ((args.length > 0) && (args[0].equals("-r"))) { + XmlRpc xmlrpc = new XmlRpc("requestRetained"); + xmlrpc.execute(); } else { launch(InstaDiscApp.class, args); } - } else { - System.out.println("Oops, you seem to be running this application incorrectly. Try running it using the startup script provided."); } } } diff --git a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java index d2362dd..70be2c1 100644 --- a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java +++ b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java @@ -90,7 +90,7 @@ public class InstaDiscView extends FrameView { } }); - jList1.setCellRenderer(new IDItemListCellRenderer(InstaDiscApp.base)); + jList1.setCellRenderer(new IDItemListCellRenderer()); jList1.setModel(lm); refreshItemPane(); -- cgit 1.4.1