From 15ffb4fd7d8734ae7a39d71f65ea462cd65b494b Mon Sep 17 00:00:00 2001 From: Lappland Date: Fri, 12 Aug 2022 03:03:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E7=AE=80=E4=B8=8E=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QtAdb/about.cpp | 16 +- QtAdb/adbprocess.cpp | 2 +- QtAdb/animationwidget.cpp | 45 +---- QtAdb/basepage.cpp | 1 + QtAdb/mainwindow.cpp | 164 +++++------------- QtAdb/mainwindow.h | 15 +- QtAdb/pagelistitem.cpp | 22 +-- QtAdb/pagemaker.cpp | 13 +- QtAdb/pagemaker.h | 1 + QtAdb/sonPages/activator/sp_activator.cpp | 26 +-- QtAdb/sonPages/advanced/sp_customize_cmd.cpp | 12 +- QtAdb/sonPages/apps/sp_installer.cpp | 10 +- QtAdb/sonPages/apps/sp_installer.ui | 8 +- QtAdb/sonPages/devControl/btnemulator.cpp | 2 +- .../devControl/sp_devcontrol_power.cpp | 10 +- QtAdb/sonPages/devInfo/sp_dpichanger.cpp | 15 +- QtAdb/sonPages/recovery/sp_recovery.cpp | 10 +- QtAdb/sonPages/sonpagemanager.cpp | 6 + QtAdb/sonPages/sonpagemanager.h | 1 + 19 files changed, 106 insertions(+), 273 deletions(-) diff --git a/QtAdb/about.cpp b/QtAdb/about.cpp index edfbe8e..644bd38 100644 --- a/QtAdb/about.cpp +++ b/QtAdb/about.cpp @@ -9,46 +9,46 @@ about::about(QWidget *parent) : self_castrate(); - QGraphicsDropShadowEffect *shadowEffect_btn_website = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_btn_website = new QGraphicsDropShadowEffect(this); shadowEffect_btn_website->setOffset(0,0); shadowEffect_btn_website->setColor(Qt::gray); shadowEffect_btn_website->setBlurRadius(5); ui->btn_website->setGraphicsEffect(shadowEffect_btn_website); - QGraphicsDropShadowEffect *shadowEffect_btn_coolapk = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_btn_coolapk = new QGraphicsDropShadowEffect(this); shadowEffect_btn_coolapk->setOffset(0,0); shadowEffect_btn_coolapk->setColor(Qt::gray); shadowEffect_btn_coolapk->setBlurRadius(5); ui->btn_coolapk->setGraphicsEffect(shadowEffect_btn_coolapk); - QGraphicsDropShadowEffect *shadowEffect_btn_github = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_btn_github = new QGraphicsDropShadowEffect(this); shadowEffect_btn_github->setOffset(0,0); shadowEffect_btn_github->setColor(Qt::gray); shadowEffect_btn_github->setBlurRadius(5); ui->btn_github->setGraphicsEffect(shadowEffect_btn_github); - QGraphicsDropShadowEffect *shadowEffect_btn_money = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_btn_money = new QGraphicsDropShadowEffect(this); shadowEffect_btn_money->setOffset(0,0); shadowEffect_btn_money->setColor(Qt::gray); shadowEffect_btn_money->setBlurRadius(5); ui->btn_money->setGraphicsEffect(shadowEffect_btn_money); - QGraphicsDropShadowEffect *shadowEffect_btn_money2 = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_btn_money2 = new QGraphicsDropShadowEffect(this); shadowEffect_btn_money2->setOffset(0,0); shadowEffect_btn_money2->setColor(Qt::gray); shadowEffect_btn_money2->setBlurRadius(5); ui->btn_money_2->setGraphicsEffect(shadowEffect_btn_money2); - QGraphicsDropShadowEffect *shadowEffect_btn_money3 = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_btn_money3 = new QGraphicsDropShadowEffect(this); shadowEffect_btn_money3->setOffset(0,0); shadowEffect_btn_money3->setColor(Qt::gray); shadowEffect_btn_money3->setBlurRadius(5); ui->btn_money_3->setGraphicsEffect(shadowEffect_btn_money3); - QGraphicsDropShadowEffect *shadowEffect_btn_money4 = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_btn_money4 = new QGraphicsDropShadowEffect(this); 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); - QGraphicsDropShadowEffect *shadowEffect_btn_version = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_btn_version = new QGraphicsDropShadowEffect(this); shadowEffect_btn_version->setOffset(0,0); shadowEffect_btn_version->setColor(Qt::gray); shadowEffect_btn_version->setBlurRadius(5); diff --git a/QtAdb/adbprocess.cpp b/QtAdb/adbprocess.cpp index b48b8c7..d6ba21a 100644 --- a/QtAdb/adbprocess.cpp +++ b/QtAdb/adbprocess.cpp @@ -4,7 +4,6 @@ adbProcess::adbProcess() { explainer = new textExplainer; connect(this , SIGNAL(readyReadStandardError()) , this , SLOT(on_readerror())); - } QString adbProcess::run(QString command) //Adb 命令解析 - 单条命令 @@ -392,6 +391,7 @@ adbProcess::~adbProcess() run("adb kill-server"); terminate(); waitForFinished(); + delete explainer; } void adbProcess::on_readerror() diff --git a/QtAdb/animationwidget.cpp b/QtAdb/animationwidget.cpp index 7bee688..7143e5e 100644 --- a/QtAdb/animationwidget.cpp +++ b/QtAdb/animationwidget.cpp @@ -2,49 +2,15 @@ animationWidget::animationWidget(QWidget *p) { - - /* - graphicsOpacityEffect = new QGraphicsOpacityEffect(this); - graphicsOpacityEffect->setOpacity(1.0); - this->setGraphicsEffect(graphicsOpacityEffect);*/ - animation = new QPropertyAnimation(this,"geometry"); setParent(p); parent = p; this->hide(); - /* - animation->setDuration(500); - animation->setStartValue(QRect(this->geometry().x() + this->width()/2, this->geometry().y() + this->height()/2, this->width(),this->height())); - animation->setEndValue(this->geometry());*/ - //animation->setEndValue(QRect(this->width(), 0, this->width(), this->height())); - - /* - QPropertyAnimation *animation1= new QPropertyAnimation(this->centralWidget(),"geometry"); - animation1->setDuration(500); - animation1->setStartValue(QRect(-this->centralWidget()->width(), 0, this->centralWidget()->width(), this->centralWidget()->height())); - animation1->setEndValue(this->centralWidget()->geometry()); - - QParallelAnimationGroup *group = new QParallelAnimationGroup; - group->addAnimation(animation); - group->addAnimation(animation1); - group->start();*/ } void animationWidget::playLoadAnimation() { - /* - opacityLoadAnimation = new QPropertyAnimation(graphicsOpacityEffect,"opacity",this); - opacityLoadAnimation->setDuration(500); - opacityLoadAnimation->setStartValue(0); - 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->setDuration(750); animation->setEndValue(QRect(301, 111, this->width(),this->height())); animation->setStartValue(QRect(301 + 50, 111, this->width(),this->height())); @@ -57,17 +23,10 @@ void animationWidget::playLoadAnimation() void animationWidget::playExitAnimation() { -/* - opacityExitAnimation = new QPropertyAnimation(graphicsOpacityEffect,"opacity",this); - opacityExitAnimation->setDuration(500); - opacityExitAnimation->setStartValue(1.0); - opacityExitAnimation->setEndValue(0); - - opacityExitAnimation->start();*/ } animationWidget::~animationWidget() { playExitAnimation(); - //delete this; + delete animation; } diff --git a/QtAdb/basepage.cpp b/QtAdb/basepage.cpp index c6e1406..f1304db 100644 --- a/QtAdb/basepage.cpp +++ b/QtAdb/basepage.cpp @@ -73,6 +73,7 @@ basePage::~basePage() sonPage->~basePage();*/ //qDebug() << "~basePage deleted" << "\n"; + delete SPManager; delete ui; } /* diff --git a/QtAdb/mainwindow.cpp b/QtAdb/mainwindow.cpp index c3b78ff..52fdbe1 100644 --- a/QtAdb/mainwindow.cpp +++ b/QtAdb/mainwindow.cpp @@ -17,17 +17,11 @@ MainWindow::MainWindow(QWidget *parent) initEnvironmentPATH(); /*加载动画GIF*/ - movie = new QMovie(":/gif/image/gif/final.gif"); - //sub = new QThread; - - /*页面内容更新线程*/ - //thread_BPCreator = new thread_createPage; - //thread_BPCreator->moveToThread(sub); - //sub->start(); + //movie = new QMovie(":/gif/image/gif/final.gif"); /*currentPage指针*/ currentPage = NULL; - WCMPage = NULL; + //WCMPage = NULL; /*devList 中的当前设备索引*/ current_device = 0; @@ -51,22 +45,18 @@ MainWindow::MainWindow(QWidget *parent) process->run("adb server"); refreshDevList(); - //displayWelcomePage(); - //ui->indexList->setCurrentRow(7); /*用户未选择设备前,锁定界面*/ this->update(); on_refreshButton_clicked(); - //initBasePage(6); lock(); - //qDebug() << "1"; - //displayWelcomePage(); - //qDebug() << "2"; } MainWindow::~MainWindow() { + ui->indexList->clear(); delete process; delete explainer; + delete maker; delete ui; } @@ -82,31 +72,22 @@ void MainWindow::initEnvironmentPATH() //方法:设置环境变 void MainWindow::refreshDevList() //方法:刷新设备列表 { - - 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); } - //qDebug() <<"afttttttttttttttter"; ui->comboBox->addItems(l); - //qDebug() <<"afterrrrrrrr"; + if(devList.isEmpty()) { current_device = -1; //重设当前设备 @@ -119,7 +100,6 @@ void MainWindow::refreshDevList() //方法:刷新设备列 void MainWindow::on_refreshButton_clicked() //槽:按下刷新按钮 { - //qDebug() <<"before"; refreshDevList(); lock(); @@ -129,19 +109,20 @@ void MainWindow::on_refreshButton_clicked() //槽:按下刷新按钮 currentPage->~basePage(); currentPage = NULL; }*/ + initBasePage(6); - //ui->indexList->setCurrentRow(6); qDebug() <<"8"; } void MainWindow::setCurrentDevice(int index) //槽:改变所选设备 { - if(index > 0) + if(index >= 0) { if(currentPage != NULL) { - currentPage->~basePage(); + delete currentPage; + //currentPage->~basePage(); currentPage = NULL; } //initBasePage(6); @@ -151,11 +132,14 @@ void MainWindow::setCurrentDevice(int index) //槽:改变所选设备 //initBasePage(0); if(ui->indexList->currentRow() == 0) { + qDebug() << "initBasePage"; initBasePage(0); } else { + qDebug() << "setCurrentRow"; ui->indexList->setCurrentRow(0); + } } unlock(); @@ -167,32 +151,16 @@ void MainWindow::initBasePage(int key) //槽:生成basePages { this->setEnabled(false); - if(WCMPage != NULL) //销毁欢迎页面 - { - //currentPage->playExitAnimation(); - //currentPage->setDisabled(true); - //delete currentPage; - WCMPage->~welcomePage(); - WCMPage = NULL; - } - - if(currentPage != NULL) //销毁上一个basePage { //currentPage->playExitAnimation(); - //currentPage->setDisabled(true); - //delete currentPage; - //currentPage->setDisabled(true); - currentPage->~basePage(); + delete currentPage; + //currentPage->~basePage(); currentPage = NULL; } - - currentPage = new basePage(this); - //devList[current_device]; - //qDebug() <<"aaaaaaaaaaaaaaaaaafter"; - qDebug() << "devlist is empty? " << devList.isEmpty(); + if(devList.isEmpty()) { device * noDevice = new device; @@ -201,18 +169,13 @@ void MainWindow::initBasePage(int key) //槽:生成basePages } 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(); - currentPage->repaint(); - + //currentPage->repaint(); this->setEnabled(true); break; @@ -228,10 +191,6 @@ void MainWindow::addItemToIndex(indexListItem *itemWidget) //方法:向indexi void MainWindow::addIndexItems() //方法:初始化向indexList中添加的item,完成indexList创建。 { -/* - basePage *wgt = new basePage(this); - currentPage = wgt;*/ - indexListItem *devInfo = new indexListItem(this->ui->indexList); devInfo->setText("设备信息"); devInfo->setPic("image:url(:/ico/image/ico/smartphone-line.svg);background-color:rgba(255,255,255,0);"); @@ -325,22 +284,22 @@ void MainWindow::setStyles() //方法:设置样式 ui->iconLabel->setStyleSheet("background-color:transparent;"); ui->fakeSpacer->setStyleSheet("background-color:transparent;"); - QGraphicsDropShadowEffect *shadowEffect_refreshButton = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_refreshButton = new QGraphicsDropShadowEffect(this); shadowEffect_refreshButton->setOffset(0,0); shadowEffect_refreshButton->setColor(Qt::gray); shadowEffect_refreshButton->setBlurRadius(5); - QGraphicsDropShadowEffect *shadowEffect_killAdbBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_killAdbBtn = new QGraphicsDropShadowEffect(this); shadowEffect_killAdbBtn->setOffset(0,0); shadowEffect_killAdbBtn->setColor(Qt::gray); shadowEffect_killAdbBtn->setBlurRadius(5); - QGraphicsDropShadowEffect *shadowEffect_testBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_testBtn = new QGraphicsDropShadowEffect(this); shadowEffect_testBtn->setOffset(0,0); shadowEffect_testBtn->setColor(Qt::gray); shadowEffect_testBtn->setBlurRadius(5); - QGraphicsDropShadowEffect *shadowEffect_WSABtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_WSABtn = new QGraphicsDropShadowEffect(this); shadowEffect_WSABtn->setOffset(0,0); shadowEffect_WSABtn->setColor(Qt::gray); shadowEffect_WSABtn->setBlurRadius(5); @@ -369,70 +328,58 @@ void MainWindow::on_adbKillerBtn_clicked() //槽:杀死ADB process->run("adb kill-server"); } -void MainWindow::playLoadingGif() //槽:播放加载动画 -{ - qDebug() << "playLoadingGif"; - ui->loadingLabel->setMovie(movie); - movie->start(); - ui->loadingLabel->show(); -} - -void MainWindow::stopLoadingGif() //槽:隐藏加载动画 + 设置currentpage参数,并发出完成basepage创建的信号 -{ - ui->loadingLabel->setVisible(false); -} - void MainWindow::on_WIFIBtn_clicked() //槽:弹出无线调试连接窗口,获取无线调试参数 { getInfo = new QWidget(); + getInfo->setMaximumSize(500,300); getInfo->setWindowTitle("无线调试"); getInfo->setStyleSheet("background-color:rgba(255,255,255,1);"); getInfo->setWindowIcon(QIcon(":/ico/image/ico/link.svg")); getInfo->setWindowIconText("test"); - QLabel * title = new QLabel(); + QLabel * title = new QLabel(getInfo); title->setText("通过WI-FI连接设备"); - QWidget *outWgt = new QWidget(); + QWidget *outWgt = new QWidget(getInfo); outWgt->setStyleSheet("border-radius: 4px;border:1px solid #BDBDBD;"); QVBoxLayout * outLayout = new QVBoxLayout(); - QLabel * step1 = new QLabel(); + QLabel * step1 = new QLabel(getInfo); step1->setText("第一步:打开 [开发者选项 -> 无线调试]"); step1->setStyleSheet("border-radius: 4px;border-bottom:1px solid #BDBDBD;"); - QLabel * lb_outIp = new QLabel(); + QLabel * lb_outIp = new QLabel(getInfo); lb_outIp->setText("无线调试IP地址:"); lb_outIp->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;"); - QLabel * lb_outPort = new QLabel(); + QLabel * lb_outPort = new QLabel(getInfo); lb_outPort->setText("无线调试端口:"); lb_outPort->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;"); - le_outIp = new QLineEdit(); + le_outIp = new QLineEdit(getInfo); //le_outIp->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;"); - le_outPort = new QLineEdit(); + le_outPort = new QLineEdit(getInfo); //le_outPort->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;"); - QWidget *inWgt = new QWidget(); + QWidget *inWgt = new QWidget(getInfo); inWgt->setStyleSheet("border-radius: 4px;border:1px solid #BDBDBD;"); QVBoxLayout * inLayout = new QVBoxLayout(); - QLabel * step2 = new QLabel(); + QLabel * step2 = new QLabel(getInfo); step2->setText("第二步:点击 [使用配对码配对设备]"); step2->setStyleSheet("border-radius: 4px;border-bottom:1px solid #BDBDBD;"); - QLabel * lb_ipAddr = new QLabel(); + QLabel * lb_ipAddr = new QLabel(getInfo); lb_ipAddr->setText("配对IP地址:"); lb_ipAddr->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;border-bottom:2px"); - QLabel * lb_port = new QLabel(); + QLabel * lb_port = new QLabel(getInfo); lb_port->setText("配对端口:"); lb_port->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;"); - QLabel * lb_code = new QLabel(); + QLabel * lb_code = new QLabel(getInfo); lb_code->setText("配对码:"); lb_code->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;"); - le_ipAddr = new QLineEdit(); + le_ipAddr = new QLineEdit(getInfo); //le_ipAddr->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;"); - le_port = new QLineEdit(); + le_port = new QLineEdit(getInfo); //le_port->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;"); - le_code = new QLineEdit(); + le_code = new QLineEdit(getInfo); //le_code->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;"); QHBoxLayout * lo_outIp = new QHBoxLayout(); @@ -455,9 +402,9 @@ void MainWindow::on_WIFIBtn_clicked() //槽:弹出无线调试 QPushButton * getInfoBtn = new QPushButton(getInfo); getInfoBtn->setText("连接"); getInfoBtn->setStyleSheet("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);}"); - QVBoxLayout * mainLayout = new QVBoxLayout(); + QVBoxLayout * mainLayout = new QVBoxLayout(getInfo); - QGraphicsDropShadowEffect *shadowEffect_getInfoBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_getInfoBtn = new QGraphicsDropShadowEffect(getInfo); shadowEffect_getInfoBtn->setOffset(0,0); shadowEffect_getInfoBtn->setColor(Qt::gray); shadowEffect_getInfoBtn->setBlurRadius(5); @@ -486,6 +433,7 @@ void MainWindow::on_WIFIBtn_clicked() //槽:弹出无线调试 connect(getInfoBtn,SIGNAL(clicked()),this,SLOT(connectWIFIDev())); getInfo->show(); + qDebug() << "size is " << getInfo->geometry(); } void MainWindow::connectWIFIDev() //槽:连接无线调试设备 @@ -520,35 +468,3 @@ void MainWindow::on_WSABtn_clicked() //槽:连接WSA msgBox->addButton(" ✓ ", QMessageBox::AcceptRole); msgBox->show(); } - -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); - //delete currentPage; - WCMPage->~welcomePage(); - WCMPage = NULL; - } - - 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 43b2bfe..8bab7c7 100644 --- a/QtAdb/mainwindow.h +++ b/QtAdb/mainwindow.h @@ -14,7 +14,6 @@ #include "basepage.h" #include "pagemaker.h" #include "threads/thread_createpage.h" -#include "welcomepage.h" #include "about.h" #include @@ -33,7 +32,6 @@ class MainWindow : public QMainWindow { Q_OBJECT signals: - //void createBasePage(int, QWidget*, device, basePage*); public: MainWindow(QWidget *parent = nullptr); @@ -42,7 +40,6 @@ public: adbProcess *process; textExplainer *explainer; pageMaker *maker; - QMovie *movie; QWidget * getInfo; QLineEdit * le_outIp; @@ -51,8 +48,6 @@ public: QLineEdit * le_port; QLineEdit * le_code; - //QThread* sub; - //thread_createPage * thread_BPCreator; int current_device; QList devList; @@ -68,18 +63,11 @@ private slots: void setCurrentDevice(int index); void initBasePage(int key); void initSonPage(int key); - void playLoadingGif(); - void stopLoadingGif(); - void on_adbKillerBtn_clicked(); void on_WIFIBtn_clicked(); void connectWIFIDev(); - - //void emit_signal_createBasePage(int key); - /*(int key, QWidget *parent, device dev)*/ - void on_WSABtn_clicked(); private: @@ -88,11 +76,10 @@ private: void initEnvironmentPATH(); void addIndexItems(); void setStyles(); - void displayWelcomePage(); basePage * currentPage; animationWidget * tmpPage; - welcomePage * WCMPage; about * WCMPage2; }; + #endif // MAINWINDOW_H diff --git a/QtAdb/pagelistitem.cpp b/QtAdb/pagelistitem.cpp index 68241fe..5208d11 100644 --- a/QtAdb/pagelistitem.cpp +++ b/QtAdb/pagelistitem.cpp @@ -11,23 +11,6 @@ pageListItem::pageListItem(QWidget *parent) : ui->widget->setStyleSheet("QWidget{background-color:transparent; border-radius:4px; border-color:gray;border:0px;}"); ui->pic->setStyleSheet("QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}"); - /* - QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect(); - shadowEffect->setOffset(0,0); - shadowEffect->setColor(Qt::gray); - shadowEffect->setBlurRadius(5); - ui->enableLight->setGraphicsEffect(shadowEffect); - - QGraphicsOpacityEffect *graphicsOpacityEffect = new QGraphicsOpacityEffect(this); - graphicsOpacityEffect->setOpacity(1.0); - ui->pic->setGraphicsEffect(graphicsOpacityEffect); - - QGraphicsDropShadowEffect *shadowEffect_icon = new QGraphicsDropShadowEffect(); - shadowEffect_icon->setOffset(0,0); - shadowEffect_icon->setColor(Qt::gray); - shadowEffect_icon->setBlurRadius(5); - ui->pic->setGraphicsEffect(shadowEffect_icon);*/ - //this->setGraphicsEffect(shadowEffect); setStyles(); } @@ -93,7 +76,8 @@ void pageListItem::slot_setText_profile(QString p) void pageListItem::setStyles() { - QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect(); + + QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect(this); shadowEffect->setOffset(0,0); shadowEffect->setColor(Qt::gray); shadowEffect->setBlurRadius(5); @@ -103,7 +87,7 @@ void pageListItem::setStyles() graphicsOpacityEffect->setOpacity(1.0); ui->pic->setGraphicsEffect(graphicsOpacityEffect); - QGraphicsDropShadowEffect *shadowEffect_icon = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_icon = new QGraphicsDropShadowEffect(this); shadowEffect_icon->setOffset(0,0); shadowEffect_icon->setColor(Qt::gray); shadowEffect_icon->setBlurRadius(5); diff --git a/QtAdb/pagemaker.cpp b/QtAdb/pagemaker.cpp index da8573d..c27e667 100644 --- a/QtAdb/pagemaker.cpp +++ b/QtAdb/pagemaker.cpp @@ -1,9 +1,4 @@ #include "pagemaker.h" -/* -pageMaker::pageMaker() -{ - -}*/ pageMaker::pageMaker() { @@ -11,9 +6,15 @@ pageMaker::pageMaker() explainer = new textExplainer(); } +pageMaker::~pageMaker() +{ + //delete process; + //delete explainer; +} + basePage* pageMaker::createPageWithKey(int key, QWidget *parent, device dev) { - qDebug() << "key in createPageWithKey() is " << key ; + //qDebug() << "key in createPageWithKey() is " << key ; int k = key; if(dev.addr.toInt() == -1) { diff --git a/QtAdb/pagemaker.h b/QtAdb/pagemaker.h index 1bcf439..5d03470 100644 --- a/QtAdb/pagemaker.h +++ b/QtAdb/pagemaker.h @@ -16,6 +16,7 @@ class pageMaker public: //pageMaker(); pageMaker(); + ~pageMaker(); adbProcess *process; textExplainer *explainer; diff --git a/QtAdb/sonPages/activator/sp_activator.cpp b/QtAdb/sonPages/activator/sp_activator.cpp index a9d959b..59e3c58 100644 --- a/QtAdb/sonPages/activator/sp_activator.cpp +++ b/QtAdb/sonPages/activator/sp_activator.cpp @@ -11,10 +11,10 @@ sp_activator::sp_activator(QWidget *parent) : connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); - QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(this); shadowEffect_runBtn->setOffset(0,0); shadowEffect_runBtn->setColor(Qt::gray); @@ -37,30 +37,16 @@ sp_activator::sp_activator(QWidget *parent) : ui->showOutputBtn->setGraphicsEffect(shadowEffect_showOutputBtn); ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn); - QGraphicsDropShadowEffect *shadowEffect_textBrowser = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_textBrowser = new QGraphicsDropShadowEffect(this); shadowEffect_textBrowser->setOffset(0,0); shadowEffect_textBrowser->setColor(Qt::gray); shadowEffect_textBrowser->setBlurRadius(5); ui->textBrowser->setGraphicsEffect(shadowEffect_textBrowser); - - /* - QGraphicsDropShadowEffect *shadowEffect_appIcon = new QGraphicsDropShadowEffect(); - shadowEffect_appIcon->setOffset(0,0); - shadowEffect_appIcon->setColor(Qt::gray); - shadowEffect_appIcon->setBlurRadius(10); - ui->appIcon->setGraphicsEffect(shadowEffect_appIcon);*/ - /* - QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect(); - shadowEffect_widget->setOffset(0,0); - shadowEffect_widget->setColor(Qt::gray); - shadowEffect_widget->setBlurRadius(5); - ui->widget->setGraphicsEffect(shadowEffect_widget);*/ - - //ui->textBrowser->sc } sp_activator::~sp_activator() { + //delete process; delete ui; } diff --git a/QtAdb/sonPages/advanced/sp_customize_cmd.cpp b/QtAdb/sonPages/advanced/sp_customize_cmd.cpp index 22d4aaa..5a973fe 100644 --- a/QtAdb/sonPages/advanced/sp_customize_cmd.cpp +++ b/QtAdb/sonPages/advanced/sp_customize_cmd.cpp @@ -10,10 +10,10 @@ sp_customize_cmd::sp_customize_cmd(QWidget *parent) : connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); - QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(this); shadowEffect_runBtn->setOffset(0,0); shadowEffect_runBtn->setColor(Qt::gray); @@ -36,13 +36,13 @@ sp_customize_cmd::sp_customize_cmd(QWidget *parent) : ui->showOutputBtn->setGraphicsEffect(shadowEffect_showOutputBtn); ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn); - QGraphicsDropShadowEffect *shadowEffect_textBrowser = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_textBrowser = new QGraphicsDropShadowEffect(this); shadowEffect_textBrowser->setOffset(0,0); shadowEffect_textBrowser->setColor(Qt::gray); shadowEffect_textBrowser->setBlurRadius(5); ui->textBrowser->setGraphicsEffect(shadowEffect_textBrowser); - QGraphicsDropShadowEffect *shadowEffect_label = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_label = new QGraphicsDropShadowEffect(this); shadowEffect_label->setOffset(0,0); shadowEffect_label->setColor(Qt::gray); shadowEffect_label->setBlurRadius(5); diff --git a/QtAdb/sonPages/apps/sp_installer.cpp b/QtAdb/sonPages/apps/sp_installer.cpp index c6876ca..b6abe55 100644 --- a/QtAdb/sonPages/apps/sp_installer.cpp +++ b/QtAdb/sonPages/apps/sp_installer.cpp @@ -16,11 +16,11 @@ sp_installer::sp_installer(QWidget *parent) : connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); - QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_selectBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_selectBtn = new QGraphicsDropShadowEffect(this); shadowEffect_runBtn->setOffset(0,0); shadowEffect_runBtn->setColor(Qt::gray); diff --git a/QtAdb/sonPages/apps/sp_installer.ui b/QtAdb/sonPages/apps/sp_installer.ui index 2059180..863230d 100644 --- a/QtAdb/sonPages/apps/sp_installer.ui +++ b/QtAdb/sonPages/apps/sp_installer.ui @@ -155,14 +155,12 @@ border-radius:4px; 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); + border:0px solid #E8EDF2; + background-color: qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #11998e, stop:1 #38ef7d); } QProgressBar:chunk{ border-radius:4px; - /*background-color:#1ABC9C;*/ - background-color:#BDBDBD; + background-color:rgba(255,255,255,0.2); } diff --git a/QtAdb/sonPages/devControl/btnemulator.cpp b/QtAdb/sonPages/devControl/btnemulator.cpp index dae5e3a..b3cf8c2 100644 --- a/QtAdb/sonPages/devControl/btnemulator.cpp +++ b/QtAdb/sonPages/devControl/btnemulator.cpp @@ -171,7 +171,7 @@ void btnEmulator::on_btn_calc_clicked() void btnEmulator::setShadow(QWidget* wgt) { - QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect(this); shadowEffect_widget->setOffset(0,0); shadowEffect_widget->setColor(Qt::gray); shadowEffect_widget->setBlurRadius(5); diff --git a/QtAdb/sonPages/devControl/sp_devcontrol_power.cpp b/QtAdb/sonPages/devControl/sp_devcontrol_power.cpp index a176f4d..56b3daf 100644 --- a/QtAdb/sonPages/devControl/sp_devcontrol_power.cpp +++ b/QtAdb/sonPages/devControl/sp_devcontrol_power.cpp @@ -17,31 +17,31 @@ sp_devControl_power::sp_devControl_power(QWidget *parent) : shadowEffect_widget->setBlurRadius(5); ui->widget->setGraphicsEffect(shadowEffect_widget);*/ - QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this); shadowEffect_back_to_basePage->setOffset(0,0); shadowEffect_back_to_basePage->setColor(Qt::gray); shadowEffect_back_to_basePage->setBlurRadius(5); ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage); - QGraphicsDropShadowEffect *shadowEffect_btn_powerDown = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_btn_powerDown = new QGraphicsDropShadowEffect(this); shadowEffect_btn_powerDown->setOffset(0,0); shadowEffect_btn_powerDown->setColor(Qt::gray); shadowEffect_btn_powerDown->setBlurRadius(5); ui->btn_powerDown->setGraphicsEffect(shadowEffect_btn_powerDown); - QGraphicsDropShadowEffect *shadowEffect_btn_rebootToSystem = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_btn_rebootToSystem = new QGraphicsDropShadowEffect(this); shadowEffect_btn_rebootToSystem->setOffset(0,0); shadowEffect_btn_rebootToSystem->setColor(Qt::gray); shadowEffect_btn_rebootToSystem->setBlurRadius(5); ui->btn_rebootToSystem->setGraphicsEffect(shadowEffect_btn_rebootToSystem); - QGraphicsDropShadowEffect *shadowEffect_rebootToRecovery_clicked = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_rebootToRecovery_clicked = new QGraphicsDropShadowEffect(this); shadowEffect_rebootToRecovery_clicked->setOffset(0,0); shadowEffect_rebootToRecovery_clicked->setColor(Qt::gray); shadowEffect_rebootToRecovery_clicked->setBlurRadius(5); ui->btn_rebootToRecovery->setGraphicsEffect(shadowEffect_rebootToRecovery_clicked); - QGraphicsDropShadowEffect *shadowEffect_btn_rebootToFastboot = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_btn_rebootToFastboot = new QGraphicsDropShadowEffect(this); shadowEffect_btn_rebootToFastboot->setOffset(0,0); shadowEffect_btn_rebootToFastboot->setColor(Qt::gray); shadowEffect_btn_rebootToFastboot->setBlurRadius(5); diff --git a/QtAdb/sonPages/devInfo/sp_dpichanger.cpp b/QtAdb/sonPages/devInfo/sp_dpichanger.cpp index 078f818..8a7118e 100644 --- a/QtAdb/sonPages/devInfo/sp_dpichanger.cpp +++ b/QtAdb/sonPages/devInfo/sp_dpichanger.cpp @@ -24,10 +24,10 @@ sp_dpiChanger::sp_dpiChanger(QWidget *parent) : "QPushButton:hover{background-color:rgba(255,255,255,0.7);}" "QPushButton:pressed{background-color:rgba(255,255,255,0.6);}"); - QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(this); shadowEffect_runBtn->setOffset(0,0); shadowEffect_runBtn->setColor(Qt::gray); @@ -49,13 +49,6 @@ sp_dpiChanger::sp_dpiChanger(QWidget *parent) : ui->runBtn->setGraphicsEffect(shadowEffect_runBtn); ui->showOutputBtn->setGraphicsEffect(shadowEffect_showOutputBtn); ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn); - - /* - QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect(); - shadowEffect_widget->setOffset(0,0); - shadowEffect_widget->setColor(Qt::gray); - shadowEffect_widget->setBlurRadius(5); - ui->widget->setGraphicsEffect(shadowEffect_widget);*/ } sp_dpiChanger::~sp_dpiChanger() diff --git a/QtAdb/sonPages/recovery/sp_recovery.cpp b/QtAdb/sonPages/recovery/sp_recovery.cpp index 5c7d7a7..8f4b329 100644 --- a/QtAdb/sonPages/recovery/sp_recovery.cpp +++ b/QtAdb/sonPages/recovery/sp_recovery.cpp @@ -10,11 +10,11 @@ sp_recovery::sp_recovery(QWidget *parent) : process = new adbProcess(); connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage())); - QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(); - QGraphicsDropShadowEffect *shadowEffect_selectBtn = new QGraphicsDropShadowEffect(); + QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(this); + QGraphicsDropShadowEffect *shadowEffect_selectBtn = new QGraphicsDropShadowEffect(this); shadowEffect_runBtn->setOffset(0,0); shadowEffect_runBtn->setColor(Qt::gray); diff --git a/QtAdb/sonPages/sonpagemanager.cpp b/QtAdb/sonPages/sonpagemanager.cpp index eb2e416..e56a736 100644 --- a/QtAdb/sonPages/sonpagemanager.cpp +++ b/QtAdb/sonPages/sonpagemanager.cpp @@ -6,6 +6,12 @@ sonPageManager::sonPageManager() explainer = new textExplainer(); } +sonPageManager::~sonPageManager() +{ + //delete process; + //delete explainer; +} + QWidget* sonPageManager::selector(QWidget *parent , QString parentName, int key, device dev) { if(parentName == "devInfo") diff --git a/QtAdb/sonPages/sonpagemanager.h b/QtAdb/sonPages/sonpagemanager.h index 096a21a..ec199a9 100644 --- a/QtAdb/sonPages/sonpagemanager.h +++ b/QtAdb/sonPages/sonpagemanager.h @@ -17,6 +17,7 @@ class sonPageManager { public: sonPageManager(); + ~sonPageManager(); adbProcess *process; textExplainer *explainer;