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

@ -147,7 +147,8 @@ struct UBGraphicsItemType
cacheItemType, cacheItemType,
groupContainerType, groupContainerType,
ToolWidgetItemType, 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) void UBMediaWidget::showEvent(QShowEvent* event)
{ {
if(mType == eMediaType_Audio){
return;
}else{
if(!mpVideoWidget){ if(!mpVideoWidget){
mpVideoWidget = new Phonon::VideoWidget(this); mpVideoWidget = new Phonon::VideoWidget(this);
mMediaLayout->addStretch(1); mMediaLayout->addStretch(1);
@ -125,6 +128,7 @@ void UBMediaWidget::showEvent(QShowEvent* event)
mpMediaObject->stop(); mpMediaObject->stop();
} }
QWidget::showEvent(event); QWidget::showEvent(event);
}
} }
void UBMediaWidget::hideEvent(QHideEvent* event) void UBMediaWidget::hideEvent(QHideEvent* event)
@ -159,11 +163,11 @@ void UBMediaWidget::createMediaPlayer()
}else if(eMediaType_Audio == mType){ }else if(eMediaType_Audio == mType){
mMediaLayout->setContentsMargins(10, 10, 10, 10); mMediaLayout->setContentsMargins(10, 10, 10, 10);
mpCover = new QLabel(mpMediaContainer); mpCover = new QLabel(mpMediaContainer);
mpMediaContainer->setStyleSheet(QString("background: none;")); //mpMediaContainer->setStyleSheet(QString("background: none;"));
setAudioCover(":images/libpalette/soundIcon.svg"); setAudioCover(":images/libpalette/soundIcon.svg");
mpCover->setScaledContents(true); mpCover->setScaledContents(true);
mMediaLayout->addStretch(1); mMediaLayout->addStretch(1);
mMediaLayout->addWidget(mpCover, 0); mMediaLayout->addWidget(mpCover);
mMediaLayout->addStretch(1); mMediaLayout->addStretch(1);
mpAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this); mpAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
Phonon::createPath(mpMediaObject, mpAudioOutput); Phonon::createPath(mpMediaObject, mpAudioOutput);

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

Loading…
Cancel
Save