mirror of
https://invent.kde.org/multimedia/kdenlive
synced 2025-12-06 16:29:58 +01:00
Compare commits
1 Commits
camille/bu
...
work/qtweb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
173ce96285 |
@@ -71,7 +71,7 @@ if(WIN32)
|
||||
set(MLT_PREFIX "..")
|
||||
else()
|
||||
set(MLT_PREFIX ${MLT_ROOT_DIR})
|
||||
find_package(Qt5 OPTIONAL_COMPONENTS WebKitWidgets QUIET)
|
||||
find_package(Qt5 OPTIONAL_COMPONENTS WebEngineWidgets QUIET)
|
||||
endif()
|
||||
|
||||
if(KF5FileMetaData_FOUND)
|
||||
|
||||
@@ -65,7 +65,7 @@ add_subdirectory(transitions)
|
||||
add_subdirectory(utils)
|
||||
add_subdirectory(widgets)
|
||||
add_subdirectory(xml)
|
||||
if(Qt5WebKitWidgets_FOUND)
|
||||
if(Qt5WebEngineWidgets_FOUND)
|
||||
add_subdirectory(qt-oauth-lib)
|
||||
endif()
|
||||
## top_SRCS
|
||||
@@ -178,12 +178,12 @@ if(KF5_PURPOSE)
|
||||
target_link_libraries(kdenliveLib KF5::Purpose KF5::PurposeWidgets)
|
||||
endif()
|
||||
|
||||
if(Qt5WebKitWidgets_FOUND)
|
||||
message(STATUS "Found Qt5 WebKitWidgets. You can use your Freesound.org credentials to download files")
|
||||
target_compile_definitions(kdenliveLib PRIVATE -DQT5_USE_WEBKIT)
|
||||
target_link_libraries(kdenliveLib Qt5::WebKitWidgets)
|
||||
if(Qt5WebEngineWidgets_FOUND)
|
||||
message(STATUS "Found Qt5 WebEngineWidgets. You can use your Freesound.org credentials to download files")
|
||||
target_compile_definitions(kdenliveLib PRIVATE -DQT5_USE_WEBENGINE)
|
||||
target_link_libraries(kdenliveLib Qt5::WebEngineWidgets)
|
||||
else()
|
||||
message(STATUS "Qt5 WebKitWidgets not found. You cannot use your Freesound.org credentials, only preview files can be downloaded from the Online Resources Widget")
|
||||
message(STATUS "Qt5 WebEngineWidgets not found. You cannot use your Freesound.org credentials, only preview files can be downloaded from the Online Resources Widget")
|
||||
endif()
|
||||
|
||||
if(Q_WS_X11)
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "ui_logindialog_ui.h"
|
||||
|
||||
#include "kdenlive_debug.h"
|
||||
#include <QWebView>
|
||||
#include <QWebEngineView>
|
||||
|
||||
LoginDialog::LoginDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
@@ -54,7 +54,7 @@ LoginDialog::LoginDialog(QWidget *parent)
|
||||
i18n("Enter your freesound account details to download the highest quality version of this file. Or use the High Quality "
|
||||
"preview file instead (no freesound account required)."));
|
||||
// m_ui->textBrowser
|
||||
connect(m_ui->webView, &QWebView::urlChanged, this, &LoginDialog::urlChanged);
|
||||
connect(m_ui->webView, &QWebEngineView::urlChanged, this, &LoginDialog::urlChanged);
|
||||
}
|
||||
|
||||
LoginDialog::~LoginDialog()
|
||||
|
||||
@@ -47,11 +47,10 @@ class LoginDialog;
|
||||
|
||||
/**
|
||||
\brief This is the dialog that is used to login to freesound
|
||||
\details It contains a QWebView object to display the freesound web page. I did try using a QTextBrowser
|
||||
\details It contains a QWebEngineView object to display the freesound web page. I did try using a QTextBrowser
|
||||
for this purpose but it responds to the URL that is used to connect with
|
||||
"No document for
|
||||
https://www.freesound.org/apiv2/oauth2/authorize/?client_id=3duhagdr874c&redirect_uri=https://www.freesound.org/home/app_permissions/permission_granted/&response_type=code"
|
||||
The use of QWebView adds a dependency on the KF5WebKit to kdenlive. Need install libkf5webkit5-dev package on ubuntu
|
||||
*/
|
||||
class LoginDialog : public QDialog
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
const QLatin1String OAuth2_strClientSecret("441d88374716e7a3503997151e4780566f007313"); // obtained when ttguy registered the kdenlive application with freesound
|
||||
#endif
|
||||
|
||||
#ifdef QT5_USE_WEBKIT
|
||||
#ifdef QT5_USE_WEBENGINE
|
||||
|
||||
class LoginDialog;
|
||||
|
||||
@@ -135,6 +135,6 @@ private:
|
||||
void buildLoginDialog();
|
||||
};
|
||||
|
||||
#endif // QT5_USE_WEBKIT
|
||||
#endif // QT5_USE_WEBENGINE
|
||||
|
||||
#endif // OAUTH2_H
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QWebView" name="webView">
|
||||
<widget class="QWebEngineView" name="webView">
|
||||
<property name="url">
|
||||
<url>
|
||||
<string>about:blank</string>
|
||||
@@ -51,9 +51,9 @@
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QWebView</class>
|
||||
<class>QWebEngineView</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>QtWebKitWidgets/QWebView</header>
|
||||
<header>QtWebEngineWidgets/QWebEngineView</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <QPixmap>
|
||||
#include <klocalizedstring.h>
|
||||
|
||||
#ifdef QT5_USE_WEBKIT
|
||||
#ifdef QT5_USE_WEBENGINE
|
||||
#include "qt-oauth-lib/oauth2.h"
|
||||
#endif
|
||||
|
||||
@@ -103,7 +103,7 @@ ResourceWidget::ResourceWidget(QString folder, QWidget *parent)
|
||||
search_text->setFocus();
|
||||
connect(search_text, SIGNAL(returnPressed()), this, SLOT(slotStartSearch()));
|
||||
|
||||
#ifdef QT5_USE_WEBKIT
|
||||
#ifdef QT5_USE_WEBENGINE
|
||||
m_pOAuth2 = new OAuth2(this);
|
||||
connect(m_pOAuth2, &OAuth2::accessTokenReceived, this, &ResourceWidget::slotAccessTokenReceived);
|
||||
connect(m_pOAuth2, &OAuth2::accessDenied, this, &ResourceWidget::slotFreesoundAccessDenied);
|
||||
@@ -375,7 +375,7 @@ void ResourceWidget::slotSaveItem(const QString &originalUrl)
|
||||
path.append(m_currentService->getDefaultDownloadName(item));
|
||||
|
||||
if (m_currentService->serviceType == AbstractService::FREESOUND) {
|
||||
#ifdef QT5_USE_WEBKIT
|
||||
#ifdef QT5_USE_WEBENGINE
|
||||
sFileExt = m_currentService->getExtension(search_results->currentItem());
|
||||
#else
|
||||
sFileExt = QStringLiteral("*.") + m_currentInfo.HQpreview.section(QLatin1Char('.'), -1);
|
||||
@@ -402,7 +402,7 @@ void ResourceWidget::slotSaveItem(const QString &originalUrl)
|
||||
}
|
||||
slotSetDescription(QString());
|
||||
button_import->setEnabled(false); // disable buttons while download runs. enabled in slotGotFile
|
||||
#ifdef QT5_USE_WEBKIT
|
||||
#ifdef QT5_USE_WEBENGINE
|
||||
if (m_currentService->serviceType == AbstractService::FREESOUND) { // open a dialog to authenticate with free sound and download the file
|
||||
m_pOAuth2->obtainAccessToken(); // when job finished ResourceWidget::slotAccessTokenReceived will be called
|
||||
} else { // not freesound - do file download via a KIO file copy job
|
||||
@@ -841,7 +841,7 @@ void ResourceWidget::DownloadRequestFinished(QNetworkReply *reply)
|
||||
m_desc.append(m_saveLocation);
|
||||
updateLayout();
|
||||
} else {
|
||||
#ifdef QT5_USE_WEBKIT
|
||||
#ifdef QT5_USE_WEBENGINE
|
||||
m_pOAuth2->ForgetAccessToken();
|
||||
#endif
|
||||
m_desc.append(QStringLiteral("<br>") + i18n("Error Saving File"));
|
||||
@@ -850,11 +850,11 @@ void ResourceWidget::DownloadRequestFinished(QNetworkReply *reply)
|
||||
} else {
|
||||
|
||||
if (reply->error() == QNetworkReply::AuthenticationRequiredError) {
|
||||
#ifdef QT5_USE_WEBKIT
|
||||
#ifdef QT5_USE_WEBENGINE
|
||||
m_pOAuth2->obtainNewAccessToken();
|
||||
#endif
|
||||
} else {
|
||||
#ifdef QT5_USE_WEBKIT
|
||||
#ifdef QT5_USE_WEBENGINE
|
||||
m_pOAuth2->ForgetAccessToken();
|
||||
#endif
|
||||
m_desc.append(QStringLiteral("<br>") + i18n("Error Downloading File. Error code: %1", reply->error()) + QStringLiteral("<br>"));
|
||||
|
||||
Reference in New Issue
Block a user