This commit is contained in:
gangphon 2023-05-08 09:59:15 +08:00
parent 0bff10348c
commit dc2a505a35
17 changed files with 35 additions and 373 deletions

View File

@ -58,7 +58,6 @@ SOURCES += \
base/softconfigdialog.cpp \
base/switchcontrol.cpp \
base/taesclass.cpp \
base/updateledset3dialog.cpp \
base/x_checkboxdelegate.cpp \
base/x_spinboxdelegate.cpp \
base/x_timeeditdelegate.cpp \
@ -148,7 +147,6 @@ HEADERS += \
base/softconfigdialog.h \
base/switchcontrol.h \
base/taesclass.h \
base/updateledset3dialog.h \
base/x_checkboxdelegate.h \
base/x_spinboxdelegate.h \
base/x_timeeditdelegate.h \
@ -230,7 +228,6 @@ HEADERS += \
program/wprogrampublishitem.h \
FORMS += \
base/updateledset3dialog.ui \
base/x_uimsgboxok.ui \
mguangyingpinwidget.ui \
device/controlpowerschedule.ui \

View File

@ -1,81 +0,0 @@
#include "updateledset3dialog.h"
#include "ui_updateledset3dialog.h"
#include <QSettings>
#include <cfg.h>
extern const QString DEFS_LEDSET_URL = "https://www.ledok.cn/download/definitions/ledset3updates.json";
UpdateLedset3Dialog::UpdateLedset3Dialog(QWidget *parent) :
BaseDlg(parent),
ui(new Ui::UpdateLedset3Dialog)
{
setAttribute(Qt::WA_DeleteOnClose);
ui->setupUi(this);
ui->pushButton_2->setVisible(false);
QString strCurApkVersion="";
QSettings settings;
strCurApkVersion = settings.value(DEFS_LEDSET_URL).toString();
if(strCurApkVersion.isEmpty()) strCurApkVersion="0.0.0";
strCurApkVersion="0.0.0";
ui->label_2->setText(tr("CurVersion")+":"+strCurApkVersion);
ui->label_2->setVisible(false);
QSimpleUpdater *m_updater=QSimpleUpdater::getInstance();
connect(ui->pushButton_2, SIGNAL(clicked()), this, SLOT(OnCheckForUpdates()));
connect(m_updater,SIGNAL(checkingFinished(QString)),this,SLOT(updateChangelog(QString)));
connect(m_updater,SIGNAL(downloadFinished(QString,QString)),this,SLOT(OnDownloadFinished(QString,QString)));
m_updater->getInstance()->setModuleVersion(DEFS_LEDSET_URL,strCurApkVersion);
m_updater->getInstance()->setNotifyOnUpdate(DEFS_LEDSET_URL,false);
m_updater->getInstance()->setNotifyOnFinish(DEFS_LEDSET_URL,false);
m_updater->getInstance()->setCompareBySameString(DEFS_LEDSET_URL,true);
m_updater->getInstance()->checkForUpdates(DEFS_LEDSET_URL);
ui->pushButton->setProperty("ssType", "progManageTool");
ui->pushButton_2->setProperty("ssType", "progManageTool");
}
UpdateLedset3Dialog::~UpdateLedset3Dialog()
{
delete ui;
}
void UpdateLedset3Dialog::OnDownloadFinished( QString url, QString filepath)
{
ui->label_2->setText(tr("CurVersion")+":"+m_updater->getInstance()->getLatestVersion(DEFS_LEDSET_URL));
ui->textEdit->setText(tr("Apk is download finished from internet,you can select LED Screen SYNC firmware now!"));
ui->pushButton_2->setVisible(false);
QSettings settings;
settings.setValue(url, m_strLastestVersion);
settings.setValue("ledset", filepath);
}
void UpdateLedset3Dialog::OnCheckForUpdates()
{
m_updater->getInstance()->setNotifyOnUpdate(DEFS_LEDSET_URL,true);
m_updater->getInstance()->setNotifyOnFinish(DEFS_LEDSET_URL,false);
// m_updater->getInstance()->setUseCustomInstallProcedures(DEFS_LEDSET_URL,true);
m_updater->getInstance()->setNoNotifyDownload(DEFS_LEDSET_URL,true);
m_updater->getInstance()->setCompareBySameString(DEFS_LEDSET_URL,true);
m_updater->getInstance()->setMandatoryUpdate(DEFS_LEDSET_URL,false);
m_updater->getInstance()->checkForUpdates(DEFS_LEDSET_URL);
}
void UpdateLedset3Dialog::updateChangelog(QString strTip)
{
Q_UNUSED(strTip)
if(m_updater->getInstance()->getUpdateAvailable(DEFS_LEDSET_URL))
{
QString strtip=tr("LatestVersion:");
m_strLastestVersion=m_updater->getInstance()->getLatestVersion(DEFS_LEDSET_URL);
strtip+= m_strLastestVersion +"\r\n";
strtip+= tr("Update log:")+"\r\n"+m_updater->getInstance()->getChangelog (DEFS_LEDSET_URL) ;
ui->textEdit->setText(strtip);
ui->pushButton_2->setVisible(true);
}
else {
ui->textEdit->setText(tr("The current version is already the latest version,,you can select LED Screen SYNC firmware now!"));
}
disconnect(m_updater,SIGNAL(checkingFinished(QString)),this,SLOT(updateChangelog(QString)));
}

