preferencesAboutTextFull
agriche 9 years ago
commit 411a09886a
  1. 10
      src/core/UBDisplayManager.cpp
  2. 3
      src/desktop/UBCustomCaptureWindow.cpp
  3. 2
      src/desktop/UBDesktopAnnotationController.cpp
  4. 50
      src/domain/UBGraphicsMediaItem.cpp
  5. 16
      src/domain/UBGraphicsMediaItem.h
  6. 2
      src/domain/UBGraphicsMediaItemDelegate.cpp
  7. 1
      src/frameworks/UBPlatformUtils.h
  8. 10
      src/frameworks/UBPlatformUtils_linux.cpp
  9. 79
      src/frameworks/UBPlatformUtils_mac.mm
  10. 7
      src/frameworks/UBPlatformUtils_win.cpp

@ -158,7 +158,7 @@ void UBDisplayManager::setDisplayWidget(QWidget* pDisplayWidget)
mDisplayWidget = pDisplayWidget;
mDisplayWidget->setGeometry(mDesktop->screenGeometry(mDisplayScreenIndex));
if (UBSettings::settings()->appUseMultiscreen->get().toBool())
mDisplayWidget->showFullScreen();
UBPlatformUtils::showFullScreen(mDisplayWidget);
}
}
@ -209,14 +209,14 @@ void UBDisplayManager::positionScreens()
{
mControlWidget->hide();
mControlWidget->setGeometry(mDesktop->screenGeometry(mControlScreenIndex));
mControlWidget->showFullScreen();
UBPlatformUtils::showFullScreen(mControlWidget);
}
if (mDisplayWidget && mDisplayScreenIndex > -1)
{
mDisplayWidget->hide();
mDisplayWidget->setGeometry(mDesktop->screenGeometry(mDisplayScreenIndex));
mDisplayWidget->showFullScreen();
UBPlatformUtils::showFullScreen(mDisplayWidget);
}
else if(mDisplayWidget)
{
@ -234,7 +234,7 @@ void UBDisplayManager::positionScreens()
{
QWidget* previous = mPreviousDisplayWidgets.at(psi);
previous->setGeometry(mDesktop->screenGeometry(mPreviousScreenIndexes.at(psi)));
previous->showFullScreen();
UBPlatformUtils::showFullScreen(previous);
}
}
@ -280,7 +280,7 @@ void UBDisplayManager::blackout()
foreach(UBBlackoutWidget *blackoutWidget, mBlackoutWidgets)
{
blackoutWidget->showFullScreen();
UBPlatformUtils::showFullScreen(blackoutWidget);
}
}

@ -30,6 +30,7 @@
#include "UBCustomCaptureWindow.h"
#include "frameworks/UBPlatformUtils.h"
#include "gui/UBRubberBand.h"
#include "core/memcheck.h"
@ -74,7 +75,7 @@ int UBCustomCaptureWindow::execute(const QPixmap &pScreenPixmap)
int currentScreen = desktop->screenNumber(QCursor::pos());
setGeometry(desktop->screenGeometry(currentScreen));
showFullScreen();
UBPlatformUtils::showFullScreen(this);
setWindowOpacity(1.0);
return exec();

@ -332,7 +332,7 @@ void UBDesktopAnnotationController::showWindow()
UBDrawingController::drawingController()->setStylusTool(mDesktopStylusTool);
#ifndef Q_OS_LINUX
mTransparentDrawingView->showFullScreen();
UBPlatformUtils::showFullScreen(mTransparentDrawingView);
#else
// this is necessary to avoid unity to hide the panels
mTransparentDrawingView->show();

