Skip to content

Commit

Permalink
todo.txt: Insert new task start date generally if Auto-Format is enab…
Browse files Browse the repository at this point in the history
…led, remove special settings option, by @gsantner, closes #1592
  • Loading branch information
gsantner committed Feb 20, 2022
1 parent 1a1bdb5 commit 0b48c2a
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public Boolean onPreferenceClicked(Preference preference, String key, int keyId)
case R.string.pref_key__share_into__todo: {
if (permc.doIfExtStoragePermissionGranted()) {
String sep = "\n";
if (appSettings.isTodoStartTasksWithTodaysDateEnabled()) {
if (appSettings.getDocumentAutoFormatEnabled(_appSettings.getTodoFile().getAbsolutePath())) {
sep += TodoTxtTask.getToday() + " ";
}
appendToExistingDocument(_appSettings.getTodoFile(), sep, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import android.text.InputFilter;
import android.text.Spanned;

import net.gsantner.markor.util.AppSettings;
import net.gsantner.opoc.util.StringUtils;

import java.util.Date;
Expand All @@ -32,11 +31,6 @@ public CharSequence filter(CharSequence source, int start, int end, Spanned dest
}

private CharSequence autoIndent(CharSequence source) {
String t = "";
final AppSettings settings = AppSettings.get();
if (settings.isTodoStartTasksWithTodaysDateEnabled()) {
t += TodoTxtTask.DATEF_YYYY_MM_DD.format(new Date()) + " ";
}
return source + t;
return source + TodoTxtTask.DATEF_YYYY_MM_DD.format(new Date()) + " ";
}
}
4 changes: 0 additions & 4 deletions app/src/main/java/net/gsantner/markor/util/AppSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,6 @@ public boolean isTodoAppendProConOnEndEnabled() {
return getBool(R.string.pref_key__todotxt__append_contexts_and_projects_on_end_of_task, true);
}

public boolean isTodoStartTasksWithTodaysDateEnabled() {
return getBool(R.string.pref_key__todotxt__start_new_tasks_with_todays_date, true);
}

public boolean isTodoAddCompletionDateEnabled() {
return getBool(R.string.pref_key__todotxt__add_completion_date_for_todos, true);
}
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/string-not_translatable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
<string name="pref_key__todotxt__hl_delay" translatable="false">pref_key__todotxt__hl_delay</string>
<string name="pref_key__todo_filepath" translatable="false">pref_key__todo_filepath</string>
<string name="pref_key__todotxt__add_completion_date_for_todos" translatable="false">pref_key__todotxt__add_completion_date_for_todos</string>
<string name="pref_key__todotxt__start_new_tasks_with_todays_date" translatable="false">pref_key__todotxt__start_new_tasks_with_todays_date</string>
<string name="pref_key__todotxt__append_contexts_and_projects_on_end_of_task" translatable="false">pref_key__todotxt__append_contexts_and_projects_on_end_of_task</string>
<string name="pref_key__todotxt__last_used_archive_filename" translatable="false">pref_key__todotxt__last_used_archive_filename</string>
<string name="pref_key__is_preview_first" translatable="false">pref_key__is_preview_first</string>
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/res/xml/preferences_master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -493,12 +493,6 @@
android:key="@string/pref_key__todotxt__add_completion_date_for_todos"
android:summary="@string/add_completion_date_for_todos_when_marking_them_as_done"
android:title="@string/add_completion_date" />
<CheckBoxPreference
android:defaultValue="true"
android:icon="@drawable/ic_date_range_black_24dp"
android:key="@string/pref_key__todotxt__start_new_tasks_with_todays_date"
android:summary="@string/insert_current_date_when_starting_new_task"
android:title="@string/tasks_with_todays_date" />
<CheckBoxPreference
android:defaultValue="true"
android:icon="@drawable/ic_add_white_24dp"
Expand Down

0 comments on commit 0b48c2a

Please sign in to comment.