Skip to content

Commit

Permalink
Group remote database actions in menu
Browse files Browse the repository at this point in the history
Closes koppor#396
  • Loading branch information
stefan-kolb committed Feb 20, 2020
1 parent 1bb814a commit cb5948d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ private void initLayout() {

setId("frame");

VBox head = new VBox(createMenu(),createToolbar());
VBox head = new VBox(createMenu(), createToolbar());
head.setSpacing(0d);
setTop(head);

Expand Down Expand Up @@ -681,8 +681,12 @@ private MenuBar createMenu() {
factory.createMenuItem(StandardActions.EXPORT_SELECTED, new ExportCommand(this, true, Globals.prefs)),
factory.createMenuItem(StandardActions.SAVE_SELECTED_AS_PLAIN_BIBTEX, new OldDatabaseCommandWrapper(Actions.SAVE_SELECTED_AS_PLAIN, this, stateManager))),

factory.createMenuItem(StandardActions.CONNECT_TO_SHARED_DB, new ConnectToSharedDatabaseCommand(this)),
factory.createMenuItem(StandardActions.PULL_CHANGES_FROM_SHARED_DB, new OldDatabaseCommandWrapper(Actions.PULL_CHANGES_FROM_SHARED_DATABASE, this, stateManager)),
new SeparatorMenuItem(),

factory.createSubMenu(StandardActions.REMOTE_DB,
factory.createMenuItem(StandardActions.CONNECT_TO_SHARED_DB, new ConnectToSharedDatabaseCommand(this)),
factory.createMenuItem(StandardActions.PULL_CHANGES_FROM_SHARED_DB, new OldDatabaseCommandWrapper(Actions.PULL_CHANGES_FROM_SHARED_DATABASE, this, stateManager))
),

new SeparatorMenuItem(),

Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jabref/gui/actions/StandardActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public enum StandardActions implements Action {
IMPORT_INTO_NEW_LIBRARY(Localization.lang("Import into new library"), KeyBinding.IMPORT_INTO_NEW_DATABASE),
IMPORT_INTO_CURRENT_LIBRARY(Localization.lang("Import into current library"), KeyBinding.IMPORT_INTO_CURRENT_DATABASE),
EXPORT_ALL(Localization.lang("Export all entries")),
REMOTE_DB(Localization.lang("Remote database"), IconTheme.JabRefIcons.REMOTE_DATABASE),
EXPORT_SELECTED(Localization.lang("Export selected entries"), KeyBinding.EXPORT_SELECTED),
CONNECT_TO_SHARED_DB(Localization.lang("Connect to shared database"), IconTheme.JabRefIcons.CONNECT_DB),
PULL_CHANGES_FROM_SHARED_DB(Localization.lang("Pull changes from shared database"), KeyBinding.PULL_CHANGES_FROM_SHARED_DATABASE),
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/gui/icon/IconTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ public enum JabRefIcons implements JabRefIcon {
REMOVE_ABBREVIATION_LIST(MaterialDesignIcon.FOLDER_REMOVE),
ADD_ABBREVIATION(MaterialDesignIcon.PLAYLIST_PLUS),
REMOVE_ABBREVIATION(MaterialDesignIcon.PLAYLIST_MINUS),
NEW_ENTRY_FROM_PLAIN_TEXT(MaterialDesignIcon.PLUS_BOX);
NEW_ENTRY_FROM_PLAIN_TEXT(MaterialDesignIcon.PLUS_BOX),
REMOTE_DATABASE(MaterialDesignIcon.DATABASE);

private final JabRefIcon icon;

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2116,3 +2116,4 @@ Optional=Optional
Required=Required
Entry\ type\ cannot\ be\ empty.\ Please\ enter\ a\ name.=Entry type cannot be empty. Please enter a name.
Field\ cannot\ be\ empty.\ Please\ enter\ a\ name.=Field cannot be empty. Please enter a name.
Remote\ database=Remote database

0 comments on commit cb5948d

Please sign in to comment.