Skip to content

Commit

Permalink
Merge branch 'feature/i18next_201901042000'
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	src/main/menus/en-US/linux.json
#	src/main/menus/en-US/win32.json
#	src/main/menus/zh-CN/linux.json
#	src/main/menus/zh-CN/win32.json
#	src/renderer/pages/index/App.vue
  • Loading branch information
agalwood committed Feb 1, 2019
2 parents fd5b21c + 31081bb commit f94cd01
Show file tree
Hide file tree
Showing 75 changed files with 1,254 additions and 384 deletions.
83 changes: 83 additions & 0 deletions README-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Motrix

<a href="https://motrix.app">
<img src="https://cdn.nlark.com/yuque/0/2018/png/129147/1543735425232-a5d2c99f-d788-43e4-9781-558ff6d21027.png" width="256" alt="App Icon" />
</a>

[English](./README.md) | 简体中文

## 一款全能的下载工具
[![Build Status](https://travis-ci.org/agalwood/Motrix.svg?branch=master)](https://travis-ci.org/agalwood/Motrix) [![Build status](https://ci.appveyor.com/api/projects/status/l11d5h05xwwcvoux/branch/master?svg=true)](https://ci.appveyor.com/project/agalwood/motrix/branch/master) ![Total Downloads](https://img.shields.io/github/downloads/agalwood/Motrix/total.svg) ![Support Platforms](https://camo.githubusercontent.com/a50c47295f350646d08f2e1ccd797ceca3840e52/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6d61634f5325323025374325323057696e646f77732532302537432532304c696e75782d6c69676874677265792e737667)

支持下载 HTTP、FTP、BT、磁力链、百度网盘等资源

<span style="font-size: 30px">我</span>是个兴趣使然的桌面应用开发者🤓,出于兴趣爱好,利用搬砖之余开发了 [MO 1.0](https://moapp.me) 版本,做出来有大半年了,没做过什么推广,所以大家可能都没怎么听过这个应用吧~👻~

本着自己用得舒(折)服(腾)😌的想法,🤠撸出了个全新的版本,并更名为 Motrix。新版本不仅优化了性能,还重新设计了图形操作界面,操作更简便!

[官网](https://motrix.app)提供了已经编译好的应用安装包([去官网下载](https://motrix.app/release)),当然你也可以自己克隆代码进行编译打包。

## 💽 安装稳定版
你可以 [Github Release](https://github.com/agalwood/Motrix/releases) 下载,也可以从[国内镜像](https://www.yuque.com/moapp/help/release)下载。
> 七牛CDN流量🔥烧不起,高峰时一天烧了110G的流量💸💸💸
## ✨ 特性
- 🕹 简洁明了的图形操作界面
- 🧲 支持BT和磁力链任务
- 🤫 支持下载百度云盘资源
- 🎛 最高支持 10 个任务同时下载
- 🚀 单任务最高支持 64 线程下载
- 🕶 模拟用户代理UA
- 🔔 下载完成后通知
- 💻 支持触控栏快捷健 (Mac 专享)
- 🗑 移除任务时可同时删除相关文件
- 🌍 国际化(当前可选简体中文和美式英语)
- 🎏 ...

## 🖥 应用界面
![motrix-screenshot-task-cn.png](https://cdn.nlark.com/yuque/0/2019/png/129147/1548251088177-21762a41-3975-4417-bf54-6f64aeb0f20d.png)

## ⌨️ 本地开发

### 克隆代码
```bash
git clone [email protected]:agalwood/Motrix.git
```

### 安装依赖
```bash
cd Motrix
npm install
```
天朝大陆用户建议使用淘宝的npm源
```bash
npm config set registry 'https://registry.npm.taobao.org'
export ELECTRON_MIRROR='https://npm.taobao.org/mirrors/electron/'
export SASS_BINARY_SITE='https://npm.taobao.org/mirrors/node-sass'
```
如果喜欢 [Yarn](https://yarnpkg.com/),也可以使用 `yarn` 安装依赖

### 开发模式
```bash
npm run dev
```

### 编译打包
```bash
npm run build
```
完成之后可以在项目的 `release` 目录看到编译打包好的应用文件

## 🛠 技术栈
- [Electron](https://electronjs.org/)
- [Vue](https://vuejs.org/) + [VueX](https://vuex.vuejs.org/) + [Element](https://element.eleme.io)
- [Aria2](https://aria2.github.io/) (注:macOS 和 Linux 版本使用的是 64 位的 aria2c,Windows 版使用的 32 位的)

## ☑️ TODO
开发计划请移步 [Trello](https://trello.com/b/qNUzA0bv/motrix) 查看

## 🤝 参与共建 [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
如果你有兴趣参与共同开发,欢迎 FORK 和 PR。

## 📜 开源许可
基于 [MIT license](https://opensource.org/licenses/MIT) 许可进行开源。
67 changes: 39 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,70 @@
<img src="https://cdn.nlark.com/yuque/0/2018/png/129147/1543735425232-a5d2c99f-d788-43e4-9781-558ff6d21027.png" width="256" alt="App Icon" />
</a>

## 一款全能的下载工具
[![Build Status](https://travis-ci.org/agalwood/Motrix.svg?branch=master)](https://travis-ci.org/agalwood/Motrix) [![Build status](https://ci.appveyor.com/api/projects/status/l11d5h05xwwcvoux/branch/master?svg=true)](https://ci.appveyor.com/project/agalwood/motrix/branch/master)
## A full-featured download manager.
[![Build Status](https://travis-ci.org/agalwood/Motrix.svg?branch=master)](https://travis-ci.org/agalwood/Motrix) [![Build status](https://ci.appveyor.com/api/projects/status/l11d5h05xwwcvoux/branch/master?svg=true)](https://ci.appveyor.com/project/agalwood/motrix/branch/master) ![Total Downloads](https://img.shields.io/github/downloads/agalwood/Motrix/total.svg) ![Support Platforms](https://camo.githubusercontent.com/a50c47295f350646d08f2e1ccd797ceca3840e52/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6d61634f5325323025374325323057696e646f77732532302537432532304c696e75782d6c69676874677265792e737667)

English | [简体中文](./README-CN.md)

支持下载 HTTP、FTP、BT、磁力链、百度网盘等资源
Motrix a full-featured download manager that support downloading HTTP, FTP, BitTorrent, Magnet, Baidu Net Disk and other resources.
It has a clean and simple interface and is easy to use. I hope you will like it 👻.

<span style="font-size: 30px">我</span>是个兴趣使然的桌面应用开发者🤓,出于兴趣爱好,利用搬砖之余开发了 [MO 1.0](https://moapp.me) 版本,做出来有大半年了,没做过什么推广,所以大家可能都没怎么听过这个应用吧~👻~
[Official Website](https://motrix.app)

本着自己用得舒(折)服(腾)😌的想法,🤠撸出了个全新的版本,并更名为 Motrix。新版本不仅优化了性能,还重新设计了图形操作界面,操作更简便!
## 💽 Installation
Download from [Github Releases](https://github.com/agalwood/Motrix/releases) and install it.

[官网](https://motrix.app)提供了已经编译好的应用安装包([去官网下载](https://motrix.app/release)),当然你也可以自己克隆代码进行编译打包。
## ✨ Features
- 🕹 Simple and clear user interface
- 🧲 Support BitTorrent & Magnet
- 🤫 Support downloading Baidu Net Disk
- 🎛 Up to 10 tasks concurrently download
- 🚀 Single task maximum support 64 thread download
- 🕶 Mock User-Agent
- 🔔 Download completed Notification
- 💻 Ready for Touch Bar (Mac only)
- 🗑 Delete related files when removing tasks (optional)
- 🌍 I18n, currently available Simplified Chinese & English.
- 🎏 ...

## 🛠 技术栈
- [Electron](https://electronjs.org/)
- [Vue](https://vuejs.org/) + [VueX](https://vuex.vuejs.org/) + [Element](https://element.eleme.io)
- [Aria2](https://aria2.github.io/) (注:macOS 和 Linux 版本使用的是 64 位的 aria2c,Windows 版使用的 32 位的)
## 🖥 User Interface
![motrix-screenshot-task-en.png](https://cdn.nlark.com/yuque/0/2019/png/129147/1548251350313-73aa0d60-ee31-4405-bdb9-1793e3fd46ef.png)

## 📦 自行编译
## ⌨️ Development

### 克隆代码
### Clone Code
```bash
git clone [email protected]:agalwood/Motrix.git
```

### 安装依赖
### Install Dependencies
```bash
cd Motrix
npm install
```
天朝大陆用户建议使用淘宝的npm源
```bash
npm config set registry 'https://registry.npm.taobao.org'
export ELECTRON_MIRROR='https://npm.taobao.org/mirrors/electron/'
export SASS_BINARY_SITE='https://npm.taobao.org/mirrors/node-sass'
```
如果喜欢 [Yarn](https://yarnpkg.com/),也可以使用 `yarn` 安装依赖
If you like [Yarn](https://yarnpkg.com/), you can also use `yarn` to install dependencies.

### 开发模式
### Dev Mode
```bash
npm run dev
```

### 编译打包
### Build Release
```bash
npm run build
```
完成之后可以在项目的 release 目录看到编译打包好的应用文件
After build finish, you can see the compiled packaged application file in the `release` directory of the project.

## 🛠 Technology Stack
- [Electron](https://electronjs.org/)
- [Vue](https://vuejs.org/) + [VueX](https://vuex.vuejs.org/) + [Element](https://element.eleme.io)
- [Aria2](https://aria2.github.io/) (Note: macOS and Linux versions use 64-bit aria2c, Windows version uses 32-bit)

## ☑️ TODO
开发计划请移步 [Trello](https://trello.com/b/qNUzA0bv/motrix)
Development Roadmap see: [Trello](https://trello.com/b/qNUzA0bv/motrix)

## 🤝 参与共建 [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
如果你有兴趣参与共同开发,欢迎 FORK 和 PR。
## 🤝 Contribute [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
If you are interested in participating in joint development, Fork and PR are welcome.

## 📜 开源许可
基于 [MIT license](https://opensource.org/licenses/MIT) 许可进行开源。
## 📜 License
[MIT](https://opensource.org/licenses/MIT) Copyright (c) 2018-present Dr_rOot
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
]
},
"dependencies": {
"@panter/vue-i18next": "^0.13.0",
"aria2": "^4.0.3",
"axios": "^0.18.0",
"clipboard-polyfill": "^2.7.0",
Expand All @@ -136,6 +137,7 @@
"electron-updater": "^4.0.7",
"element-ui": "^2.4.11",
"forever-monitor": "^1.7.1",
"i18next": "^13.1.0",
"lodash": "^4.17.11",
"normalize.css": "^8.0.1",
"parse-torrent": "^6.1.2",
Expand Down
16 changes: 10 additions & 6 deletions src/main/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ export default class Application extends EventEmitter {

this.exceptionHandler = new ExceptionHandler()

this.locale = app.getLocale()
logger.log('[Motrix] Locale: ', this.locale)
this.init()
}

init () {
this.configManager = new ConfigManager()
this.locale = this.configManager.getLocale()

this.windowManager = new WindowManager()
this.windowManager = new WindowManager({
userConfig: this.configManager.getUserConfig()
})

this.engine = new Engine({
systemConfig: this.configManager.getSystemConfig(),
Expand Down Expand Up @@ -106,14 +110,14 @@ export default class Application extends EventEmitter {
}

initProtocolManager () {
if (is.mas()) {
if (is.dev() || is.mas()) {
return
}
this.protocolManager = new ProtocolManager()
}

handleProtocol (url) {
if (is.mas()) {
if (is.dev() || is.mas()) {
return
}
this.protocolManager.handle(url)
Expand Down Expand Up @@ -193,7 +197,7 @@ export default class Application extends EventEmitter {
this.updateManager.check()
})

this.on('application:set-locale', (locale) => {
this.on('application:change-locale', (locale) => {
this.menuManager.setup(locale)
})

Expand Down
5 changes: 5 additions & 0 deletions src/main/core/ConfigManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default class ConfigManager {
defaults: {
'resume-all-when-app-launched': false,
'task-notification': true,
'hide-app-menu': false,
'new-task-show-downloading': true,
'auto-check-for-updates': false,
'update-channel': 'latest',
Expand Down Expand Up @@ -82,6 +83,10 @@ export default class ConfigManager {
return this.userConfig.get(key, defaultValue)
}

getLocale () {
return this.getUserConfig('locale') || app.getLocale()
}

setSystemConfig (...args) {
this.systemConfig.set(...args)
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/core/ExceptionHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class ExceptionHandler {
logger.error(stack)

if (showDialog && app.isReady()) {
dialog.showErrorBox('系统错误', message)
dialog.showErrorBox('Error: ', message)
}
})
}
Expand Down
Empty file removed src/main/menus/darwin.js
Empty file.
31 changes: 15 additions & 16 deletions src/main/menus/en-US/darwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@
"menu": [
{
"label": "Motrix",
"id": "app",
"id": "menu.app",
"submenu": [
{ "label": "About Motrix", "id": "app.about", "command": "application:about", "command-before": "application:show,index"},
{ "type": "separator" },
{ "label": "Preferences...", "id": "app.preferences", "command": "application:preferences" },
{ "label": "Preferences...", "id": "app.preferences", "command": "application:preferences", "command-before": "application:show,index"},
{ "label": "Check for Updates...", "id": "app.check-for-updates", "command": "application:check-for-updates" },
{ "label": "Services", "role": "services", "submenu": [] },
{ "label": "Hide Motrix", "role": "hide" },
{ "label": "Hide Others", "role": "hideothers" },
{ "label": "Show All", "role": "unhide" },
{ "label": "Hide Motrix", "id": "app.hide", "role": "hide" },
{ "label": "Hide Others", "id": "app.hide-others", "role": "hideothers" },
{ "label": "Show All", "id": "app.unhide", "role": "unhide" },
{ "type": "separator" },
{ "label": "Quit Motrix", "id": "app.quit", "role": "quit" }
]
},
{
"label": "Task",
"id": "task",
"id": "menu.task",
"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"},
Expand All @@ -37,7 +36,7 @@
},
{
"label": "Edit",
"id": "edit",
"id": "menu.edit",
"submenu": [
{ "label": "Undo", "id": "edit.undo", "role": "undo" },
{ "label": "Redo", "id": "edit.redo", "role": "redo" },
Expand All @@ -52,21 +51,21 @@
{
"label": "Window",
"role": "window",
"id": "window",
"id": "menu.window",
"submenu": [
{ "label": "Reload", "id": "view.reload", "role": "reload" },
{ "label": "Close", "role": "close" },
{ "label": "Minimize", "role": "minimize" },
{ "label": "Zoom", "role": "zoom" },
{ "label": "Enter Full Screen", "role": "togglefullscreen" },
{ "label": "Reload", "id": "window.reload", "role": "reload" },
{ "label": "Close", "id": "window.close", "role": "close" },
{ "label": "Minimize", "id": "window.minimize", "role": "minimize" },
{ "label": "Zoom", "id": "window.zoom", "role": "zoom" },
{ "label": "Enter Full Screen", "id": "window.toggle-fullscreen", "role": "togglefullscreen" },
{ "type": "separator" },
{ "label": "Bring All to Front", "role": "front" }
{ "label": "Bring All to Front", "id": "window.front", "role": "front" }
]
},
{
"label": "Help",
"role": "help",
"id": "help",
"id": "menu.help",
"submenu": [
{ "label": "Motrix Website", "id": "help.official-website", "command": "help:official-website" },
{ "label": "Manual", "id": "help.manual", "command": "help:manual" },
Expand Down
Loading

0 comments on commit f94cd01

Please sign in to comment.