Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
Claudio Valerio 12 years ago
commit afb257119a
  1. 27
      src/board/UBBoardView.cpp
  2. 3
      src/core/UB.h
  3. 8
      src/customWidgets/UBMediaWidget.cpp
  4. 38
      src/web/UBWebController.cpp
  5. 2
      src/web/UBWebController.h

@ -446,20 +446,24 @@ void UBBoardView::handleItemsSelection(QGraphicsItem *item)
return;
// delegate buttons shouldn't selected
if (DelegateButton::Type == movingItem->type())
if (DelegateButton::Type == item->type())
return;
// click on svg items (images on Frame) shouldn't change selection.
if (QGraphicsSvgItem::Type == movingItem->type())
if (QGraphicsSvgItem::Type == item->type())
return;
// Delegate frame shouldn't selected
if (UBGraphicsDelegateFrame::Type == movingItem->type())
if (UBGraphicsDelegateFrame::Type == item->type())
return;
// if we need to uwe multiple selection - we shouldn't deselect other items.
if (!mMultipleSelectionIsEnabled)
{
// here we need to determine what item is pressed. We should work
// only with UB items.
if ((UBGraphicsItemType::UserTypesCount > item->type()) && (item->type() > QGraphicsItem::UserType))
{
// if Item can be selected at mouse press - then we need to deselect all other items.
foreach(QGraphicsItem *iter_item, scene()->selectedItems())
@ -472,6 +476,7 @@ void UBBoardView::handleItemsSelection(QGraphicsItem *item)
}
}
}
}
bool UBBoardView::itemShouldReceiveMousePressEvent(QGraphicsItem *item)
{
@ -495,6 +500,10 @@ Here we determines cases when items should to get mouse press event at pressing
switch(item->type())
{
case UBGraphicsDelegateFrame::Type:
case QGraphicsSvgItem::Type:
return true;
case DelegateButton::Type:
case UBGraphicsMediaItem::Type:
return false;
@ -521,6 +530,7 @@ Here we determines cases when items should to get mouse press event at pressing
return true;
break;
case QGraphicsWebView::Type:
case UBGraphicsWidgetItem::Type:
if (currentTool == UBStylusTool::Selector && item->parentItem() && item->parentItem()->isSelected())
return true;
@ -529,9 +539,6 @@ Here we determines cases when items should to get mouse press event at pressing
if (currentTool == UBStylusTool::Play)
return true;
break;
default:
return true;
}
return false;
@ -561,11 +568,11 @@ bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item)
case DelegateButton::Type:
case UBGraphicsMediaItem::Type:
return true;
default:
return false;
}
if (!dynamic_cast<UBGraphicsItem*>(item))
return true;
else
return false;
}
@ -1066,7 +1073,7 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
else
if (movingItem)
{
if (suspendedMousePressEvent && !movingItem->data(UBGraphicsItemData::ItemLocked).toBool())
if (suspendedMousePressEvent)
{
QGraphicsView::mousePressEvent(suspendedMousePressEvent); // suspendedMousePressEvent is deleted by old Qt event loop
movingItem = NULL;

@ -147,7 +147,8 @@ struct UBGraphicsItemType
cacheItemType,
groupContainerType,
ToolWidgetItemType,
GraphicsWidgetItemType
GraphicsWidgetItemType,
UserTypesCount // this line must be the last line in this enum because it is types counter.
};
};

