Fix duplicate preference window upon prefs import

This commit is contained in:
SiboVG 2023-10-23 16:27:19 +02:00
parent e46c0bec2b
commit 8ca59685ed

View File

@ -364,9 +364,18 @@ public class GeneralPreferencesPanel extends PreferencesPanel {
trans.get("generalprefs.ImportWarning.msg"),
trans.get("generalprefs.ImportWarning.title"),
JOptionPane.WARNING_MESSAGE);
// Introduce a small delay before showing the PreferencesDialog
Timer timer = new Timer(100, new ActionListener() { // 100ms delay
@Override
public void actionPerformed(ActionEvent arg0) {
PreferencesDialog.showPreferences(parent.getParentFrame()); // Refresh the preferences dialog
}
});
timer.setRepeats(false); // Only execute once
timer.start(); // Start the timer
}
});
}
}
});