Show warning dialog about restarting OR after preferences import
This commit is contained in:
parent
0f09497275
commit
8a52185322
@ -378,6 +378,8 @@ PreferencesDialog.lbl.languageEffect = The language will change the next time yo
|
|||||||
generalprefs.lbl.language = Interface language
|
generalprefs.lbl.language = Interface language
|
||||||
generalprefs.languages.default = System default
|
generalprefs.languages.default = System default
|
||||||
generalprefs.lbl.languageEffect = The language will change the next time you start OpenRocket.
|
generalprefs.lbl.languageEffect = The language will change the next time you start OpenRocket.
|
||||||
|
generalprefs.ImportWarning.title = Reload OpenRocket
|
||||||
|
generalprefs.ImportWarning.msg = You may need to restart OpenRocket for some of the changes to take effect.
|
||||||
|
|
||||||
PreferencesExporter.chooser.title = Export the Preferences File
|
PreferencesExporter.chooser.title = Export the Preferences File
|
||||||
|
|
||||||
|
@ -264,14 +264,20 @@ public class GeneralPreferencesPanel extends PreferencesPanel {
|
|||||||
importPreferences.addActionListener(new ActionListener() {
|
importPreferences.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
PreferencesImporter.importPreferences(parent);
|
boolean imported = PreferencesImporter.importPreferences(parent);
|
||||||
|
if (imported) {
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
JOptionPane.showMessageDialog(parent,
|
||||||
|
trans.get("generalprefs.ImportWarning.msg"),
|
||||||
|
trans.get("generalprefs.ImportWarning.title"),
|
||||||
|
JOptionPane.WARNING_MESSAGE);
|
||||||
PreferencesDialog.showPreferences(parent.getParentFrame()); // Refresh the preferences dialog
|
PreferencesDialog.showPreferences(parent.getParentFrame()); // Refresh the preferences dialog
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
buttonPanel.add(importPreferences);
|
buttonPanel.add(importPreferences);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user