diff --git a/product/src/tools/file_sync_tool/FileSync.ico b/product/src/tools/file_sync_tool/FileSync.ico index 3a998bed..f9068343 100644 Binary files a/product/src/tools/file_sync_tool/FileSync.ico and b/product/src/tools/file_sync_tool/FileSync.ico differ diff --git a/product/src/tools/file_sync_tool/file_sync_tool.pro b/product/src/tools/file_sync_tool/file_sync_tool.pro index ccd82e03..72e0f0a9 100644 --- a/product/src/tools/file_sync_tool/file_sync_tool.pro +++ b/product/src/tools/file_sync_tool/file_sync_tool.pro @@ -61,7 +61,7 @@ LIBS += -lpub_logger_api \ -lsys_file_sync_api \ -lsys_login_api - +LIBS += -lpub_widget include($$PWD/../../idl_files/idl_files.pri) diff --git a/product/src/tools/file_sync_tool/mainwindow.cpp b/product/src/tools/file_sync_tool/mainwindow.cpp index af33c79d..7a1a74d8 100644 --- a/product/src/tools/file_sync_tool/mainwindow.cpp +++ b/product/src/tools/file_sync_tool/mainwindow.cpp @@ -3,10 +3,10 @@ #include "pub_sysinfo_api/SysInfoApi.h" #include "pub_utility_api/FileUtil.h" #include "../include/sys/sys_login_api/CLoginDlg.h" +#include "pub_utility_api/FileStyle.h" #include "Common.h" #include #include -#include #include #include #include @@ -14,14 +14,16 @@ #include #include "treefilterfun.h" #include "treeupdatefun.h" +#include "pub_widget/MessageBox.h" using namespace iot_public; MainWindow::MainWindow(QWidget *parent) : - QMainWindow(parent), + CustomUiMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); setWindowIcon(QIcon(":/FileSync.ico")); + setWindowTitle(tr("文件同步")); m_updeteToLocalBtn = ui->pushButton_2; m_broadcastToDomainBtn = ui->pushButton_3; @@ -141,6 +143,9 @@ MainWindow::MainWindow(QWidget *parent) : slot_hostCbmCurrentIndexChanged(m_hostCbm->currentIndex()); slot_rootPathBtnClicked(); + + initStyle(); + setTitleWidget(ui->widget_2); } MainWindow::~MainWindow() @@ -240,6 +245,27 @@ void MainWindow::updateViewShow() m_filterEndTimeEdit->setEnabled(isEnable); } +void MainWindow::initStyle() +{ + QString qss = QString(); + std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss", + "zh", + "light"); + + QFile qssfile1(QString::fromStdString(strFullPath)); + qssfile1.open(QFile::ReadOnly); + if (qssfile1.isOpen()) + { + qss += QLatin1String(qssfile1.readAll()); + qssfile1.close(); + } + + if (!qss.isEmpty()) + { + setStyleSheet(qss); + } +} + void MainWindow::slot_refeshBtnClicked() { @@ -391,8 +417,8 @@ void MainWindow::slot_broadcastToDomainBtnClicked() return; } - int ret = QMessageBox::question(this, "警告", "再次确定全域同步所选文件,是否同步?"); - if (ret != QMessageBox::Yes) + int ret = N_MessageBox::question(this, "警告", "再次确定全域同步所选文件,是否同步?"); + if (ret != N_MessageBox::Ok) { return; } @@ -535,8 +561,8 @@ void MainWindow::slot_clearTaskAction(bool) return; } - int ret = QMessageBox::question(this, "警告", QString("确定清理全域目录,清理多余文件?目录名[%1]").arg(pathFile)); - if (ret != QMessageBox::Yes) + int ret = N_MessageBox::question(this, "警告", QString("确定清理全域目录,清理多余文件?目录名[%1]").arg(pathFile)); + if (ret != N_MessageBox::Ok) { return; } @@ -590,8 +616,8 @@ void MainWindow::slot_comitModify(bool) return; } - int ret = QMessageBox::question(this, "警告", QString("确定提交修改文件?文件名[%1]").arg(pathFile)); - if (ret != QMessageBox::Yes) + int ret = N_MessageBox::question(this, "警告", QString("确定提交修改文件?文件名[%1]").arg(pathFile)); + if (ret != N_MessageBox::Ok) { return; } @@ -631,8 +657,8 @@ void MainWindow::slot_comitDel(bool) return; } - int ret = QMessageBox::question(this, "警告", QString("确定提交删除文件?文件名[%1]").arg(pathFile)); - if (ret != QMessageBox::Yes) + int ret = N_MessageBox::question(this, "警告", QString("确定提交删除文件?文件名[%1]").arg(pathFile)); + if (ret != N_MessageBox::Ok) { return; } @@ -856,8 +882,8 @@ bool MainWindow::recvExeTaskReuslt() bool MainWindow::removePathFile(const QString& pathFile) { - int ret = QMessageBox::question(this, "警告", QString("是否删除本地文件?")); - if (ret != QMessageBox::Yes) + int ret = N_MessageBox::question(this, "警告", QString("是否删除本地文件?")); + if (ret != N_MessageBox::Ok) { return false; } diff --git a/product/src/tools/file_sync_tool/mainwindow.h b/product/src/tools/file_sync_tool/mainwindow.h index 3bc98d7e..3bd0e105 100644 --- a/product/src/tools/file_sync_tool/mainwindow.h +++ b/product/src/tools/file_sync_tool/mainwindow.h @@ -13,6 +13,7 @@ #include "msgtrans.h" #include "treefilterfun.h" +#include "pub_widget/CustomMainWindow.h" namespace Ui { class MainWindow; @@ -23,7 +24,7 @@ using namespace iot_public; const static int TIME_OUT_DEF = 30; typedef QList QTreeWidgetItemList; -class MainWindow : public QMainWindow +class MainWindow : public CustomUiMainWindow { Q_OBJECT @@ -41,6 +42,8 @@ private: void updateViewShow(); + void initStyle(); + private slots: void slot_refeshBtnClicked(); void slot_rootPathBtnClicked(); diff --git a/product/src/tools/file_sync_tool/mainwindow.ui b/product/src/tools/file_sync_tool/mainwindow.ui index b83c6862..c1a43725 100644 --- a/product/src/tools/file_sync_tool/mainwindow.ui +++ b/product/src/tools/file_sync_tool/mainwindow.ui @@ -14,306 +14,330 @@ 文件同步助手 - - - - - - 0 - 0 - - - - - - - - - 主机节点 - - - - - - - - 0 - 0 - - - - - 150 - 0 - - - - - - - - Qt::Horizontal - - - - 10 - 20 - - - - - - - - + + + - - - - - - - - - - - 其他 - - - - - - - 全部 - - - - - - - Qt::Horizontal - - - - 48 - 20 - - - - - - - - 组态图形 - - - - - - - 报表 - - - - - - - 录波 - - - - - - - 配置 - - - - - - - - - - - - - 按时间过滤 - - - - - - - 开始时间 - - - - - - - yyyy/M/d HH:mm::ss - - - - - - - 结束时间 - - - - - - - - - yyyy/M/d HH:mm::ss - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 关键字 - - - - - - - - 150 - 0 - - - - - 150 - 16777215 - - - - - - - - - - - - - - - - - - - - - - - - - - - - 100 - 100 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - 根目录 - - - - - - - 刷新 - - - - - - - 上一级 - - - - - - - true - - - - - - - QAbstractItemView::ExtendedSelection - - - - 1 - - - - - - - - - - + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + - - - 24 + + + + 0 + 0 + + + + + + + + 主机节点 + + + + + + + + 0 + 0 + + + + + 150 + 0 + + + + + + + + Qt::Horizontal + + + + 10 + 20 + + + + + + + - - - <<更新到本机 - + + + + + + + + + + 其他 + + + + + + + 全部 + + + + + + + Qt::Horizontal + + + + 48 + 20 + + + + + + + + 组态图形 + + + + + + + 报表 + + + + + + + 录波 + + + + + + + 配置 + + + + + + + + + + + + + 按时间过滤 + + + + + + + 开始时间 + + + + + + + yyyy/M/d HH:mm::ss + + + + + + + 结束时间 + + + + + + + + + yyyy/M/d HH:mm::ss + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 关键字 + + + + + + + + 150 + 0 + + + + + 150 + 16777215 + + + + + + + + + + + + + + + + + + + + + - - - 全站发布>> + + + + 100 + 100 + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + 根目录 + + + + + + + 刷新 + + + + + + + 上一级 + + + + + + + true + + + + + + + QAbstractItemView::ExtendedSelection + + + + 1 + + + + + - - - 中止任务 - + + + + + + 24 + + + + + + + <<更新到本机 + + + + + + + 全站发布>> + + + + + + + 中止任务 + + + + @@ -323,6 +347,14 @@ + + + WorkFrame + QWidget +
pub_widget/WorkFrame.h
+ 1 +
+