X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FStructureChooser.java;h=6eb8d10063d89fc4270ee6a0f54a3af8be29c1d4;hp=b32e43517e3d709bc58163b943c4f42fac81271f;hb=bb5d9c75833e2d0b9ef8f66b8fcd7d5649a3271f;hpb=89350c76ad3884aa1394952979998ea58902063c diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index b32e435..6eb8d10 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -43,6 +43,7 @@ import javax.swing.table.AbstractTableModel; import jalview.api.structures.JalviewStructureDisplayI; import jalview.bin.Cache; +import jalview.bin.Console; import jalview.bin.Jalview; import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; @@ -320,6 +321,7 @@ public class StructureChooser extends GStructureChooser @Override public void run() { + btn_queryTDB.setEnabled(false); populateSeqsWithoutSourceDBRef(); final int y = seqsWithoutSourceDBRef.size(); @@ -332,6 +334,7 @@ public class StructureChooser extends GStructureChooser { new jalview.ws.dbsources.Uniprot() }, null, false); dbRefFetcher.addListener(afterDbRefFetch); // ideally this would also gracefully run with callbacks + dbRefFetcher.fetchDBRefs(true); } else @@ -353,8 +356,10 @@ public class StructureChooser extends GStructureChooser } }; }; - if (ignoreGui || seqsWithoutSourceDBRef - .size() < THRESHOLD_WARN_UNIPROT_FETCH_NEEDED) + int threshold = Cache.getDefault("UNIPROT_AUTOFETCH_THRESHOLD", + THRESHOLD_WARN_UNIPROT_FETCH_NEEDED); + Console.debug("Using Uniprot fetch threshold of " + threshold); + if (ignoreGui || seqsWithoutSourceDBRef.size() < threshold) { Executors.defaultThreadFactory().newThread(discoverCanonicalDBrefs) .start(); @@ -362,7 +367,9 @@ public class StructureChooser extends GStructureChooser } // need cancel and no to result in the discoverPDB action - mocked is // 'cancel' TODO: mock should be OK - JvOptionPane.newOptionDialog(this) + + StructureChooser thisSC = this; + JvOptionPane.newOptionDialog(thisSC.getFrame()) .setResponseHandler(JvOptionPane.OK_OPTION, discoverCanonicalDBrefs) .setResponseHandler(JvOptionPane.CANCEL_OPTION, revertview) @@ -376,7 +383,7 @@ public class StructureChooser extends GStructureChooser null, new Object[] { MessageManager.getString("action.ok"), MessageManager.getString("action.cancel") }, - MessageManager.getString("action.ok")); + MessageManager.getString("action.ok"), false); } /**