diff --git a/LedOK/ffplayer.h b/LedOK/ffplayer.h index 0ae80b5..4e81888 100644 --- a/LedOK/ffplayer.h +++ b/LedOK/ffplayer.h @@ -154,6 +154,7 @@ public: avcodec_free_context(&ctx); } }; +class FFPlayer; class AVFmt { friend class FFPlayer; public: diff --git a/LedOK/player/elescroll.cpp b/LedOK/player/elescroll.cpp index f7920b9..a844a1e 100644 --- a/LedOK/player/elescroll.cpp +++ b/LedOK/player/elescroll.cpp @@ -53,7 +53,7 @@ void EleScroll::paintEvent(QPaintEvent *e) { } while(x < rect.right()+1); } else if(effect=='r') { int x = cur + w; - boolean con1; + bool con1; do { x -= img.width(); con1 = x > rect.left()-img.width(); @@ -67,7 +67,7 @@ void EleScroll::paintEvent(QPaintEvent *e) { } while(y < rect.bottom()+1); } else if(effect=='b') { int y = cur + h; - boolean con1; + bool con1; do { y -= img.height(); con1 = y > rect.top()-img.height(); diff --git a/LedOK/player/playwin.h b/LedOK/player/playwin.h index 053fbe8..4fe6d8d 100644 --- a/LedOK/player/playwin.h +++ b/LedOK/player/playwin.h @@ -200,7 +200,7 @@ struct Page { } } }; - +class QOpenGLWidget; class PlayWin : public QWidget { Q_OBJECT public: diff --git a/LedOK/progpanel.cpp b/LedOK/progpanel.cpp index fe44448..de5b285 100644 --- a/LedOK/progpanel.cpp +++ b/LedOK/progpanel.cpp @@ -2,7 +2,6 @@ #include "program/progitem.h" #include "main.h" #include "gutil/qgui.h" -#include "cfg.h" #include "player/playwin.h" #include "program/progeditorwin.h" #include "program/copydirthread.h" @@ -247,7 +246,8 @@ ProgPanel::ProgPanel(QWidget *parent) : QWidget(parent) { auto act = new QAction("Open folder"); menu->addAction(act); connect(act, &QAction::triggered, this, [=] { - QProcess::execute("explorer", {((ProgItem*)item)->mProgDir.replace('/', '\\')}); + //QProcess::execute("explorer", {((ProgItem*)item)->mProgDir.replace('/', '\\')}); + QProcess::execute("open", {"-R", ((ProgItem*)item)->mProgDir}); }); menu->exec(QCursor::pos()+QPoint{2,2}); } diff --git a/LedOK/program/eaclock.cpp b/LedOK/program/eaclock.cpp index e3a25bb..bcbe799 100644 --- a/LedOK/program/eaclock.cpp +++ b/LedOK/program/eaclock.cpp @@ -1,6 +1,4 @@ #include "eaclock.h" -#include "QtWidgets/qgraphicsscene.h" -#include "cfg.h" #include "main.h" #include "gutil/qgui.h" #include "tools.h" @@ -251,7 +249,7 @@ QWidget* EAClock::attrWgt() { auto btnSelImg = new QPushButton(tr("Select")); btnSelImg->setProperty("ssType", "progManageTool"); connect(btnSelImg, &QPushButton::clicked, wgtAttr, [=] { - QString fileName = QFileDialog::getOpenFileName(wgtAttr, tr("Select Dail file"), "./AClock/", "Dail files(*.png)"); + QString fileName = QFileDialog::getOpenFileName(wgtAttr, tr("Select Dail file"), QApplication::applicationDirPath()+"/AClock/", "Dail files(*.png)"); if(fileName.isEmpty()) return; fdDialImg->setText(fileName); QFileInfo info(fileName); diff --git a/LedOK/program/ebase.cpp b/LedOK/program/ebase.cpp index f72c237..088b0f4 100644 --- a/LedOK/program/ebase.cpp +++ b/LedOK/program/ebase.cpp @@ -20,11 +20,11 @@ int borderImgMaxWidth = 0; int borderImgMaxHeight = 0; struct Initer { Initer() { - auto names = QDir("borders").entryList(QDir::Files); + auto names = QDir(QApplication::applicationDirPath()+"/borders").entryList(QDir::Files); for(auto &name : names) { BorderImg bdImg; bdImg.name = name; - bdImg.img = QPixmap("borders/"+bdImg.name); + bdImg.img = QPixmap(QApplication::applicationDirPath()+"/borders/"+bdImg.name); borderImgs.append(bdImg); if(bdImg.img.width() > borderImgMaxWidth) borderImgMaxWidth = bdImg.img.width(); if(bdImg.img.height() > borderImgMaxHeight) borderImgMaxHeight = bdImg.img.height(); diff --git a/LedOK/program/egif.cpp b/LedOK/program/egif.cpp index f4eda32..4ea6586 100644 --- a/LedOK/program/egif.cpp +++ b/LedOK/program/egif.cpp @@ -1,5 +1,4 @@ #include "egif.h" -#include "cfg.h" #include "tools.h" #include "main.h" #include diff --git a/LedOK/program/ephoto.cpp b/LedOK/program/ephoto.cpp index 59df031..dae115e 100644 --- a/LedOK/program/ephoto.cpp +++ b/LedOK/program/ephoto.cpp @@ -1,5 +1,4 @@ #include "ephoto.h" -#include "cfg.h" #include "tools.h" #include "main.h" #include diff --git a/LedOK/program/gentmpthread.cpp b/LedOK/program/gentmpthread.cpp index 55c8824..19b03d0 100644 --- a/LedOK/program/gentmpthread.cpp +++ b/LedOK/program/gentmpthread.cpp @@ -154,7 +154,7 @@ JObj GenTmpThread::cvtPage(const JObj &pageJson) { JObj layer{{"repeat", sourceRepeat}, {"sources", sources}}; auto border = ele["border"].toString(); if(! border.isEmpty()) { - auto bdSrc = "borders/"+border; + auto bdSrc = QApplication::applicationDirPath()+"/borders/"+border; auto id = Tools::fileMd5(bdSrc); QFile::copy(bdSrc, dstDir+"/"+id); auto borderSize = ele["borderSize"]; diff --git a/LedOK/program/pagelistitem.cpp b/LedOK/program/pagelistitem.cpp index 655d54d..b465a84 100644 --- a/LedOK/program/pagelistitem.cpp +++ b/LedOK/program/pagelistitem.cpp @@ -3,7 +3,6 @@ #include "gutil/qgui.h" #include "base/ffutil.h" #include "base/lodateselector.h" -#include "cfg.h" #include "program/eaclock.h" #include "program/ebase.h" #include "program/edclock.h" diff --git a/LedOK/program/progeditorwin.cpp b/LedOK/program/progeditorwin.cpp index 5f44576..789e01b 100644 --- a/LedOK/program/progeditorwin.cpp +++ b/LedOK/program/progeditorwin.cpp @@ -1,5 +1,4 @@ #include "progeditorwin.h" -#include "cfg.h" #include "ebase.h" #include "pagelistitem.h" #include "player/playwin.h" @@ -196,7 +195,7 @@ ProgEditorWin::ProgEditorWin(ProgItem *progItem, QWidget *parent) : QWidget(pare toolBar->addAction(action); action = new QAction(QIcon(":/res/program/demo-video.png"), tr("Demos")); connect(action, &QAction::triggered, this, [this] { - auto file = QFileDialog::getOpenFileName(this, tr("Open Demo"), "Demos"); + auto file = QFileDialog::getOpenFileName(this, tr("Open Demo"), QApplication::applicationDirPath()+"/Demos"); if(file.isEmpty()) return; auto scene = mPageEditor->graphicsView->scene(); if(scene==0) return; diff --git a/LedOK/program/sendprogramdialog.cpp b/LedOK/program/sendprogramdialog.cpp index f9c4602..ff4c604 100644 --- a/LedOK/program/sendprogramdialog.cpp +++ b/LedOK/program/sendprogramdialog.cpp @@ -1,5 +1,4 @@ #include "sendprogramdialog.h" -#include "cfg.h" #include "sendprogthread.h" #include "deviceitem.h" #include "devicepanel.h"