Author: nextgens
Date: 2007-03-30 00:04:10 +0000 (Fri, 30 Mar 2007)
New Revision: 12444
Modified:
trunk/apps/Thaw/src/thaw/core/MDNSDiscoveryPanel.java
Log:
Thaw: disable "background" actions on the config. page
Modified: trunk/apps/Thaw/src/thaw/core/MDNSDiscoveryPanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/MDNSDiscoveryPanel.java 2007-03-29
23:02:23 UTC (rev 12443)
+++ trunk/apps/Thaw/src/thaw/core/MDNSDiscoveryPanel.java 2007-03-30
00:04:10 UTC (rev 12444)
@@ -6,6 +6,8 @@
import javax.jmdns.ServiceInfo;
import javax.swing.DefaultListModel;
+
+import java.awt.Dialog;
import java.awt.GridLayout;
import java.awt.BorderLayout;
import javax.swing.JPanel;
@@ -40,6 +42,10 @@
*/
public class MDNSDiscoveryPanel extends JDialog implements ActionListener,
Runnable {
public interface MDNSDiscoveryPanelCallback {
+ /**
+ * Called upon exit from MDNSDiscoveryPanelCallback
+ * It runs on its own thread but still, don't abuse it :)
+ */
public void onMDNSDiscoverPanelClosure(boolean
hasBeenCancelled);
}
private static final long serialVersionUID = 1L;
@@ -50,6 +56,7 @@
private boolean cancelledByUser = false;
private ServiceInfo selectedValue;
private final MDNSDiscoveryPanelCallback cb;
+ private final Dialog owner;
private final JList list;
private final DefaultListModel listModel;
@@ -61,9 +68,10 @@
private JButton cancelButton;
- public MDNSDiscoveryPanel(java.awt.Dialog owner, Core core,
MDNSDiscoveryPanelCallback cb) {
+ public MDNSDiscoveryPanel(Dialog owner, Core core,
MDNSDiscoveryPanelCallback cb) {
super(owner, "ZeroConf");
this.core = core;
+ this.owner = owner;
this.cb = cb;
// The UI
@@ -122,6 +130,7 @@
public void run() {
super.setLocationRelativeTo(this.getParent());
this.setVisible(true);
+ owner.setEnabled(false);
Logger.notice(this, "Show the MDNSDiscoveryPanel");
Socket testSocket = null;
@@ -166,6 +175,7 @@
this.setVisible(false);
+ owner.setEnabled(true);
if (!cancelledByUser) {
Logger.debug(this, "We got something that looks valid
from the UI : let's propagate changes to the config");