mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-26 04:33:06 +01:00
Add html support
This commit is contained in:
parent
544b603cfa
commit
d0219191c0
@ -240,6 +240,13 @@ ApplicationWindow {
|
||||
} else {
|
||||
sidebar.state = "activeScene"
|
||||
}
|
||||
} else if (type === "html") {
|
||||
if (sidebar.activeScreen == screenId
|
||||
&& sidebar.state == "activeScene") {
|
||||
sidebar.state = "inactive"
|
||||
} else {
|
||||
sidebar.state = "activeScene"
|
||||
}
|
||||
}
|
||||
sidebar.activeScreen = screenId
|
||||
sidebar.type = type
|
||||
|
@ -12,6 +12,8 @@ Item {
|
||||
state: "inactive"
|
||||
focus: true
|
||||
property real navHeight
|
||||
property string type
|
||||
property string activeScreen
|
||||
|
||||
MouseArea {
|
||||
id: mouseAreaHelper
|
||||
@ -19,7 +21,6 @@ Item {
|
||||
enabled: true
|
||||
}
|
||||
|
||||
property string activeScreen
|
||||
onActiveScreenChanged: {
|
||||
txtHeadline.text = installedListModel.get(activeScreen).screenTitle
|
||||
image.source = Qt.resolvedUrl(
|
||||
@ -28,9 +29,6 @@ Item {
|
||||
activeScreen).screenPreview)
|
||||
}
|
||||
|
||||
property string type
|
||||
|
||||
|
||||
Item {
|
||||
id: sidebarWrapper
|
||||
|
||||
@ -349,16 +347,18 @@ Item {
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
if (type === "video" || type === "qmlScene") {
|
||||
print(type + " "+activeScreen + " " + installedListModel.absoluteStoragePath+ "/" + activeScreen,
|
||||
installedListModel.get(
|
||||
activeScreen).screenPreview)
|
||||
if (type === "video" || type === "qmlScene" || type === "html") {
|
||||
screenPlay.createWallpaper(
|
||||
monitorSelection.activeMonitorIndex,
|
||||
installedListModel.absoluteStoragePath + "/" + activeScreen,
|
||||
monitorSelection.activeMonitorIndex, installedListModel.absoluteStoragePath + "/" + activeScreen,
|
||||
installedListModel.get(activeScreen).screenPreview,
|
||||
(Math.round(sliderVolume.value * 100) / 100),
|
||||
settingsComboBox.model.get(settingsComboBox.currentIndex).text.toString(),
|
||||
type)
|
||||
settingsComboBox.model.get(settingsComboBox.currentIndex).text.toString(
|
||||
), type)
|
||||
sidebar.state = "inactive"
|
||||
} else if (type === "widget") {
|
||||
} else if (type === "widget" ) {
|
||||
screenPlay.createWidget(
|
||||
installedListModel.absoluteStoragePath + "/" + activeScreen,
|
||||
installedListModel.get(
|
||||
|
@ -46,7 +46,7 @@ QVariant InstalledListModel::data(const QModelIndex& index, int role) const
|
||||
|
||||
QHash<int, QByteArray> InstalledListModel::roleNames() const
|
||||
{
|
||||
static const QHash<int, QByteArray> roles{
|
||||
static const QHash<int, QByteArray> roles {
|
||||
{ TitleRole, "screenTitle" },
|
||||
{ TypeRole, "screenType" },
|
||||
{ PreviewRole, "screenPreview" },
|
||||
@ -116,14 +116,14 @@ void InstalledListModel::loadScreens()
|
||||
continue;
|
||||
|
||||
//Some settings dont have a file type
|
||||
|
||||
QString fileEnding;
|
||||
if (obj.contains("file")) {
|
||||
fileEnding = obj.value("file").toString();
|
||||
if (!obj.contains("type")) {
|
||||
obj.insert("type", "video");
|
||||
}
|
||||
if (fileEnding.endsWith(".webm") || (obj.value("type").toString() == "qmlScene"))
|
||||
qDebug() << fileEnding << obj.value("type");
|
||||
if (fileEnding.endsWith(".webm") || (obj.value("type").toString() == "qmlScene") || fileEnding.endsWith(".html"))
|
||||
emit addInstalledItem(obj, item.baseName());
|
||||
}
|
||||
}
|
||||
|
@ -16,24 +16,24 @@ ProjectFile::ProjectFile(QJsonObject obj, QString folderName, QUrl absolutePath)
|
||||
m_title = obj.value("title");
|
||||
|
||||
if (obj.contains("type")) {
|
||||
QString tmp = obj.value("type").toString();
|
||||
tmp = tmp.toLower();
|
||||
QString tmp = obj.value("type").toString().toLower();
|
||||
if (tmp == "video") {
|
||||
m_type = "video";
|
||||
} else if (tmp == "qmlwidget" || tmp == "standalonewidget") {
|
||||
m_type = "widget";
|
||||
} else if (tmp == "qmlscene") {
|
||||
m_type = "qmlScene";
|
||||
} else if (tmp == "html") {
|
||||
m_type = "html";
|
||||
}
|
||||
}
|
||||
|
||||
if (obj.contains("workshopid")){
|
||||
if (obj.contains("workshopid")) {
|
||||
m_workshopID = obj.value("workshopid").toInt();
|
||||
} else {
|
||||
m_workshopID = 0;
|
||||
}
|
||||
|
||||
|
||||
m_absoluteStoragePath = QUrl(absolutePath.toString() + "/" + folderName);
|
||||
|
||||
m_folderId = folderName;
|
||||
@ -46,5 +46,3 @@ ProjectFile::ProjectFile()
|
||||
ProjectFile::~ProjectFile()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,13 +8,15 @@ Rectangle {
|
||||
Connections {
|
||||
target: mainwindow
|
||||
|
||||
onQmlExit:{
|
||||
onQmlExit: {
|
||||
|
||||
webView.runJavaScript(
|
||||
"var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.volume = 0;")
|
||||
mainwindow.destroyThis()
|
||||
}
|
||||
|
||||
onFillModeChanged: {
|
||||
|
||||
//TODO
|
||||
}
|
||||
|
||||
@ -70,6 +72,12 @@ Rectangle {
|
||||
webView.url = Qt.resolvedUrl(
|
||||
"file:///" + mainwindow.getApplicationPath(
|
||||
) + "/index.html")
|
||||
} else if (mainwindow.type === "html") {
|
||||
webView.visible = true
|
||||
webView.url = Qt.resolvedUrl(
|
||||
"file:///" + mainwindow.fullContentPath)
|
||||
mainwindow.init()
|
||||
timer.start()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,6 +66,10 @@ MainWindow::MainWindow(int i, QString projectPath, QString id, QString decoder,
|
||||
QString tmpPath = m_projectPath.toString() + "/" + m_projectFile;
|
||||
setFullContentPath(tmpPath);
|
||||
setType("qmlScene");
|
||||
} else if (m_project.value("type") == "html") {
|
||||
QString tmpPath = m_projectPath.toString() + "/" + m_projectFile;
|
||||
setFullContentPath(tmpPath);
|
||||
setType("html");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user