diff --git a/QtAdb/QtAdb.pro b/QtAdb/QtAdb.pro
index 5c2e73e..46ee531 100644
--- a/QtAdb/QtAdb.pro
+++ b/QtAdb/QtAdb.pro
@@ -10,6 +10,7 @@ CONFIG += c++11
SOURCES += \
about.cpp \
adbprocess.cpp \
+ animationwidget.cpp \
basepage.cpp \
indexlistitem.cpp \
main.cpp \
@@ -17,6 +18,7 @@ SOURCES += \
pagelistitem.cpp \
pagemaker.cpp \
sonPages/activator/sp_activator.cpp \
+ sonPages/advanced/sp_customize_cmd.cpp \
sonPages/apps/sp_installer.cpp \
sonPages/devControl/btnemulator.cpp \
sonPages/devControl/sp_devcontrol_power.cpp \
@@ -27,18 +29,21 @@ SOURCES += \
sonPages/sonpagemanager.cpp \
sonPages/standardoutputpage.cpp \
textexplainer.cpp \
+ threads/adbthread.cpp \
threads/thread_createpage.cpp \
welcomepage.cpp
HEADERS += \
about.h \
adbprocess.h \
+ animationwidget.h \
basepage.h \
indexlistitem.h \
mainwindow.h \
pagelistitem.h \
pagemaker.h \
sonPages/activator/sp_activator.h \
+ sonPages/advanced/sp_customize_cmd.h \
sonPages/apps/sp_installer.h \
sonPages/devControl/btnemulator.h \
sonPages/devControl/sp_devcontrol_power.h \
@@ -49,6 +54,7 @@ HEADERS += \
sonPages/sonpagemanager.h \
sonPages/standardoutputpage.h \
textexplainer.h \
+ threads/adbthread.h \
threads/thread_createpage.h \
welcomepage.h
@@ -59,6 +65,7 @@ FORMS += \
mainwindow.ui \
pagelistitem.ui \
sonPages/activator/sp_activator.ui \
+ sonPages/advanced/sp_customize_cmd.ui \
sonPages/apps/sp_installer.ui \
sonPages/devControl/btnemulator.ui \
sonPages/devControl/sp_devcontrol_power.ui \
diff --git a/QtAdb/QtAdb.pro.user b/QtAdb/QtAdb.pro.user
new file mode 100644
index 0000000..546abf5
--- /dev/null
+++ b/QtAdb/QtAdb.pro.user
@@ -0,0 +1,270 @@
+
+
+
+
+
+ EnvironmentId
+ {2a10cdab-4a79-429f-99fd-00fc9e0d38f7}
+
+
+ ProjectExplorer.Project.ActiveTarget
+ 0
+
+
+ ProjectExplorer.Project.EditorSettings
+
+ true
+ false
+ true
+
+ Cpp
+
+ CppGlobal
+
+
+
+ QmlJS
+
+ QmlJSGlobal
+
+
+ 2
+ UTF-8
+ false
+ 4
+ false
+ 80
+ true
+ true
+ 1
+ false
+ true
+ false
+ 0
+ true
+ true
+ 0
+ 8
+ true
+ false
+ 1
+ true
+ true
+ true
+ *.md, *.MD, Makefile
+ false
+ true
+
+
+
+ ProjectExplorer.Project.PluginSettings
+
+
+ true
+ false
+ true
+ true
+ true
+ true
+
+
+ 0
+ true
+
+ -fno-delayed-template-parsing
+
+ true
+ Builtin.BuildSystem
+
+ true
+ true
+ Builtin.DefaultTidyAndClazy
+ 4
+
+
+
+ true
+
+
+ true
+
+
+
+
+ ProjectExplorer.Project.Target.0
+
+ Desktop
+ Desktop Qt 6.2.3 MSVC2019 64bit
+ Desktop Qt 6.2.3 MSVC2019 64bit
+ qt.qt6.623.win64_msvc2019_64_kit
+ 0
+ 0
+ 0
+
+ 0
+ D:\QT\QtADB\build-QtAdb-Desktop_Qt_6_2_3_MSVC2019_64bit-Debug
+ D:/QT/QtADB/build-QtAdb-Desktop_Qt_6_2_3_MSVC2019_64bit-Debug
+
+
+ true
+ QtProjectManager.QMakeBuildStep
+ false
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ 2
+ Build
+ Build
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+ clean
+
+ 1
+ Clean
+ Clean
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ false
+
+ Debug
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 2
+
+
+ D:\QT\QtADB\build-QtAdb-Desktop_Qt_6_2_3_MSVC2019_64bit-Release
+ D:/QT/QtADB/build-QtAdb-Desktop_Qt_6_2_3_MSVC2019_64bit-Release
+
+
+ true
+ QtProjectManager.QMakeBuildStep
+ true
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ 2
+ Build
+ Build
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+ clean
+
+ 1
+ Clean
+ Clean
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ false
+
+ Release
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+ 0
+
+
+ 0
+ D:\QT\QtADB\build-QtAdb-Desktop_Qt_6_2_3_MSVC2019_64bit-Profile
+ D:/QT/QtADB/build-QtAdb-Desktop_Qt_6_2_3_MSVC2019_64bit-Profile
+
+
+ true
+ QtProjectManager.QMakeBuildStep
+ true
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ 2
+ Build
+ Build
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+ clean
+
+ 1
+ Clean
+ Clean
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ false
+
+ Profile
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+ 0
+ 0
+
+ 3
+
+
+ 0
+ Deploy
+ Deploy
+ ProjectExplorer.BuildSteps.Deploy
+
+ 1
+
+ false
+ ProjectExplorer.DefaultDeployConfiguration
+
+ 1
+
+ true
+ true
+ true
+
+ 2
+
+ Qt4ProjectManager.Qt4RunConfiguration:D:/QT/QtADB/QtAdb/QtAdb.pro
+ D:/QT/QtADB/QtAdb/QtAdb.pro
+ false
+ true
+ true
+ false
+ true
+ D:/QT/QtADB/build-QtAdb-Desktop_Qt_6_2_3_MSVC2019_64bit-Debug
+
+ 1
+
+
+
+ ProjectExplorer.Project.TargetCount
+ 1
+
+
+ ProjectExplorer.Project.Updater.FileVersion
+ 22
+
+
+ Version
+ 22
+
+
diff --git a/QtAdb/about.cpp b/QtAdb/about.cpp
index e0fdbb6..4cac93f 100644
--- a/QtAdb/about.cpp
+++ b/QtAdb/about.cpp
@@ -2,10 +2,12 @@
#include "ui_about.h"
about::about(QWidget *parent) :
- QWidget(parent),
+ basePage(parent),
ui(new Ui::about)
{
ui->setupUi(this);
+ //this->setLayout(ui->verticalLayout);
+ self_castrate();
QGraphicsDropShadowEffect *shadowEffect_btn_website = new QGraphicsDropShadowEffect();
shadowEffect_btn_website->setOffset(0,0);
@@ -50,6 +52,7 @@ about::about(QWidget *parent) :
shadowEffect_btn_version->setOffset(0,0);
shadowEffect_btn_version->setColor(Qt::gray);
shadowEffect_btn_version->setBlurRadius(5);
+
ui->btn_version->setGraphicsEffect(shadowEffect_btn_version);
ui->btn_money->hide();
@@ -67,7 +70,6 @@ void about::on_btn_website_clicked()
QDesktopServices::openUrl(QUrl("https://lapplandsp.github.io/QtAdb-pages/", QUrl::TolerantMode));
}
-
void about::on_btn_coolapk_clicked()
{
QDesktopServices::openUrl(QUrl("http://www.coolapk.com/u/692559", QUrl::TolerantMode));
diff --git a/QtAdb/about.h b/QtAdb/about.h
index 3e0c7c4..a72392b 100644
--- a/QtAdb/about.h
+++ b/QtAdb/about.h
@@ -4,13 +4,15 @@
#include
#include
#include
+#include "basepage.h"
#include "sonPages/pay.h"
+#include "animationwidget.h"
namespace Ui {
class about;
}
-class about : public QWidget
+class about : public basePage
{
Q_OBJECT
diff --git a/QtAdb/about.ui b/QtAdb/about.ui
index da645f9..e2dcf1d 100644
--- a/QtAdb/about.ui
+++ b/QtAdb/about.ui
@@ -22,10 +22,26 @@
-
+
+
+ 0
+ 0
+
+
+
+
+ 600
+ 350
+
+
+
+
+ MiSans Medium
+
+
border-radius: 4px;
-background-color: rgba(255, 255, 255, 0);
-border:0px solid #BDBDBD;
+background-color: rgba(255, 255, 255, 0);
@@ -94,7 +110,6 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}
- MiSans Normal
12
@@ -157,7 +172,6 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}
- MiSans Normal
12
@@ -220,7 +234,6 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}
- MiSans Normal
12
@@ -283,7 +296,6 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}
- MiSans Normal
12
@@ -451,7 +463,6 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}
- MiSans Normal
12
diff --git a/QtAdb/adbprocess.cpp b/QtAdb/adbprocess.cpp
index af58758..ddd4d4d 100644
--- a/QtAdb/adbprocess.cpp
+++ b/QtAdb/adbprocess.cpp
@@ -4,6 +4,7 @@ adbProcess::adbProcess()
{
explainer = new textExplainer;
connect(this , SIGNAL(readyReadStandardError()) , this , SLOT(on_readerror()));
+
}
QString adbProcess::run(QString command) //Adb 命令解析 - 单条命令
@@ -39,6 +40,7 @@ QString adbProcess::run(QString command) //Adb 命令解析 -
tag = 1;
shell_command.clear();
}
+
if(args_0[i] == "'" && tag == 0)
{
//qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n";
@@ -56,7 +58,7 @@ QString adbProcess::run(QString command) //Adb 命令解析 -
}
args_1.removeAt(0);
- qDebug() << "'run' running with arguments" << args_1 ;
+ //qDebug() << "'run' running with arguments" << args_1 ;
this->start("adb", args_1);
//qDebug() << readAllStandardOutput();
@@ -68,11 +70,13 @@ QString adbProcess::run(QString command) //Adb 命令解析 -
output = readAllStandardOutput();
standardOutput.append(output);
explainer->explainOutput(output);
+ emit outputGet(output);
return output;
}
QString adbProcess::run(QString command, device dev) //Adb 命令解析 - 对指定设备发送单条命令
{
+ //Sleep(500);
QStringList args_0;
QStringList args_1;
@@ -92,6 +96,7 @@ QString adbProcess::run(QString command, device dev) //Adb 命
args_1.append(args_0[i]);
//qDebug() << "append0" << shell_command;
}
+
/*
if(tag == 0)
{
@@ -100,6 +105,7 @@ QString adbProcess::run(QString command, device dev) //Adb 命
//q.enqueue(args_0[i]);
//qDebug() << shell_command;
}*/
+
if(args_0[i] == "'" && tag == 0)
{
//qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n";
@@ -108,6 +114,7 @@ QString adbProcess::run(QString command, device dev) //Adb 命
tag = 1;
shell_command.clear();
}
+
if(args_0[i] == "'" && tag == 0)
{
//qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n";
@@ -126,7 +133,7 @@ QString adbProcess::run(QString command, device dev) //Adb 命
args_1.removeAt(2);
- qDebug() << "'run' running with arguments" << args_1 ;
+ //qDebug() << "'run' running with arguments" << args_1 ;
//qDebug() << "calling this->start('adb', args_1);";
this->start("adb", args_1);
//qDebug() << "this->start('adb', args_1); ended";
@@ -138,11 +145,14 @@ QString adbProcess::run(QString command, device dev) //Adb 命
output = readAllStandardOutput();
//qDebug() << "run output:" << output << "\n";
explainer->explainOutput(output);
+
+ emit outputGet(output);
return output;
}
QString adbProcess::run_contains_empty(QString command, device dev) //Adb 命令解析 - 对指定设备发送单条命令(可能包含空格)
{
+
QStringList args_0;
QStringList args_1;
@@ -192,7 +202,7 @@ QString adbProcess::run_contains_empty(QString command, device dev)
args_1.removeAt(2);
- qDebug() << "'run' running with arguments" << args_1 ;
+ //qDebug() << "'run' running with arguments" << args_1 ;
this->start("adb", args_1);
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
waitForReadyRead();
@@ -202,11 +212,14 @@ QString adbProcess::run_contains_empty(QString command, device dev)
output = readAllStandardOutput();
//qDebug() << "run output:" << output << "\n";
explainer->explainOutput(output);
+
+ emit outputGet(output);
return output;
}
QString adbProcess::run(QString command, QString write_command) //Adb 命令解析 - 发送单条命令并向控制台输入内容
{
+
QStringList args_0;
QStringList args_1;
@@ -221,6 +234,7 @@ QString adbProcess::run(QString command, QString write_command)
args_1.append(args_0[i]);
//qDebug() << "append0" << shell_command;
}
+
/*
if(tag == 0)
{
@@ -229,6 +243,7 @@ QString adbProcess::run(QString command, QString write_command)
//q.enqueue(args_0[i]);
//qDebug() << shell_command;
}*/
+
if(args_0[i] == "'" && tag == 0)
{
//qDebug() << "No." << i << ":" << "args_0[" << i << "] is:" << args_0[i] << "\n" << "tag = " << tag << "\n";
@@ -255,30 +270,26 @@ QString adbProcess::run(QString command, QString write_command)
}
args_1.removeAt(0);
- qDebug() << "'run' running with arguments" << args_1 ;
+ //qDebug() << "'run' running with arguments" << args_1 ;
this->start("adb", args_1);
- //qDebug() << "write 0";
- //qDebug() << "write 1";
this->write(write_command.toLocal8Bit());
- //qDebug() << "write 2";
waitForReadyRead();
- //qDebug() << "write 3";
waitForFinished();
- //qDebug() << "write 4";
QString output;
output = readAllStandardOutput();
standardOutput.append(output);
- //qDebug() << "output:" << output;
-
explainer->explainOutput(output);
+
+ emit outputGet(output);
return output;
}
QString adbProcess::run(QString command, device dev, QString write_command) //Adb 命令解析 - 对指定设备发送单条命令并向控制台输入内容
{
+
QStringList args_0;
QStringList args_1;
@@ -334,7 +345,7 @@ QString adbProcess::run(QString command, device dev, QString write_command)
args_1.removeAt(2);
- qDebug() << "'run' running with arguments" << args_1 ;
+ //qDebug() << "'run' running with arguments" << args_1 ;
this->start("adb", args_1);
this->write(write_command.toLocal8Bit());
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -346,6 +357,8 @@ QString adbProcess::run(QString command, device dev, QString write_command)
//qDebug() << "run output:" << output << "\n";
explainer->explainOutput(output);
+
+ emit outputGet(output);
return output;
}
diff --git a/QtAdb/adbprocess.h b/QtAdb/adbprocess.h
index 32030d6..56ec127 100644
--- a/QtAdb/adbprocess.h
+++ b/QtAdb/adbprocess.h
@@ -12,6 +12,7 @@
#include
+//#include
class adbProcess : public QProcess
{
@@ -29,10 +30,15 @@ public:
QString standardOutput;
textExplainer *explainer;
+ /*test*/
+ QWidget *test;
private slots:
//void onReadData();
void on_readerror();
+
+signals:
+ void outputGet(QString);
};
#endif // ADBPROCESS_H
diff --git a/QtAdb/animationwidget.cpp b/QtAdb/animationwidget.cpp
new file mode 100644
index 0000000..03f99e3
--- /dev/null
+++ b/QtAdb/animationwidget.cpp
@@ -0,0 +1,66 @@
+#include "animationwidget.h"
+
+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);
+ 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->setEasingCurve(QEasingCurve::OutQuart);
+
+ this->show();
+ animation->start();
+ emit animationEnd();
+}
+
+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;
+}
diff --git a/QtAdb/animationwidget.h b/QtAdb/animationwidget.h
new file mode 100644
index 0000000..d133b36
--- /dev/null
+++ b/QtAdb/animationwidget.h
@@ -0,0 +1,42 @@
+#ifndef ANIMATIONWIDGET_H
+#define ANIMATIONWIDGET_H
+
+#include
+
+#include
+#include
+#include
+#include
+
+namespace Ui {
+class animationWidget;
+}
+
+class animationWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit animationWidget(QWidget *parent = nullptr);
+ ~animationWidget();
+
+
+ void playLoadAnimation();
+ void playExitAnimation();
+
+ bool isBasePage;
+ QWidget *parent;
+
+ QPropertyAnimation *animation;
+ /*
+ QGraphicsOpacityEffect * graphicsOpacityEffect;
+ QPropertyAnimation * opacityLoadAnimation;
+ QPropertyAnimation * opacityExitAnimation;*/
+
+signals:
+ void animationEnd();
+
+};
+
+
+#endif // ANIMATIONWIDGET_H
diff --git a/QtAdb/basepage.cpp b/QtAdb/basepage.cpp
index 55a202a..f0f9a1c 100644
--- a/QtAdb/basepage.cpp
+++ b/QtAdb/basepage.cpp
@@ -2,7 +2,7 @@
#include "ui_basepage.h"
basePage::basePage(QWidget *parent) :
- QWidget(parent),
+ animationWidget(parent),
ui(new Ui::basePage)
{
ui->setupUi(this);
@@ -11,11 +11,11 @@ basePage::basePage(QWidget *parent) :
lastPage = NULL;
sonPage = NULL;
-
+ /*
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
shadowEffect->setOffset(0,0);
shadowEffect->setColor(Qt::gray);
- shadowEffect->setBlurRadius(10);
+ shadowEffect->setBlurRadius(10);*/
//ui->listWidget->setGraphicsEffect(shadowEffect);
/*******原来的
@@ -65,6 +65,8 @@ basePage::basePage(QWidget *parent) :
basePage::~basePage()
{
+
+ //sleep(1000);
//qDebug() << "~basePage" << "\n";
/*
if(sonPage != NULL)
@@ -73,22 +75,16 @@ basePage::~basePage()
//qDebug() << "~basePage deleted" << "\n";
delete ui;
}
-
+/*
void basePage::playExitAnimation()
-{/*
- QPropertyAnimation* pWidgetProcessOpacity = new QPropertyAnimation(exitOpacity, "opacity", this);
-
- pWidgetProcessOpacity->setDuration(300);
-
- pWidgetProcessOpacity->setStartValue(1);
-
- pWidgetProcessOpacity->setEndValue(0);
-
- pWidgetProcessOpacity->setEasingCurve(QEasingCurve::Linear);
-
- pWidgetProcessOpacity->start(QAbstractAnimation::DeleteWhenStopped);//执行动画,结束后删除对象。*/
+{
+ QPropertyAnimation *animation = new QPropertyAnimation(this,"windowOpacity");
+ animation->setDuration(1000);
+ animation->setStartValue(0);
+ animation->setEndValue(1);
+ animation->start();
}
-
+*/
void basePage::addItemsToList(pageListItem *itemWidget)
{
QListWidgetItem *tmpItem = new QListWidgetItem();
@@ -104,10 +100,10 @@ void basePage::setFather(QWidget *parent)
void basePage::slot_createSonPage(int key)
{
emit creatingSonPage();
- if(isEnable(key))
+ if(isEnable(key) && key >= 0)
{
ui->listWidget->setCurrentRow(-1);
- qDebug() << "dev of basePage = " << dev.addr;
+ //qDebug() << "dev of basePage = " << dev.addr;
sonPage = SPManager->selector(this,whoAmI(),key,dev);
if(sonPage != NULL)
{
@@ -115,7 +111,7 @@ void basePage::slot_createSonPage(int key)
ui->mainLayout->addWidget(sonPage);
}
}
- //qDebug() << "is not";
+ //ui->listWidget->setCurrentRow(-1);
}
void basePage::slot_destroySonPage()
@@ -161,3 +157,8 @@ void basePage::setDev(device device)
{
dev = device;
}
+
+void basePage::self_castrate()
+{
+ ui->listWidget->hide();
+}
diff --git a/QtAdb/basepage.h b/QtAdb/basepage.h
index 6ffba7e..e49b6be 100644
--- a/QtAdb/basepage.h
+++ b/QtAdb/basepage.h
@@ -7,12 +7,13 @@
#include
#include "pagelistitem.h"
#include "sonPages/sonpagemanager.h"
+#include "animationwidget.h"
namespace Ui {
class basePage;
}
-class basePage : public QWidget
+class basePage : public animationWidget
{
Q_OBJECT
signals:
@@ -41,6 +42,10 @@ public:
void setEnableValue(int val[20]);
void setDev(device dev);
+
+
+ void self_castrate();
+
private:
Ui::basePage *ui;
@@ -49,7 +54,9 @@ private:
//QGraphicsOpacityEffect* exitOpacity;
public slots:
- void playExitAnimation();
+ //void playExitAnimation();
+
+ //void refresh_listItem_effect();
private slots:
void slot_createSonPage(int key);
diff --git a/QtAdb/basepage.ui b/QtAdb/basepage.ui
index a51b42f..47eb60b 100644
--- a/QtAdb/basepage.ui
+++ b/QtAdb/basepage.ui
@@ -13,6 +13,9 @@
Form
+
+ background-color: rgba(255, 255, 255, 0);
+
0
diff --git a/QtAdb/ico.qrc b/QtAdb/ico.qrc
index 34f0231..22d32d1 100644
--- a/QtAdb/ico.qrc
+++ b/QtAdb/ico.qrc
@@ -70,6 +70,7 @@
image/ico/about/alipay.svg
image/ico/about/wechat.svg
image/ico/logo.svg
+ image/ico/code-s-slash-line.svg
image/test/back.png
diff --git a/QtAdb/image/ico/code-s-slash-line.svg b/QtAdb/image/ico/code-s-slash-line.svg
new file mode 100644
index 0000000..d663b48
--- /dev/null
+++ b/QtAdb/image/ico/code-s-slash-line.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/QtAdb/main.cpp b/QtAdb/main.cpp
index ab834f3..1b82684 100644
--- a/QtAdb/main.cpp
+++ b/QtAdb/main.cpp
@@ -9,6 +9,7 @@
#include
#include
#include
+#include
int main(int argc, char *argv[])
{
@@ -43,13 +44,14 @@ int main(int argc, char *argv[])
splash.setBaseSize(100,100);
splash.setMaximumSize(100,100);
splash.show();
+ //Sleep(5000);
a.processEvents();
+
MainWindow w;
w.show();
splash.finish(&w);
-
return a.exec();
}
diff --git a/QtAdb/mainwindow.cpp b/QtAdb/mainwindow.cpp
index 0c20a6f..fc8a3e0 100644
--- a/QtAdb/mainwindow.cpp
+++ b/QtAdb/mainwindow.cpp
@@ -53,9 +53,9 @@ MainWindow::MainWindow(QWidget *parent)
/*用户未选择设备前,锁定界面*/
lock();
- qDebug() << "1";
+ //qDebug() << "1";
displayWelcomePage();
- qDebug() << "2";
+ //qDebug() << "2";
}
MainWindow::~MainWindow()
@@ -101,10 +101,12 @@ void MainWindow::on_refreshButton_clicked() //槽:按下刷新按钮
lock();
if(currentPage != NULL)
{
- currentPage->~QWidget();
+ currentPage->~basePage();
currentPage = NULL;
}
displayWelcomePage();
+ ui->indexList->setCurrentRow(-1);
+ qDebug() <<"8";
}
void MainWindow::setCurrentDevice(int index) //槽:改变所选设备
@@ -115,26 +117,41 @@ void MainWindow::setCurrentDevice(int index) //槽:改变所选设备
void MainWindow::initBasePage(int key) //槽:生成basePages
{
- if(WCMPage != NULL) //销毁欢迎页面
+ while(key != -1)
{
- //currentPage->setDisabled(true);
- //delete currentPage;
- WCMPage->~welcomePage();
- WCMPage = NULL;
- }
+ this->setEnabled(false);
+ if(WCMPage != NULL) //销毁欢迎页面
+ {
+ //currentPage->playExitAnimation();
+ //currentPage->setDisabled(true);
+ //delete currentPage;
+ WCMPage->~welcomePage();
+ WCMPage = NULL;
+ }
- if(currentPage != NULL) //销毁上一个basePage
- {
- //currentPage->setDisabled(true);
- //delete currentPage;
- currentPage->~QWidget();
- currentPage = NULL;
- }
+ if(currentPage != NULL) //销毁上一个basePage
+ {
+ //currentPage->playExitAnimation();
+ //currentPage->setDisabled(true);
+ //delete currentPage;
+ currentPage->setDisabled(true);
+ currentPage->~basePage();
+ currentPage = NULL;
+ }
- currentPage = new QWidget(this);
- currentPage = maker->createPageWithKey(key,ui->page,devList[current_device]); //究极开销
- qDebug() << "currentPage = maker->createPageWithKey(key,ui->page,devList[current_device]); ended";
- ui->verticalLayout_2->addWidget(currentPage);
+ currentPage = new basePage(this);
+ currentPage = maker->createPageWithKey(key,ui->page,devList[current_device]); //*去nmd*究极开销
+ //qDebug() << "currentPage = maker->createPageWithKey(key,ui->page,devList[current_device]); ended";
+
+ ui->verticalLayout_2->addWidget(currentPage);
+
+ currentPage->playLoadAnimation();
+ //connect(currentPage,SIGNAL(animationEnd()), currentPage,SLOT(refresh_listItem_effect()));
+
+ //currentPage->repaint();
+ this->setEnabled(true);
+ break;
+ }
}
void MainWindow::addItemToIndex(indexListItem *itemWidget) //方法:向indexist中添加单个item
@@ -179,6 +196,12 @@ void MainWindow::addIndexItems() //方法:初始化向index
recovery->setPic("image:url(:/ico/image/ico/registered-line.svg);background-color:rgba(255,255,255,0);");
addItemToIndex(recovery);
+ //:/ico/image/ico/code-s-slash-line.svg //05
+ indexListItem *advanced = new indexListItem(this->ui->indexList);
+ advanced->setText("高级");
+ advanced->setPic("image:url(:/ico/image/ico/code-s-slash-line.svg);background-color:rgba(255,255,255,0);");
+ addItemToIndex(advanced);
+
indexListItem *about = new indexListItem(this->ui->indexList);
about->setText("关于");
about->setPic("image:url(:/ico/image/ico/about/information-line.svg);background-color:rgba(255,255,255,0);");
@@ -189,6 +212,7 @@ void MainWindow::addIndexItems() //方法:初始化向index
void MainWindow::lock() //方法:锁定mainwindow中控件
{
+ //this->setEnabled(false);
ui->indexList->setEnabled(false);
//currentPage->setEnabled(false);
ui->page->setEnabled(false);
@@ -196,6 +220,7 @@ void MainWindow::lock() //方法:锁定mainwindow
void MainWindow::unlock() //方法:解锁mainwindow中的控件
{
+ //this->setEnabled(false);
ui->indexList->setEnabled(true);
//currentPage->setEnabled(true);
ui->page->setEnabled(true);
@@ -298,7 +323,7 @@ void MainWindow::stopLoadingGif() //槽:隐藏加载动画 +
ui->loadingLabel->setVisible(false);
}
-void MainWindow::on_WIFIBtn_clicked() //槽:获取无线调试参数
+void MainWindow::on_WIFIBtn_clicked() //槽:弹出无线调试连接窗口,获取无线调试参数
{
getInfo = new QWidget();
getInfo->setWindowTitle("无线调试");
diff --git a/QtAdb/mainwindow.h b/QtAdb/mainwindow.h
index bd60ac3..a5813f0 100644
--- a/QtAdb/mainwindow.h
+++ b/QtAdb/mainwindow.h
@@ -22,6 +22,8 @@
#include
#include
+#include
+
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
@@ -87,8 +89,8 @@ private:
void setStyles();
void displayWelcomePage();
- QWidget * currentPage;
- QWidget * tmpPage;
+ basePage * currentPage;
+ animationWidget * tmpPage;
welcomePage * WCMPage;
};
#endif // MAINWINDOW_H
diff --git a/QtAdb/mainwindow.ui b/QtAdb/mainwindow.ui
index 8779a82..1c0552e 100644
--- a/QtAdb/mainwindow.ui
+++ b/QtAdb/mainwindow.ui
@@ -24,9 +24,12 @@
-
+
+
+
- 0
+ 11
-
@@ -45,9 +48,7 @@
-
- MiSans Normal
-
+
<html><head/><body><p><span style=" font-size:36pt; color:#41cd52;">Qt</span><span style=" font-size:36pt;">ADB</span></p></body></html>
@@ -269,9 +270,7 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}
-
- MiSans Normal
-
+
QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}
@@ -327,6 +326,25 @@ WSA
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+ background-color:rgb(85, 255, 127)
+
+
+
-
@@ -340,19 +358,6 @@ WSA
- -
-
-
-
- 0
- 0
-
-
-
- background-color:rgb(85, 255, 127)
-
-
-
diff --git a/QtAdb/pagelistitem.cpp b/QtAdb/pagelistitem.cpp
index 409490e..68241fe 100644
--- a/QtAdb/pagelistitem.cpp
+++ b/QtAdb/pagelistitem.cpp
@@ -8,20 +8,27 @@ pageListItem::pageListItem(QWidget *parent) :
ui->setupUi(this);
ui->enableLight->setVisible(false);
- ui->widget->setStyleSheet("background-color:transparent; border-radius:4px; border-color:gray;border:0px;");
+ 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);
+ ui->pic->setGraphicsEffect(shadowEffect_icon);*/
//this->setGraphicsEffect(shadowEffect);
+ setStyles();
}
pageListItem::~pageListItem()
@@ -35,6 +42,16 @@ void pageListItem::setText(QString title, QString profile)
ui->profile->setText(profile);
}
+void pageListItem::setText_title(QString title)
+{
+ ui->title->setText(title);
+}
+
+void pageListItem::setText_profile(QString profile)
+{
+ ui->profile->setText(profile);
+}
+
void pageListItem::setPic(QString ico)
{
ui->pic->setIcon(QIcon(ico));
@@ -58,3 +75,42 @@ void pageListItem::setSelectable()
{
ui->enableLight->setVisible(true);
}
+
+void pageListItem::slot_setText(QString t, QString p)
+{
+ setText(t,p);
+}
+
+void pageListItem::slot_setText_title(QString t)
+{
+ setText_title(t);
+}
+
+void pageListItem::slot_setText_profile(QString p)
+{
+ setText_profile(p);
+}
+
+void pageListItem::setStyles()
+{
+ 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);
+}
+
+void pageListItem::slot_setStyles()
+{
+ setStyles();
+}
diff --git a/QtAdb/pagelistitem.h b/QtAdb/pagelistitem.h
index 4d8ecb9..d45a768 100644
--- a/QtAdb/pagelistitem.h
+++ b/QtAdb/pagelistitem.h
@@ -24,14 +24,29 @@ public:
~pageListItem();
void setText(QString title, QString profile);
+ void setText_title(QString title);
+ void setText_profile(QString profile);
void setPic(QString qss);
void setSelectable();
+ void setStyles();
+
+ //void emitSignal();
+
private slots:
void on_copyButton_clicked();
private:
Ui::pageListItem *ui;
+
+public slots:
+ void slot_setText(QString t, QString p);
+ void slot_setText_title(QString t);
+ void slot_setText_profile(QString p);
+ void slot_setStyles();
+
+signals:
+ //void
};
#endif // PAGELISTITEM_H
diff --git a/QtAdb/pagelistitem.ui b/QtAdb/pagelistitem.ui
index 29e453b..c2e727b 100644
--- a/QtAdb/pagelistitem.ui
+++ b/QtAdb/pagelistitem.ui
@@ -81,9 +81,9 @@ border-width:1px;
- QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}
+ 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);}*/
@@ -116,9 +116,7 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}
-
- MiSans Normal
-
+
background-color: rgba(255, 255, 255, 0);
@@ -186,9 +184,7 @@ QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 11
-
- MiSans Normal
-
+
background-color: rgba(255, 255, 255, 0);
diff --git a/QtAdb/pagemaker.cpp b/QtAdb/pagemaker.cpp
index e655bb8..437a42b 100644
--- a/QtAdb/pagemaker.cpp
+++ b/QtAdb/pagemaker.cpp
@@ -11,7 +11,7 @@ pageMaker::pageMaker()
explainer = new textExplainer();
}
-QWidget* pageMaker::createPageWithKey(int key, QWidget *parent, device dev)
+basePage* pageMaker::createPageWithKey(int key, QWidget *parent, device dev)
{
int k = key;
switch(k)
@@ -40,6 +40,9 @@ QWidget* pageMaker::createPageWithKey(int key, QWidget *parent, device dev)
return createPage_recovery(parent, dev);
break;
case 5:
+ return createPage_advanced(parent,dev);
+ break;
+ case 6:
return createPage_about(parent);
break;
}
@@ -56,19 +59,77 @@ basePage* pageMaker::createPage_devInfo(QWidget *parent, device dev)
ui->listWidget->setItemWidget(pItem, pItemWidget);*/
basePage *devInfo = new basePage(parent);
+ devInfo->isBasePage = true;
devInfo->whoYouAre("devInfo");
int val[20] = {3};
//qDebug() << "!!!!!!!!!!!!!!!!!!!" << *val;
devInfo->setEnableValue(val);
devInfo->setDev(dev);
- /**/
+ /***********************************/
+ pageListItemStruct *productModel = initStruct(devInfo);
+ productModel->item->setText_title("设备型号 | DeviceModel");
+ productModel->item->setPic(":/ico/image/ico/profile-line.svg");
+ productModel->thread->initThread("adb shell getprop ro.product.model", dev);
+ QEventLoop::connect(productModel->thread,SIGNAL(signal_output(QString)),productModel->item,SLOT(slot_setText_profile(QString)));
+ //QEventLoop::connect(devInfo,SIGNAL(animationEnd()),productModel->item,SLOT(slot_setStyles()));
+ productModel->thread->start();
+ devInfo->addItemsToList(productModel->item);
+ //qDebug() << "item is in thread" << productModel->item->thread();
+
+ pageListItemStruct *screen_resolution = initStruct(devInfo);
+ screen_resolution->item->setText_title("屏幕分辨率");
+ screen_resolution->item->setPic(":/ico/image/ico/fullscreen-line.svg");
+ screen_resolution->thread->initThread("adb shell wm size", dev, ": ");
+ QEventLoop::connect(screen_resolution->thread,SIGNAL(signal_output(QString)),screen_resolution->item,SLOT(slot_setText_profile(QString)));
+ screen_resolution->thread->start();
+ devInfo->addItemsToList(screen_resolution->item);
+
+ //adb shell wm density
+ pageListItemStruct *dpi = initStruct(devInfo);
+ dpi->item->setText_title("屏幕密度 | DPI");
+ dpi->item->setPic(":/ico/image/ico/grid-line.svg");
+ dpi->thread->initThread("adb shell wm density", dev);
+ QEventLoop::connect(dpi->thread,SIGNAL(signal_output(QString)),dpi->item,SLOT(slot_setText_profile(QString)));
+ dpi->thread->start();
+ dpi->item->setSelectable();
+ devInfo->addItemsToList(dpi->item);
+
+ //adb shell settings get secure android_id
+ pageListItemStruct *android_id = initStruct(devInfo);
+ android_id->item->setText_title("Android Id");
+ android_id->item->setPic(":/ico/image/ico/barcode-line.svg");
+ android_id->thread->initThread("adb shell settings get secure android_id", dev);
+ QEventLoop::connect(android_id->thread,SIGNAL(signal_output(QString)),android_id->item,SLOT(slot_setText_profile(QString)));
+ android_id->thread->start();
+ devInfo->addItemsToList(android_id->item);
+
+ //adb shell getprop ro.build.version.release
+ pageListItemStruct *android_version = initStruct(devInfo);
+ android_version->item->setText_title("安卓版本");
+ android_version->item->setPic(":/ico/image/ico/android-line.svg");
+ android_version->thread->initThread("adb shell getprop ro.build.version.release", dev);
+ QEventLoop::connect(android_version->thread,SIGNAL(signal_output(QString)),android_version->item,SLOT(slot_setText_profile(QString)));
+ android_version->thread->start();
+ devInfo->addItemsToList(android_version->item);
+
+ pageListItemStruct *cpu = initStruct(devInfo);
+ cpu->item->setText_title("处理器 | CPU");
+ cpu->item->setPic(":/ico/image/ico/cpu-line.svg");
+ cpu->thread->initThread("adb shell cat /proc/cpuinfo", dev, "#CPU#");
+ QEventLoop::connect(cpu->thread,SIGNAL(signal_output(QString)),cpu->item,SLOT(slot_setText_profile(QString)));
+ cpu->thread->start();
+ devInfo->addItemsToList(cpu->item);
+
+ /**************别删**********************/
+ /*
pageListItem *productModel = new pageListItem(devInfo);
//qDebug() << "dev of pageMaker" << dev.addr;
productModel->setText("设备型号 | DeviceModel",process->run("adb shell getprop ro.product.model", dev).simplified());
productModel->setPic(":/ico/image/ico/profile-line.svg");
devInfo->addItemsToList(productModel);
+
pageListItem *screen_resolution = new pageListItem(devInfo);
screen_resolution->setText("屏幕分辨率",explainer->get_words_after(process->run("adb shell wm size", dev), ": "));
screen_resolution->setPic(":/ico/image/ico/fullscreen-line.svg");
@@ -96,8 +157,8 @@ basePage* pageMaker::createPage_devInfo(QWidget *parent, device dev)
pageListItem *cpu = new pageListItem(devInfo);
cpu->setText("处理器 | CPU",explainer->explain_cpu_output(process->run("adb shell cat /proc/cpuinfo", dev)));
cpu->setPic(":/ico/image/ico/cpu-line.svg");
- devInfo->addItemsToList(cpu);
- /**/
+ devInfo->addItemsToList(cpu);*/
+ /****************别删***************/
return devInfo;
}
@@ -111,6 +172,7 @@ basePage* pageMaker::createPage_devInfo_powerdown(QWidget *parent, device dev)
ui->listWidget->setItemWidget(pItem, pItemWidget);*/
basePage *devInfo = new basePage(parent);
+ devInfo->isBasePage = true;
devInfo->whoYouAre("devInfo");
int val[20] = {};
//qDebug() << "!!!!!!!!!!!!!!!!!!!" << *val;
@@ -162,6 +224,7 @@ basePage* pageMaker::createPage_devInfo_powerdown(QWidget *parent, device dev)
basePage* pageMaker::createPage_acvitator(QWidget *parent, device dev)
{
basePage *activator = new basePage(parent);
+ activator->isBasePage = true;
//activatorPage *activator = new activatorPage(parent);
activator->whoYouAre("activator");
int val[20] = {1,2,3,4,5,6,7,8,9};
@@ -228,6 +291,7 @@ basePage* pageMaker::createPage_acvitator(QWidget *parent, device dev)
basePage* pageMaker::createPage_apps(QWidget *parent, device dev)
{
basePage *apps = new basePage(parent);
+ apps->isBasePage = true;
//activatorPage *activator = new activatorPage(parent);
apps->whoYouAre("apps");
int val[20] = {1};
@@ -246,6 +310,7 @@ basePage* pageMaker::createPage_apps(QWidget *parent, device dev)
basePage* pageMaker::createPage_devControl(QWidget *parent, device dev)
{
basePage *devControl = new basePage(parent);
+ devControl->isBasePage = true;
//activatorPage *activator = new activatorPage(parent);
devControl->whoYouAre("devControl");
int val[20] = {1,2};
@@ -270,6 +335,7 @@ basePage* pageMaker::createPage_devControl(QWidget *parent, device dev)
basePage* pageMaker::createPage_recovery(QWidget *parent, device dev)
{
basePage *recovery = new basePage(parent);
+ recovery->isBasePage = true;
//activatorPage *activator = new activatorPage(parent);
recovery->whoYouAre("recovery");
int val[20] = {1};
@@ -292,8 +358,51 @@ basePage* pageMaker::createPage_recovery(QWidget *parent, device dev)
return recovery;
}
-QWidget* pageMaker::createPage_about(QWidget *parent)
+basePage* pageMaker::createPage_advanced(QWidget *parent, device dev)
+{
+ basePage *advanced = new basePage(parent);
+ advanced->isBasePage = true;
+ //activatorPage *activator = new activatorPage(parent);
+ advanced->whoYouAre("advanced");
+ int val[20] = {1,2};
+ advanced->setEnableValue(val);
+ advanced->setDev(dev);
+
+ pageListItem *customize_command = new pageListItem(advanced);
+ customize_command->setText("运行自定义命令","");
+ customize_command->setPic(":/ico/image/ico/code-s-slash-line.svg");
+ customize_command->setSelectable();
+ advanced->addItemsToList(customize_command);
+
+ pageListItem *open_cmd = new pageListItem(advanced);
+ open_cmd->setText("命令行","cmd");
+ open_cmd->setPic(":/ico/image/ico/terminal-box-line.svg");
+ open_cmd->setSelectable();
+ advanced->addItemsToList(open_cmd);
+
+ /*
+ pageListItem *btnEmulate = new pageListItem(recovery);
+ btnEmulate->setText("按键模拟","adb shell input keyevent ");
+ btnEmulate->setPic(":/ico/image/ico/refund-line.svg");
+ btnEmulate->setSelectable();
+ recovery->addItemsToList(btnEmulate);*/
+
+ return advanced;
+}
+
+basePage* pageMaker::createPage_about(QWidget *parent)
{
about* abt = new about(parent);
return abt;
}
+
+pageMaker::pageListItemStruct* pageMaker::initStruct(QWidget* parent)
+{
+ pageListItemStruct *itemStruct = new pageListItemStruct();
+ itemStruct->explainer = new textExplainer();
+ itemStruct->item = new pageListItem();
+ itemStruct->item->setParent(parent);
+ itemStruct->process = new adbProcess();
+ itemStruct->thread = new adbThread();
+ return itemStruct;
+}
diff --git a/QtAdb/pagemaker.h b/QtAdb/pagemaker.h
index e9d4d17..1bcf439 100644
--- a/QtAdb/pagemaker.h
+++ b/QtAdb/pagemaker.h
@@ -1,11 +1,15 @@
#ifndef PAGEMAKER_H
#define PAGEMAKER_H
+
+#include
#include "basepage.h"
#include "pagelistitem.h"
#include "adbprocess.h"
#include "textexplainer.h"
#include "about.h"
+#include "threads/adbthread.h"
+#include "animationwidget.h"
class pageMaker
{
@@ -16,7 +20,7 @@ public:
adbProcess *process;
textExplainer *explainer;
- QWidget *createPageWithKey(int key, QWidget *parent, device dev);
+ basePage *createPageWithKey(int key, QWidget *parent, device dev);
basePage *createPage_devInfo(QWidget *parent, device dev);
@@ -29,13 +33,22 @@ public:
basePage *createPage_recovery(QWidget *parent, device dev);
- QWidget *createPage_about(QWidget *parent);
+ basePage *createPage_advanced(QWidget *parent, device dev);
+
+ basePage *createPage_about(QWidget *parent);
//activatorPage *createSonPage_activator(QWidget *parent, device dev);
+ typedef struct{
+ QWidget* parent;
+ pageListItem* item;
+ adbProcess *process;
+ textExplainer *explainer;
+ adbThread *thread;
+ }pageListItemStruct;
private:
/*youtPhone*/
-
+ pageListItemStruct *initStruct(QWidget* parent);
diff --git a/QtAdb/sonPages/advanced/sp_customize_cmd.cpp b/QtAdb/sonPages/advanced/sp_customize_cmd.cpp
new file mode 100644
index 0000000..22d4aaa
--- /dev/null
+++ b/QtAdb/sonPages/advanced/sp_customize_cmd.cpp
@@ -0,0 +1,60 @@
+#include "sp_customize_cmd.h"
+#include "ui_sp_customize_cmd.h"
+
+sp_customize_cmd::sp_customize_cmd(QWidget *parent) :
+ QWidget(parent),
+ ui(new Ui::sp_customize_cmd)
+{
+ ui->setupUi(this);
+ 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();
+
+ shadowEffect_runBtn->setOffset(0,0);
+ shadowEffect_runBtn->setColor(Qt::gray);
+ shadowEffect_runBtn->setBlurRadius(5);
+
+ shadowEffect_showOutputBtn->setOffset(0,0);
+ shadowEffect_showOutputBtn->setColor(Qt::gray);
+ shadowEffect_showOutputBtn->setBlurRadius(5);
+
+ shadowEffect_back_to_basePage->setOffset(0,0);
+ shadowEffect_back_to_basePage->setColor(Qt::gray);
+ shadowEffect_back_to_basePage->setBlurRadius(5);
+
+ shadowEffect_refreshBtn->setOffset(0,0);
+ shadowEffect_refreshBtn->setColor(Qt::gray);
+ shadowEffect_refreshBtn->setBlurRadius(5);
+
+ ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage);
+ ui->runBtn->setGraphicsEffect(shadowEffect_runBtn);
+ ui->showOutputBtn->setGraphicsEffect(shadowEffect_showOutputBtn);
+ ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn);
+
+ QGraphicsDropShadowEffect *shadowEffect_textBrowser = new QGraphicsDropShadowEffect();
+ shadowEffect_textBrowser->setOffset(0,0);
+ shadowEffect_textBrowser->setColor(Qt::gray);
+ shadowEffect_textBrowser->setBlurRadius(5);
+ ui->textBrowser->setGraphicsEffect(shadowEffect_textBrowser);
+
+ QGraphicsDropShadowEffect *shadowEffect_label = new QGraphicsDropShadowEffect();
+ shadowEffect_label->setOffset(0,0);
+ shadowEffect_label->setColor(Qt::gray);
+ shadowEffect_label->setBlurRadius(5);
+ ui->label->setGraphicsEffect(shadowEffect_label);
+}
+
+sp_customize_cmd::~sp_customize_cmd()
+{
+ delete ui;
+}
+
+void sp_customize_cmd::on_runBtn_clicked()
+{
+ process->run(ui->lineEdit->text());
+}
diff --git a/QtAdb/sonPages/advanced/sp_customize_cmd.h b/QtAdb/sonPages/advanced/sp_customize_cmd.h
new file mode 100644
index 0000000..dc7744e
--- /dev/null
+++ b/QtAdb/sonPages/advanced/sp_customize_cmd.h
@@ -0,0 +1,28 @@
+#ifndef SP_CUSTOMIZE_CMD_H
+#define SP_CUSTOMIZE_CMD_H
+
+#include
+#include
+#include "../../adbprocess.h"
+
+namespace Ui {
+class sp_customize_cmd;
+}
+
+class sp_customize_cmd : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit sp_customize_cmd(QWidget *parent = nullptr);
+ ~sp_customize_cmd();
+
+private slots:
+ void on_runBtn_clicked();
+
+private:
+ Ui::sp_customize_cmd *ui;
+ adbProcess *process;
+};
+
+#endif // SP_CUSTOMIZE_CMD_H
diff --git a/QtAdb/sonPages/advanced/sp_customize_cmd.ui b/QtAdb/sonPages/advanced/sp_customize_cmd.ui
new file mode 100644
index 0000000..ad1a3c1
--- /dev/null
+++ b/QtAdb/sonPages/advanced/sp_customize_cmd.ui
@@ -0,0 +1,322 @@
+
+
+ sp_customize_cmd
+
+
+
+ 0
+ 0
+ 725
+ 571
+
+
+
+ Form
+
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+ border-radius: 4px;
+background-color: rgba(255, 255, 255, 0);
+border:0px solid #BDBDBD;
+
+
+
+ 11
+
+
+ 11
+
+
-
+
+
+ 14
+
+
-
+
+
+ 14
+
+
-
+
+
+
+ 40
+ 40
+
+
+
+
+ 40
+ 40
+
+
+
+
+
+
+ border-radius: 4px;
+border:0px solid #BDBDBD;
+image: url(:/ico/image/ico/code-s-slash-line.svg);
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 50
+
+
+
+
+ 16777215
+ 50
+
+
+
+
+ MiSans Normal
+ 18
+ true
+
+
+
+ border-radius: 4px;
+border:0px solid #BDBDBD;
+
+
+ 运行自定义命令
+
+
+
+
+
+ -
+
+
+
+ MiSans Normal
+
+
+
+ border:1px solid #BDBDBD;
+background-color: rgba(255, 255, 255, 0);
+
+
+
+
+
+
+
+
+ 请输入命令
+
+
+
+ -
+
+
+
+ MiSans Normal
+
+
+
+ <html><head/><body><p>暂时仅支持 ADB 命令</p><p>不支持管道符“ | ”</p></body></html>
+
+
+
+ -
+
+
+
+ MiSans Normal
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+ -
+
+
-
+
+
+
+ 30
+ 30
+
+
+
+
+ 30
+ 30
+
+
+
+ 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);}
+
+
+
+
+
+
+ :/ico/image/ico/arrow-left-line.svg:/ico/image/ico/arrow-left-line.svg
+
+
+
+ 18
+ 18
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 30
+
+
+
+
+ 16777215
+ 30
+
+
+
+
+
+
+ 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);}
+
+
+
+
+
+
+ :/ico/image/ico/play-line.svg:/ico/image/ico/play-line.svg
+
+
+
+ 18
+ 18
+
+
+
+
+ -
+
+
+
+ 30
+ 30
+
+
+
+
+ 30
+ 30
+
+
+
+ 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);}
+
+
+
+
+
+
+ :/ico/image/ico/refresh-line.svg:/ico/image/ico/refresh-line.svg
+
+
+
+ 18
+ 18
+
+
+
+
+ -
+
+
+
+ 30
+ 30
+
+
+
+
+ 30
+ 30
+
+
+
+ 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);}
+
+
+
+
+
+
+ :/ico/image/ico/terminal-box-line.svg:/ico/image/ico/terminal-box-line.svg
+
+
+
+ 18
+ 18
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/QtAdb/sonPages/apps/sp_installer.cpp b/QtAdb/sonPages/apps/sp_installer.cpp
index 41fd239..6281fa2 100644
--- a/QtAdb/sonPages/apps/sp_installer.cpp
+++ b/QtAdb/sonPages/apps/sp_installer.cpp
@@ -62,7 +62,7 @@ void sp_installer::setDev(device device)
}
void sp_installer::on_runBtn_clicked()
{
- qDebug() << "enter runBtn slot";
+ //qDebug() << "enter runBtn slot";
QString command;
if(apkPath != "")
{
@@ -72,11 +72,11 @@ void sp_installer::on_runBtn_clicked()
{
command = "adb install";
}
- qDebug() << "enter runBtn slot 1";
- qDebug() << "enter runBtn slot 2";
- qDebug() << "enter runBtn slot 4";
- qDebug() << "command: " << command;
- qDebug() << "running";
+ //qDebug() << "enter runBtn slot 1";
+ //qDebug() << "enter runBtn slot 2";
+ //qDebug() << "enter runBtn slot 4";
+ //qDebug() << "command: " << command;
+ //qDebug() << "running";
process->run_contains_empty(command, dev);
apkPath.clear();
labelDisplay.clear();
@@ -85,11 +85,11 @@ void sp_installer::on_runBtn_clicked()
void sp_installer::on_selectBtn_clicked()
{
- qDebug() << "enter pushbutton slot";
+ //qDebug() << "enter pushbutton slot";
apkPath.clear();
apkPath = QFileDialog::getOpenFileName(this, QStringLiteral("选择安装包"), "F:",QStringLiteral("安装包(*.apk)"));
ui->filePaths->setText(apkPath);
- qDebug() << "apkPathis:" << apkPath;
+ //qDebug() << "apkPathis:" << apkPath;
}
diff --git a/QtAdb/sonPages/devControl/btnemulator.cpp b/QtAdb/sonPages/devControl/btnemulator.cpp
index ad76d97..dae5e3a 100644
--- a/QtAdb/sonPages/devControl/btnemulator.cpp
+++ b/QtAdb/sonPages/devControl/btnemulator.cpp
@@ -9,6 +9,7 @@ btnEmulator::btnEmulator(QWidget *parent) :
connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage()));
process = new adbProcess();
explainer = new textExplainer();
+ 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;}");
setStyles();
}
diff --git a/QtAdb/sonPages/devControl/btnemulator.ui b/QtAdb/sonPages/devControl/btnemulator.ui
index 3682bd7..6547a81 100644
--- a/QtAdb/sonPages/devControl/btnemulator.ui
+++ b/QtAdb/sonPages/devControl/btnemulator.ui
@@ -23,14 +23,13 @@
-
-
- MiSans Normal
-
+
border-radius: 4px;
background-color: rgba(255, 255, 255, 0);
-border:0px solid #BDBDBD;
+border:0px solid #BDBDBD;
+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;}
@@ -61,9 +60,7 @@ border:0px solid #BDBDBD;
-
- MiSans Normal
-
+
系统
@@ -94,7 +91,8 @@ border:0px solid #BDBDBD;
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;}
@@ -125,7 +123,8 @@ 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: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;}
@@ -156,7 +155,8 @@ 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: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;}
@@ -187,7 +187,8 @@ 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: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;}
@@ -230,9 +231,7 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}
-
- MiSans Normal
-
+
实体
@@ -263,7 +262,8 @@ 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: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;}
@@ -294,7 +294,8 @@ 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: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;}
@@ -325,7 +326,8 @@ 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: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;}
@@ -356,7 +358,8 @@ 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: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;}
@@ -387,7 +390,8 @@ 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: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;}
@@ -418,7 +422,8 @@ 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: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;}
@@ -461,9 +466,7 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}
-
- MiSans Normal
-
+
媒体
@@ -494,7 +497,8 @@ 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: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;}
@@ -525,7 +529,8 @@ 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: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;}
@@ -556,7 +561,8 @@ 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: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;}
@@ -587,7 +593,8 @@ 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: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;}
@@ -618,7 +625,8 @@ 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: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;}
@@ -649,7 +657,8 @@ 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: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;}
@@ -692,9 +701,7 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}
-
- MiSans Normal
-
+
其它
@@ -725,7 +732,8 @@ 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: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;}
@@ -756,7 +764,8 @@ 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: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;}
@@ -787,7 +796,8 @@ 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: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;}
@@ -818,7 +828,8 @@ 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: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;}
@@ -849,7 +860,8 @@ 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: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;}
@@ -880,7 +892,8 @@ 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: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;}
@@ -936,9 +949,7 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}
-
- MiSans Normal
-
+
系统
@@ -969,7 +980,8 @@ 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: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;}
@@ -1000,7 +1012,8 @@ 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: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;}
@@ -1031,7 +1044,8 @@ 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: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;}
@@ -1062,7 +1076,8 @@ 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: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;}
@@ -1093,7 +1108,8 @@ 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: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;}
@@ -1124,7 +1140,8 @@ 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: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;}
@@ -1155,7 +1172,8 @@ 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: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;}
diff --git a/QtAdb/sonPages/devControl/sp_devcontrol_power.cpp b/QtAdb/sonPages/devControl/sp_devcontrol_power.cpp
index fac46c6..a176f4d 100644
--- a/QtAdb/sonPages/devControl/sp_devcontrol_power.cpp
+++ b/QtAdb/sonPages/devControl/sp_devcontrol_power.cpp
@@ -65,9 +65,9 @@ void sp_devControl_power::setDev(device device)
void sp_devControl_power::on_btn_rebootToSystem_clicked()
{
- qDebug() << "calling process->run('adb reboot', dev);";
+ //qDebug() << "calling process->run('adb reboot', dev);";
process->run("adb reboot", dev);
- qDebug() << "calling process->run('adb reboot', dev);";
+ //qDebug() << "calling process->run('adb reboot', dev);";
}
void sp_devControl_power::on_btn_rebootToRecovery_clicked()
diff --git a/QtAdb/sonPages/devInfo/sp_dpichanger.cpp b/QtAdb/sonPages/devInfo/sp_dpichanger.cpp
index b2767ce..2e232ce 100644
--- a/QtAdb/sonPages/devInfo/sp_dpichanger.cpp
+++ b/QtAdb/sonPages/devInfo/sp_dpichanger.cpp
@@ -67,9 +67,9 @@ sp_dpiChanger::~sp_dpiChanger()
void sp_dpiChanger::setDpiInfo()
{
- qDebug() << "dve of sonPage = " << dev.addr;
+ //qDebug() << "dve of sonPage = " << dev.addr;
QString profile = process->run("adb shell wm density", dev).replace("Physical density", "默认").replace("Override density","当前").simplified();
- qDebug() << profile;
+ //qDebug() << profile;
ui->dpiInfo->setText(profile);
}
@@ -81,7 +81,7 @@ void sp_dpiChanger::on_runBtn_clicked()
output = process->run("adb shell wm density " + ui->lineEdit->text().simplified() , dev);
this->setDisabled(false);
- qDebug() << output;
+ //qDebug() << output;
refresh();
ui->lineEdit->setPlaceholderText("已修改");
diff --git a/QtAdb/sonPages/recovery/sp_recovery.cpp b/QtAdb/sonPages/recovery/sp_recovery.cpp
index 79a48ee..5c7d7a7 100644
--- a/QtAdb/sonPages/recovery/sp_recovery.cpp
+++ b/QtAdb/sonPages/recovery/sp_recovery.cpp
@@ -54,7 +54,7 @@ void sp_recovery::setDev(device device)
}
void sp_recovery::on_runBtn_clicked()
{
- qDebug() << "enter runBtn slot";
+ //qDebug() << "enter runBtn slot";
QString command;
if(zipPath != "")
@@ -66,8 +66,8 @@ void sp_recovery::on_runBtn_clicked()
command = "adb sideload";
}
- qDebug() << "command: " << command;
- qDebug() << "running";
+ //qDebug() << "command: " << command;
+ //qDebug() << "running";
process->run_contains_empty(command, dev);
zipPath.clear();
labelDisplay.clear();
@@ -76,11 +76,11 @@ void sp_recovery::on_runBtn_clicked()
void sp_recovery::on_selectBtn_clicked()
{
- qDebug() << "enter pushbutton slot";
+ //qDebug() << "enter pushbutton slot";
zipPath.clear();
zipPath = QFileDialog::getOpenFileName(this, QStringLiteral("选择zip包"), "F:",QStringLiteral("压缩包(*.zip)"));
ui->filePaths->setText(zipPath);
- qDebug() << "zipPathis:" << zipPath;
+ //qDebug() << "zipPathis:" << zipPath;
}
diff --git a/QtAdb/sonPages/sonpagemanager.cpp b/QtAdb/sonPages/sonpagemanager.cpp
index 76a1bfe..eb2e416 100644
--- a/QtAdb/sonPages/sonpagemanager.cpp
+++ b/QtAdb/sonPages/sonpagemanager.cpp
@@ -10,7 +10,7 @@ QWidget* sonPageManager::selector(QWidget *parent , QString parentName, int key,
{
if(parentName == "devInfo")
{
- qDebug() << "dev.addr=" << dev.addr;
+ //qDebug() << "dev.addr=" << dev.addr;
return createSonPageFor_devInfo(parent, key , dev);
//return createSonPageFor_activator(parent);
}
@@ -30,6 +30,10 @@ QWidget* sonPageManager::selector(QWidget *parent , QString parentName, int key,
{
return createSonPageFor_recovery(parent, key , dev);
}
+ else if(parentName == "advanced")
+ {
+ return createSonPageFor_advanced(parent, key , dev);
+ }
throw "failed to create sonPage!";
return NULL;
@@ -241,3 +245,29 @@ QWidget* sonPageManager::createSonPageFor_recovery(QWidget *parent, int key, dev
}
return NULL;
}
+
+QWidget* sonPageManager::createSonPageFor_advanced(QWidget *parent, int key, device dev)
+{
+ switch(key +1)
+ {
+ case 1:
+ {
+ sp_customize_cmd *page = new sp_customize_cmd(parent);
+ //page->setDev(dev);
+ return page;
+ }
+ case 2:
+ {
+ //QString envPath = qgetenv("PATH"); //获取当前环境变量
+ QString appDirPath = QApplication::applicationDirPath(); //获取程序所在位置
+ QString batPath = appDirPath + "/platform-tools/open-cmd-here.bat";
+ //qDebug()<<"batPath = " << batPath;
+ QProcess batProcess;
+ batProcess.start(batPath);
+ batProcess.waitForFinished();
+ return NULL;
+ }
+ break;
+ }
+ return NULL;
+}
diff --git a/QtAdb/sonPages/sonpagemanager.h b/QtAdb/sonPages/sonpagemanager.h
index 716e5ec..096a21a 100644
--- a/QtAdb/sonPages/sonpagemanager.h
+++ b/QtAdb/sonPages/sonpagemanager.h
@@ -1,6 +1,7 @@
#ifndef SONPAGEMANAGER_H
#define SONPAGEMANAGER_H
+#include
#include "adbprocess.h"
#include "textexplainer.h"
#include "devInfo/sp_dpichanger.h"
@@ -9,6 +10,7 @@
#include "devControl/sp_devcontrol_power.h"
#include "devControl/btnemulator.h"
#include "recovery/sp_recovery.h"
+#include "advanced/sp_customize_cmd.h"
class sonPageManager
@@ -29,6 +31,7 @@ private:
sp_installer* createSonPageFor_apps(QWidget *parent, int key, device dev);
QWidget* createSonPageFor_devControl(QWidget *parent, int key, device dev);
QWidget* createSonPageFor_recovery(QWidget *parent, int key, device dev);
+ QWidget* createSonPageFor_advanced(QWidget *parent, int key, device dev);
};
#endif // SONPAGEMANAGER_H
diff --git a/QtAdb/textexplainer.cpp b/QtAdb/textexplainer.cpp
index 67835ce..d78a5f8 100644
--- a/QtAdb/textexplainer.cpp
+++ b/QtAdb/textexplainer.cpp
@@ -113,7 +113,6 @@ QString textExplainer::explain_cpu_output(QString str)
tmpInfo = tmpInfo.simplified();
//qDebug() << "tmpInfo =" << tmpInfo << "\n";
-
return get_words_after(tmpInfo, ":");
}
@@ -203,7 +202,7 @@ bool textExplainer::explainError(QString err)
bool textExplainer::explainOutput(QString op)
{
- qDebug() << "output = " << op;
+ //qDebug() << "output = " << op;
op = op.simplified();
/*普通*/
@@ -211,7 +210,7 @@ bool textExplainer::explainOutput(QString op)
{
showMsgBox("失败"," · 应用未安装 \n · 应用安装后未首次运行");
}
- qDebug() << "+++++++++++++++++Output+++++++++++++++++" << "\n" << op;
+ //qDebug() << "+++++++++++++++++Output+++++++++++++++++" << "\n" << op;
return true;
}
@@ -244,6 +243,18 @@ QString textExplainer::setState(QString state)
{
return "[侧载]";
}
- return "出错";
+ return "[未知]";
+}
+/*
+void textExplainer::slot_get_words_after(QString s, QString k)
+{
+ QString str = get_words_after(s, k);
+ emit textExplained(str);
}
+void textExplainer::slot_explain_cpu_output(QString s)
+{
+ QString str = explain_cpu_output(s);
+ emit textExplained(str);
+}
+*/
diff --git a/QtAdb/textexplainer.h b/QtAdb/textexplainer.h
index 2d4173b..0e8ed23 100644
--- a/QtAdb/textexplainer.h
+++ b/QtAdb/textexplainer.h
@@ -35,6 +35,13 @@ public:
private:
QString setState(QString state);
+
+signals:
+ void textExplained(QString);
+
+public slots:
+ void slot_get_words_after(QString s, QString k);
+ void slot_explain_cpu_output(QString s);
};
#endif // TEXTEXPLAINER_H
diff --git a/QtAdb/threads/adbthread.cpp b/QtAdb/threads/adbthread.cpp
new file mode 100644
index 0000000..574d220
--- /dev/null
+++ b/QtAdb/threads/adbthread.cpp
@@ -0,0 +1,49 @@
+#include "adbthread.h"
+
+adbThread::adbThread(QObject* parent)
+{
+
+}
+
+void adbThread::initThread(QString cmd, device d)
+{
+ command = cmd;
+ dev = d;
+ explain = false;
+}
+
+void adbThread::initThread(QString cmd, device d, QString key)
+{
+ command = cmd;
+ dev = d;
+ explain = true;
+ explainKey = key;
+}
+
+void adbThread::run()
+{
+ process = new adbProcess();
+ //qDebug() << "explainKey is " << explainKey;
+ //sleep(3);
+ if(explain == false)
+ {
+ QString output = process->run(command,dev).simplified();
+ emit signal_output(output);
+ exit();
+ //exec();
+ }
+
+ else if(explainKey == "#CPU#")
+ {
+ QString output = explainer->explain_cpu_output(process->run(command, dev));
+ emit signal_output(output);
+ exit();
+ }
+
+ else if(explain == true && explainKey != "#CPU#")
+ {
+ QString output = explainer->get_words_after(process->run(command, dev), explainKey);
+ emit signal_output(output);
+ exit();
+ }
+}
diff --git a/QtAdb/threads/adbthread.h b/QtAdb/threads/adbthread.h
new file mode 100644
index 0000000..5722443
--- /dev/null
+++ b/QtAdb/threads/adbthread.h
@@ -0,0 +1,35 @@
+#ifndef ADBTHREAD_H
+#define ADBTHREAD_H
+#include
+#include "../textexplainer.h"
+#include "../adbprocess.h"
+#include
+
+class adbThread : public QThread
+{
+ Q_OBJECT
+public:
+ explicit adbThread(QObject* parent = nullptr);
+
+ void initThread(QString cmd, device dev);
+ void initThread(QString cmd, device dev, QString explainKey);
+ void initThread_for_cpu(QString cmd, device dev);
+ bool explain = false;
+ QString command;
+ QString explainKey;
+ device dev;
+
+ adbProcess *process;
+ textExplainer *explainer;
+
+signals:
+ void signal_output(QString);
+
+public slots:
+ //static void myThreadSlot(int);
+
+protected:
+ void run() override;
+};
+
+#endif // ADBTHREAD_H
diff --git a/QtAdb/threads/thread_createpage.cpp b/QtAdb/threads/thread_createpage.cpp
index 485e8e5..0cca016 100644
--- a/QtAdb/threads/thread_createpage.cpp
+++ b/QtAdb/threads/thread_createpage.cpp
@@ -9,11 +9,11 @@ thread_createPage::thread_createPage(QObject *parent)
QWidget* thread_createPage::createBasePage(int key, QWidget *parent, device dev, QWidget *page)
{
//bPage = new basePage();
- qDebug() << "thread_createPage : creating BasePage";
+ //qDebug() << "thread_createPage : creating BasePage";
page = maker->createPageWithKey(key,parent,dev);
- qDebug() << "thread_createPage : BasePage created";
+ //qDebug() << "thread_createPage : BasePage created";
emit basePageCreated();
- qDebug() << "thread_createPage : emit SIGNAL 'basePageCreated'";
+ //qDebug() << "thread_createPage : emit SIGNAL 'basePageCreated'";
return NULL;
}
diff --git a/QtAdb/welcomepage.cpp b/QtAdb/welcomepage.cpp
index b81c8f5..910387b 100644
--- a/QtAdb/welcomepage.cpp
+++ b/QtAdb/welcomepage.cpp
@@ -2,7 +2,7 @@
#include "ui_welcomepage.h"
welcomePage::welcomePage(QWidget *parent) :
- QWidget(parent),
+ animationWidget(parent),
ui(new Ui::welcomePage)
{
ui->setupUi(this);
diff --git a/QtAdb/welcomepage.h b/QtAdb/welcomepage.h
index d00fccd..90b0032 100644
--- a/QtAdb/welcomepage.h
+++ b/QtAdb/welcomepage.h
@@ -2,12 +2,13 @@
#define WELCOMEPAGE_H
#include
+#include "animationwidget.h"
namespace Ui {
class welcomePage;
}
-class welcomePage : public QWidget
+class welcomePage : public animationWidget
{
Q_OBJECT