From 031615296accfcbde1c38daa81318771b5a1349c Mon Sep 17 00:00:00 2001 From: Lappland Date: Sun, 11 Sep 2022 02:46:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=8A=9F=E8=83=BD=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B8=8E=E7=95=8C=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QtAdb/QtAdb.pro | 9 + QtAdb/about.cpp | 28 +- QtAdb/about.h | 2 + QtAdb/about.ui | 247 ++++---- QtAdb/abstract/comboboxlistwidget.cpp | 112 ++++ QtAdb/abstract/comboboxlistwidget.h | 41 ++ QtAdb/adbprocess.cpp | 1 + QtAdb/animationwidget.cpp | 34 +- QtAdb/cfg/name.cfg | 3 + QtAdb/cfgs.qrc | 5 + QtAdb/devitem.cpp | 53 ++ QtAdb/devitem.h | 39 ++ QtAdb/devitem.ui | 318 +++++++++++ QtAdb/ico.qrc | 3 + QtAdb/image/ico/QQ_tencent-qq.svg | 1 + QtAdb/image/ico/devices.svg | 1 + QtAdb/image/ico/edit-line.svg | 1 + QtAdb/main.cpp | 2 + QtAdb/mainwindow.cpp | 168 ++++-- QtAdb/mainwindow.h | 16 +- QtAdb/mainwindow.ui | 569 +++++++++++-------- QtAdb/sonPages/advanced/sp_accounts.ui | 14 +- QtAdb/sonPages/advanced/sp_captive_portal.ui | 6 + QtAdb/sonPages/advanced/sp_scales.cpp | 3 - QtAdb/sonPages/advanced/sp_status_bar.ui | 9 + QtAdb/sonPages/apps/sp_features.ui | 6 + QtAdb/sonPages/apps/sp_installer.ui | 6 + QtAdb/sonPages/apps/sp_libraries.ui | 6 + QtAdb/sonPages/apps/sp_packages.ui | 6 + QtAdb/sonPages/apps/sp_permissiongroups.ui | 6 + QtAdb/sonPages/apps/sp_permissions.ui | 6 + QtAdb/sonPages/apps/sp_users.ui | 9 + QtAdb/sonPages/links.ui | 272 ++++----- QtAdb/textexplainer.cpp | 8 +- QtAdb/threads/thread_monitor.cpp | 10 +- README.md | 2 + 36 files changed, 1439 insertions(+), 583 deletions(-) create mode 100644 QtAdb/abstract/comboboxlistwidget.cpp create mode 100644 QtAdb/abstract/comboboxlistwidget.h create mode 100644 QtAdb/cfg/name.cfg create mode 100644 QtAdb/cfgs.qrc create mode 100644 QtAdb/devitem.cpp create mode 100644 QtAdb/devitem.h create mode 100644 QtAdb/devitem.ui create mode 100644 QtAdb/image/ico/QQ_tencent-qq.svg create mode 100644 QtAdb/image/ico/devices.svg create mode 100644 QtAdb/image/ico/edit-line.svg diff --git a/QtAdb/QtAdb.pro b/QtAdb/QtAdb.pro index 7075cb6..fb92ff5 100644 --- a/QtAdb/QtAdb.pro +++ b/QtAdb/QtAdb.pro @@ -1,5 +1,8 @@ QT += core gui QT += serialport +QT += core5compat +# QMAKE_LFLAGS += /MANIFESTUAC:\"level=\'requireAdministrator\' uiAccess=\'false\'\" + greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++11 @@ -10,9 +13,11 @@ CONFIG += c++11 SOURCES += \ about.cpp \ + abstract/comboboxlistwidget.cpp \ adbprocess.cpp \ animationwidget.cpp \ basepage.cpp \ + devitem.cpp \ indexlistitem.cpp \ main.cpp \ mainwindow.cpp \ @@ -52,9 +57,11 @@ SOURCES += \ HEADERS += \ about.h \ + abstract/comboboxlistwidget.h \ adbprocess.h \ animationwidget.h \ basepage.h \ + devitem.h \ indexlistitem.h \ mainwindow.h \ monitor.h \ @@ -94,6 +101,7 @@ HEADERS += \ FORMS += \ about.ui \ basepage.ui \ + devitem.ui \ indexlistitem.ui \ mainwindow.ui \ monitor.ui \ @@ -134,6 +142,7 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target RESOURCES += \ + cfgs.qrc \ ico.qrc \ styles.qrc diff --git a/QtAdb/about.cpp b/QtAdb/about.cpp index 2653bbc..30df6a8 100644 --- a/QtAdb/about.cpp +++ b/QtAdb/about.cpp @@ -30,12 +30,13 @@ about::about(QWidget *parent) : shadowEffect_btn_money->setOffset(0,0); shadowEffect_btn_money->setColor(Qt::gray); shadowEffect_btn_money->setBlurRadius(5); - ui->btn_money->setGraphicsEffect(shadowEffect_btn_money); + //ui->btn_money->setGraphicsEffect(shadowEffect_btn_money); + QGraphicsDropShadowEffect *shadowEffect_btn_money2 = new QGraphicsDropShadowEffect(this); shadowEffect_btn_money2->setOffset(0,0); - shadowEffect_btn_money2->setColor(Qt::green); + shadowEffect_btn_money2->setColor(QColorConstants::Svg::orange); shadowEffect_btn_money2->setBlurRadius(5); - ui->btn_money_2->setGraphicsEffect(shadowEffect_btn_money2); + ui->btn_money_2->setGraphicsEffect(shadowEffect_btn_money2);/* QGraphicsDropShadowEffect *shadowEffect_btn_money3 = new QGraphicsDropShadowEffect(this); shadowEffect_btn_money3->setOffset(0,0); shadowEffect_btn_money3->setColor(Qt::gray); @@ -45,7 +46,13 @@ about::about(QWidget *parent) : shadowEffect_btn_money4->setOffset(0,0); shadowEffect_btn_money4->setColor(Qt::gray); shadowEffect_btn_money4->setBlurRadius(5); - ui->btn_money_4->setGraphicsEffect(shadowEffect_btn_money4); + ui->btn_money_4->setGraphicsEffect(shadowEffect_btn_money4);*/ + + QGraphicsDropShadowEffect *shadowEffect_btn_qq = new QGraphicsDropShadowEffect(this); + shadowEffect_btn_qq->setOffset(0,0); + shadowEffect_btn_qq->setColor(Qt::gray); + shadowEffect_btn_qq->setBlurRadius(5); + ui->btn_qq_dis->setGraphicsEffect(shadowEffect_btn_qq); QGraphicsDropShadowEffect *shadowEffect_btn_version = new QGraphicsDropShadowEffect(this); shadowEffect_btn_version->setOffset(0,0); @@ -55,15 +62,15 @@ about::about(QWidget *parent) : QGraphicsDropShadowEffect *shadowEffect_btn_links = new QGraphicsDropShadowEffect(this); shadowEffect_btn_links->setOffset(0,0); - shadowEffect_btn_links->setColor(Qt::gray); + shadowEffect_btn_links->setColor(QColorConstants::Svg::skyblue); shadowEffect_btn_links->setBlurRadius(5); ui->btn_links->setGraphicsEffect(shadowEffect_btn_links); + /* ui->btn_money->hide(); ui->btn_money_3->hide(); - ui->btn_money_4->hide(); - + ui->btn_money_4->hide();*/ //this->setStyleSheet("QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 117, 117, 0.9);font-family: MiSans Medium; font-size:12px;border-radius:4px;}"); //this->setStyleSheet("QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 117, 117, 0.9);font-family: MiSans Medium; font-size:12px;border-radius:4px;}"); } @@ -98,7 +105,6 @@ void about::on_btn_money_2_clicked() payPage->show(); } - void about::on_btn_links_clicked() { links *linksPage = new links(); @@ -111,3 +117,9 @@ void about::on_btn_version_clicked() QDesktopServices::openUrl(QUrl("https://lapplandsp.github.io/QtAdb-Pages/qa/", QUrl::TolerantMode)); } + +void about::on_btn_qq_dis_clicked() +{ + QDesktopServices::openUrl(QUrl("https://pd.qq.com/s/k96ej1", QUrl::TolerantMode)); +} + diff --git a/QtAdb/about.h b/QtAdb/about.h index 57dd9fc..a7065a8 100644 --- a/QtAdb/about.h +++ b/QtAdb/about.h @@ -34,6 +34,8 @@ private slots: void on_btn_version_clicked(); + void on_btn_qq_dis_clicked(); + private: Ui::about *ui; }; diff --git a/QtAdb/about.ui b/QtAdb/about.ui index 874335c..e0ab3a7 100644 --- a/QtAdb/about.ui +++ b/QtAdb/about.ui @@ -6,14 +6,14 @@ 0 0 - 634 - 465 + 833 + 616 Form - + 0 @@ -52,17 +52,20 @@ background-color: rgba(255, 255, 255, 0); 11 - - - 14 - + 5 - - + + 10 + + + + + + - + 50 @@ -82,25 +85,24 @@ background-color: rgba(255, 255, 255, 0); PointingHandCursor - 版本号 + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} QPushButton:hover{background-color:rgba(255,255,255,0.7);} -QPushButton:pressed{background-color:rgba(255,255,255,0.6);} -QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 117, 117, 0.9);font-family: MiSans Medium; font-size:12px;border-radius:4px;} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} - :/ico/image/ico/about/information-line.svg:/ico/image/ico/about/information-line.svg + :/ico/image/ico/QQ_tencent-qq.svg:/ico/image/ico/QQ_tencent-qq.svg - + 0 @@ -120,16 +122,29 @@ QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 11 - 测试版本:beta-v1.3 + QQ频道 - - + + + + Qt::Vertical + + + + 20 + 40 + + + + + + - + 50 @@ -161,12 +176,12 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} - :/ico/image/ico/btnEmulator/firefox-line.svg:/ico/image/ico/btnEmulator/firefox-line.svg + :/ico/image/ico/about/coolapklogo-b.png:/ico/image/ico/about/coolapklogo-b.png - + 0 @@ -186,16 +201,16 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} - 官方网站:https://lapplandsp.github.io/QtAdb-Pages/ + 酷安 - - + + - + 50 @@ -215,24 +230,25 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} PointingHandCursor - + 版本号 QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} QPushButton:hover{background-color:rgba(255,255,255,0.7);} -QPushButton:pressed{background-color:rgba(255,255,255,0.6);} +QPushButton:pressed{background-color:rgba(255,255,255,0.6);} +QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 117, 117, 0.9);font-family: MiSans Medium; font-size:12px;border-radius:4px;} - :/ico/image/ico/about/coolapklogo-b.png:/ico/image/ico/about/coolapklogo-b.png + :/ico/image/ico/about/information-line.svg:/ico/image/ico/about/information-line.svg - + 0 @@ -252,16 +268,16 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} - 酷安:@霍星 + beta-v1.5 - - + + - + 50 @@ -284,21 +300,21 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} - QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} + QPushButton{background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px;} QPushButton:hover{background-color:rgba(255,255,255,0.7);} -QPushButton:pressed{background-color:rgba(255,255,255,0.6);} +QPushButton:pressed{background-color:rgba(255,255,255,0.5);} - :/ico/image/ico/about/github-fill.svg:/ico/image/ico/about/github-fill.svg + :/ico/image/ico/about/cola.svg:/ico/image/ico/about/cola.svg - + 0 @@ -318,22 +334,16 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} - Github :LapplandSP + 捐赠: 请我喝快乐水 - - + + - - - - 0 - 0 - - + 50 @@ -346,9 +356,15 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} 50 + + + PointingHandCursor + + + QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} QPushButton:hover{background-color:rgba(255,255,255,0.7);} @@ -359,66 +375,41 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} - :/ico/image/ico/link.svg:/ico/image/ico/link.svg - - - - - - - - MiSans Medium - 12 - - - - 相关链接 + :/ico/image/ico/btnEmulator/firefox-line.svg:/ico/image/ico/btnEmulator/firefox-line.svg - - - - - - - false - + - 50 + 0 50 - 50 + 16777215 50 - - - - 请我吃东西 - - - QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} -QPushButton:hover{background-color:rgba(255,255,255,0.7);} -QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + MiSans Medium + 12 + - - - - - :/ico/image/ico/about/heart-line.svg:/ico/image/ico/about/heart-line.svg + 官方网站 + + + + - + 50 @@ -450,46 +441,47 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} - :/ico/image/ico/about/cola.svg:/ico/image/ico/about/cola.svg + :/ico/image/ico/about/github-fill.svg:/ico/image/ico/about/github-fill.svg - + - 50 + 0 50 - 50 + 16777215 50 - - - - 请我吃鸡腿(5元) - - - QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} -QPushButton:hover{background-color:rgba(255,255,255,0.7);} -QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + MiSans Medium + 12 + - - - - - :/ico/image/ico/about/chiken.svg:/ico/image/ico/about/chiken.svg + Github + + + + - + + + + 0 + 0 + + 50 @@ -502,40 +494,25 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} 50 - - - - - 请我吃面条(10元) + + PointingHandCursor - QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} + QPushButton{background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px;} QPushButton:hover{background-color:rgba(255,255,255,0.7);} -QPushButton:pressed{background-color:rgba(255,255,255,0.6);} +QPushButton:pressed{background-color:rgba(255,255,255,0.5);} - :/ico/image/ico/about/noodles.svg:/ico/image/ico/about/noodles.svg + :/ico/image/ico/link.svg:/ico/image/ico/link.svg - - - - 0 - 50 - - - - - 16777215 - 50 - - + MiSans Medium @@ -543,28 +520,12 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} - 捐赠:请我喝快乐水 + 相关链接 - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - diff --git a/QtAdb/abstract/comboboxlistwidget.cpp b/QtAdb/abstract/comboboxlistwidget.cpp new file mode 100644 index 0000000..5b4a5b5 --- /dev/null +++ b/QtAdb/abstract/comboboxlistwidget.cpp @@ -0,0 +1,112 @@ +#include "comboboxlistwidget.h" + + + +comboboxListWidget::comboboxListWidget(QWidget *parent) + : QListWidget{parent} +{ + explainer = new textExplainer(); + + nameList[0] = name; + nameList[1] = addr; + //this->setModelColumn(count); + this->setResizeMode(QListView::Adjust); + this->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); + + QFile file_qss("://qss/scrollbar.qss"); + file_qss.open(QFile::ReadOnly); + this->verticalScrollBar()->setStyleSheet(file_qss.readAll()); + this->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); +/* + file = new QFile(":/cfgs/cfg/name.cfg"); + file->open(QFile::ReadWrite);*/ +} + +comboboxListWidget::~comboboxListWidget() +{ + +} + +void comboboxListWidget::setUpList(QList devList, QList off) +{ + /* + QFile file(":/cfgs/cfg/name.cfg"); + file.open(QFile::ReadOnly); + QString names = file.readAll(); + names = explainer->get_words_before(explainer->get_words_after(names,"###NAME###"),"###ENDNAME###"); + QStringList tmpList = names.split("\n");*/ + //qDebug() << tmpList; +/* + for(int i = 0 ;i < tmpList.size() ; i++) + { + nameList[0].append(explainer->get_words_after(tmpList[i],":")); + nameList[1].append(explainer->get_words_before(tmpList[i],":")); + }*/ + + for (int i = 0 ; i < devList.size() ; i++ ) + { + devItem *wgt = new devItem(this); + wgt->setAddr(devList[i].addr); + wgt->setDevice(devList[i].device_product); + wgt->setDevModel(devList[i].model); + wgt->setStat(devList[i].state); + + qDebug() << "nameList[1] (addr)" << nameList[1]; + qDebug() << "devList[i].addr" << devList[i].addr; + if(nameList[1].contains(devList[i].addr)) + { + wgt->setName(nameList[0][nameList[1].indexOf(devList[i].addr)]); + //qDebug() << nameList[0][nameList[1].indexOf(devList[i].addr)]; + } + else + { + wgt->setName(explainer->get_words_after(devList[i].model,":")); + } + + QListWidgetItem *item = new QListWidgetItem(this); + + this->addItem(item); + this->setItemWidget(item, wgt); + + connect(wgt,SIGNAL(addName(QString,QString)),this,SLOT(addName(QString,QString))); + } +/* + file.close();*/ + qDebug() << "closed"; + //file.deleteLater(); +} + +void comboboxListWidget::addName(QString addr,QString name) +{/* + addr = explainer->get_words_after(addr, ": "); + qDebug() << "addr:" << addr << "name:" << name; + + if(nameList[1].contains(addr)) + { + nameList[0][nameList[1].indexOf(addr)] = name; + } + else + { + nameList[0].append(name); + nameList[1].append(addr); + } + + QString text = "###NAME###\n"; + + for(int i = 0 ;i < nameList->size() ; i++) + { + text.append(nameList[1][i]).append(":").append(nameList[0][i]).append("\n"); + } + + text.append("###ENDNAME###"); + + //file.open(QFile::ReadWrite); + //file.close(); + QFile file(":/cfgs/cfg/name.cfg"); + file.setPermissions(QFile::WriteUser); + file.open(QIODevice::Truncate | QIODevice::WriteOnly); + qDebug() << file.isWritable(); + file.write(text.toUtf8()); + file.close(); + file.deleteLater();*/ +} diff --git a/QtAdb/abstract/comboboxlistwidget.h b/QtAdb/abstract/comboboxlistwidget.h new file mode 100644 index 0000000..c2bdb68 --- /dev/null +++ b/QtAdb/abstract/comboboxlistwidget.h @@ -0,0 +1,41 @@ +#ifndef COMBOBOXLISTWIDGET_H +#define COMBOBOXLISTWIDGET_H + +#include +#include +#include +#include +#include +#include +#include +#include "../devitem.h" +#include "../textexplainer.h" +#include "qstandarditemmodel.h" +#include "qscrollbar.h" + +class comboboxListWidget : public QListWidget +{ + Q_OBJECT +public: + explicit comboboxListWidget(QWidget *parent = nullptr); + ~comboboxListWidget(); + + void setUpList(QList, QList off); + + QStringList nameList[2]; + QStringList name; + QStringList addr; + +signals: + +private slots: + void addName(QString addr,QString name); + +private: + textExplainer *explainer; + + //QFile *file; + +}; + +#endif // COMBOBOXLISTWIDGET_H diff --git a/QtAdb/adbprocess.cpp b/QtAdb/adbprocess.cpp index 83c2433..bb3f014 100644 --- a/QtAdb/adbprocess.cpp +++ b/QtAdb/adbprocess.cpp @@ -80,6 +80,7 @@ QString adbProcess::run(QString command) //Adb 命令解析 - QString adbProcess::run(QString command, device dev) //Adb 命令解析 - 对指定设备发送单条命令 { + //qDebug() << "adbprocess dev = " << dev.addr; if(thread) { explainer->thread = true; diff --git a/QtAdb/animationwidget.cpp b/QtAdb/animationwidget.cpp index 86c2dd4..abcf260 100644 --- a/QtAdb/animationwidget.cpp +++ b/QtAdb/animationwidget.cpp @@ -12,17 +12,17 @@ void animationWidget::playLoadAnimation() { animation->setDuration(750); //animation->setEndValue(QPoint(301,117)); - qDebug() << "wgtHeight = " << wgtHeight; + //qDebug() << "wgtHeight = " << wgtHeight; if(parent->width() <= 600) { - animation->setEndValue(QRect(301 - 30, 117 - 6 - 11, 600,wgtHeight)); + animation->setEndValue(QRect(301 - 29, 117 - 6 - 11, 600,wgtHeight)); } else { - animation->setEndValue(QRect(301 - 30, 117 - 6 - 11, parent->width(),wgtHeight)); + animation->setEndValue(QRect(301 - 29, 117 - 6 - 11, parent->width(),wgtHeight)); } //animation->setStartValue(QPoint(301 + 50,117)); - animation->setStartValue(QRect(301 + 50 - 30, 117 - 6 - 11, parent->width()-50,wgtHeight)); + animation->setStartValue(QRect(301 + 50 - 29, 117 - 6 - 11, parent->width()-50,wgtHeight)); animation->setEasingCurve(QEasingCurve::OutQuart); @@ -38,14 +38,14 @@ void animationWidget::playLoadAnimation(int h) //qDebug() << "wgtHeight = " << wgtHeight; if(parent->width() <= 600) { - animation->setEndValue(QRect(301 - 30, 117 - 6 -11, 600,h)); + animation->setEndValue(QRect(301 - 29, 117 - 6 -11, 600,h)); } else { - animation->setEndValue(QRect(301 - 30, 117 - 6 - 11, parent->width(),h)); + animation->setEndValue(QRect(301 - 29, 117 - 6 - 11, parent->width(),h)); } //animation->setStartValue(QPoint(301 + 50,117)); - animation->setStartValue(QRect(301 + 50 - 30, 117 - 6 - 11, parent->width()-50,h)); + animation->setStartValue(QRect(301 + 50 - 29, 117 - 6 - 11, parent->width()-50,h)); animation->setEasingCurve(QEasingCurve::OutQuart); @@ -59,7 +59,7 @@ void animationWidget::playLoadAnimation_sp(int h) { animation->setDuration(500); //animation->setEndValue(QPoint(301,117)); - qDebug() << "wgtHeight = " << wgtHeight; + //qDebug() << "wgtHeight = " << wgtHeight; if(parent->width() <= 600) { animation->setEndValue(QRect(0,0, parent->width(),h)); @@ -82,17 +82,17 @@ void animationWidget::playLoadAnimation_bp(int h) { animation->setDuration(500); //animation->setEndValue(QPoint(301,117)); - qDebug() << "wgtHeight = " << wgtHeight; + //qDebug() << "wgtHeight = " << wgtHeight; if(parent->width() <= 600) { - animation->setEndValue(QRect(301 - 30, 117 - 6 -11, 600,h)); + animation->setEndValue(QRect(301 - 29, 117 - 6 -11, 600,h)); } else { - animation->setEndValue(QRect(301 - 30, 117 - 6 - 11, parent->width(),h)); + animation->setEndValue(QRect(301 - 29, 117 - 6 - 11, parent->width(),h)); } //animation->setStartValue(QPoint(301 + 50,117)); - animation->setStartValue(QRect(301 - 30, 117 - 6 - 11 + 10, parent->width(),h)); + animation->setStartValue(QRect(301 - 29, 117 - 6 - 11 + 10, parent->width(),h)); animation->setEasingCurve(QEasingCurve::OutQuart); @@ -105,18 +105,18 @@ void animationWidget::playExitAnimation() { animation->setDuration(300); //animation->setEndValue(QPoint(301,117)); - qDebug() << "wgtHeight = " << wgtHeight; + //qDebug() << "wgtHeight = " << wgtHeight; if(parent->width() <= 600) { - animation->setEndValue(QRect(301 - 30, 117 - 6 - 11 + 50, parent->width(),wgtHeight)); + animation->setEndValue(QRect(301 - 29, 117 - 6 - 11 + 50, parent->width(),wgtHeight)); } else { - animation->setEndValue(QRect(301 - 30, 117 - 6 - 11 + 50, parent->width(),wgtHeight)); + animation->setEndValue(QRect(301 - 29, 117 - 6 - 11 + 50, parent->width(),wgtHeight)); } //animation->setStartValue(QPoint(301 + 50,117)); //animation->setStartValue(QRect(301 + 50 - 30, 117 - 6 - 11, parent->width()-50,wgtHeight)); - animation->setStartValue(QRect(301 - 30, 117 - 6 - 11, parent->width(),wgtHeight)); + animation->setStartValue(QRect(301 - 29, 117 - 6 - 11, parent->width(),wgtHeight)); animation->setEasingCurve(QEasingCurve::OutQuart); @@ -129,7 +129,7 @@ void animationWidget::playExitAnimation_sp() { animation->setDuration(500); //animation->setEndValue(QPoint(301,117)); - qDebug() << "wgtHeight = " << wgtHeight; + //qDebug() << "wgtHeight = " << wgtHeight; if(parent->width() <= 600) { animation->setEndValue(QRect(0,-11, parent->width(),wgtHeight)); diff --git a/QtAdb/cfg/name.cfg b/QtAdb/cfg/name.cfg new file mode 100644 index 0000000..10dd397 --- /dev/null +++ b/QtAdb/cfg/name.cfg @@ -0,0 +1,3 @@ +###NAME### +CB512EJM8C:test +###ENDNAME### \ No newline at end of file diff --git a/QtAdb/cfgs.qrc b/QtAdb/cfgs.qrc new file mode 100644 index 0000000..e0e2de5 --- /dev/null +++ b/QtAdb/cfgs.qrc @@ -0,0 +1,5 @@ + + + cfg/name.cfg + + diff --git a/QtAdb/devitem.cpp b/QtAdb/devitem.cpp new file mode 100644 index 0000000..05e844f --- /dev/null +++ b/QtAdb/devitem.cpp @@ -0,0 +1,53 @@ +#include "devitem.h" +#include "ui_devitem.h" + +devItem::devItem(QWidget *parent) : + QWidget(parent), + ui(new Ui::devItem) +{ + ui->setupUi(this); + explainer = new textExplainer(); + QGraphicsDropShadowEffect *shadowEffect_wgt = new QGraphicsDropShadowEffect(this); + + shadowEffect_wgt->setOffset(0,0); + shadowEffect_wgt->setColor(Qt::gray); + shadowEffect_wgt->setBlurRadius(5); + ui->widget_phone->setGraphicsEffect(shadowEffect_wgt); + ui->widget_2->setStyleSheet("QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 117, 117, 0.9);font-family: MiSans Medium; font-size:12px;border-radius:4px;}"); + + ui->lineEdit->hide(); +} + +devItem::~devItem() +{ + delete ui; +} + +void devItem::setAddr(QString s) +{ + ui->label_addr_info->setText("序列号\n" + s); +} +void devItem::setDevModel(QString s) +{ + ui->label_model_info->setText("型号\n" + explainer->get_words_after(s, ":")); +} + +void devItem::setDevice(QString s) +{ + ui->label_device_info->setText("设备代号\n" + explainer->get_words_after(s, ":")); +} + +void devItem::setName(QString s) +{ + ui->lineEdit->setText(s); +} + +void devItem::setStat(QString s) +{ + ui->label_stat_info->setText(s); +} + +void devItem::on_lineEdit_editingFinished() +{ + emit addName(ui->label_addr_info->text(),ui->lineEdit->text()); +} diff --git a/QtAdb/devitem.h b/QtAdb/devitem.h new file mode 100644 index 0000000..2a861a3 --- /dev/null +++ b/QtAdb/devitem.h @@ -0,0 +1,39 @@ +#ifndef DEVITEM_H +#define DEVITEM_H + +#include +#include +//#include "abstract/comboboxlistwidget.h" +#include "textexplainer.h" + +namespace Ui { +class devItem; +} + +class devItem : public QWidget +{ + Q_OBJECT + +public: + explicit devItem(QWidget *parent = nullptr); + ~devItem(); + + void setAddr(QString); + void setDevModel(QString); + void setDevice(QString); + void setName(QString); + void setStat(QString); + + textExplainer *explainer; + +private slots: + void on_lineEdit_editingFinished(); + +private: + Ui::devItem *ui; + +signals: + void addName(QString,QString); +}; + +#endif // DEVITEM_H diff --git a/QtAdb/devitem.ui b/QtAdb/devitem.ui new file mode 100644 index 0000000..9cf8277 --- /dev/null +++ b/QtAdb/devitem.ui @@ -0,0 +1,318 @@ + + + devItem + + + + 0 + 0 + 232 + 317 + + + + Form + + + border:0px; +border-radius:8px; +background-color: rgba(255, 255, 255, 255); + + + + 30 + + + 30 + + + + + 点击选择此设备 + + + /*background-color: rgb(255, 255, 255);*/ +border:0px solid #BDBDBD;border-radius:8px;background-color: rgba(0, 0, 0, 0.4); + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + PointingHandCursor + + + + + + /*background-color: rgb(255, 255, 255);*/ +border:0px solid #BDBDBD;border-radius:8px;background-color: rgba(0, 0, 0, 0.4); + + + + 2 + + + 6 + + + 6 + + + 6 + + + 3 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + /*background-color: rgb(255, 255, 255);*/ +border:0px solid #BDBDBD; +border-radius:8px; +background-color:white; + + + + 5 + + + 5 + + + 10 + + + 5 + + + 10 + + + + + + 0 + 30 + + + + background-color: rgba(0,0,0,0.1); +border:0px solid #BDBDBD; +border-radius:15px; + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + background-color: rgba(0,0,0,0.1); +border:0px solid #BDBDBD; +border-radius:15px; + + + 型号 + + + Qt::AlignCenter + + + true + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + background-color: rgba(0,0,0,0.1); +border:0px solid #BDBDBD; +border-radius:15px; + + + 序列号 + + + Qt::AlignCenter + + + true + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + background-color: rgba(0,0,0,0.1); +border:0px solid #BDBDBD; +border-radius:15px; + + + 设备代号 + + + Qt::AlignCenter + + + true + + + + + + + + 0 + 30 + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + 9 + + + + background-color: rgba(0,0,0,0.1); +border:0px solid #BDBDBD; +border-radius:15px; + + + 状态未知 + + + Qt::AlignCenter + + + true + + + + + + + + + + + + + 8 + 8 + + + + + 8 + 8 + + + + /*background-color: rgb(255, 255, 255);*/ +border:0px solid #BDBDBD; +border-radius:4px; +background-color:white; + + + + + + + + + + Qt::Horizontal + + + + 10 + 10 + + + + + + + + + + + + + + + + + diff --git a/QtAdb/ico.qrc b/QtAdb/ico.qrc index d17673b..0926cff 100644 --- a/QtAdb/ico.qrc +++ b/QtAdb/ico.qrc @@ -78,6 +78,9 @@ image/ico/donut-chart-line.svg image/ico/layout-top-2-line.svg image/ico/stack-line.svg + image/ico/edit-line.svg + image/ico/devices.svg + image/ico/QQ_tencent-qq.svg image/test/back.png diff --git a/QtAdb/image/ico/QQ_tencent-qq.svg b/QtAdb/image/ico/QQ_tencent-qq.svg new file mode 100644 index 0000000..d160b7c --- /dev/null +++ b/QtAdb/image/ico/QQ_tencent-qq.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/devices.svg b/QtAdb/image/ico/devices.svg new file mode 100644 index 0000000..dbb2ed2 --- /dev/null +++ b/QtAdb/image/ico/devices.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/image/ico/edit-line.svg b/QtAdb/image/ico/edit-line.svg new file mode 100644 index 0000000..c46b4bc --- /dev/null +++ b/QtAdb/image/ico/edit-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/QtAdb/main.cpp b/QtAdb/main.cpp index 1b82684..2b171f0 100644 --- a/QtAdb/main.cpp +++ b/QtAdb/main.cpp @@ -13,6 +13,8 @@ int main(int argc, char *argv[]) { + //QTextCodec::setCodecForLocale(QTextCodec::codecForName("GB2312")); + QApplication a(argc, argv); QFont font; diff --git a/QtAdb/mainwindow.cpp b/QtAdb/mainwindow.cpp index d6c1e17..4e0e318 100644 --- a/QtAdb/mainwindow.cpp +++ b/QtAdb/mainwindow.cpp @@ -15,6 +15,7 @@ MainWindow::MainWindow(QWidget *parent) , ui(new Ui::MainWindow) { ui->setupUi(this); + initEnvironmentPATH(); /*加载动画GIF*/ @@ -26,7 +27,8 @@ MainWindow::MainWindow(QWidget *parent) /*devList 中的当前设备索引*/ current_device = 0; - ui->comboBox->setPlaceholderText("点击此处选择设备"); + ui->dynamic_island->setText("请先选择设备"); + //ui->comboBox->setPlaceholderText("点击此处选择设备"); /*连接信号与槽*/ connect(this->ui->comboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(setCurrentDevice(int))); //更改当前设备 @@ -36,6 +38,9 @@ MainWindow::MainWindow(QWidget *parent) /*设置界面*/ addIndexItems(); //设置左侧目录 setStyles(); //设置样式 + view = new comboboxListWidget(ui->comboBox); + ui->comboBox->setModel(view->model()); + ui->comboBox->setView(view); /*初始化对象*/ process = new adbProcess(); @@ -43,8 +48,6 @@ MainWindow::MainWindow(QWidget *parent) maker = new pageMaker(); listener = new usb_listener(); - //connect(listener, SIGNAL(DevicePlugIn()),this,SLOT(DevicePlugIn())); - //connect(listener, SIGNAL(DevicePlugOut()),this,SLOT(DevicePlugOut())); connect(listener, SIGNAL(DeviceChanged()),this,SLOT(refreshDevListLater())); connect(this, SIGNAL(adbDeviceChanged()),this,SLOT(DeviceChanged())); @@ -80,33 +83,76 @@ MainWindow::~MainWindow() void MainWindow::initEnvironmentPATH() //方法:设置环境变量 { + QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF_8")); + + /* QString envPath = qgetenv("PATH"); //获取当前环境变量 QString appDirPath = QApplication::applicationDirPath(); //获取程序所在位置 QString userPath = appDirPath + "\\platform-tools"; //向字符串中添加ADB环境 envPath += QDir::toNativeSeparators(userPath).prepend(';'); - qputenv("PATH",envPath.toStdString().c_str()); //更改环境变量 + qputenv("PATH",envPath.toStdString().c_str());*/ //更改环境变量 //qDebug() << envPath.toStdString().c_str(); + + //QTextCodec *code = QTextCodec::codecForName("UTF_8"); + + QString envPath = qgetenv("PATH"); //获取当前环境变量 + //qDebug() << "envpath" << envPath; + + //QMessageBox::warning(NULL, "nvpath",envPath); + + QString appDirPath = QApplication::applicationDirPath(); //获取程序所在位置 + //qDebug() << "appDirPath" << appDirPath; + if(appDirPath.contains(QRegularExpression("[\u4e00-\u9fa5]"))) + { + //qDebug() << "-------------------" << appDirPath.contains(QRegularExpression("[\\x4e00-\\x9fa5]+")); + //qDebug() << "\\x4e00" ; + //qDebug() << "\\x9fa5" ; + QMessageBox::warning(NULL, "路径问题","请将程序置于纯英文路径下,否则将无法正确设置ADB环境\n" + "您当前的路径为:\n" + + appDirPath); + } + +#ifdef Q_OS_WIN32 + QString userPath = appDirPath + "\\platform-tools"; //向字符串中添加ADB环境 +#endif + +#ifdef Q_OS_OSX + QString userPath = appDirPath + "\\platform-tools-OSX"; //向字符串中添加ADB环境 +#endif + +#ifdef Q_OS_LINUX + QString userPath = appDirPath + "\\platform-tools-linux"; //向字符串中添加ADB环境 +#endif + //QString userPath = appDirPath + "\\platform-tools"; //向字符串中添加ADB环境 + //qDebug() << "userPath" << userPath; + //QMessageBox::warning(NULL, "userPath",userPath); + + envPath += QDir::toNativeSeparators(userPath).prepend(';'); + //qDebug() << "envPath" << envPath; + //QMessageBox::warning(NULL, "envPath",envPath); + + qputenv("PATH",envPath.toStdString().c_str()); //更改环境变量 } void MainWindow::refreshDevList() //方法:刷新设备列表 { //ui->comboBox->clear(); /*DEBUG*/ - bool changed = false; + bool changed = false; //这个是判断列表有没有变化用的 //qDebug() << "******************一次调用*********************"; //qDebug() << "refreshDevList devList is empty? " << devList.isEmpty() << QTime::currentTime(); //qDebug() << "devList.size()" << devList.size(); - +/* for(int i = 0; i < devList.size();i++) { //qDebug() << "devList[" << i << "] is :" << devList[i].addr; } - +*/ /*DEBUG_END*/ //qDebug() << "shit 0"; bool devList_is_empty = devList.isEmpty(); - QList tmpList; + QList tmpList; //暂时的list,存储刷新前的devlist,用来与之后的devlist对比以确认设备是否有改变 /*给tmpList赋值*/ if(!devList_is_empty) @@ -188,8 +234,10 @@ void MainWindow::refreshDevList() //方法:刷新设备列 QStringList l; l.clear(); + /*一条一条添加*/ for (int i = 0 ; i < devList.size() ; i++ ) { + /*原来的*/ QString devItem = devList[i].state + " " + explainer->get_words_after(devList[i].model, ":") + " " + devList[i].addr; l.append(devItem); //qDebug() << "l[" << i << "] = " << l[i]; @@ -201,40 +249,58 @@ void MainWindow::refreshDevList() //方法:刷新设备列 ui->comboBox->setItemData(i, v, Qt::UserRole - 1); */ } + /*原来的END*/ + + /*新的*/ + + if(changed) //changed为true则设备列表有所变化,此时才更新 + { + //qDebug() <<"changed so clear"; + + ui->comboBox->clear(); + view->setUpList(devList, off); + qDebug() << "1"; + } + + /*新的END*/ } - if(changed) + /*出意外弄回来 + if(changed) //changed为true则设备列表有所变化,此时才更新 { //qDebug() <<"changed so clear"; ui->comboBox->clear(); ui->comboBox->addItems(l); - } + }*/ - if(!liangYi) + if(!liangYi) // { - //qDebug() <<"liangYi so clear"; ui->comboBox->clear(); - ui->comboBox->addItems(l); + view->setUpList(devList, off); } liangYi = false; + /*将离线设备设为不可选*/ for(int i = 0; i < off.count();i++) { QVariant v(0); ui->comboBox->setItemData(off[i], v, Qt::UserRole - 1); } + /*若没有设备,重置*/ if(devList.isEmpty()) { current_device = -1; //重设当前设备 + ui->dynamic_island->setText("请先选择设备"); } else { current_device = 0; + ui->dynamic_island->setText(devList[current_device].addr); } - liangYi = false; + liangYi = false; //重置两仪 //qDebug() << "******************一次调用结束*********************"; } @@ -271,36 +337,38 @@ void MainWindow::on_refreshButton_clicked() //槽:按下刷新按钮 void MainWindow::setCurrentDevice(int index) //槽:改变所选设备 { - qDebug() <<"MainWindow:if"; + //qDebug() <<"MainWindow:if" << "index = " << index; if(thread_mon != NULL && siXiangTimer != NULL) { - qDebug() <<"stop"; + //qDebug() <<"stop"; //siXiangTimer->stop(); - qDebug() <<"delete"; + //qDebug() <<"delete"; siXiangTimer->deleteLater(); - qDebug() <<"=NULL"; + //qDebug() <<"=NULL"; siXiangTimer = NULL; - qDebug() <<"thread_mon != NULL"; - qDebug() <<"disconnect"; + //qDebug() <<"thread_mon != NULL"; + //qDebug() <<"disconnect"; thread_mon->disconnect(); - qDebug() <<"exit()"; + //qDebug() <<"exit()"; thread_mon->quit(); - qDebug() <<"deleteLater()"; + //qDebug() <<"deleteLater()"; thread_mon->deleteLater(); } + //ui->widget_height->layout()->addWidget(ui->comboBox.it) if(index >= 0) { - qDebug() <<"NEW"; + //qDebug() <<"NEW"; siXiangTimer = new QTimer(); thread_mon = new thread_monitor(devList[current_device]); - qDebug() <<"CONNECT"; + //qDebug() <<"devList[current_device]:" << "current_device=" << current_device << "dev:" << devList[current_device].addr; + //qDebug() <<"CONNECT"; connect(siXiangTimer,SIGNAL(timeout()),thread_mon,SLOT(getInfo())); connect(thread_mon,SIGNAL(signal_monitor(float,float)),this,SLOT(slot_update_monitor(float,float))); - qDebug() <<"START"; + //qDebug() <<"START"; thread_mon->start(); siXiangTimer->start(2000); ui->progressBar_CPU->setRange(0,100); @@ -333,6 +401,8 @@ void MainWindow::setCurrentDevice(int index) //槽:改变所选设备 //qDebug() << "setCurrentRow"; ui->indexList->setCurrentRow(0); } + + ui->dynamic_island->setText(explainer->get_words_after(devList[current_device].model,":")); } unlock(); } @@ -477,12 +547,12 @@ void MainWindow::setStyles() //方法:设置样式 "QListView::item{height:35px;}" ); - ui->comboBox->setStyleSheet("QComboBox{color:black; border:0px; border-bottom:1px solid #BDBDBD; border-radius:0px; background-color:transparent;}" - "QComboBox::drop-down{border: 0px solid rgba(255,255,255,0);background-color:rgba(255,255,255,0);border-bottom-right-radius: 0px;}" - "QComboBox QAbstractItemView{border:1px solid #BDBDBD;border-radius:0px 0px 0px 0px;outline: 0px;}" - "QComboBox QAbstractItemView::item{height:30px;border:0px solid #BDBDBD;border-radius:0px 0px 0px 0px;}" - "QComboBox QAbstractItemView::item:hover{height:30px;border:0px solid #BDBDBD;border-radius:0px 0px 0px 0px;color:black}" - "QComboBox QAbstractItemView::item:selected{height:30px;border:1px solid #BDBDBD;border-radius:0px 0px 0px 0px;color:black}" + ui->comboBox->setStyleSheet("QComboBox{color:black; border:0px solid #BDBDBD; border-radius:4px; background-color:rgba(255,255,255,0.9);image:url(:/ico/image/ico/devices.svg);background-color:rgba(255,255,255,0.9);}" + "QComboBox::drop-down{border: 0px solid rgba(255,255,255,0);background-color:rgba(255,255,255,0);border-radius: 8px;}" + "QComboBox QAbstractItemView{border:1px solid #BDBDBD;border-radius:0px 0px 0px 0px;outline: 0px;background-color:rgba(255,255,255,0);}" + "QComboBox QAbstractItemView::item{height:300px;border:0px solid #BDBDBD;border-radius:0px 0px 0px 0px;background-color:rgba(255,255,255,255);}"//height:30px; + "QComboBox QAbstractItemView::item:hover{height:300px;border:0px solid #BDBDBD;border-radius:0px 0px 0px 0px;color:black;background-color:rgba(255,255,255,255);}" + "QComboBox QAbstractItemView::item:selected{height:300px;border:0px solid #BDBDBD;border-radius:0px 0px 0px 0px;color:black;background-color:rgba(255,255,255,255);}" ); /* @@ -517,18 +587,40 @@ void MainWindow::setStyles() //方法:设置样式 shadowEffect_cmdBtn->setColor(Qt::gray); shadowEffect_cmdBtn->setBlurRadius(5); - /* - QGraphicsDropShadowEffect *shadowEffect_monitor = new QGraphicsDropShadowEffect(this); - shadowEffect_monitor->setOffset(0,0); - shadowEffect_monitor->setColor(Qt::gray); - shadowEffect_monitor->setBlurRadius(5);*/ + QGraphicsDropShadowEffect *shadowEffect_island = new QGraphicsDropShadowEffect(this); + shadowEffect_island->setOffset(0,0); + shadowEffect_island->setColor(Qt::gray); + shadowEffect_island->setBlurRadius(5); + + + QGraphicsDropShadowEffect *shadowEffect_combo = new QGraphicsDropShadowEffect(this); + shadowEffect_combo->setOffset(0,0); + shadowEffect_combo->setColor(Qt::gray); + shadowEffect_combo->setBlurRadius(5); + QGraphicsDropShadowEffect *shadowEffect_CPU = new QGraphicsDropShadowEffect(this); + shadowEffect_CPU->setOffset(0,0); + shadowEffect_CPU->setColor(Qt::gray); + shadowEffect_CPU->setBlurRadius(5); + QGraphicsDropShadowEffect *shadowEffect_RAM = new QGraphicsDropShadowEffect(this); + shadowEffect_RAM->setOffset(0,0); + shadowEffect_RAM->setColor(Qt::gray); + shadowEffect_RAM->setBlurRadius(5); ui->refreshButton->setGraphicsEffect(shadowEffect_refreshButton); ui->adbKillerBtn->setGraphicsEffect(shadowEffect_killAdbBtn); ui->WIFIBtn->setGraphicsEffect(shadowEffect_testBtn); ui->WSABtn->setGraphicsEffect(shadowEffect_WSABtn); ui->cmdBtn->setGraphicsEffect(shadowEffect_cmdBtn); - //ui->widget_monitor->setGraphicsEffect(shadowEffect_monitor); + ui->dynamic_island->setGraphicsEffect(shadowEffect_island); + ui->comboBox->setGraphicsEffect(shadowEffect_combo); + ui->widget_mon_CPU->setGraphicsEffect(shadowEffect_CPU); + ui->widget_mon_RAM->setGraphicsEffect(shadowEffect_RAM); + + ui->comboBox->setMaxVisibleItems(1); + ui->comboBox->view()->window()->setWindowFlags(Qt::Popup | Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint); + ui->comboBox->view()->window()->setAttribute(Qt::WA_TranslucentBackground); + QApplication::setEffectEnabled(Qt::UI_AnimateCombo, false); + } void MainWindow::initSonPage(int key) //槽:生成子页面 @@ -774,7 +866,7 @@ void MainWindow::slot_refreshDevList() void MainWindow::refreshDevListLater() { - //qDebug() << ">>>>>>>>>>>>>>>>>>>>>>refreshDevListLater"; + qDebug() << ">>>>>>>>>>>>>>>>>>>>>>refreshDevListLater"; QTimer *timer = new QTimer(); connect(timer, SIGNAL(timeout()), this, SLOT(slot_refreshDevList())); timer->setSingleShot(true); diff --git a/QtAdb/mainwindow.h b/QtAdb/mainwindow.h index c4d9411..9173f0d 100644 --- a/QtAdb/mainwindow.h +++ b/QtAdb/mainwindow.h @@ -1,9 +1,5 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -/* -#define 布尔 bool -#define 为 = -#define 真 true*/ #include #include @@ -13,6 +9,8 @@ #include #include #include +#include +#include #include "adbprocess.h" #include "textexplainer.h" #include "indexlistitem.h" @@ -21,6 +19,8 @@ #include "about.h" #include "usb_listener.h" #include "threads/thread_monitor.h" +#include "devitem.h" +#include "abstract/comboboxlistwidget.h" #include #include @@ -87,12 +87,11 @@ private slots: void setStyles(); bool taiChi = true; //界面锁定定时器 - bool liangYi = false; //判断刷新按钮槽函数是被谁调用:false:click()调用 ; true: 自行connect() + bool liangYi = false; //判断刷新按钮槽函数是被谁调用:false:刷新按钮 click()调用 ; true: 热插拔相关 bool bagua = true; //忘了是干啥的了 //布尔 太极 为 真; - bool firstBoot = true; QTimer *taiChiTimer; QTimer *baguaTimer; @@ -105,13 +104,14 @@ private slots: thread_monitor *thread_mon = NULL; + comboboxListWidget *view; public slots: void DevicePlugIn(); void DevicePlugOut(); void DeviceChanged(); - void slot_refreshDevList(); - void refreshDevListLater(); + void slot_refreshDevList(); //如下 + void refreshDevListLater(); //与信号 usb_listener 连接的槽,在设备热插拔后启动定时器,超时1s后调用slot_refreshDevList(); void slot_update_monitor(float,float); void reset_monitorBars(); }; diff --git a/QtAdb/mainwindow.ui b/QtAdb/mainwindow.ui index d791777..456e7cd 100644 --- a/QtAdb/mainwindow.ui +++ b/QtAdb/mainwindow.ui @@ -7,7 +7,7 @@ 0 0 954 - 567 + 562 @@ -18,7 +18,10 @@ /*background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(238, 154, 229, 255), stop:1 rgba(89, 97, 249, 255));*/ - + + + 11 + 0 @@ -28,203 +31,50 @@ + + 0 + 11 - - - 5 + + + + 260 + 0 + - - - - - 250 - 100 - - - - - 250 - 100 - - - - background-color:rgba(255,255,255,0.9);border-radius:4px;border:1px solid #BDBDBD; - - - - 14 + + + 260 + 16777215 + + + + background-color:rgba(255,255,255,0);border-radius:0px;border:0px; + + + + 5 + + + 0 + + + 5 + + + 5 + + + + + 8 5 - - 14 - - - 5 - - - - - - - 3 - - - - - - 0 - 20 - - - - - 16777215 - 20 - - - - - MiSans Medium - - - - background-color: rgba(255, 255, 255, 0);border:0px; - - - CPU - - - - - - - - 0 - 20 - - - - - 16777215 - 20 - - - - - MiSans Medium - - - - background-color: rgba(255, 255, 255, 0);border:0px; - - - RAM - - - - - - - - - 3 - - - - - - 0 - 20 - - - - - 16777215 - 20 - - - - - MiSans Medium - 9 - false - false - - - - QProgressBar{ - font:9pt; - border-radius:4px; - text-align:center; - /*border:1px solid #E8EDF2;*/ - border:0px solid #E8EDF2; - background-color: #E0E0E0; -} -QProgressBar:chunk{ - border-radius:4px; - background-color:qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #38ef7d, stop:1 #11998e); -} - - - - 100 - - - 50 - - - - - - - - 0 - 20 - - - - - 16777215 - 20 - - - - - MiSans Medium - 9 - false - false - - - - QProgressBar{ - font:9pt; - border-radius:4px; - text-align:center; - /*border:1px solid #E8EDF2;*/ - border:0px solid #E8EDF2; - background-color: #E0E0E0; -} -QProgressBar:chunk{ - border-radius:4px; - background-color:qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #38ef7d, stop:1 #11998e); -} - - - - 50 - - - - - - - @@ -235,13 +85,13 @@ QProgressBar:chunk{ 0 - 30 + 28 - 210 - 30 + 16777215 + 28 @@ -253,14 +103,14 @@ QProgressBar:chunk{ - 30 - 30 + 28 + 28 - 30 - 30 + 28 + 28 @@ -291,32 +141,76 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + + 0 + 28 + + + + + 16777215 + 28 + + + + background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px; + + + + + + Qt::AlignCenter + + + + + + + + 14 + 14 + + + + + 14 + 14 + + + + + + + + + + + + 250 + 300 + + + + + 250 + 16777215 + + + + true + + + + + + - - - - - - - 250 - 300 - - - - - 250 - 16777215 - - - - true - - - - - - - + + + @@ -341,6 +235,9 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + 9 + 11 @@ -528,6 +425,234 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} + + + + 8 + + + + + + 0 + 28 + + + + + 16777215 + 28 + + + + background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px; + + + + 10 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 30 + 20 + + + + + 30 + 20 + + + + + MiSans Medium + + + + background-color: rgba(255, 255, 255, 0);border:0px; + + + CPU + + + Qt::AlignCenter + + + + + + + + 0 + 28 + + + + + 16777215 + 28 + + + + + MiSans Medium + 9 + false + false + + + + QProgressBar{ + font:9pt; + border-radius:4px; + text-align:center; + /*border:1px solid #E8EDF2;*/ + border:0px solid #E8EDF2; + + background-color: rgba(255, 255, 255, 0); +} +QProgressBar:chunk{ + border-radius:4px; + background-color:qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #38ef7d, stop:1 #11998e); +} + + + + 100 + + + 50 + + + + + + + + + + + 0 + 28 + + + + + 16777215 + 28 + + + + background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px; + + + + 10 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 30 + 20 + + + + + 30 + 20 + + + + + MiSans Medium + + + + background-color: rgba(255, 255, 255, 0);border:0px; + + + RAM + + + Qt::AlignCenter + + + + + + + + 0 + 28 + + + + + 16777215 + 28 + + + + + MiSans Medium + 9 + false + false + + + + QProgressBar{ + font:9pt; + border-radius:4px; + text-align:center; + /*border:1px solid #E8EDF2;*/ + border:0px solid #E8EDF2; + + background-color: rgba(255, 255, 255, 0); +} +QProgressBar:chunk{ + border-radius:4px; + background-color:qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #38ef7d, stop:1 #11998e); +} + + + + 50 + + + + + + + + diff --git a/QtAdb/sonPages/advanced/sp_accounts.ui b/QtAdb/sonPages/advanced/sp_accounts.ui index c9c7ca6..0a0f1bc 100644 --- a/QtAdb/sonPages/advanced/sp_accounts.ui +++ b/QtAdb/sonPages/advanced/sp_accounts.ui @@ -14,6 +14,12 @@ Form + + 0 + + + 0 + @@ -198,7 +204,7 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} - + :/ico/image/ico/arrow-left-line.svg:/ico/image/ico/arrow-left-line.svg @@ -238,7 +244,7 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} - + :/ico/image/ico/refresh-line.svg:/ico/image/ico/refresh-line.svg @@ -258,6 +264,8 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);} - + + + diff --git a/QtAdb/sonPages/advanced/sp_captive_portal.ui b/QtAdb/sonPages/advanced/sp_captive_portal.ui index fe775a0..00874b9 100644 --- a/QtAdb/sonPages/advanced/sp_captive_portal.ui +++ b/QtAdb/sonPages/advanced/sp_captive_portal.ui @@ -22,6 +22,12 @@ background-color: rgb(255, 255, 255); + + 0 + + + 0 + diff --git a/QtAdb/sonPages/advanced/sp_scales.cpp b/QtAdb/sonPages/advanced/sp_scales.cpp index 8cbde71..b74ee96 100644 --- a/QtAdb/sonPages/advanced/sp_scales.cpp +++ b/QtAdb/sonPages/advanced/sp_scales.cpp @@ -29,9 +29,6 @@ sp_scales::sp_scales(QWidget *parent) : ui->lineEdit_transition->setValidator(new QRegularExpressionValidator(QRegularExpression("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$"))); ui->lineEdit_animator->setValidator(new QRegularExpressionValidator(QRegularExpression("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$"))); ui->lineEdit_window->setValidator(new QRegularExpressionValidator(QRegularExpression("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$"))); - - - } sp_scales::~sp_scales() diff --git a/QtAdb/sonPages/advanced/sp_status_bar.ui b/QtAdb/sonPages/advanced/sp_status_bar.ui index 19a2967..36b20d9 100644 --- a/QtAdb/sonPages/advanced/sp_status_bar.ui +++ b/QtAdb/sonPages/advanced/sp_status_bar.ui @@ -17,6 +17,15 @@ background-color: rgb(255, 255, 255); + + 0 + + + 0 + + + 0 + diff --git a/QtAdb/sonPages/apps/sp_features.ui b/QtAdb/sonPages/apps/sp_features.ui index dfae4e4..c69e02a 100644 --- a/QtAdb/sonPages/apps/sp_features.ui +++ b/QtAdb/sonPages/apps/sp_features.ui @@ -14,9 +14,15 @@ Form + + 0 + 0 + + 0 + diff --git a/QtAdb/sonPages/apps/sp_installer.ui b/QtAdb/sonPages/apps/sp_installer.ui index e381fa3..6aa8b7a 100644 --- a/QtAdb/sonPages/apps/sp_installer.ui +++ b/QtAdb/sonPages/apps/sp_installer.ui @@ -14,9 +14,15 @@ Form + + 0 + 0 + + 0 + diff --git a/QtAdb/sonPages/apps/sp_libraries.ui b/QtAdb/sonPages/apps/sp_libraries.ui index 55f2433..e5a6298 100644 --- a/QtAdb/sonPages/apps/sp_libraries.ui +++ b/QtAdb/sonPages/apps/sp_libraries.ui @@ -14,9 +14,15 @@ Form + + 0 + 0 + + 0 + diff --git a/QtAdb/sonPages/apps/sp_packages.ui b/QtAdb/sonPages/apps/sp_packages.ui index 9fdb3c8..24a943e 100644 --- a/QtAdb/sonPages/apps/sp_packages.ui +++ b/QtAdb/sonPages/apps/sp_packages.ui @@ -14,9 +14,15 @@ Form + + 0 + 0 + + 0 + diff --git a/QtAdb/sonPages/apps/sp_permissiongroups.ui b/QtAdb/sonPages/apps/sp_permissiongroups.ui index 5f40820..d97618a 100644 --- a/QtAdb/sonPages/apps/sp_permissiongroups.ui +++ b/QtAdb/sonPages/apps/sp_permissiongroups.ui @@ -14,9 +14,15 @@ Form + + 0 + 0 + + 0 + diff --git a/QtAdb/sonPages/apps/sp_permissions.ui b/QtAdb/sonPages/apps/sp_permissions.ui index a316dc6..11976c9 100644 --- a/QtAdb/sonPages/apps/sp_permissions.ui +++ b/QtAdb/sonPages/apps/sp_permissions.ui @@ -14,9 +14,15 @@ Form + + 0 + 0 + + 0 + diff --git a/QtAdb/sonPages/apps/sp_users.ui b/QtAdb/sonPages/apps/sp_users.ui index 75f9f6e..6f7d6b6 100644 --- a/QtAdb/sonPages/apps/sp_users.ui +++ b/QtAdb/sonPages/apps/sp_users.ui @@ -14,6 +14,15 @@ Form + + 0 + + + 0 + + + 0 + diff --git a/QtAdb/sonPages/links.ui b/QtAdb/sonPages/links.ui index ecf3a44..58e9563 100644 --- a/QtAdb/sonPages/links.ui +++ b/QtAdb/sonPages/links.ui @@ -42,9 +42,9 @@ 0 - 0 + -609 759 - 1990 + 1117 @@ -62,24 +62,8 @@ background-color:rgba(255,255,255,0.9);border-radius:4px;border:1px solid #BDBDBD; - - - - - - MiSans Medium - 12 - - - - background-color:rgba(255,255,255,0);border-radius:0px;border:0px;border-bottom:1px solid #BDBDBD; - - - ADB - - - - + + @@ -151,7 +135,23 @@ background-color: rgba(255, 255, 255, 0); - + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0);border-radius:0px;border:0px;border-bottom:0px solid #BDBDBD; + + + ADB + + + + @@ -222,7 +222,7 @@ background-color: rgba(255, 255, 255, 0); - + @@ -296,7 +296,7 @@ background-color: rgba(255, 255, 255, 0); - + @@ -379,8 +379,8 @@ background-color: rgba(255, 255, 255, 0); background-color:rgba(255,255,255,0.9);border-radius:4px;border:1px solid #BDBDBD; - - + + @@ -389,14 +389,14 @@ background-color: rgba(255, 255, 255, 0); - background-color:rgba(255,255,255,0);border-radius:0px;border:0px;border-bottom:1px solid #BDBDBD; + background-color:rgba(255,255,255,0);border-radius:0px;border:0px;border-bottom:0px solid #BDBDBD; Recovery - + @@ -467,7 +467,7 @@ background-color: rgba(255, 255, 255, 0); - + @@ -546,8 +546,8 @@ background-color: rgba(255, 255, 255, 0); background-color:rgba(255,255,255,0.9);border-radius:4px;border:1px solid #BDBDBD; - - + + @@ -556,14 +556,14 @@ background-color: rgba(255, 255, 255, 0); - background-color:rgba(255,255,255,0);border-radius:0px;border:0px;border-bottom:1px solid #BDBDBD; + background-color:rgba(255,255,255,0);border-radius:0px;border:0px;border-bottom:0px solid #BDBDBD; 模块 - + @@ -634,7 +634,7 @@ background-color: rgba(255, 255, 255, 0); - + @@ -714,25 +714,9 @@ border-radius:4px; background-color:rgba(255,255,255,0.9);border-radius:4px;border:1px solid #BDBDBD; - - - - - - MiSans Medium - 12 - - - - background-color:rgba(255,255,255,0);border-radius:0px;border:0px;border-bottom:1px solid #BDBDBD; - - - ROMs - - - - - + + + 1 @@ -742,9 +726,9 @@ border-radius:4px; background-color:rgba(255,255,255,0);border-radius:4px;border:0px solid #BDBDBD; - + - + 50 @@ -758,7 +742,7 @@ border-radius:4px; - border:0px;image:url(:/linkIcons/image/webicons/spark.svg); + border:0px;image:url(:/linkIcons/image/webicons/crd.png); @@ -766,7 +750,7 @@ border-radius:4px; - + 0 @@ -792,7 +776,7 @@ border-radius:4px; - <a style='color: black; text-decoration: none' href = https://spark-os.live>SparkOS + <a style='color: black; text-decoration: none' href = https://crdroid.net>crDroid true @@ -802,8 +786,8 @@ border-radius:4px; - - + + 1 @@ -813,9 +797,9 @@ border-radius:4px; background-color:rgba(255,255,255,0);border-radius:4px;border:0px solid #BDBDBD; - + - + 50 @@ -829,7 +813,7 @@ border-radius:4px; - border:0px;image:url(:/linkIcons/image/webicons/paranoid.png); + border:0px;image:url(:/linkIcons/image/webicons/syb.png); @@ -837,7 +821,7 @@ border-radius:4px; - + 0 @@ -863,7 +847,7 @@ border-radius:4px; - <a style='color: black; text-decoration: none' href = https://paranoidandroid.co>paranoidandroid + <a style='color: black; text-decoration: none' href = https://syberiaos.com>Syberia OS true @@ -873,8 +857,24 @@ border-radius:4px; - - + + + + + MiSans Medium + 12 + + + + background-color:rgba(255,255,255,0);border-radius:0px;border:0px;border-bottom:0px solid #BDBDBD; + + + ROMs + + + + + 1 @@ -884,9 +884,9 @@ border-radius:4px; background-color:rgba(255,255,255,0);border-radius:4px;border:0px solid #BDBDBD; - + - + 50 @@ -900,7 +900,7 @@ border-radius:4px; - border:0px;image:url(:/linkIcons/image/webicons/projectarcana.png); + border:0px;image:url(:/linkIcons/image/webicons/rr.png); @@ -908,7 +908,7 @@ border-radius:4px; - + 0 @@ -934,7 +934,7 @@ border-radius:4px; - <a style='color: black; text-decoration: none' href = https://projectarcana-aosp.github.io/devices.html>PROJECT ARCANA + <a style='color: black; text-decoration: none' href = https://resurrectionremix.com>Resurrection Remix OS true @@ -944,8 +944,8 @@ border-radius:4px; - - + + 1 @@ -955,9 +955,9 @@ border-radius:4px; background-color:rgba(255,255,255,0);border-radius:4px;border:0px solid #BDBDBD; - + - + 50 @@ -971,7 +971,7 @@ border-radius:4px; - border:0px;image:url(:/linkIcons/image/webicons/los.png); + border:0px;image:url(:/linkIcons/image/webicons/projectarcana.png); @@ -979,7 +979,7 @@ border-radius:4px; - + 0 @@ -1005,7 +1005,7 @@ border-radius:4px; - <a style='color: black; text-decoration: none' href = https://lineageos.org>Lineage OS + <a style='color: black; text-decoration: none' href = https://projectarcana-aosp.github.io/devices.html>PROJECT ARCANA true @@ -1015,7 +1015,7 @@ border-radius:4px; - + @@ -1086,8 +1086,8 @@ border-radius:4px; - - + + 1 @@ -1097,9 +1097,9 @@ border-radius:4px; background-color:rgba(255,255,255,0);border-radius:4px;border:0px solid #BDBDBD; - + - + 50 @@ -1113,7 +1113,7 @@ border-radius:4px; - border:0px;image:url(:/linkIcons/image/webicons/nus.png); + border:0px;image:url(:/linkIcons/image/webicons/dot.png); @@ -1121,7 +1121,7 @@ border-radius:4px; - + 0 @@ -1147,7 +1147,7 @@ border-radius:4px; - <a style='color: black; text-decoration: none' href = https://nusantararom.org>Nusantara + <a style='color: black; text-decoration: none' href = https://www.droidontime.com>dotOS true @@ -1157,8 +1157,8 @@ border-radius:4px; - - + + 1 @@ -1168,9 +1168,9 @@ border-radius:4px; background-color:rgba(255,255,255,0);border-radius:4px;border:0px solid #BDBDBD; - + - + 50 @@ -1184,7 +1184,7 @@ border-radius:4px; - border:0px;image:url(:/linkIcons/image/webicons/havoc.png); + border:0px;image:url(:/linkIcons/image/webicons/spark.svg); @@ -1192,7 +1192,7 @@ border-radius:4px; - + 0 @@ -1218,7 +1218,7 @@ border-radius:4px; - <a style='color: black; text-decoration: none' href = https://havoc-os.com>Havoc-OS + <a style='color: black; text-decoration: none' href = https://spark-os.live>SparkOS true @@ -1228,8 +1228,8 @@ border-radius:4px; - - + + 1 @@ -1239,9 +1239,9 @@ border-radius:4px; background-color:rgba(255,255,255,0);border-radius:4px;border:0px solid #BDBDBD; - + - + 50 @@ -1255,7 +1255,7 @@ border-radius:4px; - border:0px;image:url(:/linkIcons/image/webicons/dot.png); + border:0px;image:url(:/linkIcons/image/webicons/paranoid.png); @@ -1263,7 +1263,7 @@ border-radius:4px; - + 0 @@ -1289,7 +1289,7 @@ border-radius:4px; - <a style='color: black; text-decoration: none' href = https://www.droidontime.com>dotOS + <a style='color: black; text-decoration: none' href = https://paranoidandroid.co>paranoidandroid true @@ -1299,8 +1299,8 @@ border-radius:4px; - - + + 1 @@ -1310,9 +1310,9 @@ border-radius:4px; background-color:rgba(255,255,255,0);border-radius:4px;border:0px solid #BDBDBD; - + - + 50 @@ -1326,7 +1326,7 @@ border-radius:4px; - border:0px;image:url(:/linkIcons/image/webicons/rr.png); + border:0px;image:url(:/linkIcons/image/webicons/los.png); @@ -1334,7 +1334,7 @@ border-radius:4px; - + 0 @@ -1360,7 +1360,7 @@ border-radius:4px; - <a style='color: black; text-decoration: none' href = https://resurrectionremix.com>Resurrection Remix OS + <a style='color: black; text-decoration: none' href = https://lineageos.org>Lineage OS true @@ -1370,8 +1370,8 @@ border-radius:4px; - - + + 1 @@ -1381,9 +1381,9 @@ border-radius:4px; background-color:rgba(255,255,255,0);border-radius:4px;border:0px solid #BDBDBD; - + - + 50 @@ -1397,7 +1397,7 @@ border-radius:4px; - border:0px;image:url(:/linkIcons/image/webicons/evoX.png); + border:0px;image:url(:/linkIcons/image/webicons/nus.png); @@ -1405,7 +1405,7 @@ border-radius:4px; - + 0 @@ -1431,7 +1431,7 @@ border-radius:4px; - <a style='color: black; text-decoration: none' href = https://evolution-x.org>Evolution X + <a style='color: black; text-decoration: none' href = https://nusantararom.org>Nusantara true @@ -1441,8 +1441,8 @@ border-radius:4px; - - + + 1 @@ -1452,9 +1452,9 @@ border-radius:4px; background-color:rgba(255,255,255,0);border-radius:4px;border:0px solid #BDBDBD; - + - + 50 @@ -1468,7 +1468,7 @@ border-radius:4px; - border:0px;image:url(:/linkIcons/image/webicons/crd.png); + border:0px;image:url(:/linkIcons/image/webicons/havoc.png); @@ -1476,7 +1476,7 @@ border-radius:4px; - + 0 @@ -1502,7 +1502,7 @@ border-radius:4px; - <a style='color: black; text-decoration: none' href = https://crdroid.net>crDroid + <a style='color: black; text-decoration: none' href = https://havoc-os.com>Havoc-OS true @@ -1512,8 +1512,8 @@ border-radius:4px; - - + + 1 @@ -1523,9 +1523,9 @@ border-radius:4px; background-color:rgba(255,255,255,0);border-radius:4px;border:0px solid #BDBDBD; - + - + 50 @@ -1539,7 +1539,7 @@ border-radius:4px; - border:0px;image:url(:/linkIcons/image/webicons/cheri.png); + border:0px;image:url(:/linkIcons/image/webicons/evoX.png); @@ -1547,7 +1547,7 @@ border-radius:4px; - + 0 @@ -1573,7 +1573,7 @@ border-radius:4px; - <a style='color: black; text-decoration: none' href = https://cherishos.com>CherishOS + <a style='color: black; text-decoration: none' href = https://evolution-x.org>Evolution X true @@ -1583,8 +1583,8 @@ border-radius:4px; - - + + 1 @@ -1594,9 +1594,9 @@ border-radius:4px; background-color:rgba(255,255,255,0);border-radius:4px;border:0px solid #BDBDBD; - + - + 50 @@ -1610,7 +1610,7 @@ border-radius:4px; - border:0px;image:url(:/linkIcons/image/webicons/syb.png); + border:0px;image:url(:/linkIcons/image/webicons/cheri.png); @@ -1618,7 +1618,7 @@ border-radius:4px; - + 0 @@ -1644,7 +1644,7 @@ border-radius:4px; - <a style='color: black; text-decoration: none' href = https://syberiaos.com>Syberia OS + <a style='color: black; text-decoration: none' href = https://cherishos.com>CherishOS true @@ -1654,7 +1654,7 @@ border-radius:4px; - + diff --git a/QtAdb/textexplainer.cpp b/QtAdb/textexplainer.cpp index 6e557b9..4587235 100644 --- a/QtAdb/textexplainer.cpp +++ b/QtAdb/textexplainer.cpp @@ -18,7 +18,7 @@ QList textExplainer::getDevList(QString tmpStr) for(int i = 1; i < tmpList.size() ; i++) { - qDebug() << "fuckQt1"; + //qDebug() << "tmplist[" << i << "]\n"; tmpList[i] = tmpList[i].simplified(); @@ -89,6 +89,11 @@ QList textExplainer::getDevList_windows(QString tmpStr) if(dev.state == "[未响应]") { dev.transport_id = tmp[2]; + + dev.device_product = "unknown"; + dev.model = "unknown"; + dev.device_debug = "unknown"; + devList.append(dev); continue; } @@ -98,6 +103,7 @@ QList textExplainer::getDevList_windows(QString tmpStr) dev.model = tmp[3]; dev.device_debug = tmp[4]; dev.transport_id = tmp[5]; + devList.append(dev); } //qDebug() << "**tmplist[" << i << "] =" << tmpList[i]; diff --git a/QtAdb/threads/thread_monitor.cpp b/QtAdb/threads/thread_monitor.cpp index b2788c7..ea8d959 100644 --- a/QtAdb/threads/thread_monitor.cpp +++ b/QtAdb/threads/thread_monitor.cpp @@ -1,9 +1,11 @@ #include "thread_monitor.h" -thread_monitor::thread_monitor(device dev) +thread_monitor::thread_monitor(device d) { + qDebug() << "******************************************" << dev.addr; process = new adbProcess(); explainer = new textExplainer(); + dev = d; //timer = new QTimer(this); //connect(timer,SIGNAL(timeout()),this,SLOT(getInfo())); //adb shell cat /proc/meminfo @@ -58,13 +60,13 @@ void thread_monitor::getInfo() int MemTotal = explainer->get_words_before(explainer->get_words_after(mem.split("\n")[0] , "MemTotal:") , "kB").simplified().simplified().toInt(); //int MemFree = explainer->get_words_before(explainer->get_words_after(mem.split("\n")[1] , "MemFree:") , "kB").simplified().simplified().toInt(); int MemAvailable = explainer->get_words_before(explainer->get_words_after(mem.split("\n")[2] , "MemAvailable:") , "kB").simplified().simplified().toInt(); - qDebug() << "Mem = " << mem; - qDebug() << "MemTotal = " << MemTotal; + //qDebug() << "Mem = " << mem; + //qDebug() << "MemTotal = " << MemTotal; //qDebug() << "MemFree = " << MemFree; //float mem_use = (float)(MemTotal - MemFree) / (float)MemTotal; float mem_use = (float)(MemTotal - MemAvailable) / (float)MemTotal; - qDebug() << "mem_use = " << mem_use; + //qDebug() << "mem_use = " << mem_use; mem = ""; emit signal_monitor(cpu_use, mem_use); diff --git a/README.md b/README.md index 22aa93e..4b8e404 100644 --- a/README.md +++ b/README.md @@ -242,3 +242,5 @@ Android 系统的可玩性在 adb 的加成下变得更加丰富,由此涌现 - Telegram:@[LapplandSP](https://t.me/LapplandSP) +- QQ频道: [点击加入](https://pd.qq.com/s/k96ej1) +