@ -114,6 +114,9 @@ eMediaType UBMediaWidget::mediaType()
void UBMediaWidget::showEvent(QShowEvent* event)
{
if(mType == eMediaType_Audio){
return;
}else{
if(!mpVideoWidget){
mpVideoWidget = new Phonon::VideoWidget(this);
mMediaLayout->addStretch(1);
@ -126,6 +129,7 @@ void UBMediaWidget::showEvent(QShowEvent* event)
}
QWidget::showEvent(event);
}
}
void UBMediaWidget::hideEvent(QHideEvent* event)
{
@ -159,11 +163,11 @@ void UBMediaWidget::createMediaPlayer()
}else if(eMediaType_Audio == mType){
mMediaLayout->setContentsMargins(10, 10, 10, 10);
mpCover = new QLabel(mpMediaContainer);
mpMediaContainer->setStyleSheet(QString("background: none;"));
//mpMediaContainer->setStyleSheet(QString("background: none;"));
setAudioCover(":images/libpalette/soundIcon.svg");
mpCover->setScaledContents(true);
mMediaLayout->addStretch(1);
mMediaLayout->addWidget(mpCover, 0);
mMediaLayout->addWidget(mpCover);
mMediaLayout->addStretch(1);
mpAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
Phonon::createPath(mpMediaObject, mpAudioOutput);

@ -64,6 +64,11 @@ UBWebController::UBWebController(UBMainWindow* mainWindow)
{
connect(mMainWindow->actionWebTools, SIGNAL(toggled(bool)), this, SLOT(toggleWebToolsPalette(bool)));
mStackedWidget = new QStackedWidget();
mStackedWidget->addWidget(new QWidget(mStackedWidget));
mStackedWidget->addWidget(new QWidget(mStackedWidget));
mStackedWidget->addWidget(new QWidget(mStackedWidget));
mMainWindow->addWebWidget(mStackedWidget);
for (int i = 0; i < TotalNumberOfWebInstances; i += 1){
@ -76,13 +81,15 @@ UBWebController::UBWebController(UBMainWindow* mainWindow)
// TODO : Comment the next line to continue the Youtube button bugfix
initialiazemOEmbedProviders();
}
UBWebController::~UBWebController()
{
// NOOP
if (mStackedWidget) {
delete mStackedWidget;
}
}
void UBWebController::initialiazemOEmbedProviders()
@ -119,6 +126,7 @@ void UBWebController::webBrowserInstance()
mCurrentWebBrowser = &mWebBrowserList[WebBrowser];
mToolsCurrentPalette = &mToolsPaletteList[WebBrowser];
mToolsPalettePositionned = mToolsPalettePositionnedList[WebBrowser];
if (!(*mCurrentWebBrowser))
{
(*mCurrentWebBrowser) = new WBBrowserWindow(mMainWindow->centralWidget(), mMainWindow);
@ -134,6 +142,10 @@ void UBWebController::webBrowserInstance()
mMainWindow->actionBookmarks->setVisible(showAddBookmarkButtons);
mMainWindow->actionAddBookmark->setVisible(showAddBookmarkButtons);
mStackedWidget->setCurrentIndex(WebBrowser);
if (mStackedWidget->currentWidget()) {
mStackedWidget->removeWidget(mStackedWidget->currentWidget());
}
mStackedWidget->insertWidget(WebBrowser, (*mCurrentWebBrowser));
showTabAtTop(UBSettings::settings()->appToolBarPositionedAtTop->get().toBool());
@ -150,9 +162,8 @@ void UBWebController::webBrowserInstance()
(*mCurrentWebBrowser)->tabWidget()->lineEdits()->show();
}
UBApplication::applicationController->setMirrorSourceWidget((*mCurrentWebBrowser)->paintWidget());
mStackedWidget->setCurrentIndex(WebBrowser);
UBApplication::applicationController->setMirrorSourceWidget((*mCurrentWebBrowser)->paintWidget());
mMainWindow->switchToWebWidget();
setupPalettes();
@ -165,7 +176,6 @@ void UBWebController::webBrowserInstance()
if (mDownloadViewIsVisible)
WBBrowserWindow::downloadManager()->show();
}
void UBWebController::tutorialWebInstance()
@ -191,13 +201,17 @@ void UBWebController::tutorialWebInstance()
{
mCurrentWebBrowser = &mWebBrowserList[Tutorial];
mToolsPalettePositionned = &mToolsPalettePositionnedList[Tutorial];
if (!(*mCurrentWebBrowser))
{
(*mCurrentWebBrowser) = new WBBrowserWindow(mMainWindow->centralWidget(), mMainWindow, true);
connect((*mCurrentWebBrowser), SIGNAL(activeViewChange(QWidget*)), this, SLOT(setSourceWidget(QWidget*)));
mStackedWidget->setCurrentIndex(Tutorial);
if (mStackedWidget->currentWidget()) {
mStackedWidget->removeWidget(mStackedWidget->currentWidget());
}
mStackedWidget->insertWidget(Tutorial, (*mCurrentWebBrowser));
adaptToolBar();
mTrapFlashController = new UBTrapFlashController((*mCurrentWebBrowser));
@ -212,12 +226,9 @@ void UBWebController::tutorialWebInstance()
else
(*mCurrentWebBrowser)->loadUrl(currentUrl);
UBApplication::applicationController->setMirrorSourceWidget((*mCurrentWebBrowser)->paintWidget());
mStackedWidget->setCurrentIndex(Tutorial);
UBApplication::applicationController->setMirrorSourceWidget((*mCurrentWebBrowser)->paintWidget());
mMainWindow->switchToWebWidget();
screenLayoutChanged();
bool mirroring = UBSettings::settings()->webShowPageImmediatelyOnMirroredScreen->get().toBool();
@ -246,6 +257,7 @@ void UBWebController::paraschoolWebInstance()
if (UBSettings::settings()->webUseExternalBrowser->get().toBool()){
QDesktopServices::openUrl(currentUrl);
}
else {
mCurrentWebBrowser = &mWebBrowserList[Paraschool];
mToolsCurrentPalette = &mToolsPaletteList[Paraschool];
@ -254,6 +266,10 @@ void UBWebController::paraschoolWebInstance()
(*mCurrentWebBrowser) = new WBBrowserWindow(mMainWindow->centralWidget(), mMainWindow, true);
connect((*mCurrentWebBrowser), SIGNAL(activeViewChange(QWidget*)), this, SLOT(setSourceWidget(QWidget*)));
mStackedWidget->setCurrentIndex(Paraschool);
if (mStackedWidget->currentWidget()) {
mStackedWidget->removeWidget(mStackedWidget->currentWidget());
}
mStackedWidget->insertWidget(Paraschool, (*mCurrentWebBrowser));
adaptToolBar();
@ -267,11 +283,9 @@ void UBWebController::paraschoolWebInstance()
}
UBApplication::applicationController->setMirrorSourceWidget((*mCurrentWebBrowser)->paintWidget());
mStackedWidget->setCurrentIndex(Paraschool);
UBApplication::applicationController->setMirrorSourceWidget((*mCurrentWebBrowser)->paintWidget());
mMainWindow->switchToWebWidget();
screenLayoutChanged();
bool mirroring = UBSettings::settings()->webShowPageImmediatelyOnMirroredScreen->get().toBool();

@ -104,7 +104,7 @@ class UBWebController : public QObject
void lookForEmbedContent(QString* pHtml, QString tag, QString attribute, QList<QUrl>* pList);
void checkForOEmbed(QString* pHtml);
QStackedWidget mStackedWidget[TotalNumberOfWebInstances];
QStackedWidget *mStackedWidget;
UBMainWindow *mMainWindow;

Loading…
Cancel
Save