Skip to content

Commit 9745b28

Browse files
committed
1:修复引擎无法在mac os英特尔环境运行的问题。2:修复编辑规则设置窗口,mac os下无法通过顶部菜单栏拖动窗口的问题。3:修复视频嗅探设置窗口,mac os下无法通过顶部菜单栏拖动窗口的问题。4:独立任务进度窗口,顶部菜单栏适配mac os系统。5:下载完成窗口,顶部菜单栏适配mac os系统。6:统一所有独立窗口的背景色。7:删除偏好设置窗口里的BT统计功能。8:删除优先级引擎功能
1 parent 405d56c commit 9745b28

25 files changed

Lines changed: 2064 additions & 2429 deletions

extra/darwin/arm64/engine/fluxcore

100644100755
308 KB
Binary file not shown.

extra/darwin/x64/engine/fluxcore

100644100755
4.39 MB
Binary file not shown.
-63.1 KB
Binary file not shown.

extra/darwin/x64/fluxcorex

6.84 MB
Binary file not shown.

linkcore-download-manager@2.3.1

Whitespace-only changes.

node

Whitespace-only changes.

package-lock.json

Lines changed: 1195 additions & 939 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"css-loader": "^6.7.3",
9090
"css-minimizer-webpack-plugin": "^5.0.0",
9191
"del": "^6.1.1",
92-
"electron": "40.4.1",
92+
"electron": "^40.4.1",
9393
"electron-builder": "^25.1.8",
9494
"electron-devtools-installer": "^3.2.0",
9595
"eslint": "^7.32.0",

src/main/Application.js

Lines changed: 16 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import TouchBarManager from './ui/TouchBarManager'
4545
import TrayManager from './ui/TrayManager'
4646
import DockManager from './ui/DockManager'
4747
import ThemeManager from './ui/ThemeManager'
48-
import PriorityManager from './core/PriorityManager'
4948

5049
export default class Application extends EventEmitter {
5150
constructor () {
@@ -119,8 +118,6 @@ export default class Application extends EventEmitter {
119118

120119
this.initUpdaterManager()
121120

122-
this.initPriorityManager()
123-
124121
this.handleCommands()
125122

126123
this.handleEvents()
@@ -1096,7 +1093,11 @@ export default class Application extends EventEmitter {
10961093
const key = 'custom-keymap'
10971094
this.configListeners[key] = userConfig.onDidChange(key, async (newValue, oldValue) => {
10981095
logger.info(`[Motrix] detected ${key} value change event:`, newValue, oldValue)
1099-
this.menuManager.setup(this.locale)
1096+
if (this.menuManager) {
1097+
this.menuManager.setup(this.locale)
1098+
} else {
1099+
logger.warn('[Motrix] menuManager not initialized')
1100+
}
11001101
})
11011102
}
11021103

@@ -1134,7 +1135,11 @@ export default class Application extends EventEmitter {
11341135
}
11351136

11361137
logger.info('[Motrix] setup protocols client:', newValue)
1137-
this.protocolManager.setup(newValue)
1138+
if (this.protocolManager) {
1139+
this.protocolManager.setup(newValue)
1140+
} else {
1141+
logger.warn('[Motrix] protocolManager not initialized')
1142+
}
11381143
})
11391144
}
11401145

@@ -1243,21 +1248,6 @@ export default class Application extends EventEmitter {
12431248
})
12441249
}
12451250

1246-
watchPriorityEngineChange () {
1247-
const { userConfig } = this.configManager
1248-
const key = 'enablePriorityEngine'
1249-
this.configListeners[key] = userConfig.onDidChange(key, async (newValue, oldValue) => {
1250-
logger.info(`[Motrix] detected ${key} value change event:`, newValue, oldValue)
1251-
if (this.priorityManager) {
1252-
if (newValue) {
1253-
this.priorityManager.enable()
1254-
} else {
1255-
this.priorityManager.disable()
1256-
}
1257-
}
1258-
})
1259-
}
1260-
12611251
watchShowProgressBarChange () {
12621252
const { userConfig } = this.configManager
12631253
const key = 'show-progress-bar'
@@ -1614,7 +1604,7 @@ export default class Application extends EventEmitter {
16141604
this.emit('ready')
16151605
})
16161606

1617-
if (is.macOS()) {
1607+
if (is.macOS() && this.touchBarManager) {
16181608
this.touchBarManager.setup(page, win)
16191609
}
16201610
}
@@ -2101,20 +2091,6 @@ export default class Application extends EventEmitter {
21012091
this.handleUpdaterEvents()
21022092
}
21032093

