More bug fixes to tag case migration--now includes upgrade message

pull/14/head
Sam Bosley 13 years ago
parent e065947528
commit 38577f9e55

@ -2,17 +2,14 @@ package com.todoroo.astrid.tags;
import java.util.HashMap;
import android.app.Activity;
import android.content.Context;
import com.timsu.astrid.R;
import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.Join;
import com.todoroo.andlib.sql.Query;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.data.Metadata;
import com.todoroo.astrid.data.TagData;
@ -27,6 +24,7 @@ public class TagCaseMigrator {
@Autowired TagDataService tagDataService;
@Autowired MetadataService metadataService;
public static final String PREF_SHOW_MIGRATION_ALERT = "tag_case_migration_alert"; //$NON-NLS-1$
private static final String PREF_CASE_MIGRATION_PERFORMED = "tag_case_migration"; //$NON-NLS-1$
public TagCaseMigrator() {
@ -59,9 +57,7 @@ public class TagCaseMigrator {
}
Preferences.setBoolean(PREF_CASE_MIGRATION_PERFORMED, true);
if (context instanceof Activity && shouldShowDialog) {
DialogUtilities.okDialog((Activity)context, context.getString(R.string.tag_case_migration_notice), null);
}
Preferences.setBoolean(PREF_SHOW_MIGRATION_ALERT, shouldShowDialog);
}
}

@ -82,8 +82,8 @@
<string name="TEA_tags_renamed">Renamed %1$s with %2$s for %3$d tasks</string>
<!-- Tag case migration -->
<string name="tag_case_migration_notice">Greetings!\n\nWe\'ve noticed that you have some lists that have the same name with different capitalizations. We think you may have intended them to
be the same list, so we\'ve combined the duplicates. Don\'t worry though: the original lists are simply renamed with numbers (e.g. Shopping_1, Shopping_2).\n\nIf you don\'t want this, you
can simply delete the new combined list.\n\nHave a nice day!\nAstrid</string>
<string name="tag_case_migration_notice">We\'ve noticed that you have some lists that have the same name with different capitalizations. We think you may have intended them to
be the same list, so we\'ve combined the duplicates. Don\'t worry though: the original lists are simply renamed with numbers (e.g. Shopping_1, Shopping_2). If you don\'t want this, you
can simply delete the new combined list!</string>
</resources>

@ -1,5 +1,7 @@
package com.todoroo.astrid.service;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import org.weloveastrid.rmilk.data.MilkNoteHelper;
@ -38,6 +40,7 @@ import com.todoroo.astrid.utility.AstridPreferences;
public final class UpgradeService {
public static final int V3_8_4 = 195;
public static final int V3_8_3_1 = 194;
public static final int V3_8_3 = 192;
public static final int V3_8_2 = 191;
@ -142,10 +145,24 @@ public final class UpgradeService {
if(!(context instanceof Activity) || from == 0)
return;
boolean showTagCaseMigration = Preferences.getBoolean(TagCaseMigrator.PREF_SHOW_MIGRATION_ALERT, false);
Preferences.clear(TagCaseMigrator.PREF_SHOW_MIGRATION_ALERT);
Preferences.clear(AstridPreferences.P_UPGRADE_FROM);
StringBuilder changeLog = new StringBuilder();
// current message
if (from >= V3_8_0 && from < V3_8_4) {
String[] base = new String[] {
"Bug fixes"
};
ArrayList<String> stringList = new ArrayList<String>();
Collections.addAll(stringList, base);
if (showTagCaseMigration)
stringList.add(0, context.getString(R.string.tag_case_migration_notice));
newVersionString(changeLog, "3.8.4 (9/20/11)", stringList.toArray(new String[stringList.size()]));
}
if (from >= V3_8_0 && from < V3_8_3_1) {
newVersionString(changeLog, "3.8.3.1 (9/06/11)", new String[] {
"A few bug fixes from the last version",

Loading…
Cancel
Save