Skip to content

Commit

Permalink
Merge branch 'master' of github.com:matburt/mobileorg-android
Browse files Browse the repository at this point in the history
* 'master' of github.com:matburt/mobileorg-android:
  Fixed issue #303 (SDCard sync uses parent of the selected folder)
  Fix for issue #306. (payload lost on screen orientation change)
  Fixed issue #307 (order of save/cancel in edit activity)
  Included entries that don't have TODO keywords on showTodo==true. (#305)
  • Loading branch information
matburt committed Dec 3, 2012
2 parents 86ac883 + 001e086 commit f07cc12
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
10 changes: 5 additions & 5 deletions res/menu/edit.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

<item
android:id="@+id/nodeedit_save"
android:icon="@drawable/ic_menu_save"
android:showAsAction="always"
android:title="Save"/>
<item
android:id="@+id/nodeedit_cancel"
android:icon="@drawable/ic_menu_close_clear_cancel"
android:showAsAction="always"
android:title="@string/menu_cancel"/>
<item
android:id="@+id/nodeedit_save"
android:icon="@drawable/ic_menu_save"
android:showAsAction="always"
android:title="Save"/>

</menu>
4 changes: 2 additions & 2 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@
<string name="preference_calendar_reminder_interval">Reminder interval</string>
<string name="preference_calendar_show_habits_summary">Shows habits in the calendar</string>
<string name="preference_calendar_show_habits">Show habits</string>
<string name="preference_calendar_show_done_summary">Show done items in the calendar</string>
<string name="preference_calendar_show_done">Show done</string>
<string name="preference_calendar_show_done_summary">Show items with done TODO keywords the calendar</string>
<string name="preference_calendar_show_done">Show done todos</string>
<string name="preference_theme_title">Theme</string>
<string name="preference_capture_advanced_title">Advanced capture</string>
<string name="preference_capture_advanced">Advanced capturing mechanism that allows capturing files under arbitrary headings.</string>
Expand Down
15 changes: 12 additions & 3 deletions src/com/matburt/mobileorg/Gui/Capture/PayloadFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

public class PayloadFragment extends ViewFragment {
private static final String PAYLOAD = "payload";
private static final String EDITING = "editing";

private RelativeLayout payloadView;
private EditText payloadEdit;
Expand Down Expand Up @@ -92,18 +93,26 @@ public void onActivityCreated(Bundle savedInstanceState) {
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);

if(this.payloadEdit.getVisibility() == View.VISIBLE)
boolean isEditing = this.payloadEdit.getVisibility() == View.VISIBLE;
outState.putBoolean(EDITING, isEditing);

if(isEditing)
outState.putString(PAYLOAD, this.payloadEdit.getText().toString());
else
outState.putString(PAYLOAD, this.payload.get());
}

public void restoreInstanceState(Bundle savedInstanceState) {
if(savedInstanceState != null) {
String payloadString = savedInstanceState.getString(PAYLOAD);
boolean isEditing = savedInstanceState.getBoolean(EDITING);

if(payloadString != null)
if(isEditing)
switchToEdit(payloadString);
else
else {
this.payload.set(payloadString);
switchToView();
}
}
}

Expand Down
8 changes: 7 additions & 1 deletion src/com/matburt/mobileorg/Services/CalendarSyncService.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class CalendarSyncService {
private boolean showDone = false;
private boolean showHabits = false;
private HashSet<String> activeTodos = new HashSet<String>();
private HashSet<String> allTodos = new HashSet<String>();

public CalendarSyncService(ContentResolver resolver, Context context) {
this.resolver = resolver;
Expand Down Expand Up @@ -74,6 +75,7 @@ private void refreshPreferences() {
"");
this.calendarId = getCalendarID(calendarName);
this.activeTodos = new HashSet<String>(OrgProviderUtils.getActiveTodos(resolver));
this.allTodos = new HashSet<String>(OrgProviderUtils.getTodos(resolver));
}

public void syncFiles() {
Expand Down Expand Up @@ -178,7 +180,11 @@ private void insertFileEntries(String filename) throws IllegalArgumentException

private void insertNode(OrgNode node, String filename)
throws IllegalArgumentException {
boolean isActive = this.activeTodos.contains(node.todo);
boolean isActive = true;

if(allTodos.contains(node.todo))
isActive = this.activeTodos.contains(node.todo);

String cleanedName = node.getCleanedName();

for (OrgNodeDate date : node.getOrgNodePayload().getDates()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public SDCardSynchronizer(Context context) {
this.remoteIndexPath = PreferenceManager.getDefaultSharedPreferences(
context).getString("indexFilePath", "");

this.remotePath = new File(remoteIndexPath).getParent() + "/";
this.remotePath = new File(remoteIndexPath) + "/";
}


Expand Down

0 comments on commit f07cc12

Please sign in to comment.