diff --git a/QtAdb/QtAdb.pro.user b/QtAdb/QtAdb.pro.user deleted file mode 100644 index 546abf5..0000000 --- a/QtAdb/QtAdb.pro.user +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - EnvironmentId - {2a10cdab-4a79-429f-99fd-00fc9e0d38f7} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - false - true - false - 0 - true - true - 0 - 8 - true - false - 1 - true - true - true - *.md, *.MD, Makefile - false - true - - - - ProjectExplorer.Project.PluginSettings - - - true - false - true - true - true - true - - - 0 - true - - -fno-delayed-template-parsing - - true - Builtin.BuildSystem - - true - true - Builtin.DefaultTidyAndClazy - 4 - - - - true - - - true - - - - - ProjectExplorer.Project.Target.0 - - Desktop - Desktop Qt 6.2.3 MSVC2019 64bit - Desktop Qt 6.2.3 MSVC2019 64bit - qt.qt6.623.win64_msvc2019_64_kit - 0 - 0 - 0 - - 0 - D:\QT\QtADB\build-QtAdb-Desktop_Qt_6_2_3_MSVC2019_64bit-Debug - D:/QT/QtADB/build-QtAdb-Desktop_Qt_6_2_3_MSVC2019_64bit-Debug - - - true - QtProjectManager.QMakeBuildStep - false - - - - true - Qt4ProjectManager.MakeStep - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - clean - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:\QT\QtADB\build-QtAdb-Desktop_Qt_6_2_3_MSVC2019_64bit-Release - D:/QT/QtADB/build-QtAdb-Desktop_Qt_6_2_3_MSVC2019_64bit-Release - - - true - QtProjectManager.QMakeBuildStep - true - - - - true - Qt4ProjectManager.MakeStep - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - clean - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - 0 - - - 0 - D:\QT\QtADB\build-QtAdb-Desktop_Qt_6_2_3_MSVC2019_64bit-Profile - D:/QT/QtADB/build-QtAdb-Desktop_Qt_6_2_3_MSVC2019_64bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - - - true - Qt4ProjectManager.MakeStep - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - clean - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - 0 - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - - false - ProjectExplorer.DefaultDeployConfiguration - - 1 - - true - true - true - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/QT/QtADB/QtAdb/QtAdb.pro - D:/QT/QtADB/QtAdb/QtAdb.pro - false - true - true - false - true - D:/QT/QtADB/build-QtAdb-Desktop_Qt_6_2_3_MSVC2019_64bit-Debug - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/QtAdb/about.cpp b/QtAdb/about.cpp index 4cac93f..edfbe8e 100644 --- a/QtAdb/about.cpp +++ b/QtAdb/about.cpp @@ -6,7 +6,7 @@ about::about(QWidget *parent) : ui(new Ui::about) { ui->setupUi(this); - //this->setLayout(ui->verticalLayout); + self_castrate(); QGraphicsDropShadowEffect *shadowEffect_btn_website = new QGraphicsDropShadowEffect(); diff --git a/QtAdb/adbprocess.cpp b/QtAdb/adbprocess.cpp index ddd4d4d..b48b8c7 100644 --- a/QtAdb/adbprocess.cpp +++ b/QtAdb/adbprocess.cpp @@ -9,6 +9,11 @@ adbProcess::adbProcess() QString adbProcess::run(QString command) //Adb 命令解析 - 单条命令 { + if(thread) + { + explainer->thread = true; + } + QStringList args_0; QStringList args_1; @@ -69,13 +74,18 @@ QString adbProcess::run(QString command) //Adb 命令解析 - QString output; output = readAllStandardOutput(); standardOutput.append(output); - explainer->explainOutput(output); + explainer->explainOutput(output , thread); emit outputGet(output); return output; } QString adbProcess::run(QString command, device dev) //Adb 命令解析 - 对指定设备发送单条命令 { + if(thread) + { + explainer->thread = true; + } + //Sleep(500); QStringList args_0; QStringList args_1; @@ -144,7 +154,7 @@ QString adbProcess::run(QString command, device dev) //Adb 命 QString output; output = readAllStandardOutput(); //qDebug() << "run output:" << output << "\n"; - explainer->explainOutput(output); + explainer->explainOutput(output , thread); emit outputGet(output); return output; @@ -153,6 +163,11 @@ QString adbProcess::run(QString command, device dev) //Adb 命 QString adbProcess::run_contains_empty(QString command, device dev) //Adb 命令解析 - 对指定设备发送单条命令(可能包含空格) { + if(thread) + { + explainer->thread = true; + } + QStringList args_0; QStringList args_1; @@ -211,7 +226,7 @@ QString adbProcess::run_contains_empty(QString command, device dev) QString output; output = readAllStandardOutput(); //qDebug() << "run output:" << output << "\n"; - explainer->explainOutput(output); + explainer->explainOutput(output, thread); emit outputGet(output); return output; @@ -220,6 +235,11 @@ QString adbProcess::run_contains_empty(QString command, device dev) QString adbProcess::run(QString command, QString write_command) //Adb 命令解析 - 发送单条命令并向控制台输入内容 { + if(thread) + { + explainer->thread = true; + } + QStringList args_0; QStringList args_1; @@ -281,7 +301,7 @@ QString adbProcess::run(QString command, QString write_command) output = readAllStandardOutput(); standardOutput.append(output); - explainer->explainOutput(output); + explainer->explainOutput(output, thread); emit outputGet(output); return output; @@ -290,6 +310,11 @@ QString adbProcess::run(QString command, QString write_command) QString adbProcess::run(QString command, device dev, QString write_command) //Adb 命令解析 - 对指定设备发送单条命令并向控制台输入内容 { + if(thread) + { + explainer->thread = true; + } + QStringList args_0; QStringList args_1; @@ -356,7 +381,7 @@ QString adbProcess::run(QString command, device dev, QString write_command) output = readAllStandardOutput(); //qDebug() << "run output:" << output << "\n"; - explainer->explainOutput(output); + explainer->explainOutput(output, thread); emit outputGet(output); return output; diff --git a/QtAdb/adbprocess.h b/QtAdb/adbprocess.h index 56ec127..911d371 100644 --- a/QtAdb/adbprocess.h +++ b/QtAdb/adbprocess.h @@ -28,6 +28,7 @@ public: QString run_contains_empty(QString command, device dev); QString standardOutput; + bool thread = false; textExplainer *explainer; /*test*/ diff --git a/QtAdb/animationwidget.cpp b/QtAdb/animationwidget.cpp index 03f99e3..7bee688 100644 --- a/QtAdb/animationwidget.cpp +++ b/QtAdb/animationwidget.cpp @@ -39,8 +39,15 @@ void animationWidget::playLoadAnimation() opacityLoadAnimation->setEndValue(1.0); opacityLoadAnimation->start();*/ animation->setDuration(500); + //qDebug() << "parent is " << parent; + //qDebug() << "parent's geometry is " << parent->geometry(); + /* animation->setEndValue(QRect(parent->geometry().x(), parent->geometry().y(), this->width(),this->height())); - animation->setStartValue(QRect(parent->geometry().x() + 50, parent->geometry().y(), this->width(),this->height())); + animation->setStartValue(QRect(parent->geometry().x() + 50, parent->geometry().y(), this->width(),this->height()));*/ + + animation->setEndValue(QRect(301, 111, this->width(),this->height())); + animation->setStartValue(QRect(301 + 50, 111, this->width(),this->height())); + animation->setEasingCurve(QEasingCurve::OutQuart); this->show(); diff --git a/QtAdb/basepage.cpp b/QtAdb/basepage.cpp index f0f9a1c..c6e1406 100644 --- a/QtAdb/basepage.cpp +++ b/QtAdb/basepage.cpp @@ -160,5 +160,7 @@ void basePage::setDev(device device) void basePage::self_castrate() { - ui->listWidget->hide(); + delete ui->listWidget; + delete ui->mainLayout; + delete ui->verticalLayout; } diff --git a/QtAdb/mainwindow.cpp b/QtAdb/mainwindow.cpp index fc8a3e0..c3b78ff 100644 --- a/QtAdb/mainwindow.cpp +++ b/QtAdb/mainwindow.cpp @@ -47,14 +47,19 @@ MainWindow::MainWindow(QWidget *parent) explainer = new textExplainer(); maker = new pageMaker(); - /*启动ADB,将延长页面创建时间,在此期间显示启动界面*/ + /*启动ADB,将延长页面创建时间,在此期间显示启动界面,显示了个勾八*/ process->run("adb server"); refreshDevList(); + //displayWelcomePage(); + //ui->indexList->setCurrentRow(7); /*用户未选择设备前,锁定界面*/ + this->update(); + on_refreshButton_clicked(); + //initBasePage(6); lock(); //qDebug() << "1"; - displayWelcomePage(); + //displayWelcomePage(); //qDebug() << "2"; } @@ -77,41 +82,82 @@ void MainWindow::initEnvironmentPATH() //方法:设置环境变 void MainWindow::refreshDevList() //方法:刷新设备列表 { - ui->comboBox->clear(); //清空combobox + + + ui->comboBox->clear(); + //qDebug() <<"aft"; devList.clear(); //清空设备列表 + //qDebug() <<"affffter"; + //qDebug() <<"before"; devList = explainer->getDevList_windows(process->run("adb devices -l")); //重新赋值 - + //qDebug() <<"after0"; /*将设备信息传入 List l ,并将l的值显示在combobox中*/ QStringList l; l.clear(); + + //qDebug() <<"beffffffore"; for (int i = 0 ; i < devList.size() ; i++ ) { + //qDebug() <<"beffffffore i = " << i; QString devItem =devList[i].state + " " + explainer->get_words_after(devList[i].device_product, ":") + " " + explainer->get_words_after(devList[i].model, ":"); l.append(devItem); } - ui->comboBox->addItems(l); - current_device = 0; //重设当前设备 + //qDebug() <<"afttttttttttttttter"; + ui->comboBox->addItems(l); + //qDebug() <<"afterrrrrrrr"; + if(devList.isEmpty()) + { + current_device = -1; //重设当前设备 + } + else + { + current_device = 0; + } } void MainWindow::on_refreshButton_clicked() //槽:按下刷新按钮 { + //qDebug() <<"before"; refreshDevList(); + lock(); + /* if(currentPage != NULL) { currentPage->~basePage(); currentPage = NULL; - } - displayWelcomePage(); - ui->indexList->setCurrentRow(-1); + }*/ + initBasePage(6); + //ui->indexList->setCurrentRow(6); qDebug() <<"8"; } void MainWindow::setCurrentDevice(int index) //槽:改变所选设备 { - current_device = index; + if(index > 0) + { + + if(currentPage != NULL) + { + currentPage->~basePage(); + currentPage = NULL; + } + //initBasePage(6); + //ui->indexList->setCurrentRow(6); + + current_device = index; + //initBasePage(0); + if(ui->indexList->currentRow() == 0) + { + initBasePage(0); + } + else + { + ui->indexList->setCurrentRow(0); + } + } unlock(); } @@ -120,6 +166,7 @@ void MainWindow::initBasePage(int key) //槽:生成basePages while(key != -1) { this->setEnabled(false); + if(WCMPage != NULL) //销毁欢迎页面 { //currentPage->playExitAnimation(); @@ -129,26 +176,44 @@ void MainWindow::initBasePage(int key) //槽:生成basePages WCMPage = NULL; } + if(currentPage != NULL) //销毁上一个basePage { //currentPage->playExitAnimation(); //currentPage->setDisabled(true); //delete currentPage; - currentPage->setDisabled(true); + //currentPage->setDisabled(true); currentPage->~basePage(); currentPage = NULL; } + + currentPage = new basePage(this); - currentPage = maker->createPageWithKey(key,ui->page,devList[current_device]); //*去nmd*究极开销 + //devList[current_device]; + //qDebug() <<"aaaaaaaaaaaaaaaaaafter"; + qDebug() << "devlist is empty? " << devList.isEmpty(); + if(devList.isEmpty()) + { + device * noDevice = new device; + noDevice->addr = "#EMPTY#"; + currentPage = maker->createPageWithKey(6,ui->page,*noDevice); + } + else + { + qDebug() << "devlist is not empty ,creating page with key " << key; + currentPage = maker->createPageWithKey(key,ui->page,devList[current_device]); + qDebug() << "page created"; + } + //qDebug() <<"aaaaaaaaaaaaaaaaaafterrrrrrrrrrrrrrrrrrrrrr"; //qDebug() << "currentPage = maker->createPageWithKey(key,ui->page,devList[current_device]); ended"; ui->verticalLayout_2->addWidget(currentPage); currentPage->playLoadAnimation(); - //connect(currentPage,SIGNAL(animationEnd()), currentPage,SLOT(refresh_listItem_effect())); + currentPage->repaint(); + - //currentPage->repaint(); this->setEnabled(true); break; } @@ -286,12 +351,6 @@ void MainWindow::setStyles() //方法:设置样式 ui->WSABtn->setGraphicsEffect(shadowEffect_WSABtn); } -/* -void MainWindow::hideCurrentPage() //方法:隐藏当前basePage -{ - currentPage->hide(); -}*/ - void MainWindow::initSonPage(int key) //槽:生成子页面 { maker->createPageWithKey(key,currentPage,devList[current_device]); @@ -462,15 +521,15 @@ void MainWindow::on_WSABtn_clicked() //槽:连接WSA msgBox->show(); } -/* -void MainWindow::emit_signal_createBasePage(int key) -{ - emit createBasePage(key, ui->widget, devList[current_device], currentPage); -} -*/ - void MainWindow::displayWelcomePage() { + /* + WCMPage2 = new about(this->ui->page); + WCMPage2->setGeometry(QRect(301,111,WCMPage2->geometry().width(),WCMPage2->geometry().height())); + qDebug() << "initing... page's geometry is " << ui->page->geometry(); + currentPage = WCMPage2;*/ + //ui->indexList->setCurrentRow(7); +/* if(WCMPage != NULL) //销毁上一个basePage { //currentPage->setDisabled(true); @@ -481,4 +540,15 @@ void MainWindow::displayWelcomePage() WCMPage = new welcomePage(); ui->verticalLayout_2->addWidget(WCMPage); +*//* + if(WCMPage2 != NULL) //销毁上一个basePage + { + //currentPage->setDisabled(true); + //delete currentPage; + WCMPage2->~about(); + WCMPage2 = NULL; + } + + WCMPage2 = new about(); + ui->verticalLayout_2->addWidget(WCMPage2);*/ } diff --git a/QtAdb/mainwindow.h b/QtAdb/mainwindow.h index a5813f0..43b2bfe 100644 --- a/QtAdb/mainwindow.h +++ b/QtAdb/mainwindow.h @@ -15,6 +15,7 @@ #include "pagemaker.h" #include "threads/thread_createpage.h" #include "welcomepage.h" +#include "about.h" #include #include @@ -92,5 +93,6 @@ private: basePage * currentPage; animationWidget * tmpPage; welcomePage * WCMPage; + about * WCMPage2; }; #endif // MAINWINDOW_H diff --git a/QtAdb/pagemaker.cpp b/QtAdb/pagemaker.cpp index 437a42b..da8573d 100644 --- a/QtAdb/pagemaker.cpp +++ b/QtAdb/pagemaker.cpp @@ -13,7 +13,13 @@ pageMaker::pageMaker() basePage* pageMaker::createPageWithKey(int key, QWidget *parent, device dev) { + qDebug() << "key in createPageWithKey() is " << key ; int k = key; + if(dev.addr.toInt() == -1) + { + k = 6; + } + switch(k) { case 0: diff --git a/QtAdb/sonPages/apps/sp_installer.cpp b/QtAdb/sonPages/apps/sp_installer.cpp index 6281fa2..c6876ca 100644 --- a/QtAdb/sonPages/apps/sp_installer.cpp +++ b/QtAdb/sonPages/apps/sp_installer.cpp @@ -6,8 +6,14 @@ sp_installer::sp_installer(QWidget *parent) : ui(new Ui::sp_installer) { ui->setupUi(this); + setParent(parent); + ui->progressBar->hide(); + this->repaint(); + parent->repaint(); process = new adbProcess(); + thread = new adbThread(); + connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(); @@ -72,12 +78,14 @@ void sp_installer::on_runBtn_clicked() { command = "adb install"; } - //qDebug() << "enter runBtn slot 1"; - //qDebug() << "enter runBtn slot 2"; - //qDebug() << "enter runBtn slot 4"; - //qDebug() << "command: " << command; - //qDebug() << "running"; - process->run_contains_empty(command, dev); + + + thread->initThread(command,dev,"#INSTALL#"); + connect(thread,SIGNAL(signal_output(QString)),this,SLOT(stop_progressBar(QString))); + thread->start(); + ui->progressBar->show(); + this->setDisabled(true); + //process->run_contains_empty(command, dev); apkPath.clear(); labelDisplay.clear(); ui->filePaths->clear(); @@ -93,3 +101,19 @@ void sp_installer::on_selectBtn_clicked() //qDebug() << "apkPathis:" << apkPath; } + +void sp_installer::stop_progressBar(QString str) +{ + if(str.contains("Success")) + { + ui->progressBar->hide(); + this->setEnabled(true); + ui->filePaths->setText("安装成功"); + } + else + { + ui->progressBar->hide(); + this->setEnabled(true); + ui->filePaths->setText("出错"); + } +} diff --git a/QtAdb/sonPages/apps/sp_installer.h b/QtAdb/sonPages/apps/sp_installer.h index 1664d60..189746a 100644 --- a/QtAdb/sonPages/apps/sp_installer.h +++ b/QtAdb/sonPages/apps/sp_installer.h @@ -5,6 +5,7 @@ #include #include "adbprocess.h" #include +#include "../../threads/adbthread.h" namespace Ui { class sp_installer; @@ -23,6 +24,7 @@ public: void setDev(device dev); adbProcess *process; + adbThread *thread; QString labelDisplay; @@ -31,10 +33,15 @@ private slots: void on_selectBtn_clicked(); + void stop_progressBar(QString); + private: Ui::sp_installer *ui; QString apkPath; + /* + QMovie *movie; + QLabel *movieLable;*/ }; #endif // SP_INSTALLER_H diff --git a/QtAdb/sonPages/apps/sp_installer.ui b/QtAdb/sonPages/apps/sp_installer.ui index 39752f3..2059180 100644 --- a/QtAdb/sonPages/apps/sp_installer.ui +++ b/QtAdb/sonPages/apps/sp_installer.ui @@ -78,7 +78,6 @@ image: url(:/ico/image/ico/install-line.svg); - MiSans Normal 18 true @@ -117,9 +116,7 @@ border:0px solid #BDBDBD; - - MiSans Normal - + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} @@ -136,9 +133,13 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} - MiSans Normal + 12 + + border:2px solid #BDBDBD; +border-radius:4px; + @@ -146,6 +147,36 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + QProgressBar{ + font:9pt; + border-radius:4px; + text-align:center; + /*border:1px solid #E8EDF2;*/ + border:1px solid #E8EDF2; + background-color: rgb(255, 255, 255); + border-color: rgb(180, 180, 180); +} +QProgressBar:chunk{ + border-radius:4px; + /*background-color:#1ABC9C;*/ + background-color:#BDBDBD; +} + + + + 0 + + + -1 + + + true + + + diff --git a/QtAdb/sonPages/devInfo/sp_dpichanger.cpp b/QtAdb/sonPages/devInfo/sp_dpichanger.cpp index 2e232ce..078f818 100644 --- a/QtAdb/sonPages/devInfo/sp_dpichanger.cpp +++ b/QtAdb/sonPages/devInfo/sp_dpichanger.cpp @@ -10,8 +10,6 @@ sp_dpiChanger::sp_dpiChanger(QWidget *parent) : process = new adbProcess; explainer = new textExplainer; - setDpiInfo(); - connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); ui->verticalLayout->setAlignment(Qt::AlignVCenter); @@ -67,9 +65,9 @@ sp_dpiChanger::~sp_dpiChanger() void sp_dpiChanger::setDpiInfo() { - //qDebug() << "dve of sonPage = " << dev.addr; + qDebug() << "dve of sonPage = " << dev.addr; QString profile = process->run("adb shell wm density", dev).replace("Physical density", "默认").replace("Override density","当前").simplified(); - //qDebug() << profile; + qDebug() << "02" << profile; ui->dpiInfo->setText(profile); } @@ -100,6 +98,7 @@ void sp_dpiChanger::on_runBtn_clicked() void sp_dpiChanger::refresh() { + qDebug() << "refresh"; setDpiInfo(); ui->lineEdit->clear(); } @@ -111,6 +110,7 @@ void sp_dpiChanger::on_refreshBtn_clicked() void sp_dpiChanger::setDev(device device) { + qDebug() << "setDev"; dev = device; setDpiInfo(); } diff --git a/QtAdb/textexplainer.cpp b/QtAdb/textexplainer.cpp index d78a5f8..9840869 100644 --- a/QtAdb/textexplainer.cpp +++ b/QtAdb/textexplainer.cpp @@ -200,13 +200,13 @@ bool textExplainer::explainError(QString err) return true; } -bool textExplainer::explainOutput(QString op) +bool textExplainer::explainOutput(QString op, bool thread) { //qDebug() << "output = " << op; op = op.simplified(); /*普通*/ - if(op.contains("No such file or directory")) + if(op.contains("No such file or directory") && thread == false) { showMsgBox("失败"," · 应用未安装 \n · 应用安装后未首次运行"); } @@ -216,13 +216,16 @@ bool textExplainer::explainOutput(QString op) void textExplainer::showMsgBox(QString title, QString msg) { - msgBox = new QMessageBox; - msgBox->setWindowIcon(QIcon(":/ico/image/ico/link.svg")); - msgBox->setStyleSheet("background-color:rgba(255,255,255,1);border:0px; border-radius:0px;"); - msgBox->setWindowTitle(title); - msgBox->setText(msg); - msgBox->addButton(" ✓ ", QMessageBox::AcceptRole); - msgBox->show(); + if(!thread) + { + msgBox = new QMessageBox; + msgBox->setWindowIcon(QIcon(":/ico/image/ico/link.svg")); + msgBox->setStyleSheet("background-color:rgba(255,255,255,1);border:0px; border-radius:0px;"); + msgBox->setWindowTitle(title); + msgBox->setText(msg); + msgBox->addButton(" ✓ ", QMessageBox::AcceptRole); + msgBox->show(); + } } QString textExplainer::setState(QString state) diff --git a/QtAdb/textexplainer.h b/QtAdb/textexplainer.h index 0e8ed23..3564f79 100644 --- a/QtAdb/textexplainer.h +++ b/QtAdb/textexplainer.h @@ -30,8 +30,9 @@ public: void showMsgBox(QString title,QString msg); bool explainError(QString err); - bool explainOutput(QString op); + bool explainOutput(QString op, bool thread); QMessageBox *msgBox; + bool thread = false; private: QString setState(QString state); diff --git a/QtAdb/threads/adbthread.cpp b/QtAdb/threads/adbthread.cpp index 574d220..6446b1c 100644 --- a/QtAdb/threads/adbthread.cpp +++ b/QtAdb/threads/adbthread.cpp @@ -23,6 +23,7 @@ void adbThread::initThread(QString cmd, device d, QString key) void adbThread::run() { process = new adbProcess(); + process->thread = true; //qDebug() << "explainKey is " << explainKey; //sleep(3); if(explain == false) @@ -40,6 +41,14 @@ void adbThread::run() exit(); } + else if(explainKey == "#INSTALL#") + { + connect(process,SIGNAL(outputGet(QString)),this,SLOT(result(QString))); + /*QString output = */process->run_contains_empty(command, dev); + //emit signal_output(output); + exit(); + } + else if(explain == true && explainKey != "#CPU#") { QString output = explainer->get_words_after(process->run(command, dev), explainKey); @@ -47,3 +56,8 @@ void adbThread::run() exit(); } } + +void adbThread::result(QString str) +{ + emit signal_output(str); +} diff --git a/QtAdb/threads/adbthread.h b/QtAdb/threads/adbthread.h index 5722443..ae87be7 100644 --- a/QtAdb/threads/adbthread.h +++ b/QtAdb/threads/adbthread.h @@ -14,6 +14,7 @@ public: void initThread(QString cmd, device dev); void initThread(QString cmd, device dev, QString explainKey); void initThread_for_cpu(QString cmd, device dev); + //void initThread(QString cmd, device dev); bool explain = false; QString command; QString explainKey; @@ -26,7 +27,7 @@ signals: void signal_output(QString); public slots: - //static void myThreadSlot(int); + void result(QString); protected: void run() override; diff --git a/README.md b/README.md index 40ae37c..c700964 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Android 系统的可玩性在 adb 的加成下变得更加的丰富,由此涌 ### *🍘饼* -> *由于个人学业紧迫(貌似考不上研了),饼中的内容添加将十分缓慢,可能在过年后,甚至再多一年后才能开始全力开发,请见谅!* +> *由于个人学业紧迫(**确实**考不上研了),饼中的内容添加将十分缓慢,可能在过年后,甚至再多一年后才能开始全力开发,请见谅!* - 完整的软件包管理器 - 跨平台 @@ -70,16 +70,16 @@ Android 系统的可玩性在 adb 的加成下变得更加的丰富,由此涌 - 设备插拔检测 - 集成scrcpy - 视觉反馈 - - 页面切换加载进度条 - - 页面切换动画效果 - - 安装应用进度条 + - ~~页面切换加载进度条~~ + - ~~页面切换动画效果~~ + - ~~安装应用进度条~~ - 侧载进度条 - 命令 - 获取 Google 服务框架 Android ID - 更改屏幕分辨率 - 更改屏幕边距 - 控制台 - - 唤起 adb shell 窗口 + - ~~唤起 adb shell 窗口~~ - 显示输出 - 优化 err 处理 - Fastboot