diff --git a/api/res/values/strings.xml b/api/res/values/strings.xml
index eb73c53de..5bc8ee5ae 100644
--- a/api/res/values/strings.xml
+++ b/api/res/values/strings.xml
@@ -189,6 +189,9 @@
Log In & Synchronize!
+
+ Logged in as:
+
Log Out
diff --git a/api/src/com/todoroo/astrid/sync/SyncProviderPreferences.java b/api/src/com/todoroo/astrid/sync/SyncProviderPreferences.java
index adae98072..7dabcedce 100644
--- a/api/src/com/todoroo/astrid/sync/SyncProviderPreferences.java
+++ b/api/src/com/todoroo/astrid/sync/SyncProviderPreferences.java
@@ -185,8 +185,12 @@ abstract public class SyncProviderPreferences extends TodorooPreferenceActivity
return true;
}
});
- if(!loggedIn)
+ if(!loggedIn) {
preference.setTitle(R.string.sync_SPr_sync_log_in);
+ preference.setSummary("");
+ }
+ else
+ preference.setSummary(r.getString(R.string.sync_SPr_logged_in_prefix) + " " + getUtilities().getLoggedInUserName());
}
// log out button
diff --git a/api/src/com/todoroo/astrid/sync/SyncProviderUtilities.java b/api/src/com/todoroo/astrid/sync/SyncProviderUtilities.java
index b6a020117..eaca9101d 100644
--- a/api/src/com/todoroo/astrid/sync/SyncProviderUtilities.java
+++ b/api/src/com/todoroo/astrid/sync/SyncProviderUtilities.java
@@ -51,6 +51,9 @@ abstract public class SyncProviderUtilities {
return getPrefs().getString(getIdentifier() + PREF_TOKEN, null);
}
+ /** Returns something like "Logged in as: user@gmail.com" */
+ abstract public String getLoggedInUserName();
+
/** Sets the authentication token. Set to null to clear. */
public void setToken(String setting) {
Editor editor = getPrefs().edit();
diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmPreferenceService.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmPreferenceService.java
index 256d22561..a4927e170 100644
--- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmPreferenceService.java
+++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmPreferenceService.java
@@ -111,4 +111,9 @@ public class ActFmPreferenceService extends SyncProviderUtilities {
return user;
}
+ @Override
+ public String getLoggedInUserName() {
+ return Preferences.getStringValue(PREF_NAME);
+ }
+
}
\ No newline at end of file
diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferenceService.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferenceService.java
index 0696c9961..9524ef459 100644
--- a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferenceService.java
+++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferenceService.java
@@ -48,4 +48,9 @@ public class GtasksPreferenceService extends SyncProviderUtilities {
/** Pref that is set once migration to new GTasks API has occurred */
public static final String PREF_MIGRATION_HAS_OCCURRED = IDENTIFIER + "_migrated"; //$NON-NLS-1$
+ @Override
+ public String getLoggedInUserName() {
+ return Preferences.getStringValue(PREF_USER_NAME);
+ }
+
}
diff --git a/astrid/plugin-src/com/todoroo/astrid/opencrx/OpencrxCoreUtils.java b/astrid/plugin-src/com/todoroo/astrid/opencrx/OpencrxCoreUtils.java
index 0d00b831f..8679aa44c 100644
--- a/astrid/plugin-src/com/todoroo/astrid/opencrx/OpencrxCoreUtils.java
+++ b/astrid/plugin-src/com/todoroo/astrid/opencrx/OpencrxCoreUtils.java
@@ -120,5 +120,8 @@ public class OpencrxCoreUtils extends SyncProviderUtilities{
return 0;
}
-
+ @Override
+ public String getLoggedInUserName() {
+ return "";
+ }
}
diff --git a/astrid/plugin-src/com/todoroo/astrid/producteev/ProducteevUtilities.java b/astrid/plugin-src/com/todoroo/astrid/producteev/ProducteevUtilities.java
index 4e83a77f7..d0bbfd1be 100644
--- a/astrid/plugin-src/com/todoroo/astrid/producteev/ProducteevUtilities.java
+++ b/astrid/plugin-src/com/todoroo/astrid/producteev/ProducteevUtilities.java
@@ -71,4 +71,9 @@ public class ProducteevUtilities extends SyncProviderUtilities {
// prevent instantiation
}
+ @Override
+ public String getLoggedInUserName() {
+ return Preferences.getStringValue(R.string.producteev_PPr_email);
+ }
+
}
\ No newline at end of file
diff --git a/astrid/res/xml/preferences_gtasks.xml b/astrid/res/xml/preferences_gtasks.xml
index 76ab5ab30..00ca30776 100644
--- a/astrid/res/xml/preferences_gtasks.xml
+++ b/astrid/res/xml/preferences_gtasks.xml
@@ -34,7 +34,8 @@
+ android:title="@string/sync_SPr_sync"
+ android:summary=""/>