From 1ccb5a91a209b7cf6f34601d81568f7a47c40ee6 Mon Sep 17 00:00:00 2001 From: "rick.chan" Date: Fri, 28 Aug 2020 10:17:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=A8=E9=80=89=E5=92=8C?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=85=A8=E9=80=89=E5=8A=9F=E8=83=BD.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rick.chan --- source/engine.cpp | 4 +-- source/engine.h | 4 +-- source/main.cpp | 4 +-- source/qtproaddfilehelper.cpp | 64 ++++++++++++++++++++++++++++++++--- source/qtproaddfilehelper.h | 14 ++++---- source/qtproaddfilehelper.ui | 25 ++++++++++++-- 6 files changed, 96 insertions(+), 19 deletions(-) diff --git a/source/engine.cpp b/source/engine.cpp index 9fb7ac9..4c5bc9b 100644 --- a/source/engine.cpp +++ b/source/engine.cpp @@ -1,6 +1,6 @@ /** - * @author: Lion Chen/QQ:174980551 - * @date: 2014-01-23 + * @author Rick Chan (cy187lion@sina.com) + * @date 2014-01-23 */ #include "engine.h" diff --git a/source/engine.h b/source/engine.h index 2de77a5..b0b5fda 100644 --- a/source/engine.h +++ b/source/engine.h @@ -1,6 +1,6 @@ /** - * @author: Lion Chen/QQ:174980551 - * @date: 2014-01-23 + * @author Rick Chan (cy187lion@sina.com) + * @date 2014-01-23 */ #ifndef ENGINE_H diff --git a/source/main.cpp b/source/main.cpp index 70825bb..fcdc880 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -1,6 +1,6 @@ /** - * @author: Lion Chen/QQ:174980551 - * @date: 2014-01-23 + * @author Rick Chan (cy187lion@sina.com) + * @date 2014-01-23 */ #include "qtproaddfilehelper.h" diff --git a/source/qtproaddfilehelper.cpp b/source/qtproaddfilehelper.cpp index 17b933f..dc0c09a 100644 --- a/source/qtproaddfilehelper.cpp +++ b/source/qtproaddfilehelper.cpp @@ -1,6 +1,6 @@ /** - * @author: Lion Chen/QQ:174980551 - * @date: 2014-01-23 + * @author Rick Chan (cy187lion@sina.com) + * @date 2020-08-28 */ #include "qtproaddfilehelper.h" @@ -21,6 +21,27 @@ QtProAddFileHelper::QtProAddFileHelper(QWidget *parent) : StatusLabel->adjustSize(); ui->statusBar->addWidget(StatusLabel); StatusLabel->setText("By: Lion Chen @Giraffe Ver:2.3.0"); + + CheckBoxes.clear(); + CheckBoxes.append(ui->cCheckBox); + CheckBoxes.append(ui->CpupuCheckBox); + CheckBoxes.append(ui->cppCheckBox); + CheckBoxes.append(ui->cxxCheckBox); + CheckBoxes.append(ui->ccCheckBox); + CheckBoxes.append(ui->tccCheckBox); + CheckBoxes.append(ui->hCheckBox); + CheckBoxes.append(ui->hpupuCheckBox); + CheckBoxes.append(ui->hppCheckBox); + CheckBoxes.append(ui->hxxCheckBox); + CheckBoxes.append(ui->MkfCheckBox); + CheckBoxes.append(ui->asmCheckBox); + CheckBoxes.append(ui->sCheckBox); + CheckBoxes.append(ui->xmlCheckBox); + + for(QList::Iterator itr=CheckBoxes.begin(); + itr!=CheckBoxes.end(); + itr++) + connect(*itr, &QCheckBox::clicked, this, &QtProAddFileHelper::OnCheckBoxesClicked); } QtProAddFileHelper::~QtProAddFileHelper() @@ -99,8 +120,8 @@ void QtProAddFileHelper::on_OKButton_clicked() * | | hxx | hpp | h++ | h | * | 0000 | 1 | 1 | 1 | 1 | * - * |......|.xml.|.s.|.asm.|.Makefile.| - * |.0000.|..1..|.1.|..1..|.....1....| + * | |.xml.|.s.|.asm.|.Makefile.| + * | 0000 | 1 | 1 | 1 | 1 | */ FILE_TYPES selectedFile; /**< Sources */ @@ -282,3 +303,38 @@ void QtProAddFileHelper::on_PathEdit_editingFinished() ui->ProEdit->setText(ui->PathEdit->text()); } } + +void QtProAddFileHelper::on_SeleAllcheckBox_clicked(bool checked) +{ + if(checked) + { + for(QList::Iterator itr=CheckBoxes.begin(); + itr!=CheckBoxes.end(); + itr++) + (*itr)->setChecked(true); + } + else + { + for(QList::Iterator itr=CheckBoxes.begin(); + itr!=CheckBoxes.end(); + itr++) + (*itr)->setChecked(false); + } +} + +void QtProAddFileHelper::OnCheckBoxesClicked(bool checked) +{ + if(checked) + { + for(QList::Iterator itr=CheckBoxes.begin(); + itr!=CheckBoxes.end(); + itr++) + { + if(!(*itr)->isChecked()) + return; + } + ui->SeleAllcheckBox->setChecked(true); + } + else + ui->SeleAllcheckBox->setChecked(false); +} diff --git a/source/qtproaddfilehelper.h b/source/qtproaddfilehelper.h index e9cb525..b17f340 100644 --- a/source/qtproaddfilehelper.h +++ b/source/qtproaddfilehelper.h @@ -1,18 +1,16 @@ /** - * @author: Lion Chen/QQ:174980551 - * @date: 2014-01-23 + * @author Rick Chan (cy187lion@sina.com) + * @date 2020-08-28 */ #ifndef QTPROADDFILEHELPER_H #define QTPROADDFILEHELPER_H #include -/** - * @author: Lion Chen/QQ:174980551 - * @data: 2014-01-23 - */ #include #include +#include +#include #include "engine.h" namespace Ui { @@ -31,6 +29,7 @@ private: Ui::QtProAddFileHelper *ui; QLabel *StatusLabel; Engine *KEngine; + QList CheckBoxes; void SetUiEnable(bool en); @@ -40,6 +39,9 @@ private slots: void on_ProButton_clicked(); void on_PathButton_clicked(); void on_PathEdit_editingFinished(); + void on_SeleAllcheckBox_clicked(bool checked); + + void OnCheckBoxesClicked(bool checked); }; #endif // QTPROADDFILEHELPER_H diff --git a/source/qtproaddfilehelper.ui b/source/qtproaddfilehelper.ui index a4df7e7..bce07fa 100644 --- a/source/qtproaddfilehelper.ui +++ b/source/qtproaddfilehelper.ui @@ -12,7 +12,7 @@ - 240 + 340 305 @@ -206,15 +206,34 @@ - 相对路径方式 + 使用相对路径 true + + + + + 16777215 + 16777215 + + + + 全选 + + + + + + 120 + 0 + + 确 定 @@ -232,7 +251,7 @@ 0 0 340 - 23 + 28