Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-03-14 21:08:40 +0000
committerslewis2008-03-14 21:08:40 +0000
commitbfbaa33348ef9c994112cc83109c1c32868c88df (patch)
tree42a9d021dffd169bfc9750dc089ab0a52680aca0
parent7decb5f4f7b60c7a8695f5af17655b434d5f2a35 (diff)
downloadorg.eclipse.ecf-bfbaa33348ef9c994112cc83109c1c32868c88df.tar.gz
org.eclipse.ecf-bfbaa33348ef9c994112cc83109c1c32868c88df.tar.xz
org.eclipse.ecf-bfbaa33348ef9c994112cc83109c1c32868c88df.zip
Fix for screen capture dialog image capture, sizing issues, and handling multiple simultaneous senders
-rw-r--r--framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/ShareReceiversECFStart.java2
-rw-r--r--framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/messages.properties2
-rw-r--r--framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/presence/collab/ui/screencapture/ScreenCaptureShare.java51
3 files changed, 33 insertions, 22 deletions
diff --git a/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/ShareReceiversECFStart.java b/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/ShareReceiversECFStart.java
index e95500685..a723c3d31 100644
--- a/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/ShareReceiversECFStart.java
+++ b/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/ShareReceiversECFStart.java
@@ -68,7 +68,7 @@ public class ShareReceiversECFStart implements IECFStart {
} catch (ECFException e) {
Activator.getDefault().getLog().log(new Status(IStatus.INFO, Activator.PLUGIN_ID, IStatus.INFO, NLS.bind(Messages.ShareReceiversECFStart_STATUS_SCREENCAPTURESHARE_NOT_CREATED, container.getID()), null));
}
- } else if (event instanceof IContainerDisconnectedEvent) {
+ } else if (event instanceof IContainerDisconnectedEvent || event instanceof IContainerEjectedEvent) {
// disconnected
URLShare.removeURLShare(containerID);
ViewShare.removeViewShare(containerID);
diff --git a/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/messages.properties b/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/messages.properties
index 0bbf02ebb..ce91994a8 100644
--- a/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/messages.properties
+++ b/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/messages.properties
@@ -22,7 +22,7 @@ ScreenCaptureShare_SCREEN_CAPTURE_RECEIVE_TITLE=Screen capture from {0}
ScreenCaptureShareRosterContributionItem_SCREENCAPTURESHARE_LISTENER_MENU_ADD_TEXT=Add Screen Capture Listener
ScreenCaptureShareRosterContributionItem_SCREENCAPTURESHARE_LISTENER_MENU_REMOVE_TEXT=Remove Screen Capture Listener
ScreenCaptureShareRosterEntryContributionItem_SCREEN_CAPTURE_MENU=Send Screen Capture
-ScreenCaptureShareRosterEntryContributionItem_SCREEN_CAPTURE_MESSAGEBOX_MESSAGE=To initiate screen capture, click on "Send", after that wait 5 seconds,\nand then select capture region with arrow cursor.
+ScreenCaptureShareRosterEntryContributionItem_SCREEN_CAPTURE_MESSAGEBOX_MESSAGE=To initiate screen capture, click on "Send", after that wait 5 seconds,\nand then select capture region with crosshair cursor.
ScreenCaptureShareRosterEntryContributionItem_SCREEN_CAPTURE_MESSAGEBOX_TITLE=Send Screen Capture Confirmation
ScreenCaptureShareRosterEntryContributionItem_VERIFY_CANCEL_BUTTON_TEXT=Cancel
ScreenCaptureShareRosterEntryContributionItem_VERIFY_SEND_BUTTON_TEXT=\ Send to {0}
diff --git a/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/presence/collab/ui/screencapture/ScreenCaptureShare.java b/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/presence/collab/ui/screencapture/ScreenCaptureShare.java
index 0ffacc017..c120a0ea5 100644
--- a/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/presence/collab/ui/screencapture/ScreenCaptureShare.java
+++ b/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/presence/collab/ui/screencapture/ScreenCaptureShare.java
@@ -12,17 +12,13 @@
package org.eclipse.ecf.presence.collab.ui.screencapture;
import java.io.ByteArrayOutputStream;
-import java.util.Hashtable;
-import java.util.Map;
-
+import java.util.*;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.util.ECFException;
import org.eclipse.ecf.datashare.IChannelContainerAdapter;
import org.eclipse.ecf.internal.presence.collab.ui.Messages;
import org.eclipse.ecf.presence.collab.ui.AbstractCollabShare;
-import org.eclipse.ecf.ui.screencapture.ImageWrapper;
-import org.eclipse.ecf.ui.screencapture.ScreenCaptureUtil;
-import org.eclipse.ecf.ui.screencapture.ShowImageShell;
+import org.eclipse.ecf.ui.screencapture.*;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
@@ -54,34 +50,49 @@ public class ScreenCaptureShare extends AbstractCollabShare {
super(adapter);
}
- ShowImageShell showImageShell = null;
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.datashare.AbstractShare#dispose()
+ */
+ public synchronized void dispose() {
+ super.dispose();
+ shells.clear();
+ }
+
+ Map shells = new HashMap();
protected void handleScreenCaptureStart(final ID id, final String fromUser, final ImageWrapper imageWrapper) {
- Display.getDefault().asyncExec(new Runnable() {
+ final Display defaultDisplay = Display.getDefault();
+ defaultDisplay.asyncExec(new Runnable() {
public void run() {
+ ShowImageShell showImageShell = (ShowImageShell) shells.get(id);
if (showImageShell == null) {
- showImageShell = new ShowImageShell(Display.getDefault(), id, imageWrapper, new DisposeListener() {
+ showImageShell = new ShowImageShell(defaultDisplay, id, new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
- showImageShell = null;
+ shells.remove(id);
}
});
- showImageShell.setText(NLS.bind(Messages.ScreenCaptureShare_SCREEN_CAPTURE_RECEIVE_TITLE, fromUser));
- showImageShell.open();
+ shells.put(id, showImageShell);
}
+ showImageShell.initialize(NLS.bind(Messages.ScreenCaptureShare_SCREEN_CAPTURE_RECEIVE_TITLE, fromUser), imageWrapper);
+ showImageShell.open();
}
});
}
protected void handleScreenCaptureData(final ID id, final byte[] data, final Boolean done) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (showImageShell != null && showImageShell.getSenderID().equals(id)) {
- showImageShell.addData(data);
- if (done.booleanValue())
- showImageShell.showImage();
- }
+ final ShowImageShell showImageShell = (ShowImageShell) shells.get(id);
+ if (showImageShell != null) {
+ final Display display = showImageShell.getDisplay();
+ if (display != null) {
+ display.asyncExec(new Runnable() {
+ public void run() {
+ showImageShell.addData(data);
+ if (done.booleanValue())
+ showImageShell.showImage();
+ }
+ });
}
- });
+ }
}
public void sendImage(final ID senderID, final String senderuser, final ID toID, ImageData imageData) {

Back to the top