aboutsummaryrefslogtreecommitdiffstats
path: root/ddms/app
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2011-08-11 17:37:04 -0700
committerSiva Velusamy <vsiva@google.com>2011-08-11 17:45:16 -0700
commitec7f13dae12a4b1ddfd3ab8c21550b617b941a40 (patch)
tree4d77c37315b524c69150c0b5ffdb300bcb00fd31 /ddms/app
parentc9bd041b91bc4aa621ec82e2babe6a2b7e942bb6 (diff)
downloadsdk-ec7f13dae12a4b1ddfd3ab8c21550b617b941a40.zip
sdk-ec7f13dae12a4b1ddfd3ab8c21550b617b941a40.tar.gz
sdk-ec7f13dae12a4b1ddfd3ab8c21550b617b941a40.tar.bz2
Use fonts as specified in preferences.
Update DDMS preference dialog to show only font preference when using the new logcat view. The font preference key is obtained from LogCatPanel in the new view so that the Eclipse ddms plugin can also reuse most of the code. Change-Id: I61afba27cde45ff8214e83b6fadfe488f6c954bb
Diffstat (limited to 'ddms/app')
-rw-r--r--ddms/app/src/com/android/ddms/PrefsDialog.java35
-rw-r--r--ddms/app/src/com/android/ddms/UIThread.java2
2 files changed, 23 insertions, 14 deletions
diff --git a/ddms/app/src/com/android/ddms/PrefsDialog.java b/ddms/app/src/com/android/ddms/PrefsDialog.java
index da31a3b..e34a63f 100644
--- a/ddms/app/src/com/android/ddms/PrefsDialog.java
+++ b/ddms/app/src/com/android/ddms/PrefsDialog.java
@@ -23,6 +23,7 @@ import com.android.ddmlib.Log;
import com.android.ddmlib.Log.LogLevel;
import com.android.ddmuilib.DdmUiPreferences;
import com.android.ddmuilib.PortFieldEditor;
+import com.android.ddmuilib.logcat.LogCatPanel;
import com.android.sdkstats.SdkStatsService;
import org.eclipse.jface.preference.BooleanFieldEditor;
@@ -424,19 +425,27 @@ public final class PrefsDialog {
*/
@Override
protected void createFieldEditors() {
- RadioGroupFieldEditor rgfe;
-
- rgfe = new RadioGroupFieldEditor(PrefsDialog.LOGCAT_COLUMN_MODE,
- "Message Column Resizing Mode", 1, new String[][] {
- { "Manual", PrefsDialog.LOGCAT_COLUMN_MODE_MANUAL },
- { "Automatic", PrefsDialog.LOGCAT_COLUMN_MODE_AUTO },
- },
- getFieldEditorParent(), true);
- addField(rgfe);
-
- FontFieldEditor ffe = new FontFieldEditor(PrefsDialog.LOGCAT_FONT, "Text output font:",
- getFieldEditorParent());
- addField(ffe);
+ if (UIThread.useOldLogCatView()) {
+ RadioGroupFieldEditor rgfe;
+
+ rgfe = new RadioGroupFieldEditor(PrefsDialog.LOGCAT_COLUMN_MODE,
+ "Message Column Resizing Mode", 1, new String[][] {
+ { "Manual", PrefsDialog.LOGCAT_COLUMN_MODE_MANUAL },
+ { "Automatic", PrefsDialog.LOGCAT_COLUMN_MODE_AUTO },
+ },
+ getFieldEditorParent(), true);
+ addField(rgfe);
+
+ FontFieldEditor ffe = new FontFieldEditor(PrefsDialog.LOGCAT_FONT,
+ "Text output font:",
+ getFieldEditorParent());
+ addField(ffe);
+ } else {
+ FontFieldEditor ffe = new FontFieldEditor(LogCatPanel.LOGCAT_VIEW_FONT_PREFKEY,
+ "Text output font:",
+ getFieldEditorParent());
+ addField(ffe);
+ }
}
}
diff --git a/ddms/app/src/com/android/ddms/UIThread.java b/ddms/app/src/com/android/ddms/UIThread.java
index 0149739..5506428 100644
--- a/ddms/app/src/com/android/ddms/UIThread.java
+++ b/ddms/app/src/com/android/ddms/UIThread.java
@@ -230,7 +230,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
*/
private static final String USE_NEW_LOGCAT_VIEW =
System.getenv("ANDROID_USE_NEW_LOGCAT_VIEW");
- private boolean useOldLogCatView() {
+ public static boolean useOldLogCatView() {
return USE_NEW_LOGCAT_VIEW == null;
}