fixed the filepicker dialog and started a window file
This commit is contained in:
parent
7545f05724
commit
366660dcb2
7 changed files with 71 additions and 48 deletions
12
TODO.org
12
TODO.org
|
@ -1,11 +1,16 @@
|
||||||
#+TITLE: Todo List
|
#+TITLE: Todo List
|
||||||
* Inbox
|
* Inbox
|
||||||
** TODO Fix file dialog using basic QT theme
|
** TODO Fix possible bug in arrangingItems in draghandler
|
||||||
[[file:~/dev/church-presenter/src/qml/presenter/SongEditor.qml::FileDialog {]]
|
[[file:~/dev/church-presenter/src/qml/presenter/DragHandle.qml::function arrangeItem() {]]
|
||||||
|
** TODO [#A] Make Presentation Window follow the presenter component
|
||||||
|
[[file:~/dev/church-presenter/src/qml/presenter/MainWindow.qml::Presenter.Slide {]]
|
||||||
|
|
||||||
** TODO Make toolbar functional for songeditor
|
** TODO Make toolbar functional for songeditor
|
||||||
[[file:~/dev/church-presenter/src/qml/presenter/SongEditor.qml::Controls.ToolBar {]]
|
[[file:~/dev/church-presenter/src/qml/presenter/SongEditor.qml::Controls.ToolBar {]]
|
||||||
|
|
||||||
** TODO Finish toolbar
|
** TODO Finish toolbar
|
||||||
[[file:~/dev/church-presenter/src/qml/presenter/Presentation.qml::Controls.ToolBar {]]
|
[[file:~/dev/church-presenter/src/qml/presenter/Presentation.qml::Controls.ToolBar {]]
|
||||||
|
|
||||||
** TODO Find a way to maths the textsize
|
** TODO Find a way to maths the textsize
|
||||||
[[file:~/dev/church-presenter/src/qml/presenter/Slide.qml::property real textSize: 50]]
|
[[file:~/dev/church-presenter/src/qml/presenter/Slide.qml::property real textSize: 50]]
|
||||||
|
|
||||||
|
@ -25,3 +30,6 @@
|
||||||
** DONE Parse Lyrics to create a list of strings for slides
|
** DONE Parse Lyrics to create a list of strings for slides
|
||||||
SCHEDULED: <2022-03-23 Wed 10:00>
|
SCHEDULED: <2022-03-23 Wed 10:00>
|
||||||
|
|
||||||
|
** DONE Fix file dialog using basic QT theme
|
||||||
|
[[file:~/dev/church-presenter/src/qml/presenter/SongEditor.qml::FileDialog {]]
|
||||||
|
|
||||||
|
|
14
src/main.cpp
14
src/main.cpp
|
@ -22,10 +22,13 @@
|
||||||
|
|
||||||
#include <QtQuick/QQuickWindow>
|
#include <QtQuick/QQuickWindow>
|
||||||
#include <QtQuick/QQuickView>
|
#include <QtQuick/QQuickView>
|
||||||
|
#include <qapplication.h>
|
||||||
|
#include <qcoreapplication.h>
|
||||||
#include <qdir.h>
|
#include <qdir.h>
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
#include <qguiapplication.h>
|
#include <qguiapplication.h>
|
||||||
#include <qqml.h>
|
#include <qqml.h>
|
||||||
|
#include <qquickstyle.h>
|
||||||
#include <qsqldatabase.h>
|
#include <qsqldatabase.h>
|
||||||
#include <qsqlquery.h>
|
#include <qsqlquery.h>
|
||||||
#include <qstringliteral.h>
|
#include <qstringliteral.h>
|
||||||
|
@ -67,17 +70,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);
|
||||||
QGuiApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
KLocalizedString::setApplicationDomain("presenter");
|
KLocalizedString::setApplicationDomain("librepresenter");
|
||||||
QCoreApplication::setOrganizationName(QStringLiteral("presenter"));
|
QCoreApplication::setOrganizationName(QStringLiteral("librepresenter"));
|
||||||
QCoreApplication::setOrganizationDomain(QStringLiteral("tfcconnection.org"));
|
QCoreApplication::setOrganizationDomain(QStringLiteral("tfcconnection.org"));
|
||||||
QCoreApplication::setApplicationName(QStringLiteral("Church Presenter"));
|
QCoreApplication::setApplicationName(QStringLiteral("Libre Presenter"));
|
||||||
|
|
||||||
#ifdef Q_OS_WINDOWS
|
#ifdef Q_OS_WINDOWS
|
||||||
QIcon::setFallbackThemeName("breeze");
|
QIcon::setFallbackThemeName("breeze");
|
||||||
QQuickStyle::setStyle(QStringLiteral("org.kde.breeze"));
|
QQuickStyle::setStyle(QStringLiteral("org.kde.breeze"));
|
||||||
|
QApplication::setStyle(QStringLiteral("breeze"));
|
||||||
#else
|
#else
|
||||||
|
QIcon::setFallbackThemeName("breeze");
|
||||||
QQuickStyle::setStyle(QStringLiteral("org.kde.desktop"));
|
QQuickStyle::setStyle(QStringLiteral("org.kde.desktop"));
|
||||||
|
QQuickStyle::setFallbackStyle(QStringLiteral("breeze"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QGuiApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("system-config-display")));
|
QGuiApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("system-config-display")));
|
||||||
|
|
|
@ -108,7 +108,12 @@ ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
listItem: serviceItem
|
listItem: serviceItem
|
||||||
listView: serviceItemList
|
listView: serviceItemList
|
||||||
onMoveRequested: serviceItemModel.move(oldIndex, newIndex)
|
onMoveRequested: {
|
||||||
|
print(oldIndex, newIndex);
|
||||||
|
serviceItemModel.move(oldIndex, newIndex);
|
||||||
|
}
|
||||||
|
onDropped: {
|
||||||
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
serviceItemList.currentIndex = index;
|
serviceItemList.currentIndex = index;
|
||||||
changeServiceItem(index);
|
changeServiceItem(index);
|
||||||
|
|
|
@ -90,35 +90,7 @@ Controls.Page {
|
||||||
Loader {
|
Loader {
|
||||||
id: presentLoader
|
id: presentLoader
|
||||||
active: presenting
|
active: presenting
|
||||||
sourceComponent: presentWindowComp
|
source: "PresentationWindow.qml"
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: presentWindowComp
|
|
||||||
Window {
|
|
||||||
id: presentationWindow
|
|
||||||
title: "presentation-window"
|
|
||||||
height: maximumHeight
|
|
||||||
width: maximumWidth
|
|
||||||
screen: presentationScreen
|
|
||||||
flags: Qt.X11BypassWindowManagerHint
|
|
||||||
onClosing: presenting = false
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
presentationWindow.showFullScreen();
|
|
||||||
print(screen.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
Presenter.Slide {
|
|
||||||
id: presentationSlide
|
|
||||||
anchors.fill: parent
|
|
||||||
imageSource: imageBackground
|
|
||||||
videoSource: videoBackground
|
|
||||||
text: ""
|
|
||||||
|
|
||||||
Component.onCompleted: slideItem = presentationSlide
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SongSqlModel {
|
SongSqlModel {
|
||||||
|
|
33
src/qml/presenter/PresentationWindow.qml
Normal file
33
src/qml/presenter/PresentationWindow.qml
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
import QtQuick 2.13
|
||||||
|
import QtQuick.Dialogs 1.0
|
||||||
|
import QtQuick.Controls 2.15 as Controls
|
||||||
|
import QtQuick.Window 2.13
|
||||||
|
import QtQuick.Layouts 1.2
|
||||||
|
import org.kde.kirigami 2.13 as Kirigami
|
||||||
|
import "./" as Presenter
|
||||||
|
import org.presenter 1.0
|
||||||
|
|
||||||
|
Window {
|
||||||
|
id: presentationWindow
|
||||||
|
title: "presentation-window"
|
||||||
|
height: maximumHeight
|
||||||
|
width: maximumWidth
|
||||||
|
screen: presentationScreen
|
||||||
|
/* flags: Qt.X11BypassWindowManagerHint */
|
||||||
|
onClosing: presenting = false
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
presentationWindow.showFullScreen();
|
||||||
|
print(screen.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
Presenter.Slide {
|
||||||
|
id: presentationSlide
|
||||||
|
anchors.fill: parent
|
||||||
|
imageSource: imageBackground
|
||||||
|
videoSource: videoBackground
|
||||||
|
text: ""
|
||||||
|
|
||||||
|
Component.onCompleted: slideItem = presentationSlide
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
import QtQuick 2.13
|
import QtQuick 2.13
|
||||||
import QtQuick.Controls 2.15 as Controls
|
import QtQuick.Controls 2.15 as Controls
|
||||||
|
import Qt.labs.platform 1.1 as Labs
|
||||||
import QtQuick.Dialogs 1.3
|
import QtQuick.Dialogs 1.3
|
||||||
import QtQuick.Layouts 1.2
|
import QtQuick.Layouts 1.2
|
||||||
import org.kde.kirigami 2.13 as Kirigami
|
import org.kde.kirigami 2.13 as Kirigami
|
||||||
|
|
|
@ -174,17 +174,15 @@ void ServiceItemModel::removeItem(int index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ServiceItemModel::move(int sourceIndex, int destIndex) {
|
bool ServiceItemModel::move(int sourceIndex, int destIndex) {
|
||||||
qDebug() << "starting move";
|
qDebug() << "starting move of: " << "source: " << sourceIndex << "dest: " << destIndex;
|
||||||
|
qDebug() << index(sourceIndex).row();
|
||||||
|
qDebug() << index(destIndex).row();
|
||||||
QModelIndex parent = index(sourceIndex).parent();
|
QModelIndex parent = index(sourceIndex).parent();
|
||||||
bool begsuc = beginMoveRows(parent, sourceIndex, sourceIndex, parent, destIndex);
|
// bool begsuc = beginMoveRows(parent, sourceIndex, sourceIndex, parent, destIndex);
|
||||||
qDebug() << begsuc;
|
beginResetModel();
|
||||||
if (!begsuc) {
|
m_items.move(sourceIndex, destIndex);
|
||||||
qDebug() << "Failed to start moving rows";
|
// endMoveRows();
|
||||||
m_items.move(sourceIndex, destIndex);
|
endResetModel();
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// bool success = moveRow(index(sourceIndex).parent(), sourceIndex, index(destIndex).parent(), destIndex);
|
|
||||||
endMoveRows();
|
|
||||||
// qDebug() << success;
|
// qDebug() << success;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -192,11 +190,11 @@ bool ServiceItemModel::move(int sourceIndex, int destIndex) {
|
||||||
QVariantMap ServiceItemModel::getItem(int index) const {
|
QVariantMap ServiceItemModel::getItem(int index) const {
|
||||||
QVariantMap data;
|
QVariantMap data;
|
||||||
const QModelIndex idx = this->index(index,0);
|
const QModelIndex idx = this->index(index,0);
|
||||||
qDebug() << idx;
|
// qDebug() << idx;
|
||||||
if( !idx.isValid() )
|
if( !idx.isValid() )
|
||||||
return data;
|
return data;
|
||||||
const QHash<int,QByteArray> rn = roleNames();
|
const QHash<int,QByteArray> rn = roleNames();
|
||||||
qDebug() << rn;
|
// qDebug() << rn;
|
||||||
QHashIterator<int,QByteArray> it(rn);
|
QHashIterator<int,QByteArray> it(rn);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
it.next();
|
it.next();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue