Skip to content

Commit

Permalink
1.4.0
Browse files Browse the repository at this point in the history
1.增加打开下载文件夹功能。
  • Loading branch information
JelinYao committed Sep 12, 2022
1 parent aaff250 commit 51ee7e5
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 7 deletions.
Binary file added Bin/Debug/skin/explorer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 17 additions & 6 deletions Bin/Debug/skin/wnd_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@

<VerticalLayout bkcolor="#FFFFFFFF">
<HorizontalLayout height="40" bkimage="bk_title.png">
<Control float="true" pos="8,6,0,0" width="28" height="28" bkimage="public/logo.png"/>
<Label text="B站视频下载工具" float="true" pos="40,10,0,0" width="200" textcolor="#FFFFFFFF" height="16" font="2" align="left" valign="center"/>
<Button name="btn_user" float="true" pos="560,6,0,0" width="28" height="28" bkimage="def_icon.png" cursor="hand" tooltip="登录"/>
<Control float="true" pos="560,6,0,0" width="28" height="28" bkimage="icon_mask.png" mouse="false"/>
<Button name="btn_download" float="true" pos="600,6,0,0" width="28" height="28" bkimage="download.png" cursor="hand" tooltip="新建下载"/>
<Button name="btn_close" float="true" pos="669,0,0,0" width="31" height="29" normalimage="file='close.png' source='0,0,31,29' " hotimage="file='close.png' source='0,29,31,58'" pushedimage="close.png' source='0,58,31,87'" cursor="hand"/>
<control width="8"/>
<VerticalLayout>
<Control height="6" />
<HorizontalLayout height="28">
<Control width="28" bkimage="public/logo.png"/>
<Label text="B站视频下载工具" padding="6,0,0,0" width="120" textcolor="#FFFFFFFF" font="2" align="left" valign="center"/>
<Control />
<Container width="28">
<Button name="btn_user" float="true" pos="0,0,0,0" width="28" height="28" bkimage="def_icon.png" cursor="hand" tooltip="登录"/>
<Control float="true" pos="0,0,0,0" width="28" height="28" bkimage="icon_mask.png" mouse="false"/>
</Container>
<Button name="btn_download" padding="6,0,0,0" width="28" bkimage="download.png" cursor="hand" tooltip="新建下载"/>
<Button name="btn_explorer" padding="6,0,0,0" width="28" bkimage="explorer.png" cursor="hand" tooltip="打开下载目录"/>
</HorizontalLayout>
<Control height="6" />
</VerticalLayout>
<Button name="btn_close" padding="16,0,0,0" width="31" height="29" normalimage="file='close.png' source='0,0,31,29' " hotimage="file='close.png' source='0,29,31,58'" pushedimage="close.png' source='0,58,31,87'" cursor="hand"/>
</HorizontalLayout>
<HorizontalLayout >
<VerticalLayout width="100" bkcolor="#FFF3F7FB">
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ mp3lame: https://lame.sourceforge.io/
jsoncpp: https://github.com/open-source-parsers/jsoncpp
restclient: https://github.com/mrtazz/restclient-cpp
## 更新记录
### 2022年9月12日 -- 1.4.0
+ 1.增加打开下载文件夹功能。
### 2022年6月12日 -- 1.3.0
+ 1.监控剪贴板,支持赋值后直接打开下载窗口。
+ 2.修改下载文件命名规则。
Expand Down
Binary file modified src/BVLoader/BVLoader.rc
Binary file not shown.
1 change: 1 addition & 0 deletions src/BVLoader/define/message_define.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ enum MsgboxWparam {
enum ShowwndWparam {
WPARAM_SHOW_LOGIN,
WPARAM_SHOW_DOWNLOAD,
WPARAM_EXPLORER,
};

// qrcode window message
Expand Down
2 changes: 1 addition & 1 deletion src/BVLoader/define/soft_define.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ static constexpr const wchar_t* kAppWindowClassName = L"GuiFoundationClass";
static constexpr const wchar_t* kAppWindowTitle = L"B站视频下载工具";
static constexpr const wchar_t* kAppInstanceMutex = L"{E33E6D86-55E3-496B-B961-A205582F84EC}";
static constexpr const wchar_t* kAppExeName = L"BVLoader.exe";
static constexpr const wchar_t* kAppVersion = L"1.0.1";
static constexpr const wchar_t* kAppVersion = L"1.4.0";
static constexpr const wchar_t* kAppName = L"DownloadTools";
static constexpr const char* kAppNameAscii = "DownloadTools";

Expand Down
Binary file modified src/BVLoader/res/skin.zip
Binary file not shown.
5 changes: 5 additions & 0 deletions src/BVLoader/service/download/download_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,5 +351,10 @@ namespace download {
return true;
}

std_cwstr_ref DownloadService::GetDownloadPath() const
{
return download_path_;
}

} // namespace download

1 change: 1 addition & 0 deletions src/BVLoader/service/download/download_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace download {
std::shared_ptr<download::Task> FindLoadingTask(UINT_PTR task_id) override;
std::shared_ptr<download::Task> FindFinishTask(UINT_PTR task_id) override;
bool AddFinishTask(UINT_PTR task_id) override;
std_cwstr_ref GetDownloadPath() const override;

protected:
bool Init() override;
Expand Down
1 change: 1 addition & 0 deletions src/BVLoader/service/service.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class IDownloadService
virtual std::shared_ptr<download::Task> FindLoadingTask(UINT_PTR task_id) = 0;
virtual std::shared_ptr<download::Task> FindFinishTask(UINT_PTR task_id) = 0;
virtual bool AddFinishTask(UINT_PTR task_id) = 0;
virtual std_cwstr_ref GetDownloadPath() const = 0;
};

// 解码服务对外能力接口
Expand Down
12 changes: 12 additions & 0 deletions src/BVLoader/wnd/wnd_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ void WndMain::OnClick(TNotifyUI& msg)
::PostMessage(m_hWnd, WM_MAINWND_SHOWWND, (WPARAM)WPARAM_SHOW_LOGIN, 0);
}
}
else if (name.Compare(L"btn_explorer") == 0) {
::PostMessage(m_hWnd, WM_MAINWND_SHOWWND, (WPARAM)WPARAM_EXPLORER, 0);
}
}

bool WndMain::AddLoadingItem(const shared_ptr<download::Task>& task)
Expand Down Expand Up @@ -402,6 +405,12 @@ void WndMain::ShowDownload()
wnd_parse_->ShowWindow();
}

void WndMain::OpenDownloadPath()
{
auto& path = DOWNLOAD_SERVICE()->GetDownloadPath();
::ShellExecute(NULL, L"open", path.c_str(), NULL, NULL, SW_SHOW);
}

UINT WndMain::ShowMsgBox(MessageIconType icon, LPCWSTR info)
{
WndMsg* wnd = new WndMsg(icon, info);
Expand Down Expand Up @@ -497,6 +506,9 @@ LRESULT WndMain::OnMsgShowWnd(WPARAM wParam, LPARAM lParam)
case WPARAM_SHOW_DOWNLOAD:
ShowDownload();
break;
case WPARAM_EXPLORER:
OpenDownloadPath();
break;
default:
break;
}
Expand Down
1 change: 1 addition & 0 deletions src/BVLoader/wnd/wnd_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class WndMain
bool OnNotifyListItem(void* param);
void ShowLogin();
void ShowDownload();
void OpenDownloadPath();

UINT ShowMsgBox(MessageIconType icon, LPCWSTR info);
LRESULT OnMsgMsgbox(WPARAM wParam, LPARAM lParam);
Expand Down

0 comments on commit 51ee7e5

Please sign in to comment.