-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
102 changed files
with
5,702 additions
and
1,710 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
- 在关于对话框中增加环境变量 | ||
- 增加 CDlgEdit | ||
- 增加 CFileBrowser | ||
- 增加文件浏览器应用程序 | ||
|
||
### 版本: v2.2.6 | ||
- 修改 debian 打包文件 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Author: Kang Lin([email protected]) | ||
|
||
project(FileBrowser LANGUAGES CXX) | ||
|
||
include(GNUInstallDirs) | ||
|
||
set(SOURCE_FILES | ||
main.cpp | ||
MainWindow.cpp | ||
MainWindow.h | ||
) | ||
|
||
set(SOURCE_UI_FILES MainWindow.ui) | ||
|
||
ADD_TARGET(NAME ${PROJECT_NAME} | ||
ISEXE | ||
SOURCE_FILES ${SOURCE_FILES} ${RESOURCE_FILES} ${SOURCE_UI_FILES} | ||
PRIVATE_LIBS RabbitCommon ${QT_LIBRARIES} | ||
INCLUDE_DIRS "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/Src>" | ||
"$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/Src>" | ||
) | ||
|
||
if(NOT EXISTS ${CMAKE_BINARY_DIR}/etc/${PROJECT_NAME}_logqt.ini) | ||
configure_file(${CMAKE_SOURCE_DIR}/Src/etc/logqt.ini | ||
${CMAKE_BINARY_DIR}/etc/${PROJECT_NAME}_logqt.ini | ||
COPYONLY) | ||
endif() | ||
INSTALL_FILE(SOURCES ${CMAKE_BINARY_DIR}/etc/${PROJECT_NAME}_logqt.ini | ||
DESTINATION etc | ||
COMPONENT Application) | ||
|
||
if(NOT ANDROID AND UNIX) | ||
INSTALL(FILES ${CMAKE_SOURCE_DIR}/share/org.Rabbit.FileBrower.desktop | ||
DESTINATION "share/applications" COMPONENT Application) | ||
INSTALL(FILES ${CMAKE_SOURCE_DIR}/Src/Resource/icons/rabbit-green/svg/browser.svg | ||
RENAME org.Rabbit.FileBrower.svg | ||
DESTINATION "share/pixmaps" COMPONENT Application) | ||
endif() | ||
|
||
set(OTHER_FILES | ||
${CMAKE_SOURCE_DIR}/License.md | ||
${CMAKE_SOURCE_DIR}/Authors.md | ||
${CMAKE_SOURCE_DIR}/Authors_zh_CN.md | ||
${CMAKE_SOURCE_DIR}/ChangeLog.md | ||
${CMAKE_SOURCE_DIR}/ChangeLog_zh_CN.md | ||
) | ||
# Install other files | ||
INSTALL_FILE(SOURCES ${OTHER_FILES} | ||
DESTINATION ${CMAKE_INSTALL_DOCDIR} | ||
COMPONENT Application) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#include <QLoggingCategory> | ||
#include <QSettings> | ||
#include "RabbitCommonTools.h" | ||
#include "MainWindow.h" | ||
#include "./ui_MainWindow.h" | ||
#include "FileBrowser.h" | ||
#include "RabbitCommonDir.h" | ||
#include "FrmUpdater.h" | ||
#include "DlgAbout.h" | ||
|
||
static Q_LOGGING_CATEGORY(log, "FileBrowser.MainWindow") | ||
MainWindow::MainWindow(QWidget *parent) | ||
: QMainWindow(parent) | ||
, ui(new Ui::MainWindow) | ||
{ | ||
bool check = false; | ||
ui->setupUi(this); | ||
|
||
#ifdef HAVE_RABBITCOMMON_GUI | ||
RabbitCommon::CTools::InsertStyleMenu(ui->menuTools, ui->actionStatus_S); | ||
ui->menuTools->insertMenu(ui->actionStatus_S, RabbitCommon::CTools::GetLogMenu(this)); | ||
ui->menuTools->insertSeparator(ui->actionStatus_S); | ||
#endif | ||
|
||
CFileBrowser* pFB = new CFileBrowser(this); | ||
check = connect(pFB, SIGNAL(destroyed(QObject*)), this, SLOT(close())); | ||
Q_ASSERT(check); | ||
setCentralWidget(pFB); | ||
setWindowIcon(pFB->windowIcon()); | ||
setWindowTitle(pFB->windowTitle()); | ||
|
||
QSettings set(RabbitCommon::CDir::Instance()->GetFileUserConfigure(), | ||
QSettings::IniFormat); | ||
QByteArray geometry | ||
= set.value("MainWindow/Status/Geometry").toByteArray(); | ||
if(!geometry.isEmpty()) | ||
restoreGeometry(geometry); | ||
QByteArray state = set.value("MainWindow/Status/State").toByteArray(); | ||
if(!state.isEmpty()) | ||
restoreState(state); | ||
|
||
bool bStatusBar = set.value("MainWindow/Status/Bar", !statusBar()->isHidden()).toBool(); | ||
ui->actionStatus_S->setChecked(bStatusBar); | ||
statusBar()->setVisible(bStatusBar); | ||
} | ||
|
||
MainWindow::~MainWindow() | ||
{ | ||
QSettings set(RabbitCommon::CDir::Instance()->GetFileUserConfigure(), | ||
QSettings::IniFormat); | ||
set.setValue("MainWindow/Status/Geometry", saveGeometry()); | ||
set.setValue("MainWindow/Status/State", saveState()); | ||
set.setValue("MainWindow/Status/Bar", !statusBar()->isHidden()); | ||
|
||
delete ui; | ||
} | ||
|
||
void MainWindow::on_actionStatus_S_triggered(bool checked) | ||
{ | ||
statusBar()->setVisible(checked); | ||
} | ||
|
||
void MainWindow::on_actionAbout_A_triggered() | ||
{ | ||
#ifdef HAVE_ABOUT | ||
CDlgAbout* dlg = new CDlgAbout(); | ||
dlg->setAttribute(Qt::WA_QuitOnClose, true); | ||
#if defined (Q_OS_ANDROID) | ||
dlg->showMaximized(); | ||
#else | ||
dlg->show(); | ||
#endif | ||
#endif | ||
|
||
#ifdef BUILD_QUIWidget | ||
QUIWidget::setFormInCenter(dlg); | ||
#endif | ||
} | ||
|
||
void MainWindow::on_actionUpdate_U_triggered() | ||
{ | ||
#ifdef HAVE_UPDATE | ||
// [Use CFrmUpdater] | ||
CFrmUpdater* m_pfrmUpdater = new CFrmUpdater(); | ||
QIcon icon = windowIcon(); | ||
if(icon.isNull()) return; | ||
auto sizeList = icon.availableSizes(); | ||
if(sizeList.isEmpty()) return; | ||
QPixmap p = icon.pixmap(*sizeList.begin()); | ||
m_pfrmUpdater->SetTitle(p.toImage()); | ||
m_pfrmUpdater->SetInstallAutoStartup(); | ||
#if defined (Q_OS_ANDROID) | ||
m_pfrmUpdater->showMaximized(); | ||
#else | ||
m_pfrmUpdater->show(); | ||
#endif | ||
// [Use CFrmUpdater] | ||
#endif | ||
#ifdef BUILD_QUIWidget | ||
QUIWidget::setFormInCenter(m_pfrmUpdater); | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef MAINWINDOW_H | ||
#define MAINWINDOW_H | ||
|
||
#include <QMainWindow> | ||
|
||
QT_BEGIN_NAMESPACE | ||
namespace Ui { | ||
class MainWindow; | ||
} | ||
QT_END_NAMESPACE | ||
|
||
class MainWindow : public QMainWindow | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
MainWindow(QWidget *parent = nullptr); | ||
~MainWindow(); | ||
|
||
private slots: | ||
void on_actionStatus_S_triggered(bool checked); | ||
void on_actionAbout_A_triggered(); | ||
void on_actionUpdate_U_triggered(); | ||
|
||
private: | ||
Ui::MainWindow *ui; | ||
}; | ||
#endif // MAINWINDOW_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>MainWindow</class> | ||
<widget class="QMainWindow" name="MainWindow"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>800</width> | ||
<height>600</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>File browser</string> | ||
</property> | ||
<widget class="QWidget" name="centralwidget"/> | ||
<widget class="QMenuBar" name="menubar"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>800</width> | ||
<height>20</height> | ||
</rect> | ||
</property> | ||
<widget class="QMenu" name="menuTools"> | ||
<property name="title"> | ||
<string>Tools(&T)</string> | ||
</property> | ||
<addaction name="actionStatus_S"/> | ||
</widget> | ||
<widget class="QMenu" name="menuHelp_H"> | ||
<property name="title"> | ||
<string>Help(&H)</string> | ||
</property> | ||
<addaction name="actionAbout_A"/> | ||
<addaction name="actionUpdate_U"/> | ||
</widget> | ||
<addaction name="menuTools"/> | ||
<addaction name="menuHelp_H"/> | ||
</widget> | ||
<widget class="QStatusBar" name="statusbar"/> | ||
<action name="actionStatus_S"> | ||
<property name="checkable"> | ||
<bool>true</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Status(&S)</string> | ||
</property> | ||
<property name="iconText"> | ||
<string>Status</string> | ||
</property> | ||
<property name="toolTip"> | ||
<string>Status</string> | ||
</property> | ||
<property name="statusTip"> | ||
<string>Status</string> | ||
</property> | ||
<property name="whatsThis"> | ||
<string>Status</string> | ||
</property> | ||
</action> | ||
<action name="actionAbout_A"> | ||
<property name="icon"> | ||
<iconset theme="help-about"/> | ||
</property> | ||
<property name="text"> | ||
<string>About(&A)</string> | ||
</property> | ||
<property name="iconText"> | ||
<string>About</string> | ||
</property> | ||
<property name="toolTip"> | ||
<string>About</string> | ||
</property> | ||
<property name="statusTip"> | ||
<string>About</string> | ||
</property> | ||
<property name="whatsThis"> | ||
<string>About</string> | ||
</property> | ||
</action> | ||
<action name="actionUpdate_U"> | ||
<property name="icon"> | ||
<iconset theme="system-software-update"/> | ||
</property> | ||
<property name="text"> | ||
<string>Update(&U)</string> | ||
</property> | ||
<property name="toolTip"> | ||
<string>Update</string> | ||
</property> | ||
<property name="statusTip"> | ||
<string>Update</string> | ||
</property> | ||
<property name="whatsThis"> | ||
<string>Update</string> | ||
</property> | ||
</action> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
Oops, something went wrong.