Skip to content

Commit

Permalink
Fix similar bug as JabRef#420 for the database properties dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Dec 1, 2015
1 parent 9b46dc2 commit adc923b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ private void storeSettings() {
}

Charset oldEncoding = panel.getEncoding();
Charset newEncoding = Charset.forName((String) encoding.getSelectedItem());
Charset newEncoding = (Charset) encoding.getSelectedItem();
panel.setEncoding(newEncoding);

Vector<String> dir = new Vector<>(1);
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/net/sf/jabref/gui/preftabs/GeneralTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class GeneralTab extends JPanel implements PrefsTab {
private final JabRefPreferences prefs;
private final JComboBox<String> language = new JComboBox<>(LANGUAGES.keySet().toArray(new String[LANGUAGES.keySet().size()]));
private final JComboBox<String> encodings;
private final DefaultComboBoxModel encodingsModel;


public GeneralTab(JabRefFrame frame, JabRefPreferences prefs) {
Expand Down Expand Up @@ -111,8 +110,7 @@ public void stateChanged(ChangeEvent arg0) {
inspectionWarnDupli = new JCheckBox(Localization.lang("Warn about unresolved duplicates when closing inspection window"));

encodings = new JComboBox<>();
encodingsModel = new DefaultComboBoxModel(Encodings.ENCODINGS);
encodings.setModel(encodingsModel);
encodings.setModel(new DefaultComboBoxModel(Encodings.ENCODINGS));

FormLayout layout = new FormLayout
("8dlu, 1dlu, left:170dlu, 4dlu, fill:pref, 4dlu, fill:pref, 4dlu, left:pref, 4dlu, left:pref, 4dlu, left:pref", "");
Expand Down Expand Up @@ -201,7 +199,7 @@ public void setValues() {
unmarkAllEntriesBeforeImporting.setSelected(prefs.getBoolean(JabRefPreferences.UNMARK_ALL_ENTRIES_BEFORE_IMPORTING));

Charset enc = Charset.forName(prefs.get(JabRefPreferences.DEFAULT_ENCODING));
encodingsModel.setSelectedItem(enc);
encodings.setSelectedItem(enc);

String oldLan = prefs.get(JabRefPreferences.LANGUAGE);

Expand Down

0 comments on commit adc923b

Please sign in to comment.