2104-
initPriorityManager () {
2105-
this.priorityManager = new PriorityManager({
2106-
configManager: this.configManager
2107-
})
2108-
}
2109-
2110-
startPriorityManager () {
2111-
if (!this.priorityManager) return
2112-
2113-
this.priorityManager.init({
2114-
engine: this.engineClient
2115-
})
2116-
}
2117-
21182094
handleUpdaterEvents () {
21192095
this.updateManager.on('checking', (event) => {
21202096
this.menuManager.updateMenuItemEnabledState('app.check-for-updates', false)
@@ -2958,24 +2934,17 @@ export default class Application extends EventEmitter {
29582934
return
29592935
}
29602936
logger.info('[Motrix] setup protocols client:', protocols)
2961-
this.protocolManager.setup(protocols)
2937+
if (this.protocolManager) {
2938+
this.protocolManager.setup(protocols)
2939+
} else {
2940+
logger.warn('[Motrix] protocolManager not initialized')
2941+
}
29622942
})
29632943

29642944
this.on('application:open-external', (url) => {
29652945
this.openExternal(url)
29662946
})
29672947

2968-
this.on('application:toggle-priority-engine', (enabled) => {
2969-
logger.info('[Motrix] toggle priority engine:', enabled)
2970-
if (this.priorityManager) {
2971-
if (enabled) {
2972-
this.priorityManager.enable()
2973-
} else {
2974-
this.priorityManager.disable()
2975-
}
2976-
}
2977-
})
2978-
29792948
this.on('task-progress:control', (payload = {}) => {
29802949
const window = this.windowManager.getWindow('index')
29812950
if (!window) {
@@ -3146,9 +3115,6 @@ export default class Application extends EventEmitter {
31463115
this.adjustMenu()
31473116
this.scheduleCheckTaskPlan(2000)
31483117

3149-
// 启动优先级管理器
3150-
this.startPriorityManager()
3151-
31523118
// 监听主窗口加载完成事件,确保前端组件已挂载后再发送更新状态
31533119
const mainWindow = this.windowManager.getWindow('index')
31543120
if (mainWindow) {
@@ -3174,7 +3140,6 @@ export default class Application extends EventEmitter {
31743140
this.watchLocaleChange()
31753141
this.watchThemeChange()
31763142
this.watchAutoCheckUpdateChange()
3177-
this.watchPriorityEngineChange()
31783143

31793144
this.on('download-status-change', (downloading) => {
31803145
this.trayManager.handleDownloadStatusChange(downloading)
@@ -3196,11 +3161,6 @@ export default class Application extends EventEmitter {
31963161
this.dockManager.openDock(path)
31973162
this._taskPlanHasCompletionSinceEnabled = true
31983163

3199-
// 通知优先级管理器任务完成
3200-
if (this.priorityManager) {
3201-
this.priorityManager.onTaskComplete(task.gid)
3202-
}
3203-
32043164
// 执行安全扫描
32053165
this.performSecurityScan(task, path)
32063166

@@ -3211,10 +3171,6 @@ export default class Application extends EventEmitter {
32113171
})
32123172

32133173
this.on('download-start', (event) => {
3214-
// 通知优先级管理器任务开始
3215-
if (this.priorityManager) {
3216-
this.priorityManager.onTaskStart()
3217-
}
32183174
})
32193175

32203176
if (this.configManager.userConfig.get('show-progress-bar')) {
@@ -3509,23 +3465,6 @@ export default class Application extends EventEmitter {
35093465
}
35103466
})
35113467

3512-
// 优先级管理相关
3513-
ipcMain.handle('priority:status', async () => {
3514-
if (this.priorityManager) {
3515-
const status = this.priorityManager.getStatus()
3516-
return { success: true, ...status }
3517-
}
3518-
return { success: false, error: 'PriorityManager not initialized' }
3519-
})
3520-
3521-
ipcMain.handle('priority:rebalance', async () => {
3522-
if (this.priorityManager) {
3523-
await this.priorityManager.rebalanceResources()
3524-
return { success: true }
3525-
}
3526-
return { success: false, error: 'PriorityManager not initialized' }
3527-
})
3528-
35293468
// Get progress window size
35303469
ipcMain.handle('get-progress-window-size', async (event) => {
35313470
try {

0 commit comments

Comments
 (0)