summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Conway <mikeconway@Mike-Conways-MacBook-Pro.local>2011-07-15 13:23:09 (GMT)
committer Mike Conway <mikeconway@Mike-Conways-MacBook-Pro.local>2011-07-15 13:23:09 (GMT)
commitc5296be6cde4150ca4f408bff1862c76051d795a (patch)
tree77345a8f8e7df7a27f059fdd0b98f9a8c2a54725
parentd2fa8b007a7940ccca596efa30dcd226c41915d3 (diff)
downloadQCG-Data-c5296be6cde4150ca4f408bff1862c76051d795a.zip
QCG-Data-c5296be6cde4150ca4f408bff1862c76051d795a.tar.gz
QCG-Data-c5296be6cde4150ca4f408bff1862c76051d795a.tar.bz2
more tweaks to look and feel setting, now a saved config
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java9
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java32
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java1
-rw-r--r--idrop-swing/src/main/resources/idrop.properties2
5 files changed, 35 insertions, 11 deletions
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java
index 1fb084d..a0c33c6 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java
@@ -206,7 +206,7 @@ public class StartupSequencer {
Timer timer = new Timer();
timer.scheduleAtFixedRate(queueSchedulerTimerTask, 10000, 120000);
idropCore.setQueueTimer(timer);
- idrop.signalIdropCoreReadyAndSplashComplete();
+
} catch (IdropException ex) {
@@ -227,15 +227,12 @@ public class StartupSequencer {
++count);
String synchDeviceName = idropCore.getIdropConfig().getSynchDeviceName();
-
+ idrop.signalIdropCoreReadyAndSplashComplete();
if (synchDeviceName == null && idropCore.getIdropConfig().isShowStartupWizard()) {
log.info("first time running idrop, starting configuration wizard");
- // show idrop gui
-
log.info("showing gui first time run");
- idrop.showIdropGui();
-
doFirstTimeConfigurationWizard();
+ idrop.showIdropGui();
} else {
// see if I show the gui at startup or show a message
if (idropCore.getIdropConfig().isShowGuiAtStartup()) {
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
index fd2d374..9d82f6f 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
@@ -112,6 +112,7 @@
<ComponentRef name="buttonGroupLandF"/>
</Property>
<Property name="mnemonic" type="int" value="100"/>
+ <Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Default"/>
<Property name="toolTipText" type="java.lang.String" value="Default system look an dfeel"/>
</Properties>
@@ -125,7 +126,6 @@
<ComponentRef name="buttonGroupLandF"/>
</Property>
<Property name="mnemonic" type="int" value="110"/>
- <Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Nimbus"/>
<Property name="toolTipText" type="java.lang.String" value="Nimbus look and feel"/>
</Properties>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
index 611fb5b..397626e 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
@@ -55,6 +55,7 @@ import org.irods.jargon.core.pub.domain.DataObject;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
import org.irods.jargon.core.query.MetaDataAndDomainData.MetadataDomain;
import org.irods.jargon.core.transfer.TransferStatus;
+import org.irods.jargon.idrop.desktop.systraygui.services.IdropConfigurationService;
import org.irods.jargon.idrop.desktop.systraygui.utils.IDropUtils;
import org.irods.jargon.idrop.desktop.systraygui.utils.IconHelper;
import org.irods.jargon.idrop.desktop.systraygui.utils.LocalFileUtils;
@@ -118,7 +119,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
}
this.iDropCore = idropCore;
- setLookAndFeel("Nimbus");
+
}
/** Creates new form IDrop */
@@ -184,8 +185,14 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
buildIdropGuiComponents();
}
- setUpLocalFileSelectTree();
- buildTargetTree();
+
+ //buildTargetTree();
+ // setting look and feel will also trigger build of irods tree view
+ setLookAndFeel(iDropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.LOOK_AND_FEEL));
+ setUpLocalFileSelectTree();
+
+
+
togglePauseTransfer.setSelected(pausedItem.getState());
iDropCore.getIconManager().setRunningStatus(
iDropCore.getTransferManager().getRunningStatus());
@@ -203,6 +210,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
}
receivedStartupSignal = true;
+
+
iDropCore.getIconManager().setRunningStatus(
iDropCore.getTransferManager().getRunningStatus());
@@ -1879,6 +1888,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
buttonGroupLandF.add(jRadioButtonLookAndFeelDefault);
jRadioButtonLookAndFeelDefault.setMnemonic('d');
+ jRadioButtonLookAndFeelDefault.setSelected(true);
jRadioButtonLookAndFeelDefault.setText("Default");
jRadioButtonLookAndFeelDefault.setToolTipText("Default system look an dfeel");
jRadioButtonLookAndFeelDefault.addActionListener(new java.awt.event.ActionListener() {
@@ -1890,7 +1900,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
buttonGroupLandF.add(jRadioButtonLookAndFeelNimbus);
jRadioButtonLookAndFeelNimbus.setMnemonic('n');
- jRadioButtonLookAndFeelNimbus.setSelected(true);
jRadioButtonLookAndFeelNimbus.setText("Nimbus");
jRadioButtonLookAndFeelNimbus.setToolTipText("Nimbus look and feel");
jRadioButtonLookAndFeelNimbus.addActionListener(new java.awt.event.ActionListener() {
@@ -2603,20 +2612,35 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
private void setLookAndFeel(String lookAndFeelChoice) {
String lookAndFeel = "";
+ if (lookAndFeelChoice == null) {
+ lookAndFeelChoice="System";
+ }
+
if (lookAndFeelChoice != null) {
+ try {
+ iDropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.LOOK_AND_FEEL, lookAndFeelChoice);
+ } catch (IdropException ex) {
+ log.error("unable to update configration for look and feel");
+ throw new IdropRuntimeException("unable to set prop for look and feel", ex);
+ }
if (lookAndFeelChoice.equals("Metal")) {
lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName();
+ this.jRadioButtonMenuItemMetal.setSelected(true);
// an alternative way to set the Metal L&F is to replace the
// previous line with:
// lookAndFeel = "javax.swing.plaf.metal.MetalLookAndFeel";
} else if (lookAndFeelChoice.equals("System")) {
lookAndFeel = UIManager.getSystemLookAndFeelClassName();
+ this.jRadioButtonLookAndFeelDefault.setSelected(true);
} else if (lookAndFeelChoice.equals("Motif")) {
lookAndFeel = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
+ this.jRadioButtonMenuItemMotif.setSelected(true);
} else if (lookAndFeelChoice.equals("GTK")) {
lookAndFeel = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
+ this.jRadioButtonMenuItemGTK.setSelected(true);
} else if (lookAndFeelChoice.equals("Nimbus")) {
+ this.jRadioButtonLookAndFeelNimbus.setSelected(true);
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
lookAndFeel = info.getClassName();
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
index fa1d3bd..9a462d5 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
@@ -30,6 +30,7 @@ public interface IdropConfigurationService {
public static final String ACCOUNT_CACHE_USER_NAME = "irods.account.user";
public static final String ACCOUNT_CACHE_ROOT_DIR = "irods.account.root.dir";
public static final String POLICY_AWARE_PROPERTY = "policy.aware";
+ public static final String LOOK_AND_FEEL = "idrop.lookandfeel";
Properties bootstrapConfiguration() throws IdropException;
diff --git a/idrop-swing/src/main/resources/idrop.properties b/idrop-swing/src/main/resources/idrop.properties
index 674b76e..4b04a52 100644
--- a/idrop-swing/src/main/resources/idrop.properties
+++ b/idrop-swing/src/main/resources/idrop.properties
@@ -5,6 +5,8 @@ force.no.synch=false
advanced.view=true
show.startup=true
idrop.show.gui=true
+# swing look and feel (Nimbus, GTK, System, Metal, Motif)
+idrop.lookandfeel=System
transfer.database=transferDatabase
login.preset.host=diamond.ils.unc.edu
login.preset.zone=lifelibZone