Added #1845 Show warning on opening file in Read only mode (binary search, unknown extensions, etc.)

Added #1845 Show error message on saving in Read only mode, "Save As" must be used
This commit is contained in:
Jindra Petřík
2022-10-30 21:06:55 +01:00
parent f5f6079846
commit 5b7cacb964
7 changed files with 50 additions and 4 deletions

View File

@@ -839,6 +839,14 @@ public class Main {
Stopwatch sw = Stopwatch.startNew();
if (bundle != null) {
if (bundle.isReadOnly()) {
View.execInEventDispatchLater(new Runnable() {
@Override
public void run() {
ViewMessages.showMessageDialog(getMainFrame().getWindow(), AppStrings.translate("warning.readonly").replace("%file%", sourceInfo.getFileTitleOrName()), AppStrings.translate("message.warning"), JOptionPane.WARNING_MESSAGE, Configuration.warningOpeningReadOnly);
}
});
}
result.bundle = bundle;
result.name = new File(sourceInfo.getFileTitleOrName()).getName();
for (Entry<String, SeekableInputStream> streamEntry : bundle.getAll().entrySet()) {