summaryrefslogtreecommitdiffstats
path: root/smglobals.cpp
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-08-26 20:35:23 +0200
committerArno <arno@disconnect.de>2018-08-26 20:35:23 +0200
commit68ee6a0ec973940eb4f799b00f6518a902cbc4e5 (patch)
tree41ddac1434482ae0a20686c8bc8c8231bf9aed36 /smglobals.cpp
parent1aebcdcc41d60f891a12b70584d3ceb833d5bfdc (diff)
downloadSheMov-68ee6a0ec973940eb4f799b00f6518a902cbc4e5.tar.gz
SheMov-68ee6a0ec973940eb4f799b00f6518a902cbc4e5.tar.bz2
SheMov-68ee6a0ec973940eb4f799b00f6518a902cbc4e5.zip
Implement custom Video player
Well, well, well. Due to several unforseen circumstances I ventured into the sources again and implemented a Video player with Qt. Looks very promising so far. There are some bugs to weed out, but I'm getting there...
Diffstat (limited to 'smglobals.cpp')
-rw-r--r--smglobals.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/smglobals.cpp b/smglobals.cpp
index 7a909b6..278772e 100644
--- a/smglobals.cpp
+++ b/smglobals.cpp
@@ -13,6 +13,7 @@
#include "mappingtablemodel.h"
#include "mappingtreemodel.h"
#include "pictureviewer2.h"
+#include "videoviewer.h"
#include "picfilesmodel.h"
#include "configurationdialog.h"
#include "archivebrowsermodel.h"
@@ -24,9 +25,12 @@
SmGlobals *SmGlobals::mInstance = nullptr;
SmGlobals::~SmGlobals(){
- foreach(QAbstractItemModel *model, mModels.values()){
+ for(QAbstractItemModel *model : mModels.values()){
model->deleteLater();
}
+ for(QWidget *w : mWidgets){
+ w->close();
+ }
}
SmGlobals *SmGlobals::instance(){
@@ -99,6 +103,14 @@ PictureViewer2 *SmGlobals::pictureViewer() {
return mPictureViewer;
}
+VideoViewer *SmGlobals::videoViewer() {
+ if(!mVideoViewer){
+ mVideoViewer = new VideoViewer;
+ mVideoViewer->setHidden(true);
+ }
+ return mVideoViewer;
+}
+
QSize SmGlobals::cursorSize() {
if(!mCursorSize.isValid()){
Display *dpy = XOpenDisplay(nullptr);
@@ -117,7 +129,7 @@ QIcon SmGlobals::iconFor(const QString &type){
return retval;
}
-SmGlobals::SmGlobals() : mPictureViewer(nullptr), mArchiveController(nullptr){
+SmGlobals::SmGlobals() : mPictureViewer(nullptr), mVideoViewer(nullptr), mArchiveController(nullptr){
mIcons.insert("Dildo", ":/dildo.png");
mIcons.insert("Dick to left", ":/back_dick.png");
mIcons.insert("Dick pointing up", ":/up_dick.png");
@@ -158,14 +170,6 @@ SmGlobals::SmGlobals() : mPictureViewer(nullptr), mArchiveController(nullptr){
mReencReasons = s.value("ui/reasons").toStringList();
}
-void SmGlobals::registerWidget(const QString &name, QWidget *w){
- mWidgets.insert(name, w);
-}
-
-QWidget *SmGlobals::getRegisteredWidget(const QString &name){
- return mWidgets.value(name);
-}
-
void SmGlobals::setReencReasons(const QStringList reasons){
mReencReasons = reasons;
std::sort(mReencReasons.begin(), mReencReasons.end());