Fixed issue 558

preferencesAboutTextFull
shibakaneki 12 years ago
parent 5bdeae56c6
commit 0707f90aed
  1. 6
      src/domain/UBGraphicsWidgetItem.cpp
  2. 3
      src/domain/UBGraphicsWidgetItem.h
  3. 2
      src/web/UBWebController.cpp

@ -107,10 +107,16 @@ void UBGraphicsWidgetItem::initialize()
QPalette palette = page()->palette(); QPalette palette = page()->palette();
palette.setBrush(QPalette::Base, QBrush(Qt::transparent)); palette.setBrush(QPalette::Base, QBrush(Qt::transparent));
page()->setPalette(palette); page()->setPalette(palette);
page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
connect(page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared())); connect(page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared()));
connect(page(), SIGNAL(geometryChangeRequested(const QRect&)), this, SLOT(geometryChangeRequested(const QRect&))); connect(page(), SIGNAL(geometryChangeRequested(const QRect&)), this, SLOT(geometryChangeRequested(const QRect&)));
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(mainFrameLoadFinished (bool))); connect(this, SIGNAL(loadFinished(bool)), this, SLOT(mainFrameLoadFinished (bool)));
connect(page(), SIGNAL(linkClicked(const QUrl&)), this, SLOT(onLinkClicked(const QUrl&)));
}
void UBGraphicsWidgetItem::onLinkClicked(const QUrl& url){
UBApplication::webController->loadUrl(url);
} }
QUrl UBGraphicsWidgetItem::mainHtml() QUrl UBGraphicsWidgetItem::mainHtml()

@ -152,6 +152,9 @@ class UBGraphicsWidgetItem : public UBGraphicsWebView
virtual void javaScriptWindowObjectCleared(); virtual void javaScriptWindowObjectCleared();
void mainFrameLoadFinished(bool ok); void mainFrameLoadFinished(bool ok);
private slots:
void onLinkClicked(const QUrl& url);
private: private:
bool mIsFrozen; bool mIsFrozen;
bool mIsTakingSnapshot; bool mIsTakingSnapshot;

@ -719,6 +719,7 @@ bool UBWebController::isEduMedia(const QUrl& pUrl)
void UBWebController::loadUrl(const QUrl& url) void UBWebController::loadUrl(const QUrl& url)
{ {
UBApplication::applicationController->showInternet();
if (UBSettings::settings()->webUseExternalBrowser->get().toBool()) if (UBSettings::settings()->webUseExternalBrowser->get().toBool())
{ {
QDesktopServices::openUrl(url); QDesktopServices::openUrl(url);
@ -726,7 +727,6 @@ void UBWebController::loadUrl(const QUrl& url)
else else
{ {
bool webBrowserAlreadyInstanciated = mStackedWidget->widget(WebBrowser) != NULL; bool webBrowserAlreadyInstanciated = mStackedWidget->widget(WebBrowser) != NULL;
UBApplication::applicationController->showInternet();
if (!webBrowserAlreadyInstanciated) { if (!webBrowserAlreadyInstanciated) {
(*mCurrentWebBrowser)->loadUrl(url); (*mCurrentWebBrowser)->loadUrl(url);

Loading…
Cancel
Save