Skip to content

Commit

Permalink
Merge "Add datetime postfix to default file name when showing save sc…
Browse files Browse the repository at this point in the history
…reen image dialog."
  • Loading branch information
ralf-at-android authored and Android Code Review committed Feb 16, 2011
2 parents 767915d + 14af6c2 commit fda24dc
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

import java.io.File;
import java.io.IOException;
import java.util.Calendar;


/**
Expand Down Expand Up @@ -282,10 +283,13 @@ private RawImage getDeviceImage() {
*/
private void saveImage(Shell shell) {
FileDialog dlg = new FileDialog(shell, SWT.SAVE);
String fileName;

Calendar now = Calendar.getInstance();
String fileName = String.format("device-%tF-%tH%tM%tS.png",
now, now, now, now);

dlg.setText("Save image...");
dlg.setFileName("device.png");
dlg.setFileName(fileName);

String lastDir = DdmUiPreferences.getStore().getString("lastImageSaveDir");
if (lastDir.length() == 0) {
Expand Down

0 comments on commit fda24dc

Please sign in to comment.