diff options
| author | Shireesh Anjal <shireesh@gluster.com> | 2011-05-11 16:26:51 +0530 |
|---|---|---|
| committer | Shireesh Anjal <shireesh@gluster.com> | 2011-05-11 16:26:51 +0530 |
| commit | e43ef5993f63a4caa3132468c0877a78341a436d (patch) | |
| tree | 43f5c7006d1c4a886850326dff9e8039d98aef62 /src | |
| parent | d5e67ff8fe7d042bd77f970efbb04495be1c378c (diff) | |
| parent | f0fa48ec79fde432cf06e212aedf5d638f01cf56 (diff) | |
Merge branch 'volume-logs'
Conflicts:
src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/DownloadVolumeLogsAction.java
Diffstat (limited to 'src')
| -rw-r--r-- | src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/DownloadVolumeLogsAction.java | 23 |
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); + } }); } } |