@ -50,13 +50,8 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
update();
//mMediaObject = new Phonon::MediaObject(this);
mMediaObject = new QMediaPlayer(this);
//playlist = new QMediaPlaylist;
//mMediaObject->setPlaylist(playlist);
QString mediaPath = pMediaFileUrl.toString();
if ("" == mediaPath)
mediaPath = pMediaFileUrl.toLocalFile();
@ -65,50 +60,27 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
{
mMediaType = mediaType_Video;
//mAudioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this);
QAudioFormat format; // to define
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::UnSignedInt);
//mAudioOutput = new QAudioOutput(format, this);
mAudioOutput = new QMediaPlayer;
mMediaObject->setNotifyInterval(50);
//mMediaObject->setTickInterval(50);
mMediaObject->setPosition(50);
//mVideoWidget = new Phonon::VideoWidget(); // owned and destructed by the scene ...
mVideoWidget = new QVideoWidget(); // owned and destructed by the scene ...
//Phonon::createPath(mMediaObject, mVideoWidget);
mMediaObject->setVideoOutput(mVideoWidget);
if(mVideoWidget->sizeHint() == QSize(1,1)){
mVideoWidget->resize(320,240);
}
//mVideoWidget->setMinimumSize(140,26);
mVideoWidget->setMinimumSize(320,240);
haveLinkedImage = true;
// DEBUGGING VIDEO
//*****************
qDebug() << "UBGraphicsMediaItem.cpp:" << mVideoWidget << "setMinimumSize(140,26)" ;
}
else if (mediaPath.toLower().contains("audios"))
{
mMediaType = mediaType_Audio;
QAudioFormat format;
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::UnSignedInt);
// mAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
//mAudioOutput = new QMediaPlayer(format, this);
mAudioOutput = new QMediaPlayer;
//mMediaObject->setTickInterval(1000);
mMediaObject->setNotifyInterval(1000);
mAudioWidget = new QWidget();
mAudioWidget->resize(320,26);
mAudioWidget->setMinimumSize(150,26);
@ -116,10 +88,6 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
haveLinkedImage = false;
}
//Phonon::createPath(mMediaObject, mAudioOutput);
//mSource = Phonon::MediaSource(pMediaFileUrl);
//mMediaObject->setCurrentSource(mSource);
mMediaObject->setMedia(pMediaFileUrl);
@ -147,7 +115,7 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly
connect(Delegate(), SIGNAL(showOnDisplayChanged(bool)), this, SLOT(showOnDisplayChanged(bool)));
connect(mMediaObject, SIGNAL(hasVideoChanged(bool)), this, SLOT(hasMediaChanged(bool)));
connect(mMediaObject, SIGNAL(videoAvailableChanged(bool)), this, SLOT(hasMediaChanged(bool)));
}
@ -192,12 +160,8 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria
absoluteMediaFilename = mMediaFileUrl.toLocalFile();
if (absoluteMediaFilename.length() > 0)
//mMediaObject->setCurrentSource(QMediaSource(absoluteMediaFilename));
mMediaObject->setMedia(QUrl::fromLocalFile(absoluteMediaFilename));
}
}
@ -230,7 +194,7 @@ void UBGraphicsMediaItem::toggleMute()
void UBGraphicsMediaItem::setMute(bool bMute)
{
mMuted = bMute;
mAudioOutput->setMuted(mMuted);
mMediaObject->setMuted(mMuted);
mMutedByUserAction = mMuted;
sIsMutedByDefault = mMuted;
}
@ -240,7 +204,6 @@ void UBGraphicsMediaItem::hasMediaChanged(bool hasMedia)
{
if(hasMedia && mMediaObject->isSeekable())
{
//mMediaObject->seek(mInitialPos);
mMediaObject->setPosition(mInitialPos);
UBGraphicsMediaItemDelegate *med = dynamic_cast<UBGraphicsMediaItemDelegate *>(Delegate());
@ -268,12 +231,12 @@ void UBGraphicsMediaItem::showOnDisplayChanged(bool shown)
if (!shown)
{
mMuted = true;
mAudioOutput->setMuted(mMuted);
mMediaObject->setMuted(mMuted);
}
else if (!mMutedByUserAction)
{
mMuted = false;
mAudioOutput->setMuted(mMuted);
mMediaObject->setMuted(mMuted);
}
}
@ -357,7 +320,6 @@ void UBGraphicsMediaItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QPointF eventPos = mapFromScene( event->scenePos());
QPointF translation = eventPos - mouseMovePos;
//translate(translation.x(), translation.y());
setPos(translation.x(), translation.y());
}

@ -30,9 +30,6 @@
#include <QtWidgets/QGraphicsView>
#include "UBGraphicsProxyWidget.h"
//#include <phonon/AudioOutput>
//#include <phonon/MediaObject>
//#include <phonon/VideoWidget>
#include <QAudioOutput>
#include <QMediaObject>
@ -73,9 +70,7 @@ public:
virtual void mediaFileUrl(QUrl url){mMediaFileUrl=url;}
//Phonon::MediaObject* mediaObject() const
QMediaPlayer* mediaObject() const
{
return mMediaObject;
}
@ -92,9 +87,7 @@ public:
return mMuted;
}
// Phonon::VideoWidget* videoWidget() const
QVideoWidget* videoWidget() const
{
return mVideoWidget;
}
@ -129,17 +122,8 @@ protected:
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
virtual void clearSource();
//Phonon::MediaObject *mMediaObject;
//Phonon::VideoWidget *mVideoWidget;
//Phonon::AudioOutput *mAudioOutput;
//Phonon::MediaSource mSource;
QMediaPlayer *mMediaObject;
QMediaPlaylist *playlist;
QVideoWidget *mVideoWidget;
// QAudioOutput *mAudioOutput;
QMediaPlayer *mAudioOutput;
QMediaService *mSource;
QWidget *mAudioWidget;

@ -252,7 +252,7 @@ void UBGraphicsMediaItemDelegate::togglePlayPause()
media->play();
}
else if (media->error())
if (media->error())
qDebug() << "Error appeared." << media->errorString();
}

@ -204,6 +204,7 @@ public:
static QString urlFromClipboard();
static QStringList availableTranslations();
static void setFrontProcess();
static void showFullScreen(QWidget * pWidget);
#ifdef Q_OS_OSX
static void SetMacLocaleByIdentifier(const QString& id);

@ -31,7 +31,6 @@
#include <QApplication>
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include "frameworks/UBFileSystemUtils.h"
@ -430,7 +429,14 @@ QString UBPlatformUtils::urlFromClipboard()
return qsRet;
}
void UBPlatformUtils::setFrontProcess()
{
// not used in Linux
}
void UBPlatformUtils::showFullScreen(QWidget *pWidget)
{
pWidget->showFullScreen();
}

@ -65,7 +65,7 @@ void UBPlatformUtils::init()
//originalSetSystemUIMode = APEPatchCreate((const void *)SetSystemUIMode, (const void *)emptySetSystemUIMode);
setDesktopMode(false);
//setDesktopMode(false);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@ -93,20 +93,24 @@ void UBPlatformUtils::init()
void UBPlatformUtils::setDesktopMode(bool desktop)
{ /*
#ifndef OS_NEWER_THAN_OR_EQUAL_TO_1010
//OSStatus (*functor)(SystemUIMode, SystemUIOptions) = (OSStatus (*)(SystemUIMode, SystemUIOptions))originalSetSystemUIMode;
{
if (desktop)
{
functor(kUIModeNormal, 0);
//qDebug() << "setDesktopMode called. desktop = " << desktop;
@try {
// temporarily disabled due to bug: when switching to desktop mode (and calling this),
// openboard switches right back to the board mode. clicking again on desktop mode works.
/*if (desktop) {
[NSApp setPresentationOptions:NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationAutoHideDock];
}
else*/
[NSApp setPresentationOptions:NSApplicationPresentationHideMenuBar | NSApplicationPresentationHideDock];
}
else
{
functor(kUIModeAllHidden, 0);
@catch(NSException * exception) {
qDebug() << "Error setting presentation options";
}
#endif
*/
}
@ -533,29 +537,35 @@ QString UBPlatformUtils::urlFromClipboard()
void UBPlatformUtils::SetMacLocaleByIdentifier(const QString& id)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@autoreleasepool {
// convert id from QString to CFString
// TODO: clean this up
const QByteArray utf8 = id.toUtf8();
const char* cString = utf8.constData();
NSString * ns = [[NSString alloc] initWithUTF8String:cString];
const char * strName = id.toLatin1().data();
CFStringRef iName = (__bridge CFStringRef)ns;
CFStringRef iName = CFStringCreateWithCString(NULL, strName, kCFStringEncodingISOLatin1 );
CFStringRef keys[] = { kTISPropertyInputSourceCategory, kTISPropertyInputSourceID };
CFStringRef values[] = { kTISCategoryKeyboardInputSource, iName };
CFDictionaryRef dict = CFDictionaryCreate(NULL, (const void **)keys, (const void **)values, 2, NULL, NULL);
CFStringRef keys[] = { kTISPropertyInputSourceID };
CFStringRef values[] = { iName };
CFDictionaryRef dict = CFDictionaryCreate(NULL, (const void **)keys, (const void **)values, 1, NULL, NULL);
// get list of current enabled keyboard layouts. dict filters the list
CFArrayRef kbds = TISCreateInputSourceList(dict, true);
if (kbds!=NULL)
{
if (CFArrayGetCount(kbds)!=0)
{
// get list of current enabled keyboard layouts. dict filters the list
// false specifies that we search only through the active input sources
CFArrayRef kbds = TISCreateInputSourceList(dict, false);
if (kbds && CFArrayGetCount(kbds) == 0)
// if not found in the active sources, we search again through all sources installed
kbds = TISCreateInputSourceList(dict, true);
if (kbds && CFArrayGetCount(kbds)!=0) {
TISInputSourceRef klRef = (TISInputSourceRef)CFArrayGetValueAtIndex(kbds, 0);
if (klRef!=NULL)
TISSelectInputSource(klRef);
}
}
[pool drain];
}
/**
@ -568,6 +578,23 @@ void UBPlatformUtils::setFrontProcess()
// activate the application, forcing focus on it
[app activateWithOptions: NSApplicationActivateIgnoringOtherApps];
// other option:NSApplicationActivateAllWindows. This won't steal focus from another app, e.g
// other option: NSApplicationActivateAllWindows. This won't steal focus from another app, e.g
// if the user is doing something else while waiting for OpenBoard to load
}
/**
* @brief Full-screen a QWidget. Specific behaviour is platform-dependent.
* @param pWidget the QWidget to maximize
*/
void UBPlatformUtils::showFullScreen(QWidget *pWidget)
{
pWidget->showMaximized();
/* On OS X, we want to hide the Dock and menu bar (aka "kiosk mode"). Qt's default behaviour
* when full-screening a QWidget is to set the dock and menu bar to auto-hide.
* Since it is impossible to later set different presentation options (i.e Hide dock & menu bar)
* to NSApplication, we have to avoid calling QWidget::showFullScreen on OSX.
*/
}

@ -427,4 +427,11 @@ QString UBPlatformUtils::urlFromClipboard()
void UBPlatformUtils::setFrontProcess()
{
// not used in Windows
}
void UBPlatformUtils::showFullScreen(QWidget *pWidget)
{
pWidget->showFullScreen();
}

Loading…
Cancel
Save