Skip to content

Commit

Permalink
feat(ui): 增加临时启用/关闭下载链接host替换功能的按钮
Browse files Browse the repository at this point in the history
  • Loading branch information
nICEnnnnnnnLee committed Jun 23, 2024
1 parent 1a2b335 commit 43107b0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/nicelee/ui/item/MJMenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,19 @@ public void onItemSelected(int itemIndex, JRadioButtonMenuItem item) {
}
}
}.build();
JMenu dForceReplaceHostMenuItem = new MJMenuWithRadioGroupBuilder("音视频链接替换host?", "替换", "不替换") {
@Override
public void onItemSelected(int itemIndex, JRadioButtonMenuItem item) {
Global.forceReplaceUposHost = itemIndex == 0;
Logger.println("音视频链接强制替换host:" + Global.forceReplaceUposHost);
}

@Override
public void init(JRadioButtonMenuItem[] menuItems) {
int itemIndex = Global.forceReplaceUposHost ? 0 : 1;
menuItems[itemIndex].setSelected(true);
}
}.build();

List<String> qnSelections = new ArrayList<>();
for (VideoQualityEnum item : VideoQualityEnum.values()) {
Expand Down Expand Up @@ -267,6 +280,7 @@ public void init(JRadioButtonMenuItem[] menuItems) {
configMenu.add(dUseRepoMenuItem);
configMenu.add(dDashDownTypeMenuItem);
configMenu.add(dTypeReDownloadMenuItem);
configMenu.add(dForceReplaceHostMenuItem);
configMenu.add(dQNMenuItem);
configMenu.add(dBatchDownMenuItem);
configMenu.add(dUpdateMenuItem);
Expand Down

0 comments on commit 43107b0

Please sign in to comment.