diff --git a/WindbgIFEO/WindbgIFEO.cpp b/WindbgIFEO/WindbgIFEO.cpp index fd80673..812756a 100644 --- a/WindbgIFEO/WindbgIFEO.cpp +++ b/WindbgIFEO/WindbgIFEO.cpp @@ -19,7 +19,7 @@ #include "everything/Everything.h" WindbgIFEO::WindbgIFEO(QWidget* parent) - : QWidget(parent), _map_windbg_path(), _stop_enum_process(false) { + : QWidget(parent), _map_windbg_path() { ui.setupUi(this); _workbranch_ptr = std::make_unique(2); this->_init_ui(); @@ -29,16 +29,6 @@ WindbgIFEO::WindbgIFEO(QWidget* parent) } WindbgIFEO::~WindbgIFEO() { - _stop_enum_process = true; - std::vector*> thr_ptr = { &_query_windbg_ptr - }; - for (auto& item : thr_ptr) { - if ((*item)->joinable()) { - this->log_info(tr("wait thread exit...")); - (*item)->join(); - } - } - _workbranch_ptr->wait_tasks(); } @@ -332,7 +322,7 @@ void WindbgIFEO::log_info(const QString& info, LOG_TYPE type) { } void WindbgIFEO::_query_windbg_path() { - // std::thread thr(); + this->log_info(tr("Start serach windbg path")); auto func = [this]() { Everything_SetMatchCase(true); Everything_SetMatchWholeWord(true); @@ -350,12 +340,11 @@ void WindbgIFEO::_query_windbg_path() { QString("\\") + QString::fromStdWString(Everything_GetResultFileName(i)); map_path[path] = path; - qDebug() << path; } this->_add_windbg_path(map_path); }; - _query_windbg_ptr = std::make_unique(func); + _workbranch_ptr->submit(func); } void WindbgIFEO::_enum_process_name() { @@ -494,10 +483,6 @@ void WindbgIFEO::_init_signal() { connect(this, SIGNAL(finished_windbg_exes()), this, SLOT(on_update_windbg_path()), Qt::QueuedConnection); - // connect(ui.chb_chinese, SIGNAL(stateChanged(int)), this, - // SLOT(on_chinese_stateChanged(int))); - // connect(ui.chb_english, SIGNAL(stateChanged(int)), this, - // SLOT(on_english_stateChanged(int))); connect(ui.comboBox_attach_name, SIGNAL(currentTextChanged(QString)), this, SLOT(on_attach_name_changed(QString))); connect(ui.chb_auto_start, SIGNAL(stateChanged(int)), this, @@ -507,9 +492,12 @@ void WindbgIFEO::_init_signal() { } void WindbgIFEO::on_update_windbg_path() { + this->log_info(tr("finished search windbg path")); + disconnect(this, SLOT(on_comboBoxChanged(QString))); std::for_each( this->_map_windbg_path.begin(), this->_map_windbg_path.end(), [this](const std::pair& value) { + this->ui.comboBox_windbg_path->clear(); QString windbg_path = value.second; if (windbg_path.contains("arm")) { this->log_info(QString(tr("filter arm version windbg path:%1")) @@ -539,7 +527,6 @@ void WindbgIFEO::on_update_process_info() { } for (auto& item : vec_com) { item->blockSignals(true); - // item->clear(); this->_remove_combo_item(item); item->addItems(process_list); item->blockSignals(false); @@ -569,16 +556,21 @@ void WindbgIFEO::on_comboBoxLanguage(const QString& text) { this->update(); } -void WindbgIFEO::on_btn_refresh_clicked() +void WindbgIFEO::on_btn_refresh_process_clicked() { this->_enum_process_name(); } -void WindbgIFEO::on_btn_refresh_2_clicked() +void WindbgIFEO::on_btn_refresh_process_2_clicked() { this->_enum_process_name(); } +void WindbgIFEO::on_btn_refresh_path_clicked() +{ + this->_query_windbg_path(); +} + void WindbgIFEO::on_btn_close_clicked() { this->close(); } diff --git a/WindbgIFEO/WindbgIFEO.h b/WindbgIFEO/WindbgIFEO.h index fcf641d..7e5ad64 100644 --- a/WindbgIFEO/WindbgIFEO.h +++ b/WindbgIFEO/WindbgIFEO.h @@ -72,8 +72,9 @@ protected slots: void on_comboBoxChanged(const QString& text); void on_comboBoxLanguage(const QString& text); - void on_btn_refresh_clicked(); - void on_btn_refresh_2_clicked(); + void on_btn_refresh_process_clicked(); + void on_btn_refresh_process_2_clicked(); + void on_btn_refresh_path_clicked(); void on_btn_close_clicked(); void on_btn_mini_clicked(); @@ -102,11 +103,8 @@ protected slots: private: Ui::WindbgIFEOClass ui; - bool _stop_enum_process; map_qstring _map_windbg_path; ProcessHelper::process_map _proces_info; - std::unique_ptr _query_windbg_ptr; - std::unique_ptr _enum_process_ptr; RegEditorHelper _reg_editor_helper; const QString _ifeo_reg_path = diff --git a/WindbgIFEO/WindbgIFEO.ui b/WindbgIFEO/WindbgIFEO.ui index 68792c9..cd8e6b8 100644 --- a/WindbgIFEO/WindbgIFEO.ui +++ b/WindbgIFEO/WindbgIFEO.ui @@ -12,8 +12,14 @@ - 0 - 40 + 1167 + 644 + + + + + 1167 + 644 @@ -298,6 +304,47 @@ QPushButton:pressed{border-image: url(":/WindbgConfig/images/close_pressed. + + + + + 25 + 25 + + + + + 25 + 25 + + + + QPushButton { +border:None; +background-color:#FFFFFF; +qproperty-icon: url(:/WindbgConfig/images/def_100_precent/refresh.png) center; +border-radius:12px; +} + +QPushButton:hover { +border:None; +qproperty-icon: url(:/WindbgConfig/images/def_100_precent/refresh.png) center; +background-color:#d2d4d9; +border-radius:12px; +} + +QPushButton:pressed { +border:None; +qproperty-icon: url(:/WindbgConfig/images/def_100_precent/refresh.png) center; +background-color:#d8dbdf; +border-radius:12px; +} + + + + + + @@ -473,7 +520,7 @@ background-color:#407ee1; - 170 + 210 25 @@ -495,7 +542,7 @@ background-color:#407ee1; - + 25 @@ -816,7 +863,7 @@ background-color:#407ee1; - 170 + 210 25 @@ -838,7 +885,7 @@ background-color:#407ee1; - + 25 diff --git a/WindbgIFEO/WindbgIFEO.vcxproj b/WindbgIFEO/WindbgIFEO.vcxproj index 849292f..97a2ce0 100644 --- a/WindbgIFEO/WindbgIFEO.vcxproj +++ b/WindbgIFEO/WindbgIFEO.vcxproj @@ -88,7 +88,7 @@ MultiThreaded true - $(Qt_INCLUDEPATH_);%(AdditionalIncludeDirectories);./3rdparty; + $(Qt_INCLUDEPATH_);%(AdditionalIncludeDirectories);./3rdparty;./3rdparty/workspace/include stdcpp17 diff --git a/WindbgIFEO/main.cpp b/WindbgIFEO/main.cpp index a5eb36e..f8969e9 100644 --- a/WindbgIFEO/main.cpp +++ b/WindbgIFEO/main.cpp @@ -5,7 +5,7 @@ #include int main(int argc, char* argv[]) { - // QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); Application app(argc, argv); WindbgIFEO w; w.show();