aboutsummaryrefslogtreecommitdiffstats
path: root/ddms/libs
diff options
context:
space:
mode:
authorSebastian Roth <sebastian.roth@gmail.com>2012-04-06 15:24:05 +0800
committerSebastian Roth <sebastian.roth@gmail.com>2012-04-06 23:54:36 +0800
commit957eea5115b9f72508c33942dbf02f3a54de1a7f (patch)
treec0d5524cf62a669600266280042bdaca846d7025 /ddms/libs
parentec90c4583e232c660d7441f6c775542da6896037 (diff)
downloadsdk-957eea5115b9f72508c33942dbf02f3a54de1a7f.zip
sdk-957eea5115b9f72508c33942dbf02f3a54de1a7f.tar.gz
sdk-957eea5115b9f72508c33942dbf02f3a54de1a7f.tar.bz2
Ensure screenshots saved through DDMS end with .png.
This patch simply makes sure that the filename will have a .png extension when saving a screenshot through DDMS. Change-Id: Idb00259ac456fcaf11ee99736663fc7ddbbc505b Signed-off-by: Sebastian Roth <sebastian.roth@gmail.com>
Diffstat (limited to 'ddms/libs')
-rw-r--r--ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java
index d0c8a2f..b0f885a 100644
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java
+++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java
@@ -321,6 +321,10 @@ public class ScreenShotDialog extends Dialog {
// the value the dialog was initialized with. It does however return
// the full path as its return value, so just pick the path from
// there.
+ if (!fileName.endsWith(".png")) {
+ fileName = fileName + ".png";
+ }
+
String saveDir = new File(fileName).getParent();
if (saveDir != null) {
DdmUiPreferences.getStore().setValue("lastImageSaveDir", saveDir);