settings dialog: show restart confirmation

This commit is contained in:
Honfika
2013-11-10 19:49:01 +01:00
parent 82ab797b5f
commit 5d163bd771
6 changed files with 30 additions and 6 deletions

View File

@@ -22,6 +22,7 @@ import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.Map;
import java.util.Map.Entry;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
@@ -169,6 +170,7 @@ public class AdvancedSettingsDialog extends AppDialog {
private void btnOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOkActionPerformed
TableModel model = configurationTable.getModel();
int count = model.getRowCount();
boolean modified = false;
for (int i = 0; i < count; i++) {
String name = (String) model.getValueAt(i, 0);
Object value = model.getValueAt(i, 1);
@@ -183,10 +185,14 @@ public class AdvancedSettingsDialog extends AppDialog {
}
if (item.get() != null && !item.get().equals(value)) {
item.set(value);
modified = true;
}
}
Configuration.saveConfig();
setVisible(false);
if (modified) {
showRestartConfirmDialod();
}
}//GEN-LAST:event_btnOkActionPerformed
private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
@@ -208,9 +214,15 @@ public class AdvancedSettingsDialog extends AppDialog {
}
Configuration.saveConfig();
setVisible(false);
SelectLanguageDialog.reloadUi();
showRestartConfirmDialod();
}//GEN-LAST:event_btnResetActionPerformed
private void showRestartConfirmDialod() {
if (View.showConfirmDialog(this, translate("advancedSettings.restartConfirmation"), AppStrings.translate("message.warning"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
SelectLanguageDialog.reloadUi();
}
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCancel;
private javax.swing.JButton btnOk;

View File

@@ -222,7 +222,6 @@ import org.pushingpixels.flamingo.api.ribbon.JRibbonComponent;
import org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenu;
import org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntryFooter;
import org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntryPrimary;
import org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntrySecondary;
import org.pushingpixels.flamingo.api.ribbon.RibbonElementPriority;
import org.pushingpixels.flamingo.api.ribbon.RibbonTask;
import org.pushingpixels.flamingo.api.ribbon.resize.BaseRibbonBandResizePolicy;

View File

@@ -13,3 +13,4 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
advancedSettings.restartConfirmation = You must restart the program for some modifications to take effect. Do you want to restart it now?

View File

@@ -0,0 +1,16 @@
# Copyright (C) 2013 JPEXS
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
advancedSettings.restartConfirmation = N\u00e9h\u00e1ny m\u00f3dos\u00edt\u00e1s \u00e9rv\u00e9nybel\u00e9p\u00e9s\u00e9het a programot \u00fajra kell ind\u00edtani. Szeretn\u00e9 \u00fajraind\u00edtani most?

View File

@@ -10,8 +10,6 @@ import com.jpexs.decompiler.graph.ExportMode;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import static org.testng.Assert.*;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

View File

@@ -25,8 +25,6 @@ import com.jpexs.decompiler.flash.tags.DoActionTag;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import static org.testng.Assert.*;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;