Revision 249fbc5b
b/src/gr/grnet/pithos/web/client/FileUploadDialog.java | ||
---|---|---|
208 | 208 |
for (var j=0; j<files.length; j++) |
209 | 209 |
files[j].url = path + "/" + files[j].name; |
210 | 210 |
dlg.@gr.grnet.pithos.web.client.FileUploadDialog::setInProgress(Z)(true); |
211 |
up.start(); |
|
211 |
if (up.state == $wnd.plupload.STOPPED) |
|
212 |
up.start(); |
|
212 | 213 |
app.@gr.grnet.pithos.web.client.Pithos::showUploadIndicator()(); |
213 | 214 |
if (!dlg.@gr.grnet.pithos.web.client.FileUploadDialog::isVisible()()) |
214 |
app.@gr.grnet.pithos.web.client.Pithos::showUploadAlert(I)(files.length); |
|
215 |
app.@gr.grnet.pithos.web.client.Pithos::showUploadAlert(I)(up.files.length);
|
|
215 | 216 |
}, |
216 | 217 |
|
217 | 218 |
FilesRemoved: function(up, files) { |
b/src/gr/grnet/pithos/web/client/Pithos.java | ||
---|---|---|
1386 | 1386 |
} |
1387 | 1387 |
}-*/; |
1388 | 1388 |
|
1389 |
public void showUploadAlert(int numOfFiles) { |
|
1390 |
uploadAlert = new UploadAlert(this, numOfFiles); |
|
1391 |
uploadAlert.setPopupPositionAndShow(new PopupPanel.PositionCallback() { |
|
1392 |
|
|
1393 |
@Override |
|
1394 |
public void setPosition(int offsetWidth, int offsetHeight) { |
|
1395 |
uploadAlert.setPopupPosition((Window.getClientWidth() - offsetWidth)/2, Window.getClientHeight() - offsetHeight); |
|
1396 |
} |
|
1397 |
}); |
|
1389 |
public void showUploadAlert(int nOfFiles) { |
|
1390 |
if (uploadAlert == null) |
|
1391 |
uploadAlert = new UploadAlert(this, nOfFiles); |
|
1392 |
if (!uploadAlert.isShowing()) |
|
1393 |
uploadAlert.setPopupPositionAndShow(new PopupPanel.PositionCallback() { |
|
1394 |
|
|
1395 |
@Override |
|
1396 |
public void setPosition(int offsetWidth, int offsetHeight) { |
|
1397 |
uploadAlert.setPopupPosition((Window.getClientWidth() - offsetWidth)/2, Window.getClientHeight() - offsetHeight); |
|
1398 |
} |
|
1399 |
}); |
|
1400 |
else |
|
1401 |
uploadAlert.setNumOfFiles(nOfFiles); |
|
1398 | 1402 |
} |
1399 | 1403 |
|
1400 | 1404 |
public void hideUploadAlert() { |
b/src/gr/grnet/pithos/web/client/UploadAlert.java | ||
---|---|---|
47 | 47 |
*/ |
48 | 48 |
public class UploadAlert extends PopupPanel { |
49 | 49 |
|
50 |
private HTML label = new HTML(); |
|
51 |
|
|
50 | 52 |
/** |
51 | 53 |
* The widget's constructor. |
52 | 54 |
*/ |
53 |
public UploadAlert(final Pithos app, int numOfFiles) { |
|
55 |
public UploadAlert(final Pithos app, int _numOfFiles) {
|
|
54 | 56 |
// The popup's constructor's argument is a boolean specifying that it |
55 | 57 |
// auto-close itself when the user clicks outside of it. |
56 | 58 |
super(false); |
57 | 59 |
setAnimationEnabled(true); |
58 | 60 |
addStyleName(Pithos.resources.pithosCss().uploadAlert()); |
59 | 61 |
FlowPanel content = new FlowPanel(); |
60 |
String label = String.valueOf(numOfFiles) + " " + (numOfFiles > 1 ? "files are" : "file is") + " being uploaded";
|
|
61 |
content.add(new HTML(label));
|
|
62 |
setNumOfFiles(_numOfFiles);
|
|
63 |
content.add(label);
|
|
62 | 64 |
Anchor a = new Anchor("Click for details"); |
63 | 65 |
a.addStyleName(Pithos.resources.pithosCss().uploadAlertLink()); |
64 | 66 |
a.addClickHandler(new ClickHandler() { |
... | ... | |
99 | 101 |
|
100 | 102 |
add(content); |
101 | 103 |
} |
104 |
|
|
105 |
public void setNumOfFiles(int n) { |
|
106 |
label.setText(String.valueOf(n) + " " + (n > 1 ? "files are" : "file is") + " being uploaded"); |
|
107 |
} |
|
102 | 108 |
} |
Also available in: Unified diff