Skip to content

Commit

Permalink
Streamline new library command (#6773)
Browse files Browse the repository at this point in the history
* Squashed 'src/main/resources/csl-styles/' changes from 586e0b8..c5f14e2

c5f14e2 Update journal-of-plant-ecology.csl (#4837)
b5d00ab Hotfix: pravnik.csl & iso690-full-note-cs.csl (#4833)
fb8d48a add PMID and DOI (#4832)
7ebdfff Update lancaster-university-harvard.csl (#4836)
8771e21 Create journal-of-clinical-neurology.csl (#4835)
70beb7b Harvard Lancaster: Fix in-text locator
0709b73 Update informal-logic.csl (#4831)
d18d133 Update gost-r-7-0-5-2008.csl (#4829)
cfb5389 Update gost-r-7-0-5-2008-numeric.csl (#4828)
0fc46ea Update gost-r-7-0-5-2008-numeric-alphabetical.csl (#4827)
fac26cb Create feminist-theory.csl (#4830)
a2721e6 Update pravnik.csl, masarykova-univerzita-pravnicka-fakulta.csl, and iso690-full-note-cs.csl (#4826)
2f0d735 Improve localization of DGfP
683d7d1 Create zeitschrift-fur-theologie-und-philosophie.csl (#4813)
7c82406 always show DOI in aps.csl (#4820)
1eb531d Update journal-of-international-business-studies.csl (#4819)
9caf926 Create interdisziplinare-anthropologie.csl (#4818)
00210e1 UKSW2 (#4807)
015db6e UKSW1 (#4800)
f706ef5 Update masarykova-univerzita-pravnicka-fakulta.csl (#4822)
096108d Update epilepsia.csl (#4823)
07ebdc3 Update eksploatacja-i-niezawodnosc.csl (#4824)
3d50f3c Create ABNT-Universidade-Federal-de-Pernambuco-CFCH.csl (#4798)
df94fa1 Update eksploatacja-i-niezawodnosc.csl (#4808)
4089be5 Update bulletin-de-la-societe-prehistorique-francaise.csl (#4810)
f130aa7 Update molecular-biology-and-evolution.csl (#4814)
86f452f Create heiliger-dienst.csl (#4815)
5ccd3e9 Update revista-brasileira-de-ciencia-do-solo.csl (#4817)
0eea734 Fix a delimiter in journal-of-the-royal-society-of-western-australia.csl (#4811)
1cbe790 Delete heiliger-dienst.csl
19fa29f Create heiliger-dienst.csl (#4787)
888bad1 Update RMIT Harvard to match Easy Cite (#4788)
46011dd Create universite-nangui-abrogoua-ufr-sn (#4676)
174adab Create apa-6th-edition-no-ampersand.csl (#4767)
03cf65f Create journal-of-plant-protection-research.csl (#4797)
c749084 Update eksploatacja-i-niezawodnosc.csl (#4782)
17e1501  Update masarykova-univerzita-pravnicka-fakulta.csl (#4783)
5596d18 Update revista-brasileira-de-ciencia-do-solo.csl (#4790)
9c1a381 create csl for the journal Textual Cultures (#4785)
8345762 Update taylor-and-francis-national-library-of-medicine.csl (#4786)
5ec1acf Create british-journal-of-criminology.csl (#4789)
68550ac Update angewandte-chemie.csl (#4791)
09e2755 Create shock.csl (#4792)
d46e49e Update antioxidants-and-redox-signaling.csl (#4793)

git-subtree-dir: src/main/resources/csl-styles
git-subtree-split: c5f14e2

* Squashed 'src/main/resources/csl-styles/' changes from c5f14e2..716f635

716f635 Update changes in Harvard-Stellenbosch (#4862)
a6a9a1a Create alkoholizmus-a-drogove-zavislosti.csl (#4859)
0560ca0 Update journal-of-the-american-college-of-surgeons.csl (#4858)
9e16631 create independent style for cellular-and-molecular-gastroenterology-and-hepatology.csl (#4852)
87b0853 Update antiquity.csl (#4841)
cb4e7f7 Update heart-rhythm.csl (#4850)
b3b55ee Create iisue-moderno (#4846)
63973a7 Create etasr.csl (#4848)
9942138 Create style for Journal of Vertebrate Biology (#4849)
7c7f3d3 Add Future Medicine dependents (#4838)
abe2066 Update methods-of-information-in-medicine.csl (#4847)
c64d98b create independent style for new-zealand-journal-of-forestry-science (#4844)
28265f9 Create continuity-and-change.csl (#4839)
d065fdd Create journal-of-clinical-ethics.csl (#4842)
b9fbfa3 Update future-medicine.csl (#4843)
ceb56fa Create future-medicine.csl (#4834)

git-subtree-dir: src/main/resources/csl-styles
git-subtree-split: 716f635

* Squashed 'src/main/resources/csl-styles/' changes from 716f635..a995c63

a995c63 Create errata.csl (#4894)
883b9cd Update archeologie-medievale.csl (#4892)
a942b5c Update rmit-university-harvard.csl (#4890)
5d535fc Update universidade-do-porto-faculdade-de-engenharia-chicago.csl (#4891)
f2a8fe3 Fix AVMA style
c5a2d7e Create universidade-do-porto-faculdade-de-engenharia-chicago.csl (#4872)
9f106eb Update rmit-university-harvard.csl (#4884)
5213c2f Update universitetet-i-oslo-rettsvitenskap.csl (#4886)
7e0828d Update uclouvain-centre-charles-de-visscher-pour-le-droit-internation… (#4871)
ae5eba3 Create revue-archeologique-de-lest.csl (#4881)
58a1672 Create pacific-conservation-biology.csl (#4880)
381106e Update national-institute-of-organisation-dynamics-australia-harvard.csl (#4879)
c66a5c0 Create society-of-biblical-literature-author-date.csl (#4812)
008073c Create ruhr-universitat-bochum-medizinische-fakultat-variante-a.csl (#4874)
193385a Update manchester (#4878)
fa9ef11 Create Faculty of Psychology and Education Sciences, Porto (#4856)
2f70b14 Add "personal communication" to remaining APA locales (#4866)
2b4f831 Fixed page-range-format (#4863)
d5661ba universitat-bern-institut-fur-musikwissenschaft add missing cs:sort to cs:bibliography (#4860)
e433c99 fix delimiter issue for bioscience.csl (#4876)
4d97aab update et-al settings for stroke.csl (#4875)
342b9e3 Update masarykova-univerzita-pravnicka-fakulta.csl (#4868)
91fe25e Add article number to IEEE (#4867)

git-subtree-dir: src/main/resources/csl-styles
git-subtree-split: a995c63

* Squashed 'src/main/resources/csl-styles/' changes from a995c63..bf698ac

bf698ac Create common-market-law-review.csl (#4910)
c962eca Create harvard-prifysgol-caerdydd.csl (#4922)
0c24e7f Update gewerblicher-rechtsschutz-und-urheberrecht.csl (#4923)
d2ec1a7 Create Tijdschrift-voor-Geneeskunde.csl (#4907)
5df7250 Update harvard-institut-fur-praxisforschung-de.csl (#4918)
093fd91 Update universite-de-montreal-apa.csl (#4916)
a3e41d4 Update thieme-german.csl (#4919)
648765a add DOI to aerosol-science-and-technology.csl (#4909)
bc1ebee Reindent/reorder
a8dc18a Fix documentation link for epidemiology & infection
aab403a Fix AGLC Newspaper date
4c018d5 Add period between editor and translator (SBL styles) (#4906)
42f7491 Create geographische-zeitschrift.csl (#4898)
a4002a6 Create german-kunstwissenschaft.csl (#4896)
b01910b Disambiguation of names (#4895)

git-subtree-dir: src/main/resources/csl-styles
git-subtree-split: bf698ac

* Squashed 'src/main/resources/csl-styles/' changes from bf698ac..7cab2f7

7cab2f7 Create depro-ufs.csl (#4947)
2fcda1f Create journal-of-sport-science-and-medicine.csl (#4949)
cd457d4 Update american-marketing-association.csl (#4945)
cacc4ee Create nejm-catalyst.csl (#4943)
bd769b9 Update and rename dependent/chinese-medical-journal.csl to chinese-me… (#4941)
1f706cd Update health-services-research.csl (#4939)
76bcd1d Update journal-of-the-royal-society-of-western-australia.csl (#4932)
e79640e Create afro-asia.csl (#4934)
c601aa4 Update lancaster-university-harvard.csl (#4938)
184fd90 Update collection-du-centre-jean-berard.csl (#4936)
82f9aec fix et-al & add DOI thyroid.csl (#4937)
4af169f Create universidade-estadual-de-alagoas-uneal-abnt (#4885)
47165b3 Update and rename medical-physics.csl to dependent/medical-physics.csl (AMA) (#4905)
3cab27d Update thieme-german.csl (#4931)
eb2c977 Create zeitschrift-fur-zahnarztliche-implantologie.csl (#4925)
4adb1ea Create karstenia.csl (#4929)
530a136 Fix author substitute in Universita Cattolica

git-subtree-dir: src/main/resources/csl-styles
git-subtree-split: 7cab2f7

* Squashed 'src/main/resources/csl-styles/' changes from 7cab2f7..827b986

827b986 add DOI preprint to american-society-for-microbiology.csl (#4946)

git-subtree-dir: src/main/resources/csl-styles
git-subtree-split: 827b986

* Squashed 'src/main/resources/csl-styles/' changes from 827b986..eb0d37e

eb0d37e Create natbib-plainnat-author-dat.csl (#4967)
fb1592a Update journal-of-fish-biology.csl (#4969)
f6876cb Update .travis.yml (#4970)
d6d400b Create london-review-of-international-law.csl (#4966)
d2a5ae1 Update harvard-stellenbosch-university.csl (#4965)
9c62141 Create phytopathologia-mediterranea.csl (#4964)
8ca2ea1 Update historical-materialism.csl (#4960)
80456dc Update historical-materialism.csl
be2d910 Update historical-materialism.csl
1d1cf09 Create atlande.csl (#4930)
89f41d4 Create juristische-zitierweise-oeffentliches-recht.csl (#4944)
8c677a0 Create korean-journal-of-gastroenterology.csl (#4954)
eadb950 Create historical-materialism.csl (#4955)
5553dcd Create revista-materia.csl (#4957)
d23a3ab Bug fix in APA 6 original publication macro (#4959)
66f9974 Always print publisher in APA 6th edition (#4899)
868809c Create agora.csl (#4940)
99c19c3 Update anthropologie-et-societes.csl (#4952)
ee17423 Create critical-reviews-in-solid-state-and-materials-science.csl (#4951)
7a13a7d Create korean-journal-of-internal-medicine.csl (#4953)

git-subtree-dir: src/main/resources/csl-styles
git-subtree-split: eb0d37e

* Merged new library actions

* l10n

* Removed unused constructor

* Fixed checkstyle failed check

* Fixed one more checkstyle issue

Co-authored-by: github actions <jabrefmail+webfeedback@gmail.com>
  • Loading branch information
calixtus and github actions committed Aug 22, 2020
1 parent 9d17101 commit dc55a76
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 24 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We improved the "Possible duplicate entries" window to remember its size and position throughout a session. [#6582](https://github.com/JabRef/jabref/issues/6582)
- We divided the toolbar into small parts, so if the application window is to small, only a part of the toolbar is moved into the chevron popup. [#6682](https://github.com/JabRef/jabref/pull/6682)
- We changed the layout for of the buttons in the Open Office side panel to ensure that the button text is always visible, specially when resizing. [#6639](https://github.com/JabRef/jabref/issues/6639)
- We merged the two new library commands in the file menu to one which always creates a new library in the default library mode. [#6359](https://github.com/JabRef/jabref/pull/6539#issuecomment-641056536)

### Fixed

Expand Down
16 changes: 3 additions & 13 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@
import org.jabref.logic.undo.UndoRedoEvent;
import org.jabref.logic.util.io.FileUtil;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.database.BibDatabaseMode;
import org.jabref.model.database.shared.DatabaseLocation;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.field.SpecialField;
Expand Down Expand Up @@ -507,20 +506,14 @@ private Node createToolbar() {
final Region leftSpacer = new Region();
final Region rightSpacer = new Region();

final Button newLibrary;
if (Globals.prefs.getDefaultBibDatabaseMode() == BibDatabaseMode.BIBLATEX) {
newLibrary = factory.createIconButton(StandardActions.NEW_LIBRARY_BIBLATEX, new NewDatabaseAction(this, BibDatabaseMode.BIBLATEX));
} else {
newLibrary = factory.createIconButton(StandardActions.NEW_LIBRARY_BIBTEX, new NewDatabaseAction(this, BibDatabaseMode.BIBTEX));
}

final PushToApplicationAction pushToApplicationAction = getPushToApplicationsManager().getPushToApplicationAction();
final Button pushToApplicationButton = factory.createIconButton(pushToApplicationAction.getActionInformation(), pushToApplicationAction);
pushToApplicationsManager.registerReconfigurable(pushToApplicationButton);

ToolBar toolBar = new ToolBar(

new HBox(newLibrary,
new HBox(
factory.createIconButton(StandardActions.NEW_LIBRARY, new NewDatabaseAction(this, prefs)),
factory.createIconButton(StandardActions.OPEN_LIBRARY, new OpenDatabaseAction(this)),
factory.createIconButton(StandardActions.SAVE_LIBRARY, new SaveAction(SaveAction.SaveMethod.SAVE, this, stateManager))),

Expand Down Expand Up @@ -733,10 +726,7 @@ private MenuBar createMenu() {
Menu help = new Menu(Localization.lang("Help"));

file.getItems().addAll(
factory.createSubMenu(StandardActions.NEW_LIBRARY,
factory.createMenuItem(StandardActions.NEW_LIBRARY_BIBTEX, new NewDatabaseAction(this, BibDatabaseMode.BIBTEX)),
factory.createMenuItem(StandardActions.NEW_LIBRARY_BIBLATEX, new NewDatabaseAction(this, BibDatabaseMode.BIBLATEX))),

factory.createMenuItem(StandardActions.NEW_LIBRARY, new NewDatabaseAction(this, prefs)),
factory.createMenuItem(StandardActions.OPEN_LIBRARY, getOpenDatabaseAction()),
fileHistory,
factory.createMenuItem(StandardActions.SAVE_LIBRARY, new SaveAction(SaveAction.SaveMethod.SAVE, this, stateManager)),
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/jabref/gui/actions/StandardActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.jabref.gui.icon.JabRefIcon;
import org.jabref.gui.keyboard.KeyBinding;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.database.BibDatabaseMode;

public enum StandardActions implements Action {

Expand Down Expand Up @@ -59,8 +58,6 @@ public enum StandardActions implements Action {
RELEVANCE(Localization.lang("Relevance"), IconTheme.JabRefIcons.RELEVANCE),
RELEVANT(Localization.lang("Toggle relevance"), IconTheme.JabRefIcons.RELEVANCE),
NEW_LIBRARY(Localization.lang("New library"), IconTheme.JabRefIcons.NEW),
NEW_LIBRARY_BIBTEX(Localization.lang("New %0 library", BibDatabaseMode.BIBTEX.getFormattedName()), IconTheme.JabRefIcons.NEW),
NEW_LIBRARY_BIBLATEX(Localization.lang("New %0 library", BibDatabaseMode.BIBLATEX.getFormattedName()), IconTheme.JabRefIcons.NEW),
OPEN_LIBRARY(Localization.lang("Open library"), IconTheme.JabRefIcons.OPEN, KeyBinding.OPEN_DATABASE),
IMPORT(Localization.lang("Import"), IconTheme.JabRefIcons.IMPORT),
EXPORT(Localization.lang("Export"), IconTheme.JabRefIcons.EXPORT, KeyBinding.EXPORT),
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/org/jabref/gui/importer/NewDatabaseAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,31 @@
import org.jabref.gui.JabRefFrame;
import org.jabref.gui.actions.SimpleCommand;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.database.BibDatabaseMode;
import org.jabref.preferences.PreferencesService;

/**
* Create a new, empty, database.
*/
public class NewDatabaseAction extends SimpleCommand {

private final JabRefFrame jabRefFrame;
private final BibDatabaseMode mode;
private final PreferencesService preferencesService;

public NewDatabaseAction(JabRefFrame jabRefFrame, BibDatabaseMode mode) {
/**
* Constructs a command to create a new library of the default type
*
* @param jabRefFrame the application frame of JabRef
* @param preferencesService the preferencesService of JabRef
*/
public NewDatabaseAction(JabRefFrame jabRefFrame, PreferencesService preferencesService) {
this.jabRefFrame = jabRefFrame;
this.mode = mode;
this.preferencesService = preferencesService;
}

@Override
public void execute() {
BibDatabaseContext bibDatabaseContext = new BibDatabaseContext();
bibDatabaseContext.setMode(mode);
bibDatabaseContext.setMode(preferencesService.getGeneralPreferences().getDefaultBibDatabaseMode());
jabRefFrame.addTab(bibDatabaseContext, true);
}
}
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/preferences/GeneralTab.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<ComboBox fx:id="language" prefWidth="200.0" GridPane.columnIndex="1"/>
<Label text="%Default encoding" GridPane.rowIndex="1"/>
<ComboBox fx:id="defaultEncoding" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
<Label text="%Default bibliography mode" GridPane.rowIndex="2"/>
<Label text="%Default library mode" GridPane.rowIndex="2"/>
<ComboBox fx:id="biblatexMode" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="2"/>
</GridPane>
<CheckBox fx:id="inspectionWarningDuplicate"
Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ Automatically\ setting\ file\ links=Automatically setting file links
Regenerating\ citation\ keys\ according\ to\ metadata=Regenerating citation keys according to metadata
Regenerate\ all\ keys\ for\ the\ entries\ in\ a\ BibTeX\ file=Regenerate all keys for the entries in a BibTeX file
Show\ debug\ level\ messages=Show debug level messages
Default\ bibliography\ mode=Default bibliography mode
Default\ library\ mode=Default library mode
Show\ only\ preferences\ deviating\ from\ their\ default\ value=Show only preferences deviating from their default value
default=default
key=key
Expand Down Expand Up @@ -1870,7 +1870,6 @@ Find\ duplicates=Find duplicates
JabRef\ resources=JabRef resources
Manage\ journal\ abbreviations=Manage journal abbreviations
Manage\ protected\ terms=Manage protected terms
New\ %0\ library=New %0 library
New\ entry\ from\ plain\ text=New entry from plain text
New\ sublibrary\ based\ on\ AUX\ file=New sublibrary based on AUX file
Push\ entries\ to\ external\ application\ (%0)=Push entries to external application (%0)
Expand Down

0 comments on commit dc55a76

Please sign in to comment.