From ec7f13dae12a4b1ddfd3ab8c21550b617b941a40 Mon Sep 17 00:00:00 2001 From: Siva Velusamy Date: Thu, 11 Aug 2011 17:37:04 -0700 Subject: 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 --- ddms/app/src/com/android/ddms/PrefsDialog.java | 35 ++++++++++++++++---------- ddms/app/src/com/android/ddms/UIThread.java | 2 +- 2 files changed, 23 insertions(+), 14 deletions(-) (limited to 'ddms/app') 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; } -- cgit v1.1