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.*;
@ -127,12 +128,12 @@ public class ListHabitsBehavior
} }
public void onResetHabits() public void onResetHabits()
{ {
commandRunner.execute(new ResetHabitsCommand(habitList), screen.showResetConfirmationScreen(() ->
null); {
habitList.repair(); commandRunner.execute(new ResetHabitsCommand(habitList),
HabitCardListCache hclc = new HabitCardListCache(habitList, commandRunner, taskRunner); null);
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