Implementing a User Warning for the Disk Corruption problem. 1st pass.

This commit is contained in:
Lisias 2018-01-08 09:33:50 -02:00
parent d2199f0792
commit 2872d93acc
1 changed files with 48 additions and 37 deletions

View File

@ -201,6 +201,14 @@ public class DiskExplorerTab {
fileTable = null; fileTable = null;
currentFileList = null; currentFileList = null;
} }
/**
* Warns user about a problem
*
* @param e
*/
protected void warnUserAbout(final DiskException e) {
// TODO Implement this!
}
/** /**
* Create the FILES tab. * Create the FILES tab.
*/ */
@ -232,7 +240,7 @@ public class DiskExplorerTab {
try { try {
changeCurrentFormat(getCurrentFormat()); // minor hack changeCurrentFormat(getCurrentFormat()); // minor hack
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? DiskExplorerTab.this.warnUserAbout(e);
} }
} }
/** /**
@ -271,7 +279,7 @@ public class DiskExplorerTab {
} }
} }
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? this.warnUserAbout(e);
} }
} }
} }
@ -284,7 +292,7 @@ public class DiskExplorerTab {
try { try {
fillFileTable(disks[0].getFiles()); fillFileTable(disks[0].getFiles());
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? this.warnUserAbout(e);
} }
directoryTree.setSelection(new TreeItem[] { directoryTree.getItems()[0] }); directoryTree.setSelection(new TreeItem[] { directoryTree.getItems()[0] });
} }
@ -358,7 +366,7 @@ public class DiskExplorerTab {
try { try {
importFiles(); importFiles();
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? DiskExplorerTab.this.warnUserAbout(e);
} }
} }
}); });
@ -413,7 +421,7 @@ public class DiskExplorerTab {
try { try {
viewFile(null); viewFile(null);
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? DiskExplorerTab.this.warnUserAbout(e);
} }
} }
}); });
@ -472,7 +480,7 @@ public class DiskExplorerTab {
try { try {
viewFile(TextFileFilter.class); viewFile(TextFileFilter.class);
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? DiskExplorerTab.this.warnUserAbout(e);
} }
} }
}); });
@ -484,7 +492,7 @@ public class DiskExplorerTab {
try { try {
viewFile(GraphicsFileFilter.class); viewFile(GraphicsFileFilter.class);
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? DiskExplorerTab.this.warnUserAbout(e);
} }
} }
}); });
@ -915,7 +923,7 @@ public class DiskExplorerTab {
try { try {
viewFile(null); viewFile(null);
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? DiskExplorerTab.this.warnUserAbout(e);
} }
} }
}); });
@ -1271,7 +1279,7 @@ public class DiskExplorerTab {
try { try {
changeCurrentFormat(FormattedDisk.FILE_DISPLAY_STANDARD); changeCurrentFormat(FormattedDisk.FILE_DISPLAY_STANDARD);
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? DiskExplorerTab.this.warnUserAbout(e);
} }
} }
}); });
@ -1284,7 +1292,7 @@ public class DiskExplorerTab {
try { try {
changeCurrentFormat(FormattedDisk.FILE_DISPLAY_NATIVE); changeCurrentFormat(FormattedDisk.FILE_DISPLAY_NATIVE);
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? DiskExplorerTab.this.warnUserAbout(e);
} }
} }
}); });
@ -1297,7 +1305,7 @@ public class DiskExplorerTab {
try { try {
changeCurrentFormat(FormattedDisk.FILE_DISPLAY_DETAIL); changeCurrentFormat(FormattedDisk.FILE_DISPLAY_DETAIL);
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? DiskExplorerTab.this.warnUserAbout(e);
} }
} }
}); });
@ -1329,7 +1337,7 @@ public class DiskExplorerTab {
try { try {
importFiles(); importFiles();
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? DiskExplorerTab.this.warnUserAbout(e);
} }
} }
}); });
@ -1374,7 +1382,7 @@ public class DiskExplorerTab {
try { try {
viewFile(null); viewFile(null);
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? DiskExplorerTab.this.warnUserAbout(e);
} }
} }
} }
@ -1644,27 +1652,30 @@ public class DiskExplorerTab {
return new Listener() { return new Listener() {
public void handleEvent(Event event) { public void handleEvent(Event event) {
FileEntry fileEntry = getSelectedFileEntry(); FileEntry fileEntry = getSelectedFileEntry();
if (fileEntry != null && event.type == SWT.KeyUp && (event.stateMask & SWT.CTRL) != 0) if (fileEntry != null && event.type == SWT.KeyUp && (event.stateMask & SWT.CTRL) != 0) {
try { switch (event.character) { try {
case CTRL_C: // Compile Wizard switch (event.character) {
if (getCompileToolItem().isEnabled()) { case CTRL_C: // Compile Wizard
compileFileWizard(); if (getCompileToolItem().isEnabled()) {
} compileFileWizard();
break; }
case CTRL_D: // Delete file break;
if (getDeleteToolItem().isEnabled()) { case CTRL_D: // Delete file
deleteFile(); if (getDeleteToolItem().isEnabled()) {
} deleteFile();
break; }
case CTRL_E: // Export Wizard break;
exportFileWizard(); case CTRL_E: // Export Wizard
break; exportFileWizard();
case CTRL_V: // View file break;
viewFile(null); case CTRL_V: // View file
break; viewFile(null);
} } catch (DiskException e) { break;
// FIXME how to warn the User about this? }
} catch (DiskException e) {
DiskExplorerTab.this.warnUserAbout(e);
} }
}
} }
}; };
} }
@ -1702,7 +1713,7 @@ public class DiskExplorerTab {
break; break;
} }
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? DiskExplorerTab.this.warnUserAbout(e);
} }
} }
} else { // No CTRL key } else { // No CTRL key
@ -1725,7 +1736,7 @@ public class DiskExplorerTab {
break; break;
} }
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? DiskExplorerTab.this.warnUserAbout(e);
} }
} }
} }
@ -1800,7 +1811,7 @@ public class DiskExplorerTab {
try { try {
printFiles(disk, 1); printFiles(disk, 1);
} catch (DiskException e) { } catch (DiskException e) {
// FIXME how to warn the User about this? DiskExplorerTab.this.warnUserAbout(e);
} }
} }
if (y != clientArea.y) { // partial page if (y != clientArea.y) { // partial page
@ -2100,5 +2111,5 @@ public class DiskExplorerTab {
protected ToolItem getShowDeletedFilesToolItem() { protected ToolItem getShowDeletedFilesToolItem() {
return showDeletedFilesToolItem; return showDeletedFilesToolItem;
} }
} }