Skip to content

Commit

Permalink
Fixed: #4166 add move & rename file (#4217)
Browse files Browse the repository at this point in the history
* Fixed: #4166 add move & rename file

* Updated: CHANGELOG.md
  • Loading branch information
upupming authored and tobiasdiez committed Jul 17, 2018
1 parent 09111c1 commit 31e6797
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
## [Unreleased]

### Changed
- We added a "Move file to file directory and rename file" option for simultaneously moving and renaming of document file. [#4166](https://github.com/JabRef/jabref/issues/4166)
- Use integrated graphics card instead of discrete on macOS [#4070](https://github.com/JabRef/jabref/issues/4070)
- We changed the minimum required version of Java to 1.8.0_171, as this is the latest release for which the automatic Java update works. [4093](https://github.com/JabRef/jabref/issues/4093)
- The special fields like `Printed` and `Read status` now show gray icons when the row is hovered.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ public void moveToDefaultDirectory() {
}
}

public void moveToDefaultDirectoryAndRename() {
moveToDefaultDirectory();
rename();
}

public boolean delete(FileDirectoryPreferences prefs) {
Optional<Path> file = linkedFile.findIn(databaseContext, prefs);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ private ContextMenu createContextMenuForFile(LinkedFileViewModel linkedFile) {
moveFile.setOnAction(event -> linkedFile.moveToDefaultDirectory());
moveFile.setDisable(linkedFile.getFile().isOnlineLink());

MenuItem renameAndMoveFile = new MenuItem(Localization.lang("Move file to file directory and rename file"));
renameAndMoveFile.setOnAction(event -> linkedFile.moveToDefaultDirectoryAndRename());
renameAndMoveFile.setDisable(linkedFile.getFile().isOnlineLink());

MenuItem deleteFile = new MenuItem(Localization.lang("Permanently delete local file"));
deleteFile.setOnAction(event -> viewModel.deleteFile(linkedFile));
deleteFile.setDisable(linkedFile.getFile().isOnlineLink());
Expand All @@ -273,7 +277,7 @@ private ContextMenu createContextMenuForFile(LinkedFileViewModel linkedFile) {
if (linkedFile.getFile().isOnlineLink()) {
menu.getItems().add(download);
}
menu.getItems().addAll(renameFile, moveFile, deleteLink, deleteFile);
menu.getItems().addAll(renameFile, moveFile, renameAndMoveFile, deleteLink, deleteFile);

return menu;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,8 @@ Query\ '%0'\ with\ fetcher\ '%1'\ did\ not\ return\ any\ results.=Query '%0' wit
Move\ file=Move file
Rename\ file=Rename file

Move\ file\ to\ file\ directory\ and\ rename\ file=Move file to file directory and rename file

Move\ file\ failed=Move file failed
Could\ not\ move\ file\ '%0'.=Could not move file '%0'.
Could\ not\ find\ file\ '%0'.=Could not find file '%0'.
Expand Down
10 changes: 6 additions & 4 deletions src/main/resources/l10n/JabRef_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Copied\ keys=已复制 BibTeX 键
Copy=复制

Copy\ BibTeX\ key=复制 BibTeX 键
Copy\ file\ to\ file\ directory=拷贝文件到文件目录
Copy\ file\ to\ file\ directory=拷贝文件到文件目录

Copy\ to\ clipboard=复制到剪贴板

Expand Down Expand Up @@ -1181,8 +1181,10 @@ Could\ not\ find\ fetcher\ '%0'=无法找到抓取器 '%0'
Running\ query\ '%0'\ with\ fetcher\ '%1'.=使用抓取器'%1'执行请求'%0'
Query\ '%0'\ with\ fetcher\ '%1'\ did\ not\ return\ any\ results.=使用抓取器'%1'请求'%0'未返回任何结果。

Move\ file=移动 文件
Rename\ file=重命名 文件
Move\ file=移动文件
Rename\ file=重命名文件

Move\ file\ to\ file\ directory\ and\ rename\ file=移动文件到文件目录重命名文件

Move\ file\ failed=移动文件失败
Could\ not\ move\ file\ '%0'.=无法移动文件 '%0'
Expand Down Expand Up @@ -1262,7 +1264,7 @@ Enforce\ legal\ characters\ in\ BibTeX\ keys=强制在 BibTeX 键值中使用合

Save\ without\ backup?=保存但不备份?
Unable\ to\ create\ backup=无法创建备份
Move\ file\ to\ file\ directory=移动文件到文件目录
Move\ file\ to\ file\ directory=移动文件到文件目录
Rename\ file\ to=将文件更名为
<b>All\ Entries</b>\ (this\ group\ cannot\ be\ edited\ or\ removed)=<b>所有记录</b>(此分组无法被编辑或者删除)
static\ group=静态分组
Expand Down

0 comments on commit 31e6797

Please sign in to comment.