chiark
/
gitweb
/
~yarrgweb
/
jarrg-ian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
threading fixes: be properly idempotent etc. about setup - comments and extra debug...
[jarrg-ian.git]
/
src
/
net
/
chiark
/
yarrg
/
MarketUploader.java
diff --git
a/src/net/chiark/yarrg/MarketUploader.java
b/src/net/chiark/yarrg/MarketUploader.java
index 864cf997d42fa6d481a00fe94377b39b29c236e7..a6df4975b34441a320301edb044553dae64d8789 100644
(file)
--- a/
src/net/chiark/yarrg/MarketUploader.java
+++ b/
src/net/chiark/yarrg/MarketUploader.java
@@
-276,11
+276,17
@@
public class MarketUploader implements Runnable, TopLevelWindowListener, GUIInit
EventQueue.invokeLater(this);
}
EventQueue.invokeLater(this);
}
+ /*
+ * We arrange to wait for the GUI to be initialised, then look at every top-level window,
+ * and if it
+ */
public void run() {
if (dtxt!=null) dtxt.println("MarketUploader run()...");
if (EventQueueMonitor.isGUIInitialized()) {
public void run() {
if (dtxt!=null) dtxt.println("MarketUploader run()...");
if (EventQueueMonitor.isGUIInitialized()) {
+ if (dtxt!=null) dtxt.println("MarketUploader GUI already ready");
guiInitialized();
} else {
guiInitialized();
} else {
+ if (dtxt!=null) dtxt.println("MarketUploader waiting for GUI");
EventQueueMonitor.addGUIInitializedListener(this);
}
}
EventQueueMonitor.addGUIInitializedListener(this);
}
}
@@
-288,19
+294,25
@@
public class MarketUploader implements Runnable, TopLevelWindowListener, GUIInit
public void guiInitialized() {
Window ws[]= EventQueueMonitor.getTopLevelWindows();
EventQueueMonitor.addTopLevelWindowListener(this);
public void guiInitialized() {
Window ws[]= EventQueueMonitor.getTopLevelWindows();
EventQueueMonitor.addTopLevelWindowListener(this);
- for (int i=0; i<ws.length; i++)
+ for (int i=0; i<ws.length; i++) {
+ if (dtxt!=null) dtxt.println("MarketUploader existing toplevel "+i);
topLevelWindowCreated(ws[i]);
topLevelWindowCreated(ws[i]);
+ }
}
}
- public void topLevelWindowDestroyed(Window w) {}
+ public void topLevelWindowDestroyed(Window w) {
+ if (dtxt!=null) dtxt.println("MarketUploader destroyed toplevel");
+ }
public void topLevelWindowCreated(Window w) {
if (frame!=null)
// already got it
return;
public void topLevelWindowCreated(Window w) {
if (frame!=null)
// already got it
return;
- if (!w.getAccessibleContext().getAccessibleName().equals("Puzzle Pirates"))
+ String name = w.getAccessibleContext().getAccessibleName();
+ if (dtxt!=null) dtxt.println("MarketUploader new toplevel "+name);
+ if (!name.equals("Puzzle Pirates"))
return;
return;
- // found it
+ if (dtxt!=null) dtxt.println("MarketUploader found toplevel, creating gui");
window = w;
createGUI();
frame.setVisible(true);
window = w;
createGUI();
frame.setVisible(true);