Skip to content

Commit

Permalink
Add CFileBrowser
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Sep 19, 2024
1 parent 632ef07 commit b7fa120
Show file tree
Hide file tree
Showing 9 changed files with 359 additions and 10 deletions.
8 changes: 8 additions & 0 deletions App/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "RabbitCommonEncrypt.h"
#ifdef HAVE_RABBITCOMMON_GUI
#include "DockFolderBrowser.h"
#include "FileBrowser.h"
#endif
#include "RabbitCommonDir.h"

Expand Down Expand Up @@ -171,3 +172,10 @@ void MainWindow::slotDownloadError(int nErr, const QString szErr)
{
qDebug(log) << "Download file error:" << nErr << szErr;
}

void MainWindow::on_actionFolder_browser_triggered()
{
CFileBrowser *pBF = new CFileBrowser();
pBF->exec();
}

2 changes: 2 additions & 0 deletions App/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ private slots:
void slotDownloadFile(const QString szFile);
void slotDownloadError(int nErr, const QString szErr);

void on_actionFolder_browser_triggered();

private:
Ui::MainWindow *ui;

Expand Down
20 changes: 12 additions & 8 deletions App/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
<string>Log</string>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
<enum>QToolButton::ToolButtonPopupMode::MenuButtonPopup</enum>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
<enum>Qt::ToolButtonStyle::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>false</bool>
</property>
<property name="arrowType">
<enum>Qt::NoArrow</enum>
<enum>Qt::ArrowType::NoArrow</enum>
</property>
</widget>
</item>
Expand Down Expand Up @@ -133,7 +133,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>27</height>
<height>20</height>
</rect>
</property>
<widget class="QMenu" name="menuAbout">
Expand All @@ -147,29 +147,33 @@
<property name="title">
<string>Tools</string>
</property>
<addaction name="actionFolder_browser"/>
</widget>
<addaction name="menuAbout"/>
<addaction name="menuTools"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionAbout">
<property name="icon">
<iconset theme="help-about">
<normaloff>.</normaloff>.</iconset>
<iconset theme="help-about"/>
</property>
<property name="text">
<string>About</string>
</property>
</action>
<action name="actionUpdate">
<property name="icon">
<iconset theme="system-software-update">
<normaloff>.</normaloff>.</iconset>
<iconset theme="system-software-update"/>
</property>
<property name="text">
<string>Update</string>
</property>
</action>
<action name="actionFolder_browser">
<property name="text">
<string>Folder browser</string>
</property>
</action>
</widget>
<resources/>
<connections/>
Expand Down
1 change: 0 additions & 1 deletion App/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "RabbitCommonTools.h"
#include "RabbitCommonDir.h"
#include "MainWindow.h"

#ifdef HAVE_UPDATE
#include "FrmUpdater.h"
#endif
Expand Down
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- Fix log file name bug
- Add environment in about dialog
- Add CDlgEdit
- Add CFileBrowser

### Version v2.2.6
- Modify debian package files
Expand Down
1 change: 1 addition & 0 deletions ChangeLog_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- 修复日志文件名错误
- 在关于对话框中增加环境变量
- 增加 CDlgEdit
- 增加 CFileBrowser

### 版本: v2.2.6
- 修改 debian 打包文件
Expand Down
5 changes: 4 additions & 1 deletion Src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ if(WITH_GUI)
Style/FrmStyle.h
TitleBar.h
DockFolderBrowser/DockFolderBrowser.h
FileBrowser/FileBrowser.h
)
list(APPEND RABBITCOMMON_HEAD_FILES
Style/Style.h
Expand All @@ -71,6 +72,7 @@ if(WITH_GUI)
Style/FrmStyle.cpp
TitleBar.cpp
DockFolderBrowser/DockFolderBrowser.cpp
FileBrowser/FileBrowser.cpp
Log/DockDebugLog.cpp
Log/DlgFilter.cpp
Log/DlgEdit.cpp
Expand All @@ -84,7 +86,8 @@ if(WITH_GUI)
)
list(APPEND RABBITCOMMON_INCLUDE_DIRS
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Style>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/DockFolderBrowser>)
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/DockFolderBrowser>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/FileBrowser>)
endif()

cmake_dependent_option(BUILD_ABOUT "Set to ON to build about function" ON
Expand Down
Loading

0 comments on commit b7fa120

Please sign in to comment.