Archived
1
0

modified JUninstaller.java

+ additional security question when trying to delete a single file from log details view (if file was only modified by installation, not created)

modified   MyQuestions.java
        x Fixed bug in word wrapping. Now paragraphs are also preserved.
This commit is contained in:
mbirth
2005-01-31 17:24:29 +00:00
parent bc3e7005ef
commit 95706c9b63
2 changed files with 37 additions and 8 deletions

View File

@@ -225,16 +225,33 @@ public class JUninstaller extends Frame implements ActionListener {
} else if (ae.getSource().equals(btDelFile)) { // Delete file (log-details)
String selItem = ltView.getSelectedItem();
String selFile = ltApps.getSelectedItem();
char status = selItem.charAt(0); // for addition question later
if (selItem != null && selFile != null) {
selItem = selItem.substring(selItem.indexOf(" ")+1);
if (MQ.yesnoBox("Are you sure?", "Do you really want to delete this file?\n\n"+selItem+"\n\nDeleting the wrong file may render your phone unusable!") == MQ.YES) {
File flDelMe = new File(selItem);
if (flDelMe.delete()) {
MIP.infoPrint("Deleted.");
} else {
MIP.infoPrint("Error!");
File flDelMe = new File(selItem);
if (flDelMe.exists()) {
if (MQ.yesnoBox("Are you sure?", "Do you really want to delete this file?\n\n"+selItem+"\n\nDeleting the wrong file may render your phone unusable!") == MQ.YES) {
boolean doIt = false;
if (status == '*') {
doIt = (MQ.yesnoBox("Are you really sure?", "This file has already been there before the logged installation occurred.\nDeleting it may harm your phone.\n\nDo you still want to delete it?") == MQ.YES);
} else {
doIt = true;
}
if (doIt) {
if (flDelMe.delete()) {
MIP.infoPrint("Deleted.");
} else {
MIP.infoPrint("Error!");
}
updateDetList(selFile+DATAEXT, selItem);
} else {
MIP.infoPrint("Deletion aborted.");
}
}
updateDetList(selFile+DATAEXT, selItem);
} else {
MIP.infoPrint("File does not exist!");
}
} else {
MIP.infoPrint("Select one entry!");