diff --git a/LedOK/LedOK.pro b/LedOK/LedOK.pro index fdec71e..b937a77 100644 --- a/LedOK/LedOK.pro +++ b/LedOK/LedOK.pro @@ -11,6 +11,7 @@ greaterThan(QT_MAJOR_VERSION, 5) { CONFIG += c++17 CONFIG += lrelease CONFIG += embed_translations + # CONFIG += console # You can also make your code fail to compile if you use deprecated APIs. @@ -117,6 +118,7 @@ SOURCES += \ ffplayer.cpp \ globaldefine.cpp \ gutil/qgui.cpp \ + gutil/qjson.cpp \ gutil/qnetwork.cpp \ main.cpp \ mainwindow.cpp \ @@ -164,7 +166,6 @@ SOURCES += \ program/videosplitthread.cpp \ program/wplanitem.cpp \ program/wplanlist.cpp \ - program/wprogrampublishitem.cpp \ HEADERS += \ base/changepasswordform.h \ @@ -189,6 +190,7 @@ HEADERS += \ ffplayer.h \ globaldefine.h \ gutil/qgui.h \ + gutil/qjson.h \ gutil/qnetwork.h \ mainwindow.h \ mguangyingpinwidget.h \ @@ -235,7 +237,6 @@ HEADERS += \ program/videosplitthread.h \ program/wplanitem.h \ program/wplanlist.h \ - program/wprogrampublishitem.h \ TRANSLATIONS += \ translations/app_zh_CN.ts \ diff --git a/LedOK/css.css b/LedOK/css.css index a32e348..c1846b0 100644 --- a/LedOK/css.css +++ b/LedOK/css.css @@ -1,4 +1,8 @@ -Table {selection-background-color: #8ce;} +Table {selection-background-color: #0ae;} + +QCheckBox::indicator, QTableWidget::indicator, QTreeWidget::indicator { + width: 1.15em; height: 1.15em; +} QLineEdit,QComboBox,QAbstractSpinBox { border: 1px solid #aaa; @@ -38,16 +42,6 @@ QAbstractSpinBox::down-arrow:pressed { top: 1px; } -QCheckBox::indicator, QTreeWidget::indicator { - border-image: url(:/res/CheckBoxUnchecked.png); width: 1em; height: 1em; margin-left: 0.25em; -} -QCheckBox::indicator:checked, QTreeWidget::indicator:checked { - border-image: url(:/res/CheckBoxChecked.png); -} -QCheckBox::indicator:disabled { - background-color: #666; -} - ExtendedGroupBox::indicator { border-image: url(:/res/groupbox-unchecked.png); } @@ -77,7 +71,7 @@ QMenu::item:selected { } QListWidget { - selection-background-color: #8ce; + selection-background-color: #0ae; } LoColorSelector { @@ -92,14 +86,10 @@ LoColorSelector { QTreeWidget[ssType="topList"]::item { border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; - height: 40px; + height: 38px; } -QTreeWidget[ssType="topList"] QHeaderView::section { - border-top: 1px solid #aaa; - border-bottom: 1px solid #aaa; - border-left: 0; - border-right: 0; - height: 36px; +QTreeWidget[ssType="topList"]>QHeaderView::section { + height: 30px; } QTreeWidget[ssType="topList"]::item:hover { background-color: #ddd; diff --git a/LedOK/device/ctrladvancedpanel.cpp b/LedOK/device/ctrladvancedpanel.cpp index 2b44428..569e42f 100644 --- a/LedOK/device/ctrladvancedpanel.cpp +++ b/LedOK/device/ctrladvancedpanel.cpp @@ -148,12 +148,12 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() { hBox->addWidget(labelWebServer); fdWebServerAddr = new QComboBox; - fdWebServerAddr->addItem(tr("www.m2mled.net")); - fdWebServerAddr->addItem(tr("www.ledaips.com")); - fdWebServerAddr->addItem(tr("https://www.taxihub.cn:2340")); - fdWebServerAddr->addItem(tr("https://www.ledaips.com:2340")); - fdWebServerAddr->addItem(tr("https://www.36taxi.com:2340")); - fdWebServerAddr->addItem(tr("www.tlzxled.com")); + fdWebServerAddr->addItem("www.m2mled.net"); + fdWebServerAddr->addItem("www.ledaips.com"); + fdWebServerAddr->addItem("https://www.taxihub.cn:2340"); + fdWebServerAddr->addItem("https://www.ledaips.com:2340"); + fdWebServerAddr->addItem("https://www.36taxi.com:2340"); + fdWebServerAddr->addItem("www.tlzxled.com"); fdWebServerAddr->setMinimumWidth(260); fdWebServerAddr->setEditable(true); hBox->addWidget(fdWebServerAddr); @@ -448,88 +448,71 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } + JObj json{{"_type","DelPrograms"},{"_id","DelPrograms"},{"zVer","xixun1"}}; if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Clearing Program")+" ..."); waitingDlg->show(); auto card = gSelCards[0]; - auto tcp = new QTcpSocket(); - auto timer = new QTimer(tcp); - timer->setSingleShot(true); - connect(timer, &QTimer::timeout, tcp, [=] { - waitingDlg->close(); - tcp->abort(); - tcp->deleteLater(); - QMessageBox::critical(this, tr("Tip"), tr("Clear Program")+" "+tr("Timeout")); - }); + auto tcp = new TcpSocket; connect(waitingDlg, &WaitingDlg::rejected, tcp, [=] { - timer->stop(); tcp->abort(); tcp->deleteLater(); }); connect(tcp, &QTcpSocket::connected, tcp, [=] { - timer->stop(); - tcp->write("{\"_type\":\"DelPrograms\",\"_id\":\"DelPrograms\",\"zVer\":\"xixun1\"}"); - timer->start(10000); + tcp->stopTimer(); + tcp->write(JToBytes(json)); + tcp->startTimer(10000); }); connect(tcp, &QTcpSocket::readyRead, tcp, [=] { - timer->stop(); - QByteArray resp = tcp->readAll(); + tcp->stopTimer(); + auto resp = tcp->readAll(); tcp->close(); tcp->deleteLater(); - QJsonParseError parseErr; - QJsonDocument json = QJsonDocument::fromJson(resp, &parseErr); - if(parseErr.error != QJsonParseError::NoError) { + QString error; + auto json = JFrom(resp, &error); + if(! error.isEmpty()) { waitingDlg->close(); - QMessageBox::critical(this, tr("Tip"), parseErr.errorString()); + QMessageBox::critical(this, tr("Tip"), error); } else if(! json["success"].toBool()) { waitingDlg->close(); QMessageBox::critical(this, tr("Tip"), tr("Clear Program")+" "+tr("Failed")); } else waitingDlg->success(); }); connect(tcp, &QTcpSocket::errorOccurred, tcp, [=](QAbstractSocket::SocketError err) { - timer->stop(); tcp->close(); tcp->deleteLater(); waitingDlg->close(); QMessageBox::critical(this, tr("Tip"), QString(socketErrKey(err))+" ("+QString::number(err)+") "+tcp->errorString()); }); tcp->connectToHost(card.ip, 3333); - timer->start(10000); + tcp->startTimer(10000); } else { foreach(auto card, gSelCards) { - auto tcp = new QTcpSocket(); - auto timer = new QTimer(tcp); - timer->setSingleShot(true); + auto tcp = new TcpSocket; auto cardId = card.id; - connect(timer, &QTimer::timeout, tcp, [tcp, cardId] { - tcp->abort(); - tcp->deleteLater(); - gFdResInfo->append(cardId+" "+tr("Clear Program")+" "+tr("Timeout")); + connect(tcp, &QTcpSocket::connected, tcp, [=] { + tcp->stopTimer(); + tcp->write(JToBytes(json)); + tcp->startTimer(10000); }); - connect(tcp, &QTcpSocket::connected, tcp, [tcp, timer] { - timer->stop(); - tcp->write("{\"_type\":\"DelPrograms\",\"_id\":\"DelPrograms\",\"zVer\":\"xixun1\"}"); - timer->start(10000); - }); - connect(tcp, &QTcpSocket::readyRead, tcp, [tcp, timer, cardId] { - timer->stop(); - QByteArray resp = tcp->readAll(); + connect(tcp, &QTcpSocket::readyRead, tcp, [=] { + tcp->stopTimer(); + auto resp = tcp->readAll(); tcp->close(); tcp->deleteLater(); - QJsonParseError parseErr; - QJsonDocument json = QJsonDocument::fromJson(resp, &parseErr); - if(parseErr.error != QJsonParseError::NoError) gFdResInfo->append(cardId+" "+tr("Clear Program")+" "+parseErr.errorString()); + QString error; + auto json = JFrom(resp, &error); + if(! error.isEmpty()) gFdResInfo->append(cardId+" "+tr("Clear Program")+" "+error); else if(! json["success"].toBool()) gFdResInfo->append(cardId+" "+tr("Clear Program")+" "+tr("Failed")); else gFdResInfo->append(cardId+" "+tr("Clear Program")+" "+tr("Success")); }); - connect(tcp, &QTcpSocket::errorOccurred, tcp, [tcp, timer, cardId](QAbstractSocket::SocketError err) { - timer->stop(); + connect(tcp, &QTcpSocket::errorOccurred, tcp, [=](QAbstractSocket::SocketError err) { tcp->close(); tcp->deleteLater(); - gFdResInfo->append(cardId+" "+tr("Clear Program")+" "+QMetaEnum::fromType().valueToKey(err)+" ("+QString::number(err)+") "+tcp->errorString()); + gFdResInfo->append(cardId+" "+tr("Clear Program")+" "+socketErrKey(err)+" ("+QString::number(err)+") "+tcp->errorString()); }); tcp->connectToHost(card.ip, 3333); - timer->start(10000); + tcp->startTimer(10000); } } }); @@ -544,87 +527,70 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() { } JObj json{{"_type","getPlayerState"},{"_id","getPlayerState"},{"zVer","xixun1"}}; if(gSelCards.count() == 1) { - auto waitingDlg = new WaitingDlg(this, tr("Clearing Program")+" ..."); - waitingDlg->show(); + auto waitingDlg = new WaitingDlg(this, tr("Getting Player State")+" ..."); + waitingDlg->showLater(); auto card = gSelCards[0]; - auto tcp = new QTcpSocket(); - auto timer = new QTimer(tcp); - timer->setSingleShot(true); - connect(timer, &QTimer::timeout, tcp, [=] { - waitingDlg->close(); - tcp->abort(); - tcp->deleteLater(); - QMessageBox::critical(this, tr("Tip"), tr("Clear Program")+" "+tr("Timeout")); - }); + auto tcp = new TcpSocket; connect(waitingDlg, &WaitingDlg::rejected, tcp, [=] { - timer->stop(); tcp->abort(); tcp->deleteLater(); }); connect(tcp, &QTcpSocket::connected, tcp, [=] { - timer->stop(); + tcp->stopTimer(); tcp->write(JToBytes(json)); - timer->start(10000); + tcp->startTimer(10000); }); connect(tcp, &QTcpSocket::readyRead, tcp, [=] { - timer->stop(); - QByteArray resp = tcp->readAll(); - tcp->close(); - tcp->deleteLater(); - QJsonParseError parseErr; - QJsonDocument json = QJsonDocument::fromJson(resp, &parseErr); - if(parseErr.error != QJsonParseError::NoError) { - waitingDlg->close(); - QMessageBox::critical(this, tr("Tip"), parseErr.errorString()); - } else if(! json["success"].toBool()) { - waitingDlg->close(); - QMessageBox::critical(this, tr("Tip"), tr("Clear Program")+" "+tr("Failed")); - } else waitingDlg->success(); - }); - connect(tcp, &QTcpSocket::errorOccurred, tcp, [=](QAbstractSocket::SocketError err) { - timer->stop(); + tcp->stopTimer(); + auto resp = tcp->readAll(); tcp->close(); tcp->deleteLater(); waitingDlg->close(); - QMessageBox::critical(this, tr("Tip"), QString(socketErrKey(err))+" ("+QString::number(err)+") "+tcp->errorString()); + QString error; + auto json = JFrom(resp, &error); + if(! error.isEmpty()) { + QMessageBox::critical(this, tr("Error"), error); + return; + } + QMessageBox::information(this, tr("Player State"), json["code"].toStr()+". "+json["des_en"].toStr()+"\n"+json["des"].toStr()); + }); + connect(tcp, &QTcpSocket::errorOccurred, tcp, [=](QAbstractSocket::SocketError err) { + tcp->close(); + tcp->deleteLater(); + waitingDlg->close(); + QMessageBox::critical(this, tr("Error"), QString(socketErrKey(err))+" ("+QString::number(err)+") "+tcp->errorString()); }); tcp->connectToHost(card.ip, 3333); - timer->start(10000); + tcp->startTimer(10000); } else { foreach(auto card, gSelCards) { - auto tcp = new QTcpSocket(); - auto timer = new QTimer(tcp); - timer->setSingleShot(true); + auto tcp = new TcpSocket; auto cardId = card.id; - connect(timer, &QTimer::timeout, tcp, [tcp, cardId] { - tcp->abort(); - tcp->deleteLater(); - gFdResInfo->append(cardId+" "+tr("Clear Program")+" "+tr("Timeout")); - }); - connect(tcp, &QTcpSocket::connected, tcp, [tcp, json, timer] { - timer->stop(); + connect(tcp, &QTcpSocket::connected, tcp, [=] { + tcp->stopTimer(); tcp->write(JToBytes(json)); - timer->start(10000); + tcp->startTimer(10000); }); - connect(tcp, &QTcpSocket::readyRead, tcp, [tcp, timer, cardId] { - timer->stop(); - QByteArray resp = tcp->readAll(); + connect(tcp, &QTcpSocket::readyRead, tcp, [=] { + tcp->stopTimer(); + auto resp = tcp->readAll(); tcp->close(); tcp->deleteLater(); - QJsonParseError parseErr; - QJsonDocument json = QJsonDocument::fromJson(resp, &parseErr); - if(parseErr.error != QJsonParseError::NoError) gFdResInfo->append(cardId+" "+tr("Clear Program")+" "+parseErr.errorString()); - else if(! json["success"].toBool()) gFdResInfo->append(cardId+" "+tr("Clear Program")+" "+tr("Failed")); - else gFdResInfo->append(cardId+" "+tr("Clear Program")+" "+tr("Success")); + QString error; + auto json = JFrom(resp, &error); + if(! error.isEmpty()) { + gFdResInfo->append(cardId+" "+tr("Get Player State")+" "+error); + return; + } + gFdResInfo->append(cardId+" "+tr("Player State")+" "+json["code"].toStr()+". "+json["des_en"].toStr()+"\n"+json["des"].toStr()); }); - connect(tcp, &QTcpSocket::errorOccurred, tcp, [tcp, timer, cardId](QAbstractSocket::SocketError err) { - timer->stop(); + connect(tcp, &QTcpSocket::errorOccurred, tcp, [=](QAbstractSocket::SocketError err) { tcp->close(); tcp->deleteLater(); - gFdResInfo->append(cardId+" "+tr("Clear Program")+" "+QMetaEnum::fromType().valueToKey(err)+" ("+QString::number(err)+") "+tcp->errorString()); + gFdResInfo->append(cardId+" "+tr("Get Player State")+" "+socketErrKey(err)+" ("+QString::number(err)+") "+tcp->errorString()); }); tcp->connectToHost(card.ip, 3333); - timer->start(10000); + tcp->startTimer(10000); } } }); @@ -1519,7 +1485,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() { }); connect(tcp, &QTcpSocket::readyRead, tcp, [=] { timer->stop(); - QByteArray resp = tcp->readAll(); + auto resp = tcp->readAll(); tcp->close(); tcp->deleteLater(); QJsonParseError parseErr; @@ -1559,7 +1525,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel() { }); connect(tcp, &QTcpSocket::readyRead, tcp, [tcp, timer, cardId] { timer->stop(); - QByteArray resp = tcp->readAll(); + auto resp = tcp->readAll(); tcp->close(); tcp->deleteLater(); QJsonParseError parseErr; @@ -2329,6 +2295,7 @@ void CtrlAdvancedPanel::transUi() { btnGetLog->setText(tr("Check Log")); btnSetBack->setText(tr("Set Wallpaper")); btnClearProg->setText(tr("Clear Program")); + btnGetPlayerState->setText(tr("Get Player State")); btnPlayerBackSet->setText(tr("Set player background")); btnPlayerBackClear->setText(tr("Clear player background")); @@ -2407,7 +2374,7 @@ void PlayerBackSendThread::run() { req.insert("zVer","xixun1"); auto resNum = tcp.write(QJsonDocument(req).toJson(QJsonDocument::Compact)); if(resNum == -1 || ! tcp.waitForBytesWritten()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when write 'proStart'"); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when write 'proStart'"); tcp.close(); return; } @@ -2418,7 +2385,7 @@ void PlayerBackSendThread::run() { req.insert("zVer","xixun1"); resNum = tcp.write(QJsonDocument(req).toJson(QJsonDocument::Compact)); if(resNum == -1 || ! tcp.waitForBytesWritten()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when write 'imgFileStart'"); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when write 'imgFileStart'"); tcp.close(); return; } @@ -2438,13 +2405,13 @@ void PlayerBackSendThread::run() { } resNum = tcp.write(readed); if(resNum == -1) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when write file: "+file->fileName()); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when write file: "+file->fileName()); tcp.close(); file->close(); return; } if(! tcp.waitForBytesWritten()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when waitForWritten file: "+file->fileName()); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when waitForWritten file: "+file->fileName()); tcp.close(); file->close(); return; @@ -2458,7 +2425,7 @@ void PlayerBackSendThread::run() { req.insert("zVer","xixun1"); resNum = tcp.write(QJsonDocument(req).toJson(QJsonDocument::Compact)); if(resNum == -1 || ! tcp.waitForBytesWritten()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when write 'fileEnd'"); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when write 'fileEnd'"); tcp.close(); return; } @@ -2468,18 +2435,18 @@ void PlayerBackSendThread::run() { req.insert("zVer","xixun1"); resNum = tcp.write(QJsonDocument(req).toJson(QJsonDocument::Compact)); if(resNum == -1 || ! tcp.waitForBytesWritten()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when write 'proEnd'"); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when write 'proEnd'"); tcp.close(); return; }; if(! tcp.waitForReadyRead()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when waitForRead 'proEnd'"); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when waitForRead 'proEnd'"); tcp.close(); return; } auto resp = tcp.readAll(); if(resp.isEmpty()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when read 'proEnd'"); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when read 'proEnd'"); tcp.close(); return; } diff --git a/LedOK/device/upgradeapkdialog.cpp b/LedOK/device/upgradeapkdialog.cpp index 80a95c1..81ddf89 100644 --- a/LedOK/device/upgradeapkdialog.cpp +++ b/LedOK/device/upgradeapkdialog.cpp @@ -364,7 +364,7 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) { m_headerItem->setText(Upgrade_ONLINE, tr("Online")); m_headerItem->setText(Upgrade_SCREEN_IP, tr("Screen IP")); m_headerItem->setText(Upgrade_ENCRYPT, tr("Security")); - m_headerItem->setText(Upgrade_REMARK_NAME, tr("Remark Name")); + m_headerItem->setText(Upgrade_REMARK_NAME, tr("Alias")); m_headerItem->setText(Upgrade_PROGRESS, tr("Progress")); m_headerItem->setText(Upgrade_Remark, tr("State")); m_headerItem->setText(Upgrade_XIXUNPLAYER_VERSION, tr("xixunplayer")); diff --git a/LedOK/devicepanel.cpp b/LedOK/devicepanel.cpp index 8a3f0f0..84641a6 100644 --- a/LedOK/devicepanel.cpp +++ b/LedOK/devicepanel.cpp @@ -362,7 +362,7 @@ void DevicePanel::transUi() { m_headerItem->setText(DeviceTable_ID, tr("Screen ID")); m_headerItem->setText(DeviceTable_IP, tr("Screen IP")); m_headerItem->setText(DeviceTable_ScreenSize, tr("Screen Size")); - m_headerItem->setText(DeviceTable_Remark, tr("Remark Name")); + m_headerItem->setText(DeviceTable_Remark, tr("Alias")); m_headerItem->setText(DeviceTable_Screenshot, tr("readback pic")); m_headerItem->setText(DeviceTable_Brightness, tr("Screen Brightness")); m_headerItem->setText(DeviceTable_Power, tr("Power Status")); diff --git a/LedOK/globaldefine.h b/LedOK/globaldefine.h index 5ff0e50..2197ef4 100644 --- a/LedOK/globaldefine.h +++ b/LedOK/globaldefine.h @@ -4,8 +4,7 @@ #include #include -class LedCard { -public: +struct LedCard { QString id; QString ip; int mWidth{0}; diff --git a/LedOK/gutil/qgui.cpp b/LedOK/gutil/qgui.cpp index 06b6655..ef0cf02 100644 --- a/LedOK/gutil/qgui.cpp +++ b/LedOK/gutil/qgui.cpp @@ -16,7 +16,7 @@ Table::Table(std::initializer_list colAttrs, int rows, QWidget *parent) noStretch = false; } else horizontalHeader()->setSectionResizeMode(i, (QHeaderView::ResizeMode)it->resizeMode); } - mFieldMap.insert(it->field, i++); + mFieldMap.emplace(it->field, i++); } } @@ -31,9 +31,14 @@ void Table::resizeSec() { int colCnt = columnCount(), remainWidth = header->width(), stretchWidth = 0, secWidth; QTableWidgetItem *item; for(int cc=0; ccdata(0x99).toInt()) > 0) stretchWidth += secWidth; - else remainWidth -= header->sectionSize(cc); - } + if((secWidth = item->data(0x99).toInt()) > 0) stretchWidth += secWidth; + else remainWidth -= header->sectionSize(cc); + } if(remainWidth<=0 || stretchWidth==0) return; for(int cc=0; ccdata(0x99).toInt()) > 0) header->resizeSection(cc, secWidth * remainWidth / stretchWidth); } + +void Table::updateGeometries() { + QTableWidget::updateGeometries(); + emit updGeos(); +} diff --git a/LedOK/gutil/qgui.h b/LedOK/gutil/qgui.h index 98bd097..b71e068 100644 --- a/LedOK/gutil/qgui.h +++ b/LedOK/gutil/qgui.h @@ -2,12 +2,12 @@ #define QGUI_H #include -#include -#include -#include -#include #include #include +#include +#include +#include +#include #include #define MainMust \ @@ -155,10 +155,6 @@ public: Table() {} Table(std::initializer_list colAttrs, int rows = 0, QWidget *parent = 0); - inline auto setNoEdit() { - setEditTriggers(QAbstractItemView::NoEditTriggers); - return this; - } inline auto setDefs() { setSelectionBehavior(QTableWidget::SelectRows); setEditTriggers(QAbstractItemView::NoEditTriggers); @@ -291,13 +287,15 @@ public: setCellWidget(row, col, widget); } + std::map mFieldMap; public Q_SLOTS: inline void clearRows() {setRowCount(0);} - +signals: + void updGeos(); protected: void resizeEvent(QResizeEvent *event) override; + void updateGeometries() override; void resizeSec(); - QMap mFieldMap; bool noStretch{true}; }; diff --git a/LedOK/gutil/qjson.h b/LedOK/gutil/qjson.h index 5deb662..48f1662 100644 --- a/LedOK/gutil/qjson.h +++ b/LedOK/gutil/qjson.h @@ -94,13 +94,23 @@ public: if(type==Array) return *(JArray*) data; return JArray(); } + const JValue operator[](const QString &key) const { + return type==Obj ? (*(JObj*) data)[key] : JValue(); + } + const JValue operator[](int i) const { + return type==Array ? (*(JArray*) data)[i] : JValue(); + } private: JValue(const void *) = delete; // avoid implicit conversions from char * to bool }; class JParser { public: - JParser(QTextStream &in) : in(in) {} + JParser(QTextStream &in) : in(in) { +#if(QT_VERSION_MAJOR < 6) + in.setCodec("UTF-8"); +#endif + } inline JValue read() { skipSpace(); @@ -144,7 +154,11 @@ inline JValue JFrom(QIODevice *device, QString *err = 0) { class JOut { public: - JOut(QTextStream &out, QString indent = "") : out(out), indent(indent) {} + JOut(QTextStream &out, QString indent = "") : out(out), indent(indent) { +#if(QT_VERSION_MAJOR < 6) + out.setCodec("UTF-8"); +#endif + } void write(const JValue &obj); void writeStr(const QString &str); diff --git a/LedOK/gutil/qnetwork.cpp b/LedOK/gutil/qnetwork.cpp index 65cef07..3bbc591 100644 --- a/LedOK/gutil/qnetwork.cpp +++ b/LedOK/gutil/qnetwork.cpp @@ -71,13 +71,12 @@ bool TcpSocket::connAndExec(int msecs, QEventLoop *loop) { connect(this, &QTcpSocket::errorOccurred, loop, [loop] { loop->exit(1); }); - if(msecs > 0) { - connect(this, &TcpSocket::timeout, loop, &QEventLoop::exit); - if(timerId!=0) killTimer(timerId); - timerId = startTimer(msecs); + if(timerId) { + killTimer(timerId); + timerId = 0; } + if(msecs > 0) startTimer(msecs); auto res = loop->exec(); - timerStop(); - if(res==5) setSocketError(SocketTimeoutError); + stopTimer(); return res==0; } diff --git a/LedOK/gutil/qnetwork.h b/LedOK/gutil/qnetwork.h index a2e15cb..b2938e9 100644 --- a/LedOK/gutil/qnetwork.h +++ b/LedOK/gutil/qnetwork.h @@ -5,6 +5,7 @@ #include #include #include +#include extern const char *const FormBoundary; @@ -101,30 +102,45 @@ const char* socketErrKey(int value); class TcpSocket : public QTcpSocket { Q_OBJECT public: - explicit TcpSocket(QObject *parent = nullptr) : QTcpSocket{parent} {}; + using QTcpSocket::QTcpSocket; ~TcpSocket() { - if(timerId!=0) killTimer(timerId); + if(timerId) killTimer(timerId); }; + + void abort() { + stopTimer(); + QTcpSocket::abort(); + } + void close() override { + stopTimer(); + QTcpSocket::close(); + } bool waitForConnected(int msecs = 30000) override; bool waitForDisconnected(int msecs = 30000) override; bool waitForBytesWritten(int msecs = 30000) override; bool waitForReadyRead(int msecs = 30000) override; -protected: - void timerEvent(QTimerEvent *e) override { - if(e->timerId()!=timerId) return; - killTimer(timerId); - timerId = 0; - emit timeout(5); - }; - bool connAndExec(int msecs, QEventLoop *loop); - inline void timerStop() { + void startTimer(int interval, Qt::TimerType timerType = Qt::CoarseTimer) { + if(timerId) killTimer(timerId); + timerId = QTcpSocket::startTimer(interval, timerType); + } + void stopTimer() { if(timerId==0) return; killTimer(timerId); timerId = 0; } - int timerId = 0; -signals: - void timeout(int); + int timerId{0}; + +protected: + void timerEvent(QTimerEvent *e) override { + if(e->timerId()!=timerId) QTcpSocket::timerEvent(e); + else { + abort(); + setSocketError(SocketTimeoutError); + setErrorString(QCoreApplication::translate("QAbstractSocket", "Socket operation timed out")); + emit errorOccurred(QAbstractSocket::SocketTimeoutError); + } + }; + bool connAndExec(int msecs, QEventLoop *loop); }; #endif // QNETWORK_H diff --git a/LedOK/main.cpp b/LedOK/main.cpp index 3df2f1e..0c0cffa 100644 --- a/LedOK/main.cpp +++ b/LedOK/main.cpp @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) { QApplication::setOrganizationDomain("www.ledok.cn"); QApplication::setApplicationName("LedOK Express"); QApplication a(argc, argv); - a.setStyle(QStyleFactory::create("Fusion")); + QApplication::setStyle(QStyleFactory::create("Fusion")); QFile file(":/css.css"); if(file.exists() && file.open(QFile::ReadOnly)) { a.setStyleSheet(css = file.readAll()); diff --git a/LedOK/progpanel.cpp b/LedOK/progpanel.cpp index 65ae585..49f9b97 100644 --- a/LedOK/progpanel.cpp +++ b/LedOK/progpanel.cpp @@ -214,7 +214,7 @@ ProgPanel::ProgPanel(QWidget *parent) : QWidget(parent) { connect(txtSearch,SIGNAL(textChanged(const QString &)),this,SLOT(FilterProgram(const QString &))); mProgTree = new LoQTreeWidget(); - mProgTree->setIndentation(10); + mProgTree->setIndentation(6); mProgTree->setSortingEnabled(true); m_headerItem = new QTreeWidgetItem(); for(int i=1; isetTextAlignment(i, Qt::AlignCenter); @@ -223,7 +223,7 @@ ProgPanel::ProgPanel(QWidget *parent) : QWidget(parent) { m_headerItem->setData(ENUM_PROGRAMLISTHEADERITEM_RESOLUTION, Qt::DisplayRole, tr("Resolution")); m_headerItem->setData(ENUM_PROGRAMLISTHEADERITEM_SIZE, Qt::DisplayRole, tr("File Size")); m_headerItem->setData(ENUM_PROGRAMLISTHEADERITEM_LASTTIME, Qt::DisplayRole, tr("Last Modify")); - m_headerItem->setData(ENUM_PROGRAMLISTHEADERITEM_USB_EXPORT, Qt::DisplayRole, tr("Usb playback")); + m_headerItem->setData(ENUM_PROGRAMLISTHEADERITEM_USB_EXPORT, Qt::DisplayRole, tr("USB Update")); m_headerItem->setData(ENUM_PROGRAMLISTHEADERITEM_SEND, Qt::DisplayRole, tr("Publish")); mProgTree->setHeaderItem(m_headerItem); mProgTree->header()->setSectionResizeMode(ENUM_PROGRAMLISTHEADERITEM_CHECK, QHeaderView::Fixed); @@ -308,7 +308,7 @@ void ProgPanel::transUi() { m_headerItem->setData(ENUM_PROGRAMLISTHEADERITEM_RESOLUTION, 0, tr("Resolution")); m_headerItem->setData(ENUM_PROGRAMLISTHEADERITEM_SIZE, 0, tr("File Size")); m_headerItem->setData(ENUM_PROGRAMLISTHEADERITEM_LASTTIME, 0, tr("Last Modify")); - m_headerItem->setData(ENUM_PROGRAMLISTHEADERITEM_USB_EXPORT, 0, tr("Usb playback")); + m_headerItem->setData(ENUM_PROGRAMLISTHEADERITEM_USB_EXPORT, 0, tr("USB Update")); m_headerItem->setData(ENUM_PROGRAMLISTHEADERITEM_SEND, 0, tr("Publish")); bnNew->setText(tr("New")); bnEdit->setText(tr("Edit")); @@ -317,7 +317,6 @@ void ProgPanel::transUi() { bnExport->setText(tr("Export")); bnSend->setText(tr("Send")); btnPlay->setText(tr("Play")+"/"+tr("Stop")); - for(int i=0;irefreshLable(); } void ProgPanel::onEditClicked(bool){ diff --git a/LedOK/program/progitem.cpp b/LedOK/program/progitem.cpp index d6bf75c..7c31d18 100644 --- a/LedOK/program/progitem.cpp +++ b/LedOK/program/progitem.cpp @@ -74,7 +74,6 @@ QPushButton:hover { }); m_bnExport = new QPushButton(); m_bnExport->setCursor(QCursor(Qt::PointingHandCursor)); - m_bnExport->setToolTip(QObject::tr("ExportButtonTip")); m_bnExport->setStyleSheet(R"rrr( QPushButton { border-radius: 4px; @@ -87,7 +86,7 @@ QPushButton:hover{background-color: #cccccc;} mTree->setItemWidget(this, ENUM_PROGRAMLISTHEADERITEM_USB_EXPORT, m_bnExport); QObject::connect(m_bnExport, &QPushButton::clicked, mTree, [this] { QDialog dlg(mTree); - dlg.setWindowTitle(QObject::tr("Usb upgrade program")); + dlg.setWindowTitle(QObject::tr("USB Update Program")); #ifdef Q_OS_WIN dlg.setWindowFlag(Qt::WindowContextHelpButtonHint, 0); #endif @@ -140,7 +139,6 @@ QPushButton:hover{background-color: #cccccc;} m_bnSend = new QPushButton(); m_bnSend->setCursor(QCursor(Qt::PointingHandCursor)); - m_bnSend->setToolTip(QObject::tr("SendButtonTip")); m_bnSend->setStyleSheet(R"rrr( QPushButton{ border-radius: 4px; @@ -164,10 +162,6 @@ QPushButton:hover{background-color: #cccccc;} dlg.exec(); }); } -void ProgItem::refreshLable() { - m_bnExport->setToolTip(QObject::tr("ExportButtonTip")); - m_bnSend->setToolTip(QObject::tr("SendButtonTip")); -} void ProgItem::save() { QDir dRoot(mProgDir); diff --git a/LedOK/program/progitem.h b/LedOK/program/progitem.h index 312317b..f00de8e 100644 --- a/LedOK/program/progitem.h +++ b/LedOK/program/progitem.h @@ -18,7 +18,6 @@ public: void save(); void del(); - void refreshLable(); QString mName; int mWidth; diff --git a/LedOK/program/sendprogramdialog.cpp b/LedOK/program/sendprogramdialog.cpp index 9a53934..1671e01 100644 --- a/LedOK/program/sendprogramdialog.cpp +++ b/LedOK/program/sendprogramdialog.cpp @@ -1,14 +1,17 @@ #include "sendprogramdialog.h" #include "cfg.h" -#include "wprogrampublishitem.h" #include "sendprogthread.h" -#include "gutil/qgui.h" +#include "deviceitem.h" +#include "devicepanel.h" +#include "gutil/qnetwork.h" +#include "base/waitingdlg.h" #include #include #include #include -#include "deviceitem.h" -#include "devicepanel.h" +#include +#include +#include SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialog(parent), mProgName(progName) { #ifdef Q_OS_WIN @@ -18,6 +21,7 @@ SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialo resize(1024, 700); auto vBox = new VBox(this); + vBox->setContentsMargins(6,0,6,9); auto hBox = new HBox(vBox); label = new QLabel(tr("success info")); @@ -25,96 +29,107 @@ SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialo hBox->addStretch(); - auto pushButtonRefresh = new QPushButton(tr("Refresh")); - pushButtonRefresh->setProperty("ssType", "progManageTool"); - connect(pushButtonRefresh, SIGNAL(clicked()),this, SLOT(onRefresh())); - hBox->addWidget(pushButtonRefresh); + auto btnRefresh = new QPushButton(tr("Refresh")); + btnRefresh->setProperty("ssType", "progManageTool"); + connect(btnRefresh, &QPushButton::clicked, this, &SendProgramDialog::refresh); + hBox->addWidget(btnRefresh); - auto txtSearch = new QLineEdit(); + auto txtSearch = new QLineEdit; txtSearch->setFixedWidth(150); txtSearch->setClearButtonEnabled(true); - txtSearch->setStyleSheet("QLineEdit{border: 2px solid #aaaaaa; padding: 2px;}"); + txtSearch->setStyleSheet("QLineEdit{border: 2px solid #aaa; padding: 2px;}"); txtSearch->addAction(new QAction(QIcon(":/res/program/bnSearch.png"), QString()), QLineEdit::LeadingPosition); - connect(txtSearch,SIGNAL(textChanged(const QString &)),this,SLOT(FilterProgram(const QString &))); + connect(txtSearch, &QLineEdit::textEdited, this, [=](const QString &text) { + auto cnt = table->rowCount(); + for(int rr=0; rrsetRowHidden(rr, !(text.isEmpty() || table->text(rr, "id").contains(text) || table->text(rr, "ip").contains(text) || table->text(rr, "alias").contains(text) || table->text(rr, "size").contains(text))); + }); hBox->addWidget(txtSearch); + table = new Table{ + {"id", "ID", 140}, + {"online", tr("Online"), 40}, + {"ip", "IP", 100}, + {"size", tr("Screen Size"), 80}, + {"alias", tr("Alias"), 120}, + {"encrypt", tr("Security"), 40}, + {"progress", tr("Progress"), 120}, + {"remarks", tr("Remarks"), QHeaderView::Stretch} + }; + table->setDefs(); + auto colId = table->mFieldMap["id"]; + table->sortItems(colId); + table->setSelectionMode(Table::NoSelection); + table->setStyle(new ViewItemStyle); + vBox->addWidget(table); - wDevicePublishList = new LoQTreeWidget(); - wDevicePublishList->setProperty("ssType", "topList"); - m_headerItem = new QTreeWidgetItem(); - m_headerItem->setTextAlignment(1, Qt::AlignHCenter | Qt::AlignVCenter); - for(int i=1; isetTextAlignment(i, Qt::AlignCenter); - m_headerItem->setData(ENUM_DEVICE_PUBLISH_HEADE_CHECK, 0, ""); - m_headerItem->setData(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_ID, 0, tr("Screen ID")); - m_headerItem->setData(ENUM_DEVICE_PUBLISH_HEADE_ONLINE, 0, tr("Online")); - m_headerItem->setData(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_IP, 0, tr("Screen IP")); - m_headerItem->setData(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_SIZE, 0, tr("Screen Size")); - m_headerItem->setData(ENUM_DEVICE_PUBLISH_HEADE_ENCRYPT,0,tr("Security")); - m_headerItem->setData(ENUM_DEVICE_PUBLISH_HEADE_REMARK_NAME, 0, tr("Remark Name")); - m_headerItem->setData(ENUM_DEVICE_PUBLISH_HEADE_PROGRESS, 0, tr("Progress")); - m_headerItem->setData(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, 0, tr("Remarks")); - wDevicePublishList->setHeaderItem(m_headerItem); - wDevicePublishList->header()->setSectionResizeMode(ENUM_DEVICE_PUBLISH_HEADE_CHECK, QHeaderView::Fixed); - wDevicePublishList->header()->setSectionResizeMode(ENUM_DEVICE_PUBLISH_HEADE_ONLINE, QHeaderView::Fixed); - wDevicePublishList->header()->setSectionResizeMode(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_ID, QHeaderView::Fixed); - wDevicePublishList->header()->setSectionResizeMode(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_IP, QHeaderView::Fixed); - wDevicePublishList->header()->setSectionResizeMode(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_SIZE, QHeaderView::Fixed); - wDevicePublishList->header()->setSectionResizeMode(ENUM_DEVICE_PUBLISH_HEADE_ENCRYPT, QHeaderView::Fixed); - wDevicePublishList->header()->setSectionResizeMode(ENUM_DEVICE_PUBLISH_HEADE_PROGRESS, QHeaderView::Fixed); - wDevicePublishList->header()->setSectionResizeMode(ENUM_DEVICE_PUBLISH_HEADE_REMARK_NAME, QHeaderView::Interactive); - wDevicePublishList->header()->setSectionResizeMode(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, QHeaderView::Stretch); - wDevicePublishList->header()->setStretchLastSection(false); - wDevicePublishList->setColumnWidth(ENUM_DEVICE_PUBLISH_HEADE_CHECK, 52); - wDevicePublishList->setColumnWidth(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_ID, 130); - wDevicePublishList->setColumnWidth(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_IP, 130); - wDevicePublishList->setColumnWidth(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_SIZE, 88); - wDevicePublishList->setColumnWidth(ENUM_DEVICE_PUBLISH_HEADE_ONLINE, 50); - wDevicePublishList->setColumnWidth(ENUM_DEVICE_PUBLISH_HEADE_ENCRYPT, 52); - wDevicePublishList->setColumnWidth(ENUM_DEVICE_PUBLISH_HEADE_REMARK_NAME, 160); - wDevicePublishList->setColumnWidth(ENUM_DEVICE_PUBLISH_HEADE_PROGRESS, 120); - vBox->addWidget(wDevicePublishList); - + fdCheckAll = new QCheckBox(table); + connect(fdCheckAll, &QCheckBox::stateChanged, this, [=](int state) { + if(state==Qt::PartiallyChecked) return; + int cnt = table->rowCount(); + for(int i=0; iitemValid(i, colId)->setCheckState((Qt::CheckState) state); + }); + connect(table, &Table::updGeos, this, [=] { + fdCheckAll->move(table->verticalHeader()->size().width() + 8, 2); + }); + auto cellClicked = [=](int row, int column) { + if(column!=colId) return; + auto item = table->itemValid(row, colId); + auto state = item->checkState()==Qt::Checked ? Qt::Unchecked : Qt::Checked; + item->setCheckState(state); + int cnt = table->rowCount(); + fdCheckAll->blockSignals(true); + for(int i=0; iitemValid(i, colId)->checkState()!=state) { + fdCheckAll->setCheckState(Qt::PartiallyChecked); + goto end; + } + fdCheckAll->setCheckState(state); + end:fdCheckAll->blockSignals(false); + }; + connect(table, &Table::cellClicked, table, cellClicked); + connect(table, &Table::cellEntered, table, cellClicked); auto btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); btnBox->button(QDialogButtonBox::Ok)->setText(tr("Publish")); connect(btnBox, &QDialogButtonBox::rejected, this, &QDialog::reject); - connect(btnBox, &QDialogButtonBox::accepted, this, [this] { + connect(btnBox, &QDialogButtonBox::accepted, this, [=] { if(mWaitCnt > 0) return; - int cnt = wDevicePublishList->topLevelItemCount(); + int cnt = table->rowCount(); int sentCnt{0}; for(int i=0; itopLevelItem(i); - if(item->checkState(0) != Qt::Checked) continue; - auto row = static_cast(item); - if(row->mIsSending) continue; - if(row->mLedCard.hasPassword && row->mLedCard.isLocked) { - row->setData(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, 0, tr("This screen is encrypted")); - row->setForeground(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, Qt::red); + auto fdId = table->itemValid(i, colId); + if(fdId->checkState()!=Qt::Checked) continue; + if(fdId->data(isSending).toBool()) continue; + auto btnUnlock = (QPushButton*) table->cellWidget(i, "encrypt"); + auto fdRemarks = table->itemValid(i, "remarks"); + if(btnUnlock && btnUnlock->property("isLocked").toBool()) { + fdRemarks->setText(tr("This screen is encrypted")); + fdRemarks->setForeground(Qt::red); continue; } - row->fdProgress->setValue(0); + auto fdProgress = (QProgressBar*) table->cellWidget(i, "progress"); + fdProgress->setValue(0); if(sentCnt>=5) { - row->setData(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, 0, " 等待中 ..."); - row->setForeground(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, Qt::black); + fdRemarks->setText(" "+tr("Waiting")+" ..."); + fdRemarks->setForeground(Qt::black); mWaitCnt++; continue; } - row->mIsSending = true; - row->setData(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, 0, ""); - auto sendProg = new SendProgThread(programsDir()+"/"+mProgName+"_tmp", row->mLedCard.ip, 3333); - connect(sendProg, &SendProgThread::emErr, row, [this, row](QString strTip) { - row->mIsSending = false; + fdId->setData(isSending, true); + fdRemarks->setText(""); + auto sendProg = new SendProgThread(programsDir()+"/"+mProgName+"_tmp", table->text(i, "ip"), 3333); + connect(sendProg, &SendProgThread::emErr, fdProgress, [=](QString strTip) { + fdId->setData(isSending, false); if(strTip=="OK") { - row->setCheckState(0, Qt::Unchecked); - row->setData(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, 0, "OK"); - row->setForeground(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, Qt::darkGreen); + fdId->setCheckState(Qt::Unchecked); + fdRemarks->setText("OK"); + fdRemarks->setForeground(Qt::darkGreen); } else { - row->setData(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, 0, strTip); - row->setForeground(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, Qt::red); + fdRemarks->setText(strTip); + fdRemarks->setForeground(Qt::red); } sendNext(); }); - connect(sendProg, &SendProgThread::emProgress, row->fdProgress, &QProgressBar::setValue); + connect(sendProg, &SendProgThread::emProgress, fdProgress, &QProgressBar::setValue); connect(this, &SendProgramDialog::stopAllThd, sendProg, &SendProgThread::stop); sendProg->start(); sentCnt++; @@ -122,147 +137,133 @@ SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialo }); vBox->addWidget(btnBox); - onRefresh(); + refresh(); auto timer = new QTimer(this); - connect(timer, &QTimer::timeout, this, &SendProgramDialog::onRefresh); + connect(timer, &QTimer::timeout, this, &SendProgramDialog::refresh); timer->start(60000); } + +void SendProgramDialog::addRow(LedCard card) { + int cnt = table->rowCount(); + for(int rr=0; rrtext(rr, "id") == card.id) { + updRow(rr, card); + return; + } + table->setSortingEnabled(false); + table->setRowCount(cnt+1); + + auto item = table->setText(cnt, "id", card.id); + item->setCheckState(Qt::Unchecked); + item->setFlags(Qt::ItemIsEnabled); + + auto fdOnline = new QLabel; + fdOnline->setAlignment(Qt::AlignCenter); + table->setCellWidget(cnt, "online", fdOnline); + + auto fdProgress = new QProgressBar; + fdProgress->setAlignment(Qt::AlignCenter); + fdProgress->setStyleSheet("QProgressBar {margin-top: 6px; margin-bottom: 6px;}"); + table->setCellWidget(cnt, "progress", fdProgress); + + updRow(cnt, card); + table->setSortingEnabled(true); +} +void SendProgramDialog::updRow(int row, LedCard card) { + table->setText(row, "alias", card.alias); + table->setText(row, "ip", card.ip); + table->setText(row, "size", QString("%1 x %2").arg(card.mWidth).arg(card.mHeight))->setTextAlignment(Qt::AlignCenter); + ((QLabel*) table->cellWidget(row, "online"))->setPixmap(QPixmap(card.isOnline ? ":/res/O_Online.png" : ":/res/O_Offline.png")); + if(! card.hasPassword) table->setCellWidget(row, "encrypt", 0); + else { + auto btnUnlock = (QPushButton*) table->cellWidget(row, "encrypt"); + if(btnUnlock==0) { + btnUnlock = new QPushButton; + btnUnlock->setMaximumHeight(40); + btnUnlock->setProperty("isLocked", card.isLocked); + table->setCellWidget(row, "encrypt", btnUnlock); + connect(btnUnlock, &QPushButton::clicked, btnUnlock, [=] { + if(! btnUnlock->property("isLocked").toBool()) return; + bool ok; + auto pwd = QInputDialog::getText(this, tr("Input password"), tr("Input password"), QLineEdit::Password, QString(), &ok); + if(! ok) return; + QJsonObject json; + json.insert("_id", "VerifyPassword"); + json.insert("_type", "VerifyPassword"); + json.insert("pwd", pwd); + auto waitingDlg = new WaitingDlg(this, tr("VerifyPassword")+" ..."); + waitingDlg->show(); + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(60000).post(json); + waitingDlg->connAbort(reply); + connect(reply, &QNetworkReply::finished, btnUnlock, [=] { + QJsonDocument json; + QString err = checkReplyForJson(reply, &json); + if(! err.isEmpty()) { + waitingDlg->close(); + QMessageBox::critical(this, QObject::tr("Error"), err); + return; + } + if(! json["result"].toBool()) { + waitingDlg->close(); + QMessageBox::warning(this, tr("Tip Info"), tr("password is wrong")); + return; + } + waitingDlg->success(); + btnUnlock->setProperty("isLocked", false); + btnUnlock->setIcon(QIcon(":/res/UnLock.png")); + auto item = findItem(card.id); + if(item) { + item->mCard.isLocked = false; + item->btnUnlock->setIcon(QIcon(":/res/UnLock.png")); + } + }); + }); + } + btnUnlock->setIcon(QIcon(card.isLocked ? ":/res/Lock.png" : ":/res/UnLock.png")); //已验证显示绿色 没验证蓝色 + } +} + void SendProgramDialog::closeEvent(QCloseEvent *) { emit stopAllThd(); } void SendProgramDialog::sendNext() { if(mWaitCnt <= 0) return; - int cnt = wDevicePublishList->topLevelItemCount(); + int cnt = table->rowCount(); for(int i=0; itopLevelItem(i); - if(item->checkState(0) != Qt::Checked) continue; - auto row = static_cast(item); - if(row->mIsSending) continue; - if(row->mLedCard.hasPassword && row->mLedCard.isLocked) continue; - if(! row->data(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, 0).toString().startsWith(" ")) continue; - row->setData(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, 0, ""); - row->fdProgress->setValue(0); - row->mIsSending = true; + auto fdId = table->itemValid(i, "id"); + if(fdId->checkState()!=Qt::Checked) continue; + if(fdId->data(isSending).toBool()) continue; + auto btnUnlock = (QPushButton*) table->cellWidget(i, "encrypt"); + if(btnUnlock && btnUnlock->property("isLocked").toBool()) continue; + auto fdRemarks = table->itemValid(i, "remarks"); + if(! fdRemarks->text().startsWith(" ")) continue; + fdRemarks->setText(""); + auto fdProgress = (QProgressBar*) table->cellWidget(i, "progress"); + fdProgress->setValue(0); + fdId->setData(isSending, true); mWaitCnt--; - auto sendProg = new SendProgThread(programsDir()+"/"+mProgName+"_tmp", row->mLedCard.ip, 3333); - connect(sendProg, &SendProgThread::emErr, row, [this, row](QString strTip) { - row->mIsSending = false; + auto sendProg = new SendProgThread(programsDir()+"/"+mProgName+"_tmp", table->text(i, "ip"), 3333); + connect(sendProg, &SendProgThread::emErr, fdProgress, [=](QString strTip) { + fdId->setData(isSending, false); if(strTip=="OK") { - row->setCheckState(0, Qt::Unchecked); - row->setData(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, 0, "OK"); - row->setForeground(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, Qt::darkGreen); + fdId->setCheckState(Qt::Unchecked); + fdRemarks->setText("OK"); + fdRemarks->setForeground(Qt::darkGreen); } else { - row->setData(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, 0, strTip); - row->setForeground(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, Qt::red); + fdRemarks->setText(strTip); + fdRemarks->setForeground(Qt::red); } sendNext(); }); - connect(sendProg, &SendProgThread::emProgress, row->fdProgress, &QProgressBar::setValue); + connect(sendProg, &SendProgThread::emProgress, fdProgress, &QProgressBar::setValue); connect(this, &SendProgramDialog::stopAllThd, sendProg, &SendProgThread::stop); sendProg->start(); return; } } -void SendProgramDialog::onRefresh() { +void SendProgramDialog::refresh() { int cnt = gDevicePanel->mDeviceTable->topLevelItemCount(); - for(int i=0; i(gDevicePanel->mDeviceTable->topLevelItem(i))->mCard); - label->setText(tr("All")+":"+QString::number(cnt)); -} -void SendProgramDialog::onAddLedCard(LedCard p) { - int iExistFlg=0; - int cnt = wDevicePublishList->topLevelItemCount(); - for(int i=0; i(wDevicePublishList->topLevelItem(i))->mLedCard.id; - if(strTempCardId == p.id) { - iExistFlg=1; - static_cast(wDevicePublishList->topLevelItem(i))->SetItemParam(p); - break; - } - } - if(iExistFlg==0) new wProgramPublishItem(p, wDevicePublishList, mProgName, programsDir()); -} -void SendProgramDialog::FilterProgram(const QString &strtemp) -{ - if (strtemp.isEmpty()) //显示全部 - { - for (int i = 0; i< wDevicePublishList->topLevelItemCount(); ++i) - { - QTreeWidgetItem* topItem = wDevicePublishList->topLevelItem(i); - wDevicePublishList->setRowHidden(i,wDevicePublishList->indexFromItem(topItem->parent()),false); - } - } - else - { - QList resultList = wDevicePublishList->findItems(strtemp, Qt::MatchContains,ENUM_DEVICE_PUBLISH_HEADE_SCREEN_ID); //搜索结果 - if (resultList.size() > 0) - { - //QMessageBox::warning(this, "Export", QString(resultList.size())); - for (int i = 0; i< wDevicePublishList->topLevelItemCount(); ++i) - { - QTreeWidgetItem* topItem = wDevicePublishList->topLevelItem(i); - if (resultList.contains(topItem)) - wDevicePublishList->setRowHidden(i,wDevicePublishList->indexFromItem(topItem->parent()),false); //显示匹配的结果 - else - wDevicePublishList->setRowHidden(i,wDevicePublishList->indexFromItem(topItem->parent()),true); //隐藏不匹配的结果 - } - } - else { - - QList resultList6 = wDevicePublishList->findItems(strtemp, Qt::MatchContains,ENUM_DEVICE_PUBLISH_HEADE_REMARK_NAME); //搜索结果 - if (resultList6.size() > 0) - { - //QMessageBox::warning(this, "Export", QString(resultList.size())); - for (int i = 0; i< wDevicePublishList->topLevelItemCount(); ++i) - { - QTreeWidgetItem* topItem = wDevicePublishList->topLevelItem(i); - if (resultList6.contains(topItem)) - wDevicePublishList->setRowHidden(i,wDevicePublishList->indexFromItem(topItem->parent()),false); //显示匹配的结果 - else - wDevicePublishList->setRowHidden(i,wDevicePublishList->indexFromItem(topItem->parent()),true); //隐藏不匹配的结果 - } - } - else { - - - //QMessageBox::warning(this, "Export", "FilterProgram"); - QList resultList1 = wDevicePublishList->findItems(strtemp, Qt::MatchContains,ENUM_DEVICE_PUBLISH_HEADE_SCREEN_SIZE); //搜索结果 - if (resultList1.size() > 0) - { - //QMessageBox::warning(this, "Export", QString(resultList.size())); - for (int i = 0; i< wDevicePublishList->topLevelItemCount(); ++i) - { - QTreeWidgetItem* topItem = wDevicePublishList->topLevelItem(i); - if (resultList1.contains(topItem)) - wDevicePublishList->setRowHidden(i,wDevicePublishList->indexFromItem(topItem->parent()),false); //显示匹配的结果 - else - wDevicePublishList->setRowHidden(i,wDevicePublishList->indexFromItem(topItem->parent()),true); //隐藏不匹配的结果 - } - } - else { - QList resultList2 = wDevicePublishList->findItems(strtemp, Qt::MatchContains,ENUM_DEVICE_PUBLISH_HEADE_SCREEN_IP); //搜索结果 - if (resultList2.size() > 0) - { - //QMessageBox::warning(this, "Export", QString(resultList.size())); - for (int i = 0; i< wDevicePublishList->topLevelItemCount(); ++i) - { - QTreeWidgetItem* topItem = wDevicePublishList->topLevelItem(i); - if (resultList2.contains(topItem)) - wDevicePublishList->setRowHidden(i,wDevicePublishList->indexFromItem(topItem->parent()),false); //显示匹配的结果 - else - wDevicePublishList->setRowHidden(i,wDevicePublishList->indexFromItem(topItem->parent()),true); //隐藏不匹配的结果 - } - } - else { - for (int i = 0; i< wDevicePublishList->topLevelItemCount(); ++i) - { - QTreeWidgetItem* topItem = wDevicePublishList->topLevelItem(i); - wDevicePublishList->setRowHidden(i,wDevicePublishList->indexFromItem(topItem->parent()),true); //隐藏不匹配的结果 - } - } - } - } - } - } + for(int i=0; i(gDevicePanel->mDeviceTable->topLevelItem(i))->mCard); + label->setText(tr("All")+": "+QString::number(cnt)); } diff --git a/LedOK/program/sendprogramdialog.h b/LedOK/program/sendprogramdialog.h index 33ab3c8..c78916b 100644 --- a/LedOK/program/sendprogramdialog.h +++ b/LedOK/program/sendprogramdialog.h @@ -1,33 +1,51 @@ #ifndef SENDPROGRAMDIALOG_H #define SENDPROGRAMDIALOG_H -#include -#include -#include "base/loqtreewidget.h" #include "globaldefine.h" +#include "gutil/qgui.h" +#include +#include +#include +#include class SendProgramDialog : public QDialog { Q_OBJECT public: explicit SendProgramDialog(QString, QWidget *parent = nullptr); -protected: - void closeEvent(QCloseEvent *event) override; signals: void stopAllThd(); protected slots: - void onRefresh(); - void FilterProgram(const QString &strtemp); -private: + void refresh(); +protected: + void closeEvent(QCloseEvent *event) override; void sendNext(); - void onAddLedCard(LedCard); + void addRow(LedCard); + void updRow(int, LedCard); - LoQTreeWidget *wDevicePublishList; + Table *table; + QCheckBox *fdCheckAll; int mWaitCnt{0}; QLabel *label; - QTreeWidgetItem *m_headerItem = nullptr; QString mProgName; QString m_strUrl; + + enum {isSending = Qt::UserRole}; +}; + +class ViewItemStyle : public QProxyStyle { +public: + ViewItemStyle() : QProxyStyle(QApplication::style()) {} + QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const override { + auto res = QProxyStyle::subElementRect(element, option, widget); + if(option && option->type==QStyleOption::SO_ViewItem && ((QStyleOptionViewItem*)option)->features & QStyleOptionViewItem::HasCheckIndicator && ((QStyleOptionViewItem*)option)->index.internalId()==0) res.setLeft(res.x() + 6); + return res; + } + int pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option, const QWidget *widget) const override { + auto res = QProxyStyle::pixelMetric(metric, option, widget); + if(metric==PM_FocusFrameHMargin && option && option->type==QStyleOption::SO_ViewItem && ((QStyleOptionViewItem*)option)->features & QStyleOptionViewItem::HasCheckIndicator) res += 4; + return res; + } }; #endif // SENDPROGRAMDIALOG_H diff --git a/LedOK/program/sendprogthread.cpp b/LedOK/program/sendprogthread.cpp index 516b5b4..083d869 100644 --- a/LedOK/program/sendprogthread.cpp +++ b/LedOK/program/sendprogthread.cpp @@ -22,7 +22,7 @@ void SendProgThread::run() { TcpSocket tcp; tcp.connectToHost(ip, port); if(! tcp.waitForConnected()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when waitForConnected"); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when waitForConnected"); tcp.close(); return; } @@ -45,18 +45,18 @@ void SendProgThread::run() { auto requ = QJsonDocument(req).toJson(QJsonDocument::Compact); auto resNum = tcp.write(requ); if(resNum == -1 || ! tcp.waitForBytesWritten()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when write 'consult'. size"+QString::number(requ.size())); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when write 'consult'. size"+QString::number(requ.size())); tcp.close(); return; } if(! tcp.waitForReadyRead()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when waitForRead 'consult'. size"+QString::number(requ.size())); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when waitForRead 'consult'. size"+QString::number(requ.size())); tcp.close(); return; } auto resp = tcp.readAll(); if(resp.isEmpty()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when read 'consult'. size"+QString::number(requ.size())); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when read 'consult'. size"+QString::number(requ.size())); tcp.close(); return; } @@ -68,13 +68,13 @@ void SendProgThread::run() { QJsonDocument res = QJsonDocument::fromJson(resp, &parseErr); for(int i=2; parseErr.error == QJsonParseError::UnterminatedString && i < 10; i++) { if(! tcp.waitForReadyRead()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when waitForRead 'consult' "+QString::number(i)); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when waitForRead 'consult' "+QString::number(i)); tcp.close(); return; } auto resp2 = tcp.readAll(); if(resp2.isEmpty()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when read 'consult' "+QString::number(i)); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when read 'consult' "+QString::number(i)); tcp.close(); return; } @@ -111,7 +111,7 @@ void SendProgThread::run() { req.insert("zVer","xixun1"); auto resNum = tcp.write(QJsonDocument(req).toJson(QJsonDocument::Compact)); if(resNum == -1 || ! tcp.waitForBytesWritten()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when write 'proStart'"); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when write 'proStart'"); tcp.close(); return; } @@ -132,7 +132,7 @@ void SendProgThread::run() { req.insert("zVer","xixun1"); auto resNum = tcp.write(QJsonDocument(req).toJson(QJsonDocument::Compact)); if(resNum == -1 || ! tcp.waitForBytesWritten()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when write 'fileStart'"); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when write 'fileStart'"); tcp.close(); return; } @@ -157,13 +157,13 @@ void SendProgThread::run() { }; resNum = tcp.write(readed); if(resNum == -1) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when write file: "+file->fileName()); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when write file: "+file->fileName()); tcp.close(); file->close(); return; } if(! tcp.waitForBytesWritten(60000)) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when waitForWritten file: "+file->fileName()); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when waitForWritten file: "+file->fileName()); tcp.close(); file->close(); return; @@ -188,7 +188,7 @@ void SendProgThread::run() { req.insert("zVer", "xixun1"); resNum = tcp.write(QJsonDocument(req).toJson(QJsonDocument::Compact)); if(resNum == -1 || ! tcp.waitForBytesWritten()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when write 'fileEnd'"); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when write 'fileEnd'"); tcp.close(); return; } @@ -204,18 +204,18 @@ void SendProgThread::run() { req.insert("zVer","xixun1"); resNum = tcp.write(QJsonDocument(req).toJson(QJsonDocument::Compact)); if(resNum == -1 || ! tcp.waitForBytesWritten()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when write 'proEnd'"); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when write 'proEnd'"); tcp.close(); return; }; if(! tcp.waitForReadyRead()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when waitForRead 'proEnd'"); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when waitForRead 'proEnd'"); tcp.close(); return; } auto resp = tcp.readAll(); if(resp.isEmpty()) { - emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") when read 'proEnd'"); + emit emErr(QString(socketErrKey(tcp.error()))+" ("+QString::number(tcp.error())+") "+tcp.errorString()+" when read 'proEnd'"); tcp.close(); return; } diff --git a/LedOK/program/wprogrampublishitem.cpp b/LedOK/program/wprogrampublishitem.cpp deleted file mode 100644 index ada4dab..0000000 --- a/LedOK/program/wprogrampublishitem.cpp +++ /dev/null @@ -1,89 +0,0 @@ -#include "wprogrampublishitem.h" -#include "gutil/qgui.h" -#include "base/waitingdlg.h" -#include "gutil/qnetwork.h" -#include "deviceitem.h" -#include -#include -#include -#include -#include "globaldefine.h" -#include -#include - -wProgramPublishItem::wProgramPublishItem(LedCard pLedCard, LoQTreeWidget *parent, QString strProgramName, QString strProgramPath) : QObject(parent), QTreeWidgetItem(UserType), m_parent(parent) { - m_strProgramName = strProgramName; - m_strProgramPath = strProgramPath; - mLedCard = pLedCard; - - setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); - setCheckState(0, Qt::Unchecked); - m_parent->addTopLevelItem(this); - m_ImageOnline = new QLabel(); - m_ImageOnline->setAlignment(Qt::AlignCenter); - m_parent->setItemWidget(this, ENUM_DEVICE_PUBLISH_HEADE_ONLINE, m_ImageOnline); - for(int i=1; isetStyleSheet("margin-top: 8px; margin-bottom: 8px;"); - m_parent->setItemWidget(this, ENUM_DEVICE_PUBLISH_HEADE_PROGRESS, fdProgress); - fdProgress->setAlignment(Qt::AlignCenter); - - btnUnlock = new QPushButton; - btnUnlock->setMaximumHeight(40); - auto wgt = new QWidget; - auto vBox = new VBox(wgt); - vBox->setContentsMargins(0,0,0,0); - vBox->addWidget(btnUnlock); - m_parent->setItemWidget(this, ENUM_DEVICE_PUBLISH_HEADE_ENCRYPT, wgt); - connect(btnUnlock, &QPushButton::clicked, this, [this] { - if(! mLedCard.isLocked) return; - bool ok; - auto pwd = QInputDialog::getText(treeWidget(), tr("Input password"), tr("Input password"), QLineEdit::Password, QString(), &ok); - if(! ok) return; - QJsonObject json; - json.insert("_id", "VerifyPassword"); - json.insert("_type", "VerifyPassword"); - json.insert("pwd", pwd); - auto waitingDlg = new WaitingDlg(treeWidget(), tr("VerifyPassword")+" ..."); - waitingDlg->show(); - auto reply = NetReq("http://"+mLedCard.ip+":2016/settings").timeout(60000).post(json); - waitingDlg->connAbort(reply); - connect(reply, &QNetworkReply::finished, this, [=] { - QJsonDocument json; - QString err = checkReplyForJson(reply, &json); - if(! err.isEmpty()) { - waitingDlg->close(); - QMessageBox::critical(m_parent, QObject::tr("Error"), err); - return; - } - if(! json["result"].toBool()) { - waitingDlg->close(); - QMessageBox::warning(treeWidget(), tr("Tip Info"), tr("password is wrong")); - return; - } - waitingDlg->success(); - mLedCard.isLocked = false; - btnUnlock->setIcon(QIcon(":/res/UnLock.png")); - auto item = findItem(mLedCard.id); - if(item) { - item->mCard.isLocked = false; - item->btnUnlock->setIcon(QIcon(":/res/UnLock.png")); - } - }); - }); - - SetItemParam(mLedCard); -} - -void wProgramPublishItem::SetItemParam(LedCard card) { - setData(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_ID, 0, card.id); - setData(ENUM_DEVICE_PUBLISH_HEADE_REMARK_NAME, 0, card.alias); - setData(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_IP, 0, card.ip); - setData(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_SIZE, 0, QString("%1 x %2").arg(card.mWidth).arg(card.mHeight)); - m_ImageOnline->setPixmap(QPixmap(mLedCard.isOnline ? ":/res/O_Online.png" : ":/res/O_Offline.png")); - if(! card.hasPassword) btnUnlock->hide(); - else { - if(! btnUnlock->isVisible()) btnUnlock->show(); - btnUnlock->setIcon(QIcon(card.isLocked ? ":/res/Lock.png" : ":/res/UnLock.png")); //如果已经验证通过密码显示绿色图标 没有验证显示蓝色锁图标 - } -} diff --git a/LedOK/program/wprogrampublishitem.h b/LedOK/program/wprogrampublishitem.h deleted file mode 100644 index 8fc873c..0000000 --- a/LedOK/program/wprogrampublishitem.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef WPROGRAMPUBLISHITEM_H -#define WPROGRAMPUBLISHITEM_H - -#include -#include -#include -#include -#include -#include -#include -#include "base/loqtreewidget.h" -#include "globaldefine.h" - -class wProgramPublishItem : public QObject, public QTreeWidgetItem { - Q_OBJECT -public: - explicit wProgramPublishItem(LedCard pLedCard, LoQTreeWidget *parent = nullptr, QString strProgramName="",QString strProgramPath=""); - void SetItemParam(LedCard p); - - LedCard mLedCard; - QProgressBar *fdProgress{nullptr}; - bool mIsSending{false}; - -private: - QString m_strProgramName=""; - QString m_strProgramPath=""; - QLabel *m_ImageOnline=nullptr; - LoQTreeWidget *m_parent = nullptr; - QPushButton *btnUnlock = nullptr;// - -}; -enum ENUM_DEVICE_PUBLISH_HEADERITEM { - ENUM_DEVICE_PUBLISH_HEADE_CHECK=0, - ENUM_DEVICE_PUBLISH_HEADE_SCREEN_ID, - ENUM_DEVICE_PUBLISH_HEADE_ONLINE, - ENUM_DEVICE_PUBLISH_HEADE_SCREEN_IP, - ENUM_DEVICE_PUBLISH_HEADE_SCREEN_SIZE, - ENUM_DEVICE_PUBLISH_HEADE_ENCRYPT, - ENUM_DEVICE_PUBLISH_HEADE_REMARK_NAME, - ENUM_DEVICE_PUBLISH_HEADE_PROGRESS, - ENUM_DEVICE_PUBLISH_HEADE_REMARKS, - ENUM_DEVICE_PUBLISH_HEADE_END, -}; - -#endif // WPROGRAMPUBLISHITEM_H diff --git a/LedOK/translations/app_en.ts b/LedOK/translations/app_en.ts index 4ca752a..7ec4d1a 100644 --- a/LedOK/translations/app_en.ts +++ b/LedOK/translations/app_en.ts @@ -56,975 +56,997 @@ CtrlAdvancedPanel - + Advanced Advanced - + Screen Width(pixel) Screen Width(pixel) - + Width Width - - + + Height Height - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Set Set - + Alias Alias - + Web Server Address: Web Server Address: - + www.m2mled.net - + www.ledaips.com - + https://www.taxihub.cn:2340 - + https://www.ledaips.com:2340 - + https://www.36taxi.com:2340 - + www.tlzxled.com - + MCU Uploading - + Traffic screen settings - + Setting protocol ... - + Set protocol - + Getting protocol ... - + Get protocol - - + + Port - + Realtimer Server Address: Realtimer Server Address: - + Firmware Management - + update or uninstall - + Clear Clear - + Check Apk Check Apk - + Uninstall Uninstall - + Running check Running check - + Restart Restart - + Check Log Check Log - + Start LedSet4 Start LedSet4.0 (Apk Display2.0 and higher) - + Open ADB Open ADB debugging function - + Post Custom JSON Post Custom JSON - - - - + + + - - + + + Clear Program Clear Program - + www.ledokcloud.com/realtime - + Config Config - + Refresh Refresh - + Restore to default Restore to default - + Taxi top screen configuration Taxi top screen configuration - - + + Service:High Out of service:Low Service:High Out of service:Low - - + + Service:Low Out of service:High Service:Low Out of service:High - + Binding *.ic account indentity voucher Binding *.ic account indentity voucher - + Rotate Rotate - + Min brightness Min brightness - - - + + + Readback Readback - + Send Send - + Max brightness Max brightness - - + + SetScreenSize Set Screen Size - - - - - + + + + + Success Success - + Compant ID: Company ID - + Compant ID Company ID - + InputWebServerAddressTip Please enter web server address - + InputCompanyIdTip Please enter company ID - + Do you want to modify webserveraddress and companyId? Are you sure you want to configure the server address and company ID? - - + + SetOnlineAddr Set Web server address - - + + ClearRealtimeServer Clear - - + + SetRealtimeServer Set realtimer address - + Tip Info Tip Info - - + + RestartAndroid Restart - - + + running running - - + + no running no running - + Check Apk Version Check Apk Version - - + + UninstallSoftware Uninstall - - + + Check apk running status - - + + OpenAdb Open ADB debugging function - + indentity voucher (*.ic) indentity voucher (*.ic) - - - - - + + + + + InvokeTaxiAppFunction Binding certificate - - + + AliIotSetting - + Software Version Info - + Package - + Version - - + + Package name is null - + Clearing Program - - - - + + + + Timeout Timeout - - - - + + + + Failed - + Getting Log - - - - - - - - - - - + + + + + + + + + + + + + Error Error - + Setting Timing Reboot - + Set Timing Reboot - + Getting Timing Reboot - + Get Timing Reboot - + totalResolution FPGA total resoltuion - + strCurDisplayResolution Cur display resolution - - + + File not exist - - + + Getting Player State + + + + + + + Get Player State + + + + + + Player State + + + + + Cannot Open File - + Uploading - + Update Update - - + + Set Display Mode - - + + Get Display Mode - - + + Set Screen Offset - - + + Get Screen Offset - + Open file Failed Open file Failed - + Setting Wallpaper - - + + Set Wallpaper - + System Updating - - + + System Update - + Getting MCU Version - - + + MCU Version - + Select File Select File - + Setting player background - - + + Set player background - + Clearing player background - - - - - - - - + + + + + + + + Clear player background - - + + GetScreenRotation Get Screen Rotation - + Setting Baud Rate - + Set Baud Rate - + Getting Baud Rate - + Get Baud Rate - + Text is empty - + Json Parse Error - + Json isn't an Object - + Setting card work mode ... - + Set card work mode - + Getting card work mode ... - + Get card work mode - + Input password Input password - + Change Password Change Password - + Resolution Config - + Full screen - + Part - + Display Mode - + Screen Position - + Offset - + Hidden Settings - + Click right button to hide - - + + Update MCU - + Get MCU Version - + Baud Config - + Model - + Uart - + Baud - - - - - - - + + + + + + + Get - + Timing Reboot - + Protocol - + Server - + Client - - + + SetScreenRotation Set screen rotation - - + + SetMinBrightness Set min brightness value - - + + SetMaxBrightness Set maximum brightness value - - + + GetMinBrightness Get min brightness - - + + GetMaxBrightness Get maximum brightness - - + + Card work mode - - + + SetSpecialResolution Set Special Resolution - - + + GetSpecialResolution Get Special Resolution - - + + CleanDisplayScreenSize Restore to default relolution - - + + SetHighForBusy Set level for busy - - + + GetStateForBusy Get level of busy - - + + SetCardAlias Set alias - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + Tip Tip - - - - - - - - - - + + + + + + + + + + - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + NoSelectedController Please select screen first - + InputWidthTip Please enter the correct width pixel value - + InputHeightTip Please enter the correct height pixel value - + Password is error Password is error @@ -3087,8 +3109,8 @@ - - + + @@ -3160,238 +3182,238 @@ DevicePanel - + All ALL ALL - + Online Online Online - + Refresh Refresh Refresh - - + + Specify IP Specify IP Specify IP - - - - + + + + Current Screen Current screen - - + + none none - + Current Brightness - + Android Version - + FPGA Version FPGA Version - + Brightness Level Brightness Level - + Android OS Resolution Android OS Resolution - + Firmware Version Firmware Version - - - - + + + + Player Version - + Detail Info Detail Info - + Getting - + Specify IP list - + Search Search - - + + Attention Attention - - + + Please input IP address! Please input IP address! - + Cancel Cancel - + Screen ID Screen ID - + Screen IP Screen IP - + Screen Size Screen Size - - Remark Name - Alias + + Alias + - + readback pic Screenshot - + On ON - + Off OFF - + Brightness Adj. Brightness Adj. - + Power Control Power Control - + Net Config Network Config - + Time Sync Time Sync - + Video source Video Source - + Password Password - + Advanced Advanced - + Volume Adj. Volume - + Test Test - - + + Multi screen operation Multi screen operation - - + + selected num Selected number - - + + Clear Clear - + More Info More Info - + Screen Brightness Screen Brightness - + Power Status Power Status - + Security encryption @@ -4619,50 +4641,50 @@ MainWindow - + Language Language - + Help Help - + Check for updates Check for updates - + firmware manager Firmware management - + Preferences - + Info - + About About - + Setting Setting @@ -4754,27 +4776,27 @@ Error - + Device Terminals - + Program Solutions - + Control Terminal Control - + Lora Screen - + Check card Detect @@ -5011,12 +5033,12 @@ PlayerBackSendThread - + Open file failed Open file failed - + Read file failed Read file failed @@ -5376,8 +5398,8 @@ - Usb playback - USB playback + USB Update + @@ -5453,16 +5475,10 @@ password is wrong password is wrong - - - - ExportButtonTip - USB playback - - Usb upgrade program - Usb upgrade program + USB Update Program + @@ -5491,12 +5507,6 @@ please select usb device in list please select usb device in list - - - - SendButtonTip - Publish - SendProgThread @@ -5542,8 +5552,8 @@ - Remark Name - Alias + Alias + @@ -5604,12 +5614,12 @@ Upgrade - + Uninstall Uninstall - + check running state check running state @@ -5619,98 +5629,98 @@ Select Fpga - + Installing - + Refresh Refresh - + Cancel Cancel - + Screen ID Screen ID - - Remark Name - Alias + + Alias + - + Online Online - + Screen IP Screen IP - + Security encryption - + Progress Progress - + xixunplayer - + cardsystem - + taxiapp - + starter - + connection - + displayer - + FPGA FPGA - + update - + State State - - + + All ALL @@ -5753,7 +5763,7 @@ - + Tip Tip @@ -5769,98 +5779,98 @@ - + Downloading Online File - - + + Error Error - + Online file is empty - + Uploading - + Upload error - + Don't power off during this process - + Install error - + Install success - + Reminder - + Reminder: Uninstalling this program may cause the device to offline, cannot be found, lost configs and have a black screen. Please uninstall with caution! - + Do you want to continue? - + Uninstalling Uninstalling - + Uninstall error - + Uninstall success - + Check apk running status - + Check error - + Running Running - + Not running - + The encrypted control card can be upgraded directly The encrypted control card can be upgraded directly diff --git a/LedOK/translations/app_ja.ts b/LedOK/translations/app_ja.ts index 56a48c6..f3883d1 100644 --- a/LedOK/translations/app_ja.ts +++ b/LedOK/translations/app_ja.ts @@ -56,975 +56,997 @@ CtrlAdvancedPanel - + Advanced 上級パラメータ - + Screen Width(pixel) 画面幅(ピクセル) - + Width - - + + Height 高さ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Set セット - + Alias 別名 - + Web Server Address: Webサーバのアドレス: - + www.m2mled.net - + www.ledaips.com - + https://www.taxihub.cn:2340 - + https://www.ledaips.com:2340 - + https://www.36taxi.com:2340 - + www.tlzxled.com - + MCU Uploading - + Traffic screen settings - + Setting protocol ... - + Set protocol - + Getting protocol ... - + Get protocol - - + + Port ポート - + Realtimer Server Address: Realtimerアドレス: - + Firmware Management ファームウェア管理 - + update or uninstall 更新またはアンインストール - + Clear クリア - + Check Apk APKを検出 - + Uninstall アンマウント - + Running check 運転状態モニタ - + Restart 再起動 - + Check Log ログを見る - + Start LedSet4 - + Open ADB ADBデバッグ機能を開く - + Post Custom JSON Post Custom JSON - - - - + + + - - + + + Clear Program 番組をクリア - + www.ledokcloud.com/realtime - + Config の設定 - + Refresh 更新 - + Restore to default 標準の値を復元 - + Taxi top screen configuration タクシートップ画面の設定 - - + + Service:High Out of service:Low 客がいます:高 客がいません:低 - - + + Service:Low Out of service:High 客がいます:低 客がいません:高 - + Binding *.ic account indentity voucher テーピングtaxihubプラットフォームのユーザーID証明書 - + Rotate 回転 - + Min brightness 最低輝度 - - - + + + Readback 読み戻し - + Send 送信 - + Max brightness 最高輝度 - - + + SetScreenSize スクリーンのピクセルサイズを設定 - - - - - + + + + + Success 成功 - + Compant ID: 会社ID: - + Compant ID 会社ID - + InputWebServerAddressTip Webサーバのアドレスを入力してください - + InputCompanyIdTip 会社IDを入力してください - + Do you want to modify webserveraddress and companyId? 設定サーバアドレスと会社IDを確認しますか? - - + + SetOnlineAddr ウェブサーバのアドレスを設定 - - + + ClearRealtimeServer クリア - - + + SetRealtimeServer RealTimerアドレスを設定 - + Tip Info ヒント - - + + RestartAndroid 再起動 - - + + running 実行中 - - + + no running 実行されていません - + Check Apk Version チェック APK バージョン - - + + UninstallSoftware アンマウント - - + + Check apk running status APK運転状態監視 - - + + OpenAdb ADBデバッグ機能を開く - + indentity voucher (*.ic) 身分証明書(*.ic) - - - - - + + + + + InvokeTaxiAppFunction 証明書をバインド - - + + AliIotSetting - + Software Version Info - + Package - + Version バージョン - - + + Package name is null パッケージ名は空です - + Clearing Program プログラムクリア - - - - + + + + Timeout タイムアウト - - - - + + + + Failed 失敗 - + Getting Log ログを取得中 - - - - - - - - - - - + + + + + + + + + + + + + Error エラー - + Setting Timing Reboot スケジュール再起動を設定中 - + Set Timing Reboot スケジュール再起動の設定 - + Getting Timing Reboot スケジュール再起動を取得中 - + Get Timing Reboot スケジュール再起動の取得 - + totalResolution トータル解像度 - + strCurDisplayResolution 表示解像度 - - + + File not exist ファイルが存在しません - - + + Getting Player State + プレーヤーの状態を取得しています + + + + + + Get Player State + プレーヤーの状態の取得 + + + + + Player State + プレーヤーの状態 + + + + Cannot Open File ファイルのオープンに失敗しました - + Uploading アップロード中 - + Update 更新 - - + + Set Display Mode - - + + Get Display Mode - - + + Set Screen Offset - - + + Get Screen Offset - + Open file Failed ファイルのオープンに失敗しました - + Setting Wallpaper - - + + Set Wallpaper - + System Updating - - + + System Update - + Getting MCU Version - - + + MCU Version - + Select File ファイルを選択 - + Setting player background - - + + Set player background - + Clearing player background - - - - - - - - + + + + + + + + Clear player background - - + + GetScreenRotation 画面回転の取得 - + Setting Baud Rate - + Set Baud Rate - + Getting Baud Rate - + Get Baud Rate - + Text is empty - + Json Parse Error - + Json isn't an Object - + Setting card work mode ... - + Set card work mode - + Getting card work mode ... - + Get card work mode - + Input password パスワードを入力 - + Change Password パスワード変更 - + Resolution Config 解像度設定 - + Full screen フルスクリーン - + Part セクション - + Display Mode 表示モード - + Screen Position - + Offset - + Hidden Settings - + Click right button to hide - - + + Update MCU - + Get MCU Version - + Baud Config - + Model - + Uart - + Baud - - - - - - - + + + + + + + Get 得る - + Timing Reboot スケジュール再起動 - + Protocol プロトコル - + Server サービス - + Client クライアント - - + + SetScreenRotation 画面の回転を設定する - - + + SetMinBrightness 最小輝度値を設定します - - + + SetMaxBrightness 輝度最大値を設定 - - + + GetMinBrightness 輝度最小値を取得 - - + + GetMaxBrightness 輝度最大値を取得 - - + + Card work mode - - + + SetSpecialResolution 解像度を設定 - - + + GetSpecialResolution 読み込み解像度 - - + + CleanDisplayScreenSize デフォルトの解像度を復元 - - + + SetHighForBusy 客レベルの設定 - - + + GetStateForBusy ゲストレベルを取得 - - + + SetCardAlias エイリアスの設定 - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + Tip 提示 - - - - - - - - - - + + + + + + + + + + - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + NoSelectedController 先に大きいスクリーンを選んでください - + InputWidthTip 正しい幅のピクセル値を入力してください - + InputHeightTip 正しい高さのピクセル値を入力してください - + Password is error パスワード @@ -3087,8 +3109,8 @@ デバイス応答 - - + + @@ -3160,237 +3182,237 @@ DevicePanel - + All トータル トータル - + Online オンライン中 - + Refresh 更新 更新 - - + + Specify IP 指定IP 指定IP - - - - + + + + Current Screen 現在のスクリーン - - + + none なし - + Current Brightness 現在の明るさ - + Android Version Androidバージョン - + FPGA Version FPGAバージョン - + Brightness Level 輝度レベル - + Android OS Resolution Androidの解像度 - + Firmware Version ファームウェアバージョン - - - - + + + + Player Version プレーヤーファームウェアバージョン - + Detail Info 詳細 - + Getting - + Specify IP list 指定 IP リスト - + Search 検索 - - + + Attention 注意 - - + + Please input IP address! IPアドレスを入力してください! - + Cancel キャンセル - + Screen ID ターミナルID - + Screen IP ターミナルIP - + Screen Size スクリーンサイズ - - Remark Name + + Alias 別名 - + readback pic 読み戻し - + On オン - + Off オフ - + Brightness Adj. 輝度設定 - + Power Control 電源コントロール - + Net Config ネット配置 - + Time Sync タイマ配置 - + Video source ビデオソース - + Password ひそかに言う - + Advanced 上級パラメータ - + Volume Adj. 音量調節 - + Test テスト - - + + Multi screen operation マルチスクリーン操作 - - + + selected num 選択された数 - - + + Clear クリア - + More Info 詳細 - + Screen Brightness 画面の明るさ - + Power Status 画面切り替えステータス - + Security 暗号化 @@ -4618,50 +4640,50 @@ MainWindow - + Language 言語 - + Help ヘルプ - + Check for updates アップデートをチェック - + firmware manager ファームウェア管理 - + Preferences プリファレンス設定 - + Info 情報 - + About 当ソフトウェアについて - + Setting 設置 @@ -4753,27 +4775,27 @@ エラー - + Device 端末管理 - + Program コンテンツ管理 - + Control ターミナルコントロール - + Lora Screen - + Check card ワンタッチ修復 @@ -5010,12 +5032,12 @@ PlayerBackSendThread - + Open file failed ファイルのオープンに失敗しました - + Read file failed ファイルの読み込みに失敗しました @@ -5375,8 +5397,8 @@ - Usb playback - USBメモリで再生する + USB Update + USB更新 @@ -5452,16 +5474,10 @@ password is wrong パスワードエラー - - - - ExportButtonTip - USBメモリで再生する - - Usb upgrade program - Uディスク更新プログラム + USB Update Program + USB更新プログラム @@ -5490,12 +5506,6 @@ please select usb device in list リスト内のUSBデバイスを選択してください - - - - SendButtonTip - 転送 - SendProgThread @@ -5541,7 +5551,7 @@ - Remark Name + Alias 別名 @@ -5603,12 +5613,12 @@ アップグレード - + Uninstall アンマウント - + check running state 運転状態を検出 @@ -5618,98 +5628,98 @@ FPGAファイルを選択 - + Installing インストール中 - + Refresh 更新 - + Cancel キャンセル - + Screen ID ターミナルID - - Remark Name + + Alias 別名 - + Online オンライン中 - + Screen IP ターミナルIP - + Security 暗号化 - + Progress 程度 - + xixunplayer - + cardsystem - + taxiapp - + starter - + connection - + displayer - + FPGA FPGA - + update - + State 状態 - - + + All トータル @@ -5752,7 +5762,7 @@ - + Tip 提示 @@ -5768,98 +5778,98 @@ - + Downloading Online File オンラインファイルをダウンロード中 - - + + Error エラー - + Online file is empty オンラインファイルが空です - + Uploading アップロード中 - + Upload error アップロード エラー - + Don't power off during this process アップグレード中は電源を切らないでください - + Install error インストール エラー - + Install success インストールに成功しました - + Reminder ヒント - + Reminder: Uninstalling this program may cause the device to offline, cannot be found, lost configs and have a black screen. Please uninstall with caution! ヒント:このプログラムをアンインストールすると、プラットフォームがオフラインになり、デバイスが見つかりません。構成パラメータが失われ、黒画面の問題が発生します。慎重にアンインストールしてください。 - + Do you want to continue? 続行しますか? - + Uninstalling アンマウント中 - + Uninstall error アンインストール エラー - + Uninstall success アンインストールに成功しました - + Check apk running status APK運転状態監視 - + Check error チェック エラー - + Running 実行中 - + Not running 実行されていません - + The encrypted control card can be upgraded directly 暗号化されたコントロールカードを直接アップグレードすることができます diff --git a/LedOK/translations/app_zh_CN.ts b/LedOK/translations/app_zh_CN.ts index 105ce8c..ff7d310 100644 --- a/LedOK/translations/app_zh_CN.ts +++ b/LedOK/translations/app_zh_CN.ts @@ -56,975 +56,997 @@ CtrlAdvancedPanel - + Advanced 高级设置 - + Screen Width(pixel) 屏幕宽(像素) - + Width - - + + Height - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Set 设置 - + Alias 别名 - + Web Server Address: Web服务器地址: - + www.m2mled.net - + www.ledaips.com - + https://www.taxihub.cn:2340 - + https://www.ledaips.com:2340 - + https://www.36taxi.com:2340 - + www.tlzxled.com - + MCU Uploading 正在上传单片机 - + Traffic screen settings 交通屏设置 - + Setting protocol ... 正在设置协议 ... - + Set protocol 设置协议 - + Getting protocol ... 正在回读协议 ... - + Get protocol 回读协议 - - + + Port 端口 - + Realtimer Server Address: Realtimer地址: - + Firmware Management 固件管理 - + update or uninstall 更新或卸载 - + Clear 清空 - + Check Apk 检查Apk - + Uninstall 卸载 - + Running check 运行状态监测 - + Restart 重启 - + Check Log 查看日志 - + Start LedSet4 使用 LedSet4.0 配置LED模组(Apk Display2.0以上版本) - + Open ADB 打开ADB调试功能 - + Post Custom JSON Post Custom JSON - - - - + + + - - + + + Clear Program 清除节目 - + www.ledokcloud.com/realtime - + Config 配置 - + Refresh 刷新 - + Restore to default 恢复默认值 - + Taxi top screen configuration 车顶有无客电平配置 - - + + Service:High Out of service:Low 有客:高电平 无客:低电平 - - + + Service:Low Out of service:High 有客:低电平 无客:高电平 - + Binding *.ic account indentity voucher 绑定taxihub平台用户身份凭证 - + Rotate 旋转 - + Min brightness 最低亮度 - - - + + + Readback 回读 - + Send 发送 - + Max brightness 最高亮度 - - + + SetScreenSize 设置屏幕像素尺寸 - - - - - + + + + + Success 成功 - + Compant ID: 公司ID: - + Compant ID 公司ID - + InputWebServerAddressTip 请输入Web服务器地址 - + InputCompanyIdTip 请输入公司ID - + Do you want to modify webserveraddress and companyId? 是否确认配置服务器地址和公司ID? - - + + SetOnlineAddr 设置web服务器地址 - - + + ClearRealtimeServer 清除 - - + + SetRealtimeServer 设置RealTimer地址 - + Tip Info 提示 - - + + RestartAndroid 重启 - - + + running 正在运行 - - + + no running 没有运行 - + Check Apk Version 查询已安装apk版本 - - + + UninstallSoftware 卸载 - - + + Check apk running status 监测APK运行状态 - - + + OpenAdb 打开ADB调试功能 - + indentity voucher (*.ic) 身份凭证(*.ic) - - - - - + + + + + InvokeTaxiAppFunction 绑定证书 - - + + AliIotSetting - + Software Version Info 软件版本信息 - + Package 包名 - + Version 版本 - - + + Package name is null 包名为空 - + Clearing Program 正在清除节目 - - - - + + + + Timeout 超时 - - - - + + + + Failed 失败 - + Getting Log 正在获取日志 - - - - - - - - - - - + + + + + + + + + + + + + Error 错误 - + Setting Timing Reboot 正在设置定时重启 - + Set Timing Reboot 设置定时重启 - + Getting Timing Reboot 正在获取定时重启 - + Get Timing Reboot 获取定时重启 - + totalResolution 包括行场数的分辨率 - + strCurDisplayResolution 当前显示屏分辨率 - - + + File not exist 文件不存在 - - + + Getting Player State + 正在获取播放器状态 + + + + + + Get Player State + 获取播放器状态 + + + + + Player State + 播放器状态 + + + + Cannot Open File 文件打开失败 - + Uploading 正在上传 - + Update 更新 - - + + Set Display Mode 设置显示模式 - - + + Get Display Mode 获取显示模式 - - + + Set Screen Offset 设置屏幕偏移 - - + + Get Screen Offset 获取屏幕偏移 - + Open file Failed 文件打开失败 - + Setting Wallpaper 正在设置系统桌面背景 - - + + Set Wallpaper 设置系统桌面背景 - + System Updating 系统升级中 - - + + System Update 系统升级 - + Getting MCU Version 正在获取单片机版本 - - + + MCU Version 单片机版本 - + Select File 选择文件 - + Setting player background 正在设置播放器背景 - - + + Set player background 设置播放器背景 - + Clearing player background 正在清除播放器背景 - - - - - - - - + + + + + + + + Clear player background 清除播放器背景 - - + + GetScreenRotation 获取屏幕旋转 - + Setting Baud Rate 正在设置波特率 - + Set Baud Rate 设置波特率 - + Getting Baud Rate 正在获取波特率 - + Get Baud Rate 获取波特率 - + Text is empty 文本为空 - + Json Parse Error - + Json isn't an Object - + Setting card work mode ... 正在设置控制卡工作模式 ... - + Set card work mode 设置控制卡工作模式 - + Getting card work mode ... 正在回读控制卡工作模式 ... - + Get card work mode 回读控制卡工作模式 - + Input password 输入密码 - + Change Password 修改密码 - + Resolution Config 分辨率配置 - + Full screen 全屏 - + Part 局部 - + Display Mode 显示模式 - + Screen Position 屏幕位置 - + Offset 偏移 - + Hidden Settings 隐藏的设置 - + Click right button to hide 点击右键隐藏 - - + + Update MCU 更新单片机 - + Get MCU Version 获取单片机版本 - + Baud Config 波特率配置 - + Model 设备型号 - + Uart 串口节点 - + Baud 波特率 - - - - - - - + + + + + + + Get 获取 - + Timing Reboot 定时重启 - + Protocol 协议 - + Server 服务端 - + Client 客户端 - - + + SetScreenRotation 设置屏幕旋转 - - + + SetMinBrightness 设置最小的亮度值 - - + + SetMaxBrightness 设置亮度最大值 - - + + GetMinBrightness 获取亮度最小值 - - + + GetMaxBrightness 获取亮度最大值 - - + + Card work mode 控制卡工作模式 - - + + SetSpecialResolution 设置分辨率 - - + + GetSpecialResolution 读取分辨率 - - + + CleanDisplayScreenSize 恢复默认分辨率 - - + + SetHighForBusy 设置有无客电平 - - + + GetStateForBusy 获取有无客电平 - - + + SetCardAlias 设置别名 - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + Tip 提示 - - - - - - - - - - + + + + + + + + + + - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + NoSelectedController 请先选择大屏幕 - + InputWidthTip 请输入正确的宽度像素值 - + InputHeightTip 请输入正确的高度像素值 - + Password is error 密码错误 @@ -3087,8 +3109,8 @@ 设备回复 - - + + @@ -3160,238 +3182,238 @@ DevicePanel - + All 总数 总数 - + Online 在线 在线 - + Refresh 刷新 刷新 - - - - + + + + Current Screen 当前屏幕 - - + + none - - + + Specify IP 指定IP 指定IP - + Current Brightness 当前亮度 - + Android Version 安卓版本 - + FPGA Version FPGA版本 - + Brightness Level 亮度等级 - + Android OS Resolution 安卓分辨率 - + Firmware Version 固件版本 - - - - + + + + Player Version 播放器固件版本 - + Detail Info 详细信息 - + Getting 正在获取 - + Specify IP list 指定IP列表 - + Search 搜索 - - + + Attention 注意 - - + + Please input IP address! 请输入IP地址! - + Cancel 取消 - + Screen ID 屏幕ID - + Screen IP 屏幕IP - + Screen Size 屏幕像素 - - Remark Name + + Alias 别名 - + readback pic 回读画面 - + On - + Off - + Brightness Adj. 亮度调节 - + Power Control 电源控制 - + Net Config 网络配置 - + Time Sync 对时管理 - + Video source 同异步配置 - + Password 设置密码 - + Advanced 高级设置 - + Volume Adj. 音量调节 - + Test 测试 - - + + Multi screen operation 多屏操作 - - + + selected num 选中数目 - - + + Clear 清空 - + More Info 详细信息 - + Screen Brightness 屏幕亮度 - + Power Status 屏幕开关状态 - + Security 加密 @@ -4619,50 +4641,50 @@ MainWindow - + Language 语言 - + Help 帮助 - + Check for updates 检查更新 - + firmware manager 固件管理 - + Preferences 偏好设置 - + Info 信息 - + About 关于 - + Setting 设置 @@ -4754,27 +4776,27 @@ 错误 - + Device 设备管理 - + Program 节目管理 - + Control 终端控制 - + Lora Screen 光影屏 - + Check card 一键找卡 @@ -5011,12 +5033,12 @@ PlayerBackSendThread - + Open file failed 文件读取失败 - + Read file failed 文件读取失败 @@ -5376,8 +5398,8 @@ - Usb playback - U盘更新 + USB Update + USB更新 @@ -5453,16 +5475,10 @@ password is wrong 密码错误 - - - - ExportButtonTip - U盘播放 - - Usb upgrade program - U盘更新节目 + USB Update Program + USB更新节目 @@ -5491,12 +5507,6 @@ please select usb device in list 请在列表中选择usb设备 - - - - SendButtonTip - 发布 - SendProgThread @@ -5542,7 +5552,7 @@ - Remark Name + Alias 别名 @@ -5604,12 +5614,12 @@ 升级 - + Uninstall 卸载 - + check running state 检测运行状态 @@ -5619,98 +5629,98 @@ 选择FPGA文件 - + Installing 正在安装 - + Refresh 刷新 - + Cancel 取消 - + Screen ID 屏幕ID - - Remark Name + + Alias 别名 - + Online 在线 - + Screen IP 屏幕IP - + Security 加密 - + Progress 进度 - + xixunplayer - + cardsystem - + taxiapp - + starter - + connection - + displayer - + FPGA FPGA - + update 更新 - + State 状态 - - + + All 总数 @@ -5753,7 +5763,7 @@ - + Tip 提示 @@ -5769,98 +5779,98 @@ - + Downloading Online File 正在下载在线文件 - - + + Error 错误 - + Online file is empty 在线文件为空 - + Uploading 正在上传 - + Upload error 上传错误 - + Don't power off during this process 升级过程中请勿断电 - + Install error 安装错误 - + Install success 安装成功 - + Reminder 提示 - + Reminder: Uninstalling this program may cause the device to offline, cannot be found, lost configs and have a black screen. Please uninstall with caution! 提示:卸载此程序会导致平台掉线,找不到设备,配置参数丢失和黑屏问题,请谨慎卸载! - + Do you want to continue? 是否继续? - + Uninstalling 正在卸载 - + Uninstall error 卸载错误 - + Uninstall success 卸载成功 - + Check apk running status 监测APK运行状态 - + Check error 检查错误 - + Running 正在运行 - + Not running 没有运行 - + The encrypted control card can be upgraded directly 加密控制卡可以直接升级 diff --git a/LedOK/translations/app_zh_TW.ts b/LedOK/translations/app_zh_TW.ts index efa6ec8..95c18c5 100644 --- a/LedOK/translations/app_zh_TW.ts +++ b/LedOK/translations/app_zh_TW.ts @@ -56,975 +56,997 @@ CtrlAdvancedPanel - + Advanced 高級設定 - + Screen Width(pixel) 螢幕寬(點數) - + Width - - + + Height - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Set 設定 - + Alias 別名 - + Web Server Address: Web伺服器地址: - + www.m2mled.net - + www.ledaips.com - + https://www.taxihub.cn:2340 - + https://www.ledaips.com:2340 - + https://www.36taxi.com:2340 - + www.tlzxled.com - + MCU Uploading 正在上傳單片機 - + Traffic screen settings 交通屏設定 - + Setting protocol ... 正在設定協定 - + Set protocol 設定協定 - + Getting protocol ... 正在回讀協定 ... - + Get protocol 回讀協定 - - + + Port - + Realtimer Server Address: Realtimer地址: - + Firmware Management 固件管理 - + update or uninstall 更新或卸載 - + Clear 清空 - + Check Apk 檢查Apk - + Uninstall 卸載 - + Running check 運行狀態監測 - + Restart 重啓 - + Check Log 查看日誌 - + Start LedSet4 - + Open ADB 打開ADB調試功能 - + Post Custom JSON Post Custom JSON - - - - + + + - - + + + Clear Program 清除節目 - + www.ledokcloud.com/realtime - + Config 配寘 - + Refresh 檢測 - + Restore to default 恢復預設值 - + Taxi top screen configuration 車頂有無客電平配寘 - - + + Service:High Out of service:Low 有客:高電平無客:低電平 - - + + Service:Low Out of service:High 有客:低電平 無客:高電平 - + Binding *.ic account indentity voucher 綁定taxihub平臺用戶身份憑證 - + Rotate 旋轉 - + Min brightness 最低亮度 - - - + + + Readback 回讀 - + Send 發送 - + Max brightness 最高亮度 - - + + SetScreenSize 設定螢幕點數尺寸 - - - - - + + + + + Success 成功 - + Compant ID: 公司ID: - + Compant ID 公司ID - - - - - - - - - - + + + + + + + + + + - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + NoSelectedController 請先選擇大螢幕 - + InputWebServerAddressTip 請輸入Web伺服器地址 - + InputCompanyIdTip 請輸入公司ID - + Do you want to modify webserveraddress and companyId? 是否確認配寘伺服器地址和公司ID? - - + + SetOnlineAddr 設定web伺服器地址 - - + + ClearRealtimeServer 清除 - - + + SetRealtimeServer 設定RealTimer地址 - + Tip Info 提示 - - + + RestartAndroid 重啓 - - + + running 正在運行 - - + + no running 沒有運行 - + Check Apk Version 査詢已安裝apk版本 - - + + UninstallSoftware 卸載 - - + + Check apk running status 監測APK運行狀態 - - + + OpenAdb 打開ADB調試功能 - + indentity voucher (*.ic) 身份憑證(*.ic) - - - - - + + + + + InvokeTaxiAppFunction 綁定證書 - - + + AliIotSetting - + Software Version Info 軟體版本資訊 - + Package 包名 - + Version 版本 - - + + Package name is null 包名為空 - + Clearing Program 正在清除節目 - - - - + + + + Timeout 超時 - - - - + + + + Failed 失敗 - + Getting Log 讀取日誌 - - - - - - - - - - - + + + + + + + + + + + + + Error 錯誤 - + Setting Timing Reboot 正在設定定時重啓 - + Set Timing Reboot 設定定時重啓 - + Getting Timing Reboot 正在獲取定時重啓 - + Get Timing Reboot 獲取定時重啓 - + totalResolution 行数を含む解像度 - + strCurDisplayResolution 當前顯示分辯率 - - + + File not exist 檔案不存在 - - + + Getting Player State + 正在獲取播放機狀態 + + + + + + Get Player State + 獲取播放機狀態 + + + + + Player State + 播放機狀態 + + + + Cannot Open File 檔案打開失敗 - + Uploading 正在上傳 - + Update 更新 - - + + Set Display Mode 設定顯示模式 - - + + Get Display Mode 獲取顯示模式 - - + + Set Screen Offset 設定螢幕偏移 - - + + Get Screen Offset 獲取螢幕偏移 - + Open file Failed 檔案打開失敗 - + Setting Wallpaper 正在設定系統桌面背景 - - + + Set Wallpaper 設定系統桌面背景 - + System Updating 系統升級中 - - + + System Update 系統升級 - + Getting MCU Version 正在獲取單片機版本 - - + + MCU Version 單片機版本 - + Select File 選擇檔案 - + Setting player background 正在設定播放機背景 - - + + Set player background 設定播放機背景 - + Clearing player background 正在清除播放機背景 - - - - - - - - + + + + + + + + Clear player background 清除播放機背景 - - + + GetScreenRotation 獲取荧幕旋轉 - + Setting Baud Rate 正在設定串列傳輸速率 - + Set Baud Rate 設定串列傳輸速率 - + Getting Baud Rate 正在讀取串列傳輸速率 - + Get Baud Rate 讀取串列傳輸速率 - + Text is empty - + Json Parse Error - + Json isn't an Object - + Setting card work mode ... 正在設定控制卡工作模式 ... - + Set card work mode 設定控制卡工作模式 - + Getting card work mode ... 正在回讀控制卡工作模式 ... - + Get card work mode 回讀控制卡工作模式 - + Input password 輸入密碼 - + Change Password 修改密碼 - + Resolution Config 分辯率配寘 - + Full screen 全屏 - + Part 局部 - + Display Mode 顯示模式 - + Screen Position 螢幕位置 - + Offset 偏移 - + Hidden Settings 隱藏的設定 - + Click right button to hide 點擊右鍵隱藏 - - + + Update MCU 更新單片機 - + Get MCU Version 獲取單片機版本 - + Baud Config 串列傳輸速率配寘 - + Model 設備型號 - + Uart 串口節點 - + Baud 串列傳輸速率 - - - - - - - + + + + + + + Get 讀取 - + Timing Reboot 定時重啓 - + Protocol 協定 - + Server 服務端 - + Client 用戶端 - - + + SetScreenRotation 設定螢幕旋轉 - - + + SetMinBrightness 設定最小的亮度值 - - + + SetMaxBrightness 設定亮度最大值 - - + + GetMinBrightness 獲取亮度最小值 - - + + GetMaxBrightness 獲取亮度最大值 - - + + Card work mode 控制卡工作模式 - - + + SetSpecialResolution 設定分辯率 - - + + GetSpecialResolution 讀取分辯率 - - + + CleanDisplayScreenSize 恢復默認分辯率 - - + + SetHighForBusy 設定有無客電平 - - + + GetStateForBusy 獲取有無客電平 - - + + SetCardAlias 設定別名 - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + Tip 提示 - + InputWidthTip 請輸入正確的寬度點數值 - + InputHeightTip 請輸入正確的高度點數值 - + Password is error 密碼錯誤 @@ -3092,8 +3114,8 @@ 設備回復 - - + + @@ -3165,236 +3187,236 @@ DevicePanel - + All 總數 - + Online 在线 線上 - + Refresh 檢測 - - + + Specify IP 指定IP 指定IP - - - - + + + + Current Screen 当前屏幕 - - + + none - + Current Brightness 當前亮度 - + Android Version 安卓版本 - + FPGA Version FPGA版本 - + Brightness Level 亮度等級 - + Android OS Resolution 安卓分辯率 - + Firmware Version 固件版本 - - - - + + + + Player Version 播放機固件版本 - + Detail Info 詳細資訊 - + Getting 正在獲取 - + Specify IP list 指定IP清單 - + Search 蒐索 - - + + Attention 注意 - - + + Please input IP address! 請輸入IP地址! - + Cancel 取消 - + Screen ID 螢幕ID - + Screen IP 螢幕IP - + Screen Size 螢幕點數 - - Remark Name + + Alias 別名 - + readback pic 回讀畫面 - + On - + Off - + Brightness Adj. 亮度調節 - + Power Control 電源控制 - + Net Config 網絡配寘 - + Time Sync 對時管理 - + Video source 同異步配寘 - + Password 設寘密碼 - + Advanced 高級設定 - + Volume Adj. 音量調節 - + Test 測試 - - + + Multi screen operation 多屏操作 - - + + selected num 選中數目 - - + + Clear 清空 - + More Info 詳細資訊 - + Screen Brightness 螢幕亮度 - + Power Status 螢幕開關狀態 - + Security 加密 @@ -4622,50 +4644,50 @@ MainWindow - + Language 語言 - + Help 幫助 - + Check for updates 檢查更新 - + firmware manager 固件管理 - + Preferences 偏好設定 - + Info 資訊 - + About 關於 - + Setting 設定 @@ -4757,27 +4779,27 @@ 錯誤 - + Device 設備管理 - + Program 節目管理 - + Control 終端控制 - + Lora Screen 光影屏 - + Check card 一鍵找卡 @@ -5014,12 +5036,12 @@ PlayerBackSendThread - + Open file failed 檔案打開失敗 - + Read file failed 檔案讀取失敗 @@ -5379,8 +5401,8 @@ - Usb playback - U盤更新 + USB Update + USB更新 @@ -5456,16 +5478,10 @@ password is wrong 密碼錯誤 - - - - ExportButtonTip - U盤播放 - - Usb upgrade program - U盘更新节目 + USB Update Program + USB更新節目 @@ -5494,12 +5510,6 @@ please select usb device in list 請在清單中選擇usb設備 - - - - SendButtonTip - 發佈 - SendProgThread @@ -5545,7 +5555,7 @@ - Remark Name + Alias 別名 @@ -5607,12 +5617,12 @@ 陞級 - + Uninstall 卸載 - + check running state 檢測運行狀態 @@ -5622,98 +5632,98 @@ 選擇FPGA檔案 - + Installing 正在安裝 - + Refresh 檢測 - + Cancel 取消 - + Screen ID 螢幕ID - - Remark Name + + Alias 別名 - + Online 線上 - + Screen IP 螢幕IP - + Security 加密 - + Progress 進度 - + xixunplayer - + cardsystem - + taxiapp - + starter - + connection - + displayer - + FPGA FPGA - + update 更新 - + State 陳述 - - + + All 總數 @@ -5756,7 +5766,7 @@ - + Tip 提示 @@ -5772,98 +5782,98 @@ - + Downloading Online File 正在下載線上檔案 - - + + Error 錯誤 - + Online file is empty 線上檔案為空 - + Uploading - + Upload error 上傳錯誤 - + Don't power off during this process 陞級過程中請勿斷電 - + Install error 安裝錯誤 - + Install success 安裝成功 - + Reminder 提示 - + Reminder: Uninstalling this program may cause the device to offline, cannot be found, lost configs and have a black screen. Please uninstall with caution! 提示:卸載此程式會導致平臺掉線,找不到設備,配寘參數遺失和黑屏問題,請謹慎卸載! - + Do you want to continue? 是否繼續? - + Uninstalling 正在卸載 - + Uninstall error 卸載錯誤 - + Uninstall success 卸載成功 - + Check apk running status 監測APK運行狀態 - + Check error 檢查錯誤 - + Running 正在運行 - + Not running 沒有運行 - + The encrypted control card can be upgraded directly 加密控制卡可以直接陞級