Added confirmasion dialog to settings reset button

pull/592/head
Febon 5 years ago
parent ca3ad18515
commit 6d676fcb78

@ -25,6 +25,7 @@ import org.isoron.uhabits.core.commands.*;
import org.isoron.uhabits.core.models.*; import org.isoron.uhabits.core.models.*;
import org.isoron.uhabits.core.preferences.*; import org.isoron.uhabits.core.preferences.*;
import org.isoron.uhabits.core.tasks.*; import org.isoron.uhabits.core.tasks.*;
import org.isoron.uhabits.core.ui.callbacks.OnConfirmedCallback;
import org.isoron.uhabits.core.utils.*; import org.isoron.uhabits.core.utils.*;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
@ -126,12 +127,12 @@ public class ListHabitsBehavior
}); });
} }
public void onResetHabits() public void onResetHabits()
{
screen.showResetConfirmationScreen(() ->
{ {
commandRunner.execute(new ResetHabitsCommand(habitList), commandRunner.execute(new ResetHabitsCommand(habitList),
null); null);
habitList.repair(); });
HabitCardListCache hclc = new HabitCardListCache(habitList, commandRunner, taskRunner);
hclc.refreshAllHabits();
} }
public void onSendBugReport() public void onSendBugReport()
@ -201,5 +202,8 @@ public class ListHabitsBehavior
void showSendBugReportToDeveloperScreen(String log); void showSendBugReportToDeveloperScreen(String log);
void showSendFileScreen(@NonNull String filename); void showSendFileScreen(@NonNull String filename);
void showResetConfirmationScreen(
@NonNull OnConfirmedCallback callback);
} }
} }

Loading…
Cancel
Save