Screens work and the beginnings of a settings module
This commit is contained in:
parent
9882a0a289
commit
fab9f86b41
6 changed files with 67 additions and 32 deletions
13
src/main.cpp
13
src/main.cpp
|
@ -16,6 +16,7 @@
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QOpenGLContext>
|
#include <QOpenGLContext>
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
|
#include <QQuickStyle>
|
||||||
|
|
||||||
#include <QtGui/QOpenGLFramebufferObject>
|
#include <QtGui/QOpenGLFramebufferObject>
|
||||||
|
|
||||||
|
@ -23,9 +24,11 @@
|
||||||
#include <QtQuick/QQuickView>
|
#include <QtQuick/QQuickView>
|
||||||
#include <qdir.h>
|
#include <qdir.h>
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
|
#include <qguiapplication.h>
|
||||||
#include <qqml.h>
|
#include <qqml.h>
|
||||||
#include <qsqldatabase.h>
|
#include <qsqldatabase.h>
|
||||||
#include <qsqlquery.h>
|
#include <qsqlquery.h>
|
||||||
|
#include <qstringliteral.h>
|
||||||
|
|
||||||
#include "songlistmodel.h"
|
#include "songlistmodel.h"
|
||||||
#include "mpv/mpvobject.h"
|
#include "mpv/mpvobject.h"
|
||||||
|
@ -62,12 +65,20 @@ static void connectToDatabase() {
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
QApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
KLocalizedString::setApplicationDomain("presenter");
|
KLocalizedString::setApplicationDomain("presenter");
|
||||||
QCoreApplication::setOrganizationName(QStringLiteral("presenter"));
|
QCoreApplication::setOrganizationName(QStringLiteral("presenter"));
|
||||||
QCoreApplication::setOrganizationDomain(QStringLiteral("tfcconnection.org"));
|
QCoreApplication::setOrganizationDomain(QStringLiteral("tfcconnection.org"));
|
||||||
QCoreApplication::setApplicationName(QStringLiteral("Church Presenter"));
|
QCoreApplication::setApplicationName(QStringLiteral("Church Presenter"));
|
||||||
|
|
||||||
|
#ifdef Q_OS_WINDOWS
|
||||||
|
QIcon::setFallbackThemeName("breeze");
|
||||||
|
QQuickStyle::setStyle(QStringLiteral("org.kde.breeze"));
|
||||||
|
#else
|
||||||
|
QQuickStyle::setStyle(QStringLiteral("org.kde.desktop"));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QGuiApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("system-config-display")));
|
||||||
// apparently mpv needs this class set
|
// apparently mpv needs this class set
|
||||||
std::setlocale(LC_NUMERIC, "C");
|
std::setlocale(LC_NUMERIC, "C");
|
||||||
qmlRegisterType<MpvObject>("mpv", 1, 0, "MpvObject");
|
qmlRegisterType<MpvObject>("mpv", 1, 0, "MpvObject");
|
||||||
|
|
|
@ -88,6 +88,11 @@ Kirigami.ApplicationWindow {
|
||||||
libraryOpen = !libraryOpen
|
libraryOpen = !libraryOpen
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function togglePresenting() {
|
||||||
|
presenting = !presenting
|
||||||
|
mainPage.present(presenting);
|
||||||
|
}
|
||||||
|
|
||||||
function openSettings() {
|
function openSettings() {
|
||||||
settingsSheet.open()
|
settingsSheet.open()
|
||||||
}
|
}
|
||||||
|
@ -96,12 +101,15 @@ Kirigami.ApplicationWindow {
|
||||||
/* showPassiveNotification(Kirigami.Settings.style); */
|
/* showPassiveNotification(Kirigami.Settings.style); */
|
||||||
/* Kirigami.Settings.style = "Plasma"; */
|
/* Kirigami.Settings.style = "Plasma"; */
|
||||||
/* showPassiveNotification(Kirigami.Settings.style); */
|
/* showPassiveNotification(Kirigami.Settings.style); */
|
||||||
print(Qt.platform.os);
|
print("OS is: " + Qt.platform.os);
|
||||||
print("checking screens");
|
/* print("checking screens"); */
|
||||||
print("Present Mode is " + presenting);
|
print("Present Mode is " + presenting);
|
||||||
|
/* print(Qt.application.state); */
|
||||||
screens = Qt.application.screens;
|
screens = Qt.application.screens;
|
||||||
|
presentationScreen = screens[1]
|
||||||
for (let i = 0; i < screens.length; i++) {
|
for (let i = 0; i < screens.length; i++) {
|
||||||
print(screens[i].name);
|
/* print(screens[i]); */
|
||||||
|
/* print(screens[i].name); */
|
||||||
screenModel.append({
|
screenModel.append({
|
||||||
"name": screens[i].name,
|
"name": screens[i].name,
|
||||||
"width": (screens[i].width * screens[i].devicePixelRatio),
|
"width": (screens[i].width * screens[i].devicePixelRatio),
|
||||||
|
@ -109,19 +117,23 @@ Kirigami.ApplicationWindow {
|
||||||
"pixeldensity": screens[i].pixelDensity,
|
"pixeldensity": screens[i].pixelDensity,
|
||||||
"pixelratio": screens[i].devicePixelRatio
|
"pixelratio": screens[i].devicePixelRatio
|
||||||
})
|
})
|
||||||
print("width of screen: " + (screens[i].width * screens[i].devicePixelRatio));
|
/* print("width of screen: " + (screens[i].width * screens[i].devicePixelRatio)); */
|
||||||
print("height of screen: " + (screens[i].height * screens[i].devicePixelRatio));
|
/* print("height of screen: " + (screens[i].height * screens[i].devicePixelRatio)); */
|
||||||
print("pixeldensity of screen: " + screens[i].pixelDensity);
|
/* print("pixeldensity of screen: " + screens[i].pixelDensity); */
|
||||||
print("pixelratio of screen: " + screens[i].devicePixelRatio);
|
/* print("pixelratio of screen: " + screens[i].devicePixelRatio); */
|
||||||
|
if (i == 0)
|
||||||
|
print("Current Screens available: ");
|
||||||
|
print(screenModel.get(i).name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Presenter.Settings {
|
|
||||||
id: settingsSheet
|
|
||||||
model: screenModel
|
|
||||||
}
|
|
||||||
|
|
||||||
ListModel {
|
ListModel {
|
||||||
id: screenModel
|
id: screenModel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Presenter.Settings {
|
||||||
|
id: settingsSheet
|
||||||
|
theModel: screenModel
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,8 @@ Kirigami.ActionToolBar {
|
||||||
icon.name: "view-presentation"
|
icon.name: "view-presentation"
|
||||||
text: presenting ? "Presenting" : "Go Live"
|
text: presenting ? "Presenting" : "Go Live"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
print("Window is loading")
|
print("Window is loading");
|
||||||
presenting = true
|
togglePresenting();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -161,8 +161,11 @@ ColumnLayout {
|
||||||
background: "file:/home/chris/nextcloud/tfc/openlp/videos/test.mp4"
|
background: "file:/home/chris/nextcloud/tfc/openlp/videos/test.mp4"
|
||||||
}
|
}
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "Marvelous Light"
|
name: "facebook"
|
||||||
type: "song"
|
type: "video"
|
||||||
|
text: ""
|
||||||
|
backgroundType: "video"
|
||||||
|
background: "file:/home/chris/nextcloud/tfc/videos/facebook-ukraine-vid.mkv"
|
||||||
}
|
}
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "10,000 Reason"
|
name: "10,000 Reason"
|
||||||
|
|
|
@ -28,12 +28,6 @@ Controls.Page {
|
||||||
property var song
|
property var song
|
||||||
property var draggedLibraryItem
|
property var draggedLibraryItem
|
||||||
|
|
||||||
signal songLyricsUpdated(string lyrics)
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
mainPage.songLyricsUpdated.connect(library.updateSongLyrics);
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: mainItem
|
id: mainItem
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -97,12 +91,13 @@ Controls.Page {
|
||||||
title: "presentation-window"
|
title: "presentation-window"
|
||||||
height: maximumHeight
|
height: maximumHeight
|
||||||
width: maximumWidth
|
width: maximumWidth
|
||||||
screen: screens[0]
|
screen: presentationScreen
|
||||||
|
flags: Qt.X11BypassWindowManagerHint
|
||||||
onClosing: presenting = false
|
onClosing: presenting = false
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
presentationWindow.showFullScreen();
|
presentationWindow.showFullScreen();
|
||||||
print(screens[1].name)
|
print(screen.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
Presenter.Slide {
|
Presenter.Slide {
|
||||||
|
@ -110,14 +105,14 @@ Controls.Page {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
imageSource: imageBackground
|
imageSource: imageBackground
|
||||||
videoSource: videoBackground
|
videoSource: videoBackground
|
||||||
text: "good"
|
text: ""
|
||||||
|
|
||||||
Component.onCompleted: slideItem = presentationSlide
|
Component.onCompleted: slideItem = presentationSlide
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FileDialog {
|
FileDialog {
|
||||||
id: videoFileDialog
|
id: videoFileDialog
|
||||||
title: "Please choose a background"
|
title: "Please choose a background"
|
||||||
|
@ -205,6 +200,13 @@ Controls.Page {
|
||||||
mainPageArea.pop(Controls.StackView.Immediate)
|
mainPageArea.pop(Controls.StackView.Immediate)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function present(present) {
|
||||||
|
if (present)
|
||||||
|
presentationWindow.showFullScreen();
|
||||||
|
else
|
||||||
|
presentationWindow.close();
|
||||||
|
}
|
||||||
|
|
||||||
function updateLyrics(lyrics) {
|
function updateLyrics(lyrics) {
|
||||||
songsqlmodel.updateLyrics(song, lyrics);
|
songsqlmodel.updateLyrics(song, lyrics);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,19 +8,26 @@ import org.presenter 1.0
|
||||||
|
|
||||||
Kirigami.OverlaySheet {
|
Kirigami.OverlaySheet {
|
||||||
|
|
||||||
property ListModel model
|
property ListModel theModel
|
||||||
|
|
||||||
id: root
|
id: root
|
||||||
header: Kirigami.Heading {
|
header: Kirigami.Heading {
|
||||||
text: "Settings"
|
text: "Settings"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Component.onCompleted: { */
|
||||||
|
/* showPassiveNotification(screenModel.get(1).name) */
|
||||||
|
/* } */
|
||||||
|
|
||||||
Kirigami.FormLayout {
|
Kirigami.FormLayout {
|
||||||
Controls.ComboBox {
|
Controls.ComboBox {
|
||||||
id: screenSelectionField
|
id: screenSelectionField
|
||||||
Kirigami.FormData.label: i18nc("@label:textbox", "Screen:")
|
Kirigami.FormData.label: i18nc("@label:textbox", "Presentation Screen:")
|
||||||
model: model
|
model: screens
|
||||||
textRole: name
|
textRole: "name"
|
||||||
onAccepted: descriptionField.forceActiveFocus()
|
onActivated: {
|
||||||
|
presentationScreen = screens[currentIndex];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Controls.TextField {
|
Controls.TextField {
|
||||||
id: descriptionField
|
id: descriptionField
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue