Add confirmation dialog for PC deletion

This commit is contained in:
Cameron Gutman
2018-10-24 18:47:52 -07:00
parent 7eac609219
commit a9af4e54a9
3 changed files with 41 additions and 6 deletions

View File

@@ -567,12 +567,17 @@ public class PcView extends Activity implements AdapterFragmentCallbacks {
LimeLog.info("Ignoring delete PC request from monkey");
return true;
}
if (managerBinder == null) {
Toast.makeText(PcView.this, getResources().getString(R.string.error_manager_not_running), Toast.LENGTH_LONG).show();
return true;
}
managerBinder.removeComputer(computer.details.name);
removeComputer(computer.details);
UiHelper.displayDeletePcConfirmationDialog(this, computer.details, new Runnable() {
@Override
public void run() {
if (managerBinder == null) {
Toast.makeText(PcView.this, getResources().getString(R.string.error_manager_not_running), Toast.LENGTH_LONG).show();
return;
}
managerBinder.removeComputer(computer.details.name);
removeComputer(computer.details);
}
}, null);
return true;
case APP_LIST_ID: