Skip to content

A full-featured download manager.

feat: open torrent from file dialog

Dr_rOotf36cdccf9fee
diff --git a/src/main/Application.js b/src/main/Application.js
index 8fdf10c2..fed92999 100644
--- a/src/main/Application.js
+++ b/src/main/Application.js
@@ -1,6 +1,8 @@
import { EventEmitter } from 'events'
import { app, shell, dialog, ipcMain } from 'electron'
import is from 'electron-is'
+import * as fs from 'fs'
+import { extname, basename } from 'path'
import logger from './core/Logger'
import ConfigManager from './core/ConfigManager'
import { setupLocaleManager } from '@/ui/Locale'
@@ -15,6 +17,7 @@ import TouchBarManager from './ui/TouchBarManager'
export default class Application extends EventEmitter {
constructor () {
super()
+ this.isReady = false
this.init()
}
@@ -23,6 +26,7 @@ export default class Application extends EventEmitter {
this.locale = this.configManager.getLocale()
this.localeManager = setupLocaleManager(this.locale)
+ this.i18n = this.localeManager.getI18n()
this.windowManager = new WindowManager({
userConfig: this.configManager.getUserConfig()
@@ -53,12 +57,11 @@ export default class Application extends EventEmitter {
try {
this.engine.start()
} catch (err) {
+ const { message } = err
dialog.showMessageBox({
type: 'error',
- title: '系统错误',
- message: `应用启动失败:${err.message}`,
- buttons: ['知道了'],
- cancelId: 1
+ title: this.i18n.t('app.system-error-title'),
+ message: this.i18n.t('app.system-error-message', { message })
}, () => {
setTimeout(() => {
app.quit()
@@ -73,6 +76,10 @@ export default class Application extends EventEmitter {
showPage (page) {
const win = this.windowManager.openWindow(page)
+ win.once('ready-to-show', () => {
+ this.isReady = true
+ this.emit('ready')
+ })
this.touchBarManager.setup(page, win)
}
@@ -123,6 +130,26 @@ export default class Application extends EventEmitter {
this.showPage('index')
}
+ handleFileAssociation (path) {
+ if (!path) {
+ return
+ }
+ if (extname(path).toLowerCase() !== '.torrent') {
+ return
+ }
+
+ const fileName = basename(path)
+ fs.readFile(path, (err, data) => {
+ if (err) {
+ logger.warn(`[Motrix] read file error: ${path}`, err.message)
+ return
+ }
+ const file = Buffer.from(data).toString('base64')
+ const args = [fileName, file]
+ this.sendCommand('application:new-bt-task-with-file', ...args)
+ })
+ }
+
initUpdaterManager () {
if (is.mas()) {
return
@@ -200,6 +227,21 @@ export default class Application extends EventEmitter {
this.menuManager.setup(locale)
})
+ this.on('application:open-file', (event) => {
+ dialog.showOpenDialog({
+ properties: ['openFile'],
+ filters: [
+ {
+ name: 'Torrent',
+ extensions: ['torrent']
+ }
+ ]
+ }, (filePaths) => {
+ const [filePath] = filePaths
+ this.handleFileAssociation(filePath)
+ })
+ })
+
this.on('application:clear-recent-tasks', () => {
app.clearRecentDocuments()
})
diff --git a/src/main/menus/de/darwin.json b/src/main/menus/de/darwin.json
index 0119155f..9dab38bc 100644
--- a/src/main/menus/de/darwin.json
+++ b/src/main/menus/de/darwin.json
@@ -21,6 +21,7 @@
"submenu": [
{ "label": "Neue Aufgabe", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "Neue BT Aufgabe", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Torrent-Datei öffnen...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Aufgabe pausieren", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Aufgabe fortsetzen", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/de/linux.json b/src/main/menus/de/linux.json
index b3f817b3..0c4dba5c 100644
--- a/src/main/menus/de/linux.json
+++ b/src/main/menus/de/linux.json
@@ -18,6 +18,7 @@
"submenu": [
{ "label": "Neue Aufgabe", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "Neue BT Aufgabe", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Torrent-Datei öffnen...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Aufgabe pausieren", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Aufgabe fortsetzen", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/de/win32.json b/src/main/menus/de/win32.json
index 48c28ae5..68830efb 100644
--- a/src/main/menus/de/win32.json
+++ b/src/main/menus/de/win32.json
@@ -18,6 +18,7 @@
"submenu": [
{ "label": "Neue Aufgabe", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "Neue BT Aufgabe", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Torrent-Datei öffnen...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Aufgabe pausieren", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Aufgabe fortsetzen", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/en-US/darwin.json b/src/main/menus/en-US/darwin.json
index bec9e8fa..ecd73d12 100644
--- a/src/main/menus/en-US/darwin.json
+++ b/src/main/menus/en-US/darwin.json
@@ -21,6 +21,7 @@
"submenu": [
{ "label": "New Task", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "New BT Task", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Open Torrent File...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Pause Task", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Resume Task", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/en-US/linux.json b/src/main/menus/en-US/linux.json
index fc77bf4b..9b651aac 100644
--- a/src/main/menus/en-US/linux.json
+++ b/src/main/menus/en-US/linux.json
@@ -18,6 +18,7 @@
"submenu": [
{ "label": "New Task", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "New BT Task", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Open Torrent File...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Pause Task", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Resume Task", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/en-US/win32.json b/src/main/menus/en-US/win32.json
index bd2cff7f..38638e7a 100644
--- a/src/main/menus/en-US/win32.json
+++ b/src/main/menus/en-US/win32.json
@@ -18,6 +18,7 @@
"submenu": [
{ "label": "New Task", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "New BT Task", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Open Torrent File...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Pause Task", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Resume Task", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/fr/darwin.json b/src/main/menus/fr/darwin.json
index d2536a4a..a84ef5d0 100644
--- a/src/main/menus/fr/darwin.json
+++ b/src/main/menus/fr/darwin.json
@@ -21,6 +21,7 @@
"submenu": [
{ "label": "Nouvelle Tâche", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "Nouvelle Tâche BT", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Ouvrir un fichier torrent...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Mettre en pause", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Reprendre la tâche", "id": "task.resume-task", "command": "application:resume-task" },
@@ -77,4 +78,4 @@
]
}
]
-}
\ No newline at end of file
+}
diff --git a/src/main/menus/fr/linux.json b/src/main/menus/fr/linux.json
index bcb76111..6e25c3e6 100644
--- a/src/main/menus/fr/linux.json
+++ b/src/main/menus/fr/linux.json
@@ -18,6 +18,7 @@
"submenu": [
{ "label": "Nouvelle Tâche", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "Nouvelle Tâche BT", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Ouvrir un fichier torrent...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Mettre en pause", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Reprendre la tâche", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/fr/win32.json b/src/main/menus/fr/win32.json
index 64e490d9..232a1a53 100644
--- a/src/main/menus/fr/win32.json
+++ b/src/main/menus/fr/win32.json
@@ -18,6 +18,7 @@
"submenu": [
{ "label": "Nouvelle Tâche", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "Nouvelle Tâche BT", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Ouvrir un fichier torrent...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Mettre en pause", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Reprendre la tâche", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/pt-BR/darwin.json b/src/main/menus/pt-BR/darwin.json
index f0e1ecb0..19e4ec0a 100644
--- a/src/main/menus/pt-BR/darwin.json
+++ b/src/main/menus/pt-BR/darwin.json
@@ -21,6 +21,7 @@
"submenu": [
{ "label": "Nova Tarefa", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "Nova Tarefa BT", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Abra o arquivo Torrent...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Pausar Tarefa", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Resumir Tarefa", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/pt-BR/linux.json b/src/main/menus/pt-BR/linux.json
index 552608dd..9f13e2e8 100644
--- a/src/main/menus/pt-BR/linux.json
+++ b/src/main/menus/pt-BR/linux.json
@@ -18,6 +18,7 @@
"submenu": [
{ "label": "Nova Tarefa", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "Nova Tarefa BT", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Abra o arquivo Torrent...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Pausar Tarefa", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Resumir Tarefa", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/pt-BR/win32.json b/src/main/menus/pt-BR/win32.json
index de372d14..5805ae8c 100644
--- a/src/main/menus/pt-BR/win32.json
+++ b/src/main/menus/pt-BR/win32.json
@@ -18,6 +18,7 @@
"submenu": [
{ "label": "Nova Tarefa", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "Nova Tarefa BT", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Abra o arquivo Torrent...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Pausar Tarefa", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Resumir Tarefa", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/tr/darwin.json b/src/main/menus/tr/darwin.json
index 2633430b..14414012 100644
--- a/src/main/menus/tr/darwin.json
+++ b/src/main/menus/tr/darwin.json
@@ -21,6 +21,7 @@
"submenu": [
{ "label": "Yeni Görev", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "Yeni BT Görevi", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Torrent Dosyasını Aç...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Görevi Durdur", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Görevi Sürdür", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/tr/linux.json b/src/main/menus/tr/linux.json
index 1f3a2434..4a2aff2b 100644
--- a/src/main/menus/tr/linux.json
+++ b/src/main/menus/tr/linux.json
@@ -18,6 +18,7 @@
"submenu": [
{ "label": "Yeni Görev", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "Yeni BT Görevi", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Torrent Dosyasını Aç...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Görevi Durdur", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Görevi Sürdür", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/tr/win32.json b/src/main/menus/tr/win32.json
index 20b9e725..59f5b114 100644
--- a/src/main/menus/tr/win32.json
+++ b/src/main/menus/tr/win32.json
@@ -18,6 +18,7 @@
"submenu": [
{ "label": "Yeni Görev", "id": "task.new-task", "command": "application:new-task", "command-arg": "uri", "command-after": "application:show,index"},
{ "label": "Yeni BT Görevi", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "Torrent Dosyasını Aç...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Görevi Durdur", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "Görevi Sürdür", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/zh-CN/darwin.json b/src/main/menus/zh-CN/darwin.json
index bade96f1..0263a0f2 100644
--- a/src/main/menus/zh-CN/darwin.json
+++ b/src/main/menus/zh-CN/darwin.json
@@ -21,6 +21,7 @@
"submenu": [
{ "label": "新建任务", "id": "task.new-task", "command": "application:new-task", "command-after": "application:show,index"},
{ "label": "新建 BT 任务", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "打开种子文件...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "暂停任务", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "恢复任务", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/zh-CN/linux.json b/src/main/menus/zh-CN/linux.json
index 1f296e4d..216e1d73 100644
--- a/src/main/menus/zh-CN/linux.json
+++ b/src/main/menus/zh-CN/linux.json
@@ -18,6 +18,7 @@
"submenu": [
{ "label": "新建任务", "id": "task.new-task", "command": "application:new-task", "command-after": "application:show,index"},
{ "label": "新建 BT 任务", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "打开种子文件...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "暂停任务", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "恢复任务", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/zh-CN/win32.json b/src/main/menus/zh-CN/win32.json
index 759c2e7d..399555ea 100644
--- a/src/main/menus/zh-CN/win32.json
+++ b/src/main/menus/zh-CN/win32.json
@@ -18,6 +18,7 @@
"submenu": [
{ "label": "新建任务", "id": "task.new-task", "command": "application:new-task", "command-after": "application:show,index"},
{ "label": "新建 BT 任务", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "打开种子文件...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "暂停任务", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "恢复任务", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/zh-TW/darwin.json b/src/main/menus/zh-TW/darwin.json
index d9f3fa1c..8e395249 100644
--- a/src/main/menus/zh-TW/darwin.json
+++ b/src/main/menus/zh-TW/darwin.json
@@ -20,7 +20,8 @@
"id": "menu.task",
"submenu": [
{ "label": "新增任務", "id": "task.new-task", "command": "application:new-task", "command-after": "application:show,index"},
- { "label": "新建 BT 任務", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "新增 BT 任務", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "打開種子文件...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "暫停任務", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "繼續任務", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/zh-TW/linux.json b/src/main/menus/zh-TW/linux.json
index 3dc7be76..a3b19caa 100644
--- a/src/main/menus/zh-TW/linux.json
+++ b/src/main/menus/zh-TW/linux.json
@@ -17,7 +17,8 @@
"id": "menu.task",
"submenu": [
{ "label": "新增任務", "id": "task.new-task", "command": "application:new-task", "command-after": "application:show,index"},
- { "label": "新建 BT 任務", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "新增 BT 任務", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "打開種子文件...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "暫停任務", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "繼續任務", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/main/menus/zh-TW/win32.json b/src/main/menus/zh-TW/win32.json
index 3017ac5e..f07ba52e 100644
--- a/src/main/menus/zh-TW/win32.json
+++ b/src/main/menus/zh-TW/win32.json
@@ -17,7 +17,8 @@
"id": "menu.task",
"submenu": [
{ "label": "新增任務", "id": "task.new-task", "command": "application:new-task", "command-after": "application:show,index"},
- { "label": "新建 BT 任務", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "新增 BT 任務", "id": "task.new-bt-task", "command": "application:new-bt-task", "command-arg": "torrent", "command-after": "application:show,index"},
+ { "label": "打開種子文件...", "id": "task.open-file", "command": "application:open-file", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "暫停任務", "id": "task.pause-task", "command": "application:pause-task" },
{ "label": "繼續任務", "id": "task.resume-task", "command": "application:resume-task" },
diff --git a/src/renderer/components/Command/index.js b/src/renderer/components/Command/index.js
index ffb15a1a..18880a61 100644
--- a/src/renderer/components/Command/index.js
+++ b/src/renderer/components/Command/index.js
@@ -3,6 +3,8 @@ import store from '@/store'
import CommandManager from './CommandManager'
import { Message } from 'element-ui'
import { getLocaleManager } from '@/components/Locale'
+import { base64StringToBlob } from 'blob-util'
+import { buildFileList } from '@shared/utils'
const commands = new CommandManager()
const i18n = getLocaleManager().getI18n()
@@ -15,6 +17,16 @@ function showAddTask (taskType = 'uri') {
store.dispatch('app/showAddTaskDialog', taskType)
}
+function showAddBtTaskWithFile (fileName, base64Data = '') {
+ const blob = base64StringToBlob(base64Data, 'application/x-bittorrent')
+ const file = new File([blob], fileName, { type: 'application/x-bittorrent' })
+ const fileList = buildFileList(file)
+ store.dispatch('app/showAddTaskDialog', 'torrent')
+ setTimeout(() => {
+ store.dispatch('app/addTaskAddTorrents', { fileList })
+ }, 200)
+}
+
function navigateTaskList (status = 'active') {
router.push({ path: `/task/${status}` })
}
@@ -58,6 +70,7 @@ function resumeAllTask () {
commands.register('application:about', showAboutPanel)
commands.register('application:new-task', showAddTask)
commands.register('application:new-bt-task', showAddTask)
+commands.register('application:new-bt-task-with-file', showAddBtTaskWithFile)
commands.register('application:task-list', navigateTaskList)
commands.register('application:preferences', navigatePreferences)