Skip to content

Commit

Permalink
Fix for Issue #4437 - Some bugs in preference->Entry table columns (#…
Browse files Browse the repository at this point in the history
…4546)

* Changed gui.preference.TableColumnTab.java. But some files I haven't touched are showing errors.

* made preferences->Entry table columns editable

* style changes

* removed obsolete localization key

* adding rows also adds widths

* check consistent endstate if change columns from GUI

* changing columns from GUI

* check consistent endstate if change columns from GUI

* removed redundant tableRows

* removed unnecessary updates to colsetup

* CHANGELOG updated

* removed UpdateWidthsAction and associated stuff
  • Loading branch information
rachelwu21 authored and tobiasdiez committed Jan 12, 2019
1 parent 84573cc commit f3d03a8
Show file tree
Hide file tree
Showing 21 changed files with 77 additions and 213 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Expand Up @@ -48,7 +48,8 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We updated updated the Related Articles tab to accept JSON from the new version of the Mr. DLib service
- We added an option in the preference dialog box that allows user to choose behavior after dragging and dropping files in Entry Editor. [#4356](https://github.com/JabRef/jabref/issues/4356)
- We added the ability to have an export preference where previously "File"-->"Export"/"Export selected entries" would not save the user's preference[#4495](https://github.com/JabRef/jabref/issues/4495)

- We added the ability to add field names from the Preferences Dialog [#4546](https://github.com/JabRef/jabref/issues/4546)
- We added the ability change the column widths directly in the main table. [#4546](https://github.com/JabRef/jabref/issues/4546)



Expand Down Expand Up @@ -91,7 +92,6 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where only one PDF file could be imported [#4422](https://github.com/JabRef/jabref/issues/4422)
- We fixed an issue where "Move to group" would always move the first entry in the library and not the selected [#4414](https://github.com/JabRef/jabref/issues/4414)
- We fixed an issue where an older dialog appears when downloading full texts from the quality menu. [#4489](https://github.com/JabRef/jabref/issues/4489)
- We fixed an issue where uncaught exceptions were logged but the user wasn't informed about their occurance. [#2288] (https://github.com/JabRef/jabref/issues/2288)



Expand All @@ -107,7 +107,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Set/clear/append/rename fields: available through Edit menu
- Manage keywords: available through Edit menu
- Copy linked files to folder: available through File menu

- We removed the option to change the column widths in the preferences dialog. [#4546](https://github.com/JabRef/jabref/issues/4546)



Expand Down
Expand Up @@ -26,7 +26,9 @@ public PersistenceVisualStateTable(final MainTable mainTable, JabRefPreferences
this.preferences = preferences;

mainTable.getColumns().addListener(this::onColumnsChanged);
mainTable.getColumns().forEach(col -> col.sortTypeProperty().addListener(obs -> updateColumnSortType(col.getText(), col.getSortType())));
mainTable.getColumns().forEach(col -> col.sortTypeProperty().addListener(obs ->
updateColumnSortType(col.getText(), col.getSortType())));
mainTable.getColumns().forEach(col -> col.widthProperty().addListener(obs -> updateColumnPreferences()));

}

Expand Down Expand Up @@ -63,8 +65,10 @@ private void updateColumnPreferences() {
}
}

// Finally, we store the new preferences.
preferences.putStringList(JabRefPreferences.COLUMN_NAMES, columnNames);
preferences.putStringList(JabRefPreferences.COLUMN_WIDTHS, columnsWidths);
if (columnNames.size() == columnsWidths.size() &&
columnNames.size() == preferences.getStringList(preferences.COLUMN_NAMES).size()) {
preferences.putStringList(JabRefPreferences.COLUMN_NAMES, columnNames);
preferences.putStringList(JabRefPreferences.COLUMN_WIDTHS, columnsWidths);
}
}
}

0 comments on commit f3d03a8

Please sign in to comment.