Skip to content

Commit

Permalink
feat: 点击关闭全部Tab页后,弹出提示框。close #165
Browse files Browse the repository at this point in the history
  • Loading branch information
nICEnnnnnnnLee committed Nov 1, 2023
1 parent 2ec6fb7 commit f2bddbe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/nicelee/ui/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public class Global {
public static boolean closeToSystray;
@Config(key = "bilibili.tab.display.previewPic", note = "Tab页面自动显示作品预览图", defaultValue = "on", eq_true = "on", valids = { "on", "off" })
public static boolean autoDisplayPreviewPic;
@Config(key = "bilibili.menu.tab.promptBeforeCloseAllTabs", note = "点击【关闭全部Tab页】后,弹出确认框", defaultValue = "true", valids = { "true", "false" })
public static boolean promptBeforeCloseAllTabs;

public static ImageIcon backgroundImg;
public static FrameWaiting frWaiting;
Expand Down
11 changes: 10 additions & 1 deletion src/nicelee/ui/item/MJMenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,16 @@ public void actionPerformed(ActionEvent e) {
closeAllMenuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Global.index.closeAllVideoTabs();
if(Global.promptBeforeCloseAllTabs) {
Object[] options = { "是", "否" };
int m = JOptionPane.showOptionDialog(null,
"关闭所有Tab页面?\n\nps:想要取消此确认框,可在配置页搜索关键词\n【menu.tab】 或 【promptBeforeCloseAllTabs】 或 【弹出确认框】",
"请确认", JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[0]);
if (m == 0) {
Global.index.closeAllVideoTabs();
}
}else
Global.index.closeAllVideoTabs();
}
});

Expand Down
3 changes: 3 additions & 0 deletions src/resources/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ bilibili.menu.download.plan = 1
## 批量下载优先下载清晰度 8K/HDR/4K/1080P60/1080P+/1080P/720P60/720P/480P/320P
bilibili.menu.download.qn = 1080P
bilibili.tab.download.qn = 1080P

## 在菜单栏里,点击【关闭全部Tab页】后,弹出确认框 true/false
bilibili.menu.tab.promptBeforeCloseAllTabs = true
#######################################################################################################
# 分页查询时,每页最大显示个数
bilibili.pageSize = 5
Expand Down

0 comments on commit f2bddbe

Please sign in to comment.