show close confirmation

This commit is contained in:
2014-12-22 18:50:46 +01:00
parent 11af78ad3d
commit 04ca818045
7 changed files with 53 additions and 0 deletions
@@ -657,6 +657,21 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
}
public void closeAll() {
boolean modified = false;
for (SWFList swfList: swfs) {
for (SWF swf : swfList) {
if (swf.isModified()) {
modified = true;
}
}
}
if (modified) {
if (View.showConfirmDialog(this, translate("message.confirm.closeAll"), translate("message.warning"), JOptionPane.OK_CANCEL_OPTION, Configuration.showCloseConfirmation, JOptionPane.OK_OPTION) == JOptionPane.CANCEL_OPTION) {
return;
}
}
swfs.clear();
oldItem = null;
previewPanel.clear();
@@ -672,6 +687,19 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
}
public void close(SWFList swfList) {
boolean modified = false;
for (SWF swf : swfList) {
if (swf.isModified()) {
modified = true;
}
}
if (modified) {
if (View.showConfirmDialog(this, translate("message.confirm.close").replace("{swfName}",swfList.name), translate("message.warning"), JOptionPane.OK_CANCEL_OPTION, Configuration.showCloseConfirmation, JOptionPane.CANCEL_OPTION) == JOptionPane.CANCEL_OPTION) {
return;
}
}
swfs.remove(swfList);
if (abcPanel != null) {
for (SWF swf : swfList) {
@@ -305,3 +305,6 @@ config.group.description.import = Configuration of imports
config.name.textImportResizeTextBoundsMode = Text bounds resize mode
config.description.textImportResizeTextBoundsMode = Text bounds resize mode after text editing.
config.name.showCloseConfirmation = Show again SWF close confirmation
config.description.showCloseConfirmation = Show again SWF close confirmation for modified files.
@@ -305,3 +305,6 @@ config.group.description.import = Import\u00e1l\u00e1s be\u00e1ll\u00edt\u00e1sa
config.name.textImportResizeTextBoundsMode = Sz\u00f6veg hat\u00e1r \u00e1tm\u00e9retez\u00e9se
config.description.textImportResizeTextBoundsMode = Sz\u00f6veg hat\u00e1r \u00e1tm\u00e9retez\u00e9se sz\u00f6veg m\u00f3dos\u00edt\u00e1sa ut\u00e1n.
config.name.showCloseConfirmation = SWF bez\u00e1r\u00e1si meger\u0151s\u00edt\u00e9s \u00fajb\u00f3li mutat\u00e1sa
config.description.showCloseConfirmation = SWF bez\u00e1r\u00e1si meger\u0151s\u00edt\u00e9s \u00fajb\u00f3li mutat\u00e1sa m\u00f3dosult f\u00e1jlok eset\u00e9n.
@@ -545,3 +545,6 @@ fit = fit
button.setAdvanceValues = Set advance values
menu.tools.replace = Text Replace
message.confirm.close = There are unsaved changes. Do you really want to close {swfName}?
message.confirm.closeAll = There are unsaved changes. Do you really want to close all SWFs?
@@ -545,3 +545,6 @@ fit = kit\u00f6lt
button.setAdvanceValues = Halad\u00e1si \u00e9rt\u00e9kek be\u00e1ll\u00edt\u00e1sa
menu.tools.replace = Sz\u00f6veg csere
message.confirm.close = Mentetlen v\u00e1ltoz\u00e1sok vannak. Szeretm\u00e9 m\u00e9gis bez\u00e9rni a k\u00f6vetkez\u0151t: {swfName}?
message.confirm.closeAll = Mentetlen v\u00e1ltoz\u00e1sok vannak. Szeretn\u00e9 bez\u00e1rni az \u00f6sszes SWF-t ?