diff --git a/LedOK/LedOK.pro b/LedOK/LedOK.pro index 4a5337a..c1f6456 100644 --- a/LedOK/LedOK.pro +++ b/LedOK/LedOK.pro @@ -260,9 +260,10 @@ LIBS += -L$$PWD/ffmpeg-mac/lib/\ -lswresample \ -lswscale -copy.files += $$files(ffmpeg-mac/lib/*.dylib) +//copy.files += $$files(ffmpeg-mac/lib/*.dylib) +copy.files += ffmpeg-mac/bin/ffmpeg copy.path = Contents/MacOS copydir.path = Contents/MacOS -#QMAKE_BUNDLE_DATA += copy +QMAKE_BUNDLE_DATA += copy QMAKE_BUNDLE_DATA += copydir } diff --git a/LedOK/device/ctrladvancedpanel.cpp b/LedOK/device/ctrladvancedpanel.cpp index 1e26ad9..3516f8b 100644 --- a/LedOK/device/ctrladvancedpanel.cpp +++ b/LedOK/device/ctrladvancedpanel.cpp @@ -297,7 +297,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { fdPkg->clear(); auto apps = json["apps"].toArray(); auto infoDlg = new QDialog(this); + infoDlg->setAttribute(Qt::WA_DeleteOnClose); +#ifdef Q_OS_WIN infoDlg->setWindowFlag(Qt::WindowContextHelpButtonHint, false); +#endif infoDlg->resize(500, 500); infoDlg->setWindowTitle(tr("Software Version Info")); auto vBox = new QVBoxLayout(infoDlg); @@ -320,6 +323,8 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { if(! (packageName.endsWith(".cardsystem") || packageName.endsWith(".systemcore") || packageName.endsWith(".update"))) fdPkg->addItem(packageName); } infoDlg->show(); + infoDlg->raise(); + infoDlg->activateWindow(); }); }); hBox->addWidget(btnApkCheck); diff --git a/LedOK/player/elevideo.cpp b/LedOK/player/elevideo.cpp index b77272c..7975dc1 100644 --- a/LedOK/player/elevideo.cpp +++ b/LedOK/player/elevideo.cpp @@ -1,5 +1,4 @@ #include "elevideo.h" -#include "tools.h" #include #include #include diff --git a/LedOK/program/evideo.cpp b/LedOK/program/evideo.cpp index 0277c26..9988360 100644 --- a/LedOK/program/evideo.cpp +++ b/LedOK/program/evideo.cpp @@ -23,7 +23,7 @@ EVideo *EVideo::create(const QString &file, PageListItem *pageItem, EBase *multi } QFileInfo rawInfo(file); QString rawName = rawInfo.fileName(); - QString outFile = transcoding(file, rawName, pageItem->mPageDir, img.width(), img.height(), codecId); + QString outFile = transcoding(pageItem->listWidget(), file, rawName, pageItem->mPageDir, img.width(), img.height(), codecId); if(outFile.isEmpty()) return 0; QFileInfo outInfo(outFile); if(! outInfo.isFile() || outInfo.size()==0) return 0; @@ -188,7 +188,7 @@ QWidget* EVideo::attrWgt() { fdFileName->setText(mRawName); playDuration = dur/1000000; fdDuration->setValue(playDuration); - QString outFile = transcoding(rawFile, mRawName, mPageItem->mPageDir, mCoverImg.width(), mCoverImg.height(), codecId); + QString outFile = transcoding(wgtAttr, rawFile, mRawName, mPageItem->mPageDir, mCoverImg.width(), mCoverImg.height(), codecId); if(outFile.isEmpty()) return; QFile oldfile(mDir+"/"+mName); if(oldfile.exists()) oldfile.remove(); @@ -263,7 +263,7 @@ QJsonObject EVideo::attrJson() const { return oRoot; } -QString EVideo::transcoding(QString rawFile, QString rawName, QString dir, int w, int h, AVCodecID codec_id) { +QString EVideo::transcoding(QWidget *parent, QString rawFile, QString rawName, QString dir, int w, int h, AVCodecID codec_id) { QSettings settings; int rawMax = qMax(w, h); if(settings.value("VideoCompress", true).toBool() && rawMax > 1360 && (w > gProgItem->mWidth || h > gProgItem->mHeight)) { @@ -280,7 +280,7 @@ QString EVideo::transcoding(QString rawFile, QString rawName, QString dir, int w QProcess process; process.setWorkingDirectory(QApplication::applicationDirPath()); - QMessageBox msgBox; + QMessageBox msgBox(parent); msgBox.setWindowFlag(Qt::WindowCloseButtonHint, false); msgBox.setStandardButtons(QMessageBox::NoButton); msgBox.setWindowTitle(tr("Video Transcoding")); @@ -288,9 +288,9 @@ QString EVideo::transcoding(QString rawFile, QString rawName, QString dir, int w connect(&process, (void(QProcess::*)(int, QProcess::ExitStatus))&QProcess::finished, &msgBox, [&msgBox] { msgBox.accept(); }); - connect(&process, &QProcess::errorOccurred, &msgBox, [&msgBox](QProcess::ProcessError error) { + connect(&process, &QProcess::errorOccurred, &msgBox, [=, &msgBox](QProcess::ProcessError error) { msgBox.accept(); - QMessageBox::critical(0, tr("Error"), QString(QMetaEnum::fromType().valueToKey(error))+" ("+QString::number(error)+")"); + QMessageBox::critical(parent, tr("Error"), QString(QMetaEnum::fromType().valueToKey(error))+" ("+QString::number(error)+")"); }); connect(&process, &QProcess::readyReadStandardOutput, &msgBox, [&process] { auto data = process.readAllStandardOutput(); @@ -318,7 +318,7 @@ QString EVideo::transcoding(QString rawFile, QString rawName, QString dir, int w process.start("ffmpeg", {"-y", "-i", rawFile, "-vcodec", "h264", "-s", QString::number(w)+"x"+QString::number(h), "-profile:v", "main", "-b:v", QString::number(w*h/150)+"k", outFile}); msgBox.exec(); if(err.rightRef(32).contains("Conversion failed!")) { - QMessageBox::critical(0, tr("Error"), err); + QMessageBox::critical(parent, tr("Error"), err); return ""; } return outFile; diff --git a/LedOK/program/evideo.h b/LedOK/program/evideo.h index 76dab35..63da6ca 100644 --- a/LedOK/program/evideo.h +++ b/LedOK/program/evideo.h @@ -18,7 +18,7 @@ public: static const QImage mask = QImage(":/res/video-pre.png"); return mask; } - static QString transcoding(QString rawFile, QString rawName, QString dir, int rawW, int rawH, AVCodecID codec_id); + static QString transcoding(QWidget *parent, QString rawFile, QString rawName, QString dir, int rawW, int rawH, AVCodecID codec_id); static EVideo *create(const QString &file, PageListItem *pageItem, EBase *multiWin = nullptr); static EVideo *create(const QJsonObject &, PageListItem *pageItem, EBase *multiWin = nullptr); static QJsonObject genProg(const QJsonObject &, const QString &, ProgItem *mProgItem); diff --git a/LedOK/translations/app_en.qm b/LedOK/translations/app_en.qm index 7b1a785..502f7b9 100644 Binary files a/LedOK/translations/app_en.qm and b/LedOK/translations/app_en.qm differ diff --git a/LedOK/translations/app_ja.qm b/LedOK/translations/app_ja.qm index f214706..6fba7ee 100644 Binary files a/LedOK/translations/app_ja.qm and b/LedOK/translations/app_ja.qm differ diff --git a/LedOK/translations/app_zh_CN.qm b/LedOK/translations/app_zh_CN.qm index 9b8c6dc..5c084d6 100644 Binary files a/LedOK/translations/app_zh_CN.qm and b/LedOK/translations/app_zh_CN.qm differ diff --git a/LedOK/translations/app_zh_TW.qm b/LedOK/translations/app_zh_TW.qm index 2e903b1..d8946d3 100644 Binary files a/LedOK/translations/app_zh_TW.qm and b/LedOK/translations/app_zh_TW.qm differ