Fixed some control set bugs and display issues

pull/14/head
Sam Bosley 13 years ago
parent 2d67c23b9e
commit 13a3a64755

@ -220,19 +220,14 @@ public final class TagsControlSet extends PopupControlSet {
}
@Override
protected void readFromTaskPrivate() {
newTags.removeAllViews();
for (int i = 0; i < selectedTags.getCount(); i++) { // clear all selected items
selectedTags.setItemChecked(i, false);
}
public void readFromTask(Task task) {
super.readFromTask(task);
if(model.getId() != AbstractModel.NO_ID) {
TodorooCursor<Metadata> cursor = tagService.getTags(model.getId());
LinkedHashSet<String> tags = new LinkedHashSet<String>(cursor.getCount());
try {
for(cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
String tag = cursor.get(TagService.TAG);
setTagSelected(tag);
tags.add(tag);
}
} finally {
@ -240,11 +235,32 @@ public final class TagsControlSet extends PopupControlSet {
}
model.putTransitory("tags", tags); //$NON-NLS-1$
}
}
@Override
protected void readFromTaskPrivate() {
newTags.removeAllViews();
for (int i = 0; i < selectedTags.getCount(); i++) { // clear all selected items
selectedTags.setItemChecked(i, false);
}
if(model.getId() != AbstractModel.NO_ID) {
selectTagsFromModel();
}
addTag("", false); //$NON-NLS-1$
refreshDisplayView();
populated = true;
}
private void selectTagsFromModel() {
LinkedHashSet<String> tags = (LinkedHashSet<String>) model.getTransitory("tags");
if (tags != null) {
for (String tag : tags) {
setTagSelected(tag);
}
}
}
@Override
protected void afterInflate() {
Tag[] allTags = getTagArray();

@ -89,7 +89,7 @@ public class DeadlineControlSet extends PopupControlSet {
}
public boolean isDeadlineSet() {
return dateAndTimePicker.constructDueDate() != 0;
return (dateAndTimePicker != null && dateAndTimePicker.constructDueDate() != 0);
}
/**

@ -168,7 +168,9 @@ public class HideUntilControlSet extends PopupControlSet implements OnItemSelect
public void setDefaults() {
int setting = Preferences.getIntegerFromString(R.string.p_default_hideUntil_key,
Task.HIDE_UNTIL_NONE);
spinner.setSelection(setting);
selection = setting;
if (spinner != null)
spinner.setSelection(selection);
refreshDisplayView();
}

Loading…
Cancel
Save