View File

@ -1,30 +0,0 @@
#ifndef UPDATELEDSET3DIALOG_H
#define UPDATELEDSET3DIALOG_H
#include <basedlg.h>
#include <QSimpleUpdater.h>
namespace Ui {
class UpdateLedset3Dialog;
}
class UpdateLedset3Dialog : public BaseDlg
{
Q_OBJECT
public:
explicit UpdateLedset3Dialog(QWidget *parent = nullptr);
~UpdateLedset3Dialog();
private:
Ui::UpdateLedset3Dialog *ui;
QSimpleUpdater *m_updater;
QString m_strLastestVersion="";
protected slots:
void OnCheckForUpdates() ;
void updateChangelog(QString);
void OnDownloadFinished( QString url, QString filepath);
};
#endif // UPDATELEDSET3DIALOG_H

View File

@ -1,204 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>UpdateLedset3Dialog</class>
<widget class="QDialog" name="UpdateLedset3Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>381</width>
<height>272</height>
</rect>
</property>
<widget class="QFrame" name="frame">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>382</width>
<height>275</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>LedSet3.0 Update</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="maximumSize">
<size>
<width>30</width>
<height>24</height>
</size>
</property>
<property name="text">
<string>X</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="styleSheet">
<string notr="true">border-top: 2px solid gray; </string>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">image: url(:/res/ledset.png);</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item alignment="Qt::AlignLeft">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>V1.0.0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="textEdit">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QPushButton" name="pushButton_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Update</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections>
<connection>
<sender>pushButton</sender>
<signal>clicked()</signal>
<receiver>UpdateLedset3Dialog</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>355</x>
<y>22</y>
</hint>
<hint type="destinationlabel">
<x>190</x>
<y>135</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -1,9 +1,6 @@
#include "ctrladvancedpanel.h"
#include "deviceitem.h"
#include "globaldefine.h"
#include "base/waitingdlg.h"
#include "base/changepasswordform.h"
#include "base/updateledset3dialog.h"
#include "passwordindlg.h"
#include "tools.h"
#include "gutil/qgui.h"
@ -927,7 +924,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
btnLedSet3 = new QPushButton;
btnLedSet3->setMinimumHeight(34);
btnLedSet3->setProperty("ssType", "progManageTool");
connect(btnLedSet3, &QPushButton::clicked, this, [this] {
connect(btnLedSet3, &QPushButton::clicked, this, [] {
QString strLedSetFile = QApplication::applicationDirPath()+"/LedSet/LedSet3.0.exe";
QFileInfo cc22(strLedSetFile);
if(cc22.exists()) {
@ -939,13 +936,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
if(!strLedsetPath.isEmpty()) {
QFileInfo cc(strLedsetPath);
if(cc.exists()) QProcess::startDetached(strLedsetPath,QStringList());
else {
auto res = QMessageBox::question(gMainWin, tr("Tip Info"), tr("Can not find LedSet3.0.exe,down you need download and install it")+strLedsetPath);
if(res == QMessageBox::Yes) {
UpdateLedset3Dialog *pDlg=new UpdateLedset3Dialog(this);
pDlg->exec();
}
}
else QMessageBox::critical(gMainWin, tr("Tip Info"), tr("Can not find LedSet3.0.exe")+strLedsetPath);
return;
}
QSettings reg1("HKEY_LOCAL_MACHINE\\SOFTWARE\\sysolution\\LedSet3.0", QSettings::NativeFormat);
@ -961,13 +952,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
QString str2="C:/Program Files (x86)/sysolution/LedSet3.0/LedSet3.0.exe";
QFileInfo cc2(str1);
if(cc2.exists()) QProcess::startDetached(str2,QStringList());
else {
auto res = QMessageBox::question(gMainWin, tr("Tip Info"), tr("Can not find LedSet3.0.exe,down you need download and install it")+strLedsetPath);
if(res == QMessageBox::Yes) {
UpdateLedset3Dialog *pDlg=new UpdateLedset3Dialog(this);
pDlg->exec();
}
}
else QMessageBox::critical(gMainWin, tr("Tip Info"), tr("Can not find LedSet3.0.exe")+strLedsetPath);
}
}
} else {
@ -978,13 +963,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
QString str2="C:/Program Files (x86)/sysolution/LedSet3.0/LedSet3.0.exe";
QFileInfo cc2(str1);
if(cc2.exists())QProcess::startDetached(str2,QStringList());
else {
auto res = QMessageBox::question(gMainWin, tr("Tip Info"), tr("Can not find LedSet3.0.exe,down you need download and install it")+strLedsetPath);
if(res == QMessageBox::Yes) {
UpdateLedset3Dialog *pDlg=new UpdateLedset3Dialog(this);
pDlg->exec();
}
}
else QMessageBox::critical(gMainWin, tr("Tip Info"), tr("Can not find LedSet3.0.exe")+strLedsetPath);
}
}
});
@ -999,6 +978,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) {
});
hBox->addWidget(btnLedSet4);
#ifndef Q_OS_WINDOWS
btnLedSet3->setVisible(false);
btnLedSet4->setVisible(false);
#endif
auto line = new QFrame;
line->setFrameShape(QFrame::HLine);

View File

@ -12,6 +12,7 @@
#include <QKeyEvent>
#include <QJsonArray>
#include <QHttpMultiPart>
#include <QDialogButtonBox>
UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) {
resize(1280, 720);
@ -76,7 +77,9 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) {
return;
}
QDialog dlg(this);
dlg.setWindowFlag(Qt::WindowContextHelpButtonHint, false);
#ifdef Q_OS_WIN
dlg.setWindowFlag(Qt::WindowContextHelpButtonHint, 0);
#endif
dlg.setWindowTitle(tr("Select Online APK"));
dlg.resize(800, 500);
@ -105,15 +108,13 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) {
});
vBox->addWidget(table);
auto hBox = new HBox(vBox);
hBox->addStretch();
auto btnOk = new QPushButton("确定");
btnOk->setMinimumWidth(80);
connect(btnOk, &QPushButton::clicked, &dlg, [=, &dlg] {
auto btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Close);
connect(btnBox, &QDialogButtonBox::rejected, &dlg, &QDialog::reject);
connect(btnBox, &QDialogButtonBox::accepted, &dlg, [=, &dlg] {
auto sels = table->selectedRanges();
if(sels.isEmpty()) {
QMessageBox::warning(&dlg, "Warning", "请选择文件");
QMessageBox::warning(&dlg, "Warning", tr("Please select a file"));
return;
}
auto row = sels[0].topRow();
@ -122,14 +123,7 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) {
filePath = "";
dlg.accept();
});
hBox->addWidget(btnOk);
hBox->addStretch();
auto btnClose = new QPushButton("关闭");
btnClose->setMinimumWidth(80);
connect(btnClose, &QPushButton::clicked, &dlg, &QDialog::reject);
hBox->addWidget(btnClose);
hBox->addStretch();
vBox->addWidget(btnBox);
dlg.exec();
});

View File

