summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDhandapani <dhandapani@gluster.com>2011-05-13 14:21:44 +0530
committerDhandapani <dhandapani@gluster.com>2011-05-13 14:21:44 +0530
commit4829b2a9aff7537dc6b2b6bea76b70c20cde53b0 (patch)
treebf648cf61b34443aee3eaa5edc42ee9860abb30b /src
parent182879f6050cf88ab4651d604cab9412fad30436 (diff)
parente43ef5993f63a4caa3132468c0877a78341a436d (diff)
Merge commit 'upstream/master'
Diffstat (limited to 'src')
-rw-r--r--src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/DownloadVolumeLogsAction.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/DownloadVolumeLogsAction.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/DownloadVolumeLogsAction.java
index 88bbdf46..9a75355f 100644
--- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/DownloadVolumeLogsAction.java
+++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/DownloadVolumeLogsAction.java
@@ -22,6 +22,7 @@ import java.io.File;
import org.eclipse.jface.action.IAction;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
@@ -51,21 +52,35 @@ public class DownloadVolumeLogsAction extends AbstractActionDelegate {
final Volume volume = (Volume)selectedEntity;
final VolumesClient client = new VolumesClient(GlusterDataModelManager.getInstance().getSecurityToken());
- Display.getDefault().asyncExec(new Runnable() {
+ final Runnable downloadLogsThread = new Runnable() {
@Override
public void run() {
FileDialog dialog = new FileDialog(getShell(), SWT.SAVE);
- dialog.setFilterNames(new String[] {"GZipped Tar"});
+ dialog.setFilterNames(new String[] {"GZipped Tar (*.tar.gz)"});
dialog.setFilterExtensions(new String[] {"*.tar.gz"});
dialog.open();
+ String title = "Download Volume Logs [" + volume.getName() + "]";
+ String filePath = dialog.getFilterPath() + File.separator + dialog.getFileName();
+ if(!filePath.endsWith(".tar.gz")) {
+ filePath += ".tar.gz";
+ }
try {
- client.downloadLogs(volume.getName(), dialog.getFilterPath() + File.separator + dialog.getFileName());
+ client.downloadLogs(volume.getName(), filePath);
+ showInfoDialog(title, "Volume logs downloaded successfully to [" + filePath + "]");
} catch(Exception e) {
- showErrorDialog("Download Volume Logs [" + volume.getName() + "]", e.getMessage());
+ showErrorDialog(title, e.getMessage());
}
}
+ };
+
+ BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
+
+ @Override
+ public void run() {
+ Display.getDefault().asyncExec(downloadLogsThread);
+ }
});
}
}