Merge branch 'Bett-2012' of github.com:Sankore/Sankore-3.1 into Bett-2012

preferencesAboutTextFull
shibakaneki 13 years ago
commit ea81899384
  1. 3
      src/adaptors/UBImportDocument.cpp
  2. 1
      src/adaptors/UBImportImage.cpp
  3. 1
      src/adaptors/UBImportPDF.cpp
  4. 2
      src/core/UBDisplayManager.cpp
  5. 17
      src/customWidgets/UBMediaWidget.cpp
  6. 1
      src/customWidgets/UBMediaWidget.h
  7. 2
      src/document/UBDocumentController.cpp
  8. 4
      src/gui/UBTBPageEditWidget.cpp
  9. 56
      src/gui/UBTeacherBarPreviewWidget.cpp
  10. 2
      src/gui/UBTeacherBarPreviewWidget.h

@ -14,7 +14,6 @@
*/
#include "UBImportDocument.h"
#include "UBMetadataDcSubsetAdaptor.h"
#include "document/UBDocumentProxy.h"
#include "frameworks/UBFileSystemUtils.h"
@ -49,7 +48,7 @@ QStringList UBImportDocument::supportedExtentions()
QString UBImportDocument::importFileFilter()
{
return tr("Sankore 3.1 (*.ubz)");
return tr("Open-Sankore (*.ubz)");
}

@ -14,7 +14,6 @@
*/
#include "UBImportImage.h"
#include "UBMetadataDcSubsetAdaptor.h"
#include "UBSvgSubsetAdaptor.h"
#include "document/UBDocumentProxy.h"

@ -14,7 +14,6 @@
*/
#include "UBImportPDF.h"
#include "UBMetadataDcSubsetAdaptor.h"
#include "UBSvgSubsetAdaptor.h"
#include "document/UBDocumentProxy.h"

@ -48,7 +48,7 @@ UBDisplayManager::UBDisplayManager(QObject *parent)
void UBDisplayManager::initScreenIndexes()
{
int screenCount = numScreens();
int screenCount = 1;//= numScreens();
mScreenIndexesRoles.clear();

@ -103,6 +103,21 @@ eMediaType UBMediaWidget::mediaType()
return mType;
}
void UBMediaWidget::showEvent(QShowEvent* event)
{
if(!mpVideoWidget){
mpVideoWidget = new Phonon::VideoWidget(this);
mMediaLayout.addStretch(1);
mMediaLayout.addWidget(mpVideoWidget, 0);
mMediaLayout.addStretch(1);
Phonon::createPath(mpMediaObject, mpVideoWidget);
adaptSizeToVideo();
mpMediaObject->play();
mpMediaObject->stop();
}
QWidget::showEvent(event);
}
/**
* \brief Create the media player
*/
@ -114,12 +129,14 @@ void UBMediaWidget::createMediaPlayer()
if(eMediaType_Video == mType){
mMediaLayout.setContentsMargins(10, 10, 25, 10);
if(isVisible()){
mpVideoWidget = new Phonon::VideoWidget(this);
mMediaLayout.addStretch(1);
mMediaLayout.addWidget(mpVideoWidget, 0);
mMediaLayout.addStretch(1);
Phonon::createPath(mpMediaObject, mpVideoWidget);
adaptSizeToVideo();
}
mpAudioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this);
Phonon::createPath(mpMediaObject, mpAudioOutput);
}else if(eMediaType_Audio == mType){

@ -71,6 +71,7 @@ public:
protected:
void resizeEvent(QResizeEvent* ev);
void showEvent(QShowEvent* event);
private slots:
void onPlayStopClicked();

@ -37,7 +37,6 @@
#include "board/UBBoardPaletteManager.h"
#include "board/UBDrawingController.h"
//#include "gui/UBKeyboardPalette.h"
#include "gui/UBThumbnailView.h"
#include "gui/UBDocumentTreeWidget.h"
@ -69,7 +68,6 @@ UBDocumentController::UBDocumentController(UBMainWindow* mainWindow)
, mToolsPalette(0)
, mToolsPalettePositionned(false)
, mTrashTi(0)
// , mKeyboardPalette(0)
{
setupViews();
setupToolbar();

@ -199,10 +199,14 @@ void UBTBPageEditWidget::updateFields()
}
// Medias
foreach(QString url, mpDataMgr->mediaUrls()){
if(url.isEmpty())
continue;
QWidget* pWidget = mpMediaContainer->generateMediaWidget(url);
if(pWidget != NULL){
mpDataMgr->medias()->append(pWidget);
mpMediaContainer->addWidget(pWidget);
}
}
// Links
foreach(sLink link, *mpDataMgr->urls()){
UBUrlWidget* urlWidget = new UBUrlWidget(this);

@ -43,34 +43,34 @@ void UBTeacherBarPreviewMedia::loadWidgets(QList<QWidget*> pWidgetsList, bool is
}
int UBTeacherBarPreviewMedia::loadMedia(QStringList pMedias)
{
int addedMedia = 0;
// foreach(QString eachString, pMedias){
// if(!eachString.isEmpty()){
// QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(eachString);
// if(mimeType.contains("image")){
// UBDraggableLabel* label = new UBDraggableLabel();
// label->loadImage(eachString);
// mWidget->addWidget(label);
// mWidgetList[label]=eachString;
// addedMedia += 1;
// }
// else if(mimeType.contains("video") || mimeType.contains("audio")){
// UBDraggableMediaPlayer* mediaPlayer = new UBDraggableMediaPlayer();
// mediaPlayer->setFile(eachString);
// mWidget->addWidget(mediaPlayer);
// mWidgetList[mediaPlayer] = eachString;
// addedMedia += 1;
// }
// else{
// qWarning() << "pMediaPath" << eachString;
// qWarning() << "bad idea to come here";
// }
// }
// }
return addedMedia;
}
//int UBTeacherBarPreviewMedia::loadMedia(QStringList pMedias)
//{
// int addedMedia = 0;
//// foreach(QString eachString, pMedias){
//// if(!eachString.isEmpty()){
//// QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(eachString);
//// if(mimeType.contains("image")){
//// UBDraggableLabel* label = new UBDraggableLabel();
//// label->loadImage(eachString);
//// mWidget->addWidget(label);
//// mWidgetList[label]=eachString;
//// addedMedia += 1;
//// }
//// else if(mimeType.contains("video") || mimeType.contains("audio")){
//// UBDraggableMediaPlayer* mediaPlayer = new UBDraggableMediaPlayer();
//// mediaPlayer->setFile(eachString);
//// mWidget->addWidget(mediaPlayer);
//// mWidgetList[mediaPlayer] = eachString;
//// addedMedia += 1;
//// }
//// else{
//// qWarning() << "pMediaPath" << eachString;
//// qWarning() << "bad idea to come here";
//// }
//// }
//// }
// return addedMedia;
//}
// -----------------------------------------------------------------------------------------------
UBActionPreview::UBActionPreview(QWidget *parent, const char *name):QWidget(parent)

@ -15,7 +15,7 @@ class UBTeacherBarPreviewMedia : public QWidget
public:
UBTeacherBarPreviewMedia(QWidget* parent=0, const char* name="UBTeacherBarPreviewMedia");
~UBTeacherBarPreviewMedia();
int loadMedia(QStringList pMedias);
// int loadMedia(QStringList pMedias);
void loadWidgets(QList<QWidget*> pWidgetList, bool isResizable = true);
void cleanMedia();

Loading…
Cancel
Save