@ -27,6 +27,6 @@ PasswordInChDlg::PasswordInChDlg(QWidget *parent) : QDialog(parent) {
vBox->addStretch();
btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
vBox->addWidget(btnBox);
connect(btnBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
vBox->addWidget(btnBox);
}

View File

@ -8,7 +8,6 @@
#include "elescroll.h"
#include "eletimer.h"
#include "elevideo.h"
#include "gutil/qgui.h"
#include "posdlg.h"
#include <QFileInfo>
#include <QJsonArray>
@ -20,7 +19,7 @@
#include <QWebEngineView>
#include <QGuiApplication>
PlayWin* PlayWin::self = nullptr;
PlayWin* PlayWin::self = 0;
QPoint gPlayPos{0, 0};
Page::Page(QWidget *parent) : QWidget{parent} {

View File

@ -1,8 +1,10 @@
#include "eweb.h"
#include "program/progeditorwin.h"
#include <QSpinBox>
#include <QBoxLayout>
#include <QLineEdit>
#include <QJsonObject>
#include <QPainter>
#include <QLabel>
EWeb::EWeb(EBase *multiWin) : EBase(multiWin) {
mType = EBase::Web;

View File

@ -1,8 +1,7 @@
#ifndef EWEB_H
#define EWEB_H
#include "ebase.h"
#include "synctimer.h"
#include <QMovie>
class EWeb : public EBase {
Q_OBJECT

View File

@ -5,7 +5,9 @@
#include <QPushButton>
ProgCreateDlg::ProgCreateDlg(QString name, int width, int height, QString remarks, QString widths, QWidget *parent) : QDialog(parent) {
#ifdef Q_OS_WINDOWS
setWindowFlag(Qt::WindowContextHelpButtonHint, 0);
#endif
setWindowTitle(tr("Solution Information"));
auto vBox = new VBox(this);
auto hBox = new HBox(vBox);

View File

@ -33,6 +33,7 @@
#include <QSettings>
#include <QToolBar>
#include <QUdpSocket>
#include <QMovie>
ProgItem *gProgItem{0};
QWidget *gProgEditorWin;

View File

@ -170,6 +170,7 @@ void ProgItem::onUsbExportProgram() {
vBox->addWidget(fdDrives);
auto btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(btnBox, &QDialogButtonBox::rejected, &dlg, &QDialog::reject);
connect(btnBox, &QDialogButtonBox::accepted, &dlg, [=, &dlg] {
auto selects = fdDrives->selectedItems();
if(selects.count() > 0) {
@ -188,7 +189,6 @@ void ProgItem::onUsbExportProgram() {
if(fdDrives->count() <= 0) QMessageBox::warning(&dlg, tr("Tip"),tr("No checked USB device"));
else QMessageBox::warning(&dlg, tr("Tip"),tr("please select usb device in list"));
});
connect(btnBox, &QDialogButtonBox::rejected, &dlg, &QDialog::reject);
vBox->addWidget(btnBox);
fdDrives->clear();

View File

@ -1202,8 +1202,8 @@
<location filename="../device/ctrladvancedpanel.cpp" line="943"/>
<location filename="../device/ctrladvancedpanel.cpp" line="965"/>
<location filename="../device/ctrladvancedpanel.cpp" line="982"/>
<source>Can not find LedSet3.0.exe,down you need download and install it</source>
<translation>Can not find LedSet3.0.exe,down you need download and install it</translation>
<source>Can not find LedSet3.0.exe</source>
<translation></translation>
</message>
<message>
<location filename="../device/ctrladvancedpanel.cpp" line="416"/>

View File

@ -1202,8 +1202,8 @@
<location filename="../device/ctrladvancedpanel.cpp" line="943"/>
<location filename="../device/ctrladvancedpanel.cpp" line="965"/>
<location filename="../device/ctrladvancedpanel.cpp" line="982"/>
<source>Can not find LedSet3.0.exe,down you need download and install it</source>
<translation>LEDSET 3.0 . exeを見つけることができません</translation>
<source>Can not find LedSet3.0.exe</source>
<translation>LedSet3.0.exe </translation>
</message>
<message>
<location filename="../device/ctrladvancedpanel.cpp" line="416"/>

View File

@ -1202,8 +1202,8 @@
<location filename="../device/ctrladvancedpanel.cpp" line="943"/>
<location filename="../device/ctrladvancedpanel.cpp" line="965"/>
<location filename="../device/ctrladvancedpanel.cpp" line="982"/>
<source>Can not find LedSet3.0.exe,down you need download and install it</source>
<translation>LedSet3.0.exe</translation>
<source>Can not find LedSet3.0.exe</source>
<translation> LedSet3.0.exe</translation>
</message>
<message>
<location filename="../device/ctrladvancedpanel.cpp" line="416"/>

View File

@ -1254,7 +1254,7 @@
<location filename="../device/ctrladvancedpanel.cpp" line="943"/>
<location filename="../device/ctrladvancedpanel.cpp" line="965"/>
<location filename="../device/ctrladvancedpanel.cpp" line="982"/>
<source>Can not find LedSet3.0.exe,down you need download and install it</source>
<source>Can not find LedSet3.0.exe</source>
<translation> LedSet3.0.exe</translation>
</message>
<message>