Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: #4166 add move & rename file #4217

Merged
merged 2 commits into from
Jul 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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