Removed repair button

pull/214/head
M66B 1 year ago
parent 19eaced6ad
commit f2902fe6bc

@ -162,7 +162,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swTest4; private SwitchCompat swTest4;
private SwitchCompat swTest5; private SwitchCompat swTest5;
private Button btnRepair;
private Button btnDaily; private Button btnDaily;
private TextView tvLastDaily; private TextView tvLastDaily;
private SwitchCompat swAutostart; private SwitchCompat swAutostart;
@ -398,7 +397,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swTest4 = view.findViewById(R.id.swTest4); swTest4 = view.findViewById(R.id.swTest4);
swTest5 = view.findViewById(R.id.swTest5); swTest5 = view.findViewById(R.id.swTest5);
btnRepair = view.findViewById(R.id.btnRepair);
btnDaily = view.findViewById(R.id.btnDaily); btnDaily = view.findViewById(R.id.btnDaily);
tvLastDaily = view.findViewById(R.id.tvLastDaily); tvLastDaily = view.findViewById(R.id.tvLastDaily);
swAutostart = view.findViewById(R.id.swAutostart); swAutostart = view.findViewById(R.id.swAutostart);
@ -974,79 +972,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
} }
}); });
btnRepair.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (BuildConfig.DEBUG)
new AlertDialog.Builder(view.getContext())
.setIcon(R.drawable.twotone_bug_report_24)
.setTitle(R.string.title_advanced_repair)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
new SimpleTask<Void>() {
@Override
protected void onPostExecute(Bundle args) {
prefs.edit().remove("debug").apply();
}
@Override
protected Void onExecute(Context context, Bundle args) throws Throwable {
DB db = DB.getInstance(context);
List<EntityAccount> accounts = db.account().getAccounts();
if (accounts == null)
return null;
for (EntityAccount account : accounts) {
if (account.protocol != EntityAccount.TYPE_IMAP)
continue;
List<EntityFolder> folders = db.folder().getFolders(account.id, false, false);
if (folders == null)
continue;
EntityFolder inbox = db.folder().getFolderByType(account.id, EntityFolder.INBOX);
for (EntityFolder folder : folders) {
if (inbox == null && "inbox".equalsIgnoreCase(folder.name))
folder.type = EntityFolder.INBOX;
if (!EntityFolder.USER.equals(folder.type) &&
!EntityFolder.SYSTEM.equals(folder.type)) {
EntityLog.log(context, "Repairing " + account.name + ":" + folder.type);
folder.setProperties();
folder.setSpecials(account);
db.folder().updateFolder(folder);
}
}
}
return null;
}
@Override
protected void onExecuted(Bundle args, Void data) {
ToastEx.makeText(v.getContext(), R.string.title_completed, Toast.LENGTH_LONG).show();
ServiceSynchronize.reload(v.getContext(), null, true, "repair");
}
@Override
protected void onException(Bundle args, Throwable ex) {
Log.unexpectedError(getParentFragmentManager(), ex);
}
}.execute(FragmentOptionsMisc.this, new Bundle(), "repair");
}
})
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Do nothing
}
})
.show();
}
});
btnDaily.setOnClickListener(new View.OnClickListener() { btnDaily.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {

@ -927,18 +927,6 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btnRepair"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableEnd="@drawable/twotone_bug_report_24"
android:drawablePadding="6dp"
android:text="@string/title_advanced_repair"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCaptionDebug" />
<Button <Button
android:id="@+id/btnDaily" android:id="@+id/btnDaily"
style="?android:attr/buttonStyleSmall" style="?android:attr/buttonStyleSmall"
@ -949,7 +937,7 @@
android:drawablePadding="6dp" android:drawablePadding="6dp"
android:text="@string/title_advanced_daily" android:text="@string/title_advanced_daily"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnRepair" /> app:layout_constraintTop_toBottomOf="@id/tvCaptionDebug" />
<TextView <TextView
android:id="@+id/tvLastDaily" android:id="@+id/tvLastDaily"

@ -874,7 +874,6 @@
<string name="title_advanced_test3" translatable="false">Test #3</string> <string name="title_advanced_test3" translatable="false">Test #3</string>
<string name="title_advanced_test4" translatable="false">Test #4</string> <string name="title_advanced_test4" translatable="false">Test #4</string>
<string name="title_advanced_test5" translatable="false">Test #5</string> <string name="title_advanced_test5" translatable="false">Test #5</string>
<string name="title_advanced_repair" translatable="false">Repair</string>
<string name="title_advanced_daily" translatable="false">Daily</string> <string name="title_advanced_daily" translatable="false">Daily</string>
<string name="title_advanced_autostart" translatable="false">Autostart app</string> <string name="title_advanced_autostart" translatable="false">Autostart app</string>
<string name="title_advanced_emergency" translatable="false">Write emergency file</string> <string name="title_advanced_emergency" translatable="false">Write emergency file</string>

Loading…
Cancel
Save