From 6d5e5b5b03509e9a5acee41778e3d31632b9fbf8 Mon Sep 17 00:00:00 2001 From: Vekhir Date: Thu, 20 Jun 2024 14:44:41 +0200 Subject: [PATCH 01/10] refactor (UBYouTubePublisher): Don't save password The password is saved in an insecure way and is only used for later auto-fill-in. Password managers are a better fit for that. --- src/core/UBSettings.cpp | 1 - src/podcast/youtube/UBYouTubePublisher.cpp | 6 ------ 2 files changed, 7 deletions(-) diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index 645063e53..f2e5dd3b5 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -1460,7 +1460,6 @@ void UBSettings::cleanNonPersistentSettings() } if(!youTubeCredentialsPersistence->get().toBool()){ - removePassword(youTubeUserEMail->get().toString()); youTubeUserEMail->set(QVariant("")); } } diff --git a/src/podcast/youtube/UBYouTubePublisher.cpp b/src/podcast/youtube/UBYouTubePublisher.cpp index c1e66cd37..e45f19b91 100644 --- a/src/podcast/youtube/UBYouTubePublisher.cpp +++ b/src/podcast/youtube/UBYouTubePublisher.cpp @@ -74,9 +74,6 @@ void UBYouTubePublisher::uploadVideo(const QString& videoFilePath) QString defaultEMail = UBSettings::settings()->youTubeUserEMail->get().toString(); pub.email->setText(defaultEMail); - QString defaultPassword = UBSettings::settings()->password(defaultEMail); - pub.password->setText(defaultPassword); - if (pub.exec() == QDialog::Accepted) { mTitle = pub.title->text(); @@ -89,8 +86,6 @@ void UBYouTubePublisher::uploadVideo(const QString& videoFilePath) QString password = pub.password->text(); - UBSettings::settings()->setPassword(email, password); - postClientLoginRequest(email, password); } else @@ -356,7 +351,6 @@ UBYouTubePublishingDialog::UBYouTubePublishingDialog(const QString& videoFilePat UBSettings* settings = UBSettings::settings(); email->setText(settings->youTubeUserEMail->get().toString()); - password->setText(settings->password(email->text())); youtubeCredentialsPersistence->setChecked(UBSettings::settings()->youTubeCredentialsPersistence->get().toBool()); updatePersistanceEnableState(); From 573ac359c5c40167bf79b7eb297b9d7a3893c348 Mon Sep 17 00:00:00 2001 From: Vekhir Date: Fri, 21 Jun 2024 00:26:59 +0200 Subject: [PATCH 02/10] refactor (UBSettings): Make proxy credentials nonpersistent The proxy credentials are currently stored in an insecure way, and should not be stored persistently if it can be avoided. For architectural reasons, the credentials have to be saved for the runtime of the program to be accessed by the network manager. Clear the credentials at the end of the program. --- src/core/UBSettings.cpp | 30 +++++++++++------------------- src/core/UBSettings.h | 3 +++ 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index f2e5dd3b5..61b568c69 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -440,6 +440,9 @@ void UBSettings::init() communityPsw = new UBSetting(this, "Community", "Password", ""); communityCredentialsPersistence = new UBSetting(this,"Community", "CredentialsPersistence",false); + proxyUser = new UBSetting(this, "Proxy", "UserName", ""); + proxyPsw = new UBSetting(this, "Proxy", "Password", ""); + QStringList uris = UBToolsManager::manager()->allToolIDs(); favoritesNativeToolUris = new UBSetting(this, "App", "FavoriteToolURIs", uris); @@ -1312,8 +1315,8 @@ QNetworkProxy* UBSettings::httpProxy() proxy->setHostName(mAppSettings->value("Proxy/HostName").toString()); proxy->setPort(mAppSettings->value("Proxy/Port", 1080).toInt()); - proxy->setUser(mAppSettings->value("Proxy/UserName").toString()); - proxy->setPassword(mAppSettings->value("Proxy/Password").toString()); + proxy->setUser(proxyUser->get().toString()); + proxy->setPassword(proxyPsw->get().toString()); } return proxy; @@ -1349,38 +1352,25 @@ QString UBSettings::password(const QString& id) QString UBSettings::proxyUsername() { - QString idUsername = "http.proxy.user"; - return password(idUsername); + return proxyUser->get().toString(); } void UBSettings::setProxyUsername(const QString& username) { - QString idUsername = "http.proxy.user"; - - if (username.length() > 0) - setPassword(idUsername, username); - else - removePassword(idUsername); + proxyUser->set(QVariant(username)); } QString UBSettings::proxyPassword() { - QString idPassword = "http.proxy.pass"; - return password(idPassword); + return proxyPsw->get().toString(); } void UBSettings::setProxyPassword(const QString& password) { - QString idPassword = "http.proxy.pass"; - - if (password.length() > 0) - setPassword(idPassword, password); - else - removePassword(idPassword); - + proxyPsw->set(QVariant(password)); } QString UBSettings::communityUsername() @@ -1462,6 +1452,8 @@ void UBSettings::cleanNonPersistentSettings() if(!youTubeCredentialsPersistence->get().toBool()){ youTubeUserEMail->set(QVariant("")); } + proxyUser->set(QVariant("")); + proxyPsw->set(QVariant("")); } /** diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h index 53a608833..e402e456c 100644 --- a/src/core/UBSettings.h +++ b/src/core/UBSettings.h @@ -412,6 +412,9 @@ class UBSettings : public QObject UBSetting* communityPsw; UBSetting* communityCredentialsPersistence; + UBSetting* proxyUser; + UBSetting* proxyPsw; + UBSetting* pageSize; UBSetting* KeyboardLocale; From 93e900d72798831732233c818691a3faddca7597 Mon Sep 17 00:00:00 2001 From: Vekhir Date: Thu, 20 Jun 2024 13:54:42 +0200 Subject: [PATCH 03/10] refactor (UBSettings): Remove password storage API These methods are no longer used due to insecure practices, thus remove them. --- src/core/UBSettings.cpp | 28 ---------------------------- src/core/UBSettings.h | 4 ---- 2 files changed, 32 deletions(-) diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index 61b568c69..372d6039c 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -34,7 +34,6 @@ #include "frameworks/UBPlatformUtils.h" #include "frameworks/UBFileSystemUtils.h" -#include "frameworks/UBCryptoUtils.h" #include "UB.h" #include "UBSetting.h" @@ -1323,33 +1322,6 @@ QNetworkProxy* UBSettings::httpProxy() } -void UBSettings::setPassword(const QString& id, const QString& password) -{ - QString encrypted = UBCryptoUtils::instance()->symetricEncrypt(password); - - mUserSettings->setValue(QString("Vault/") + id, encrypted); -} - - -void UBSettings::removePassword(const QString& id) -{ - mUserSettings->remove(QString("Vault/") + id); -} - - -QString UBSettings::password(const QString& id) -{ - QString encrypted = mUserSettings->value(QString("Vault/") + id).toString(); - - QString result = ""; - - if (encrypted.length() > 0) - result = UBCryptoUtils::instance()->symetricDecrypt(encrypted); - - return result; -} - - QString UBSettings::proxyUsername() { return proxyUser->get().toString(); diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h index e402e456c..757ce05f4 100644 --- a/src/core/UBSettings.h +++ b/src/core/UBSettings.h @@ -110,10 +110,6 @@ class UBSettings : public QObject bool isItalicFont(); void setItalicFont(bool italic); - void setPassword(const QString& id, const QString& password); - QString password(const QString& id); - void removePassword(const QString& id); - QString proxyUsername(); void setProxyUsername(const QString& username); QString proxyPassword(); From 234920d81b77fd32fe4aa2f065b3b9900115bf31 Mon Sep 17 00:00:00 2001 From: Vekhir Date: Thu, 20 Jun 2024 14:00:36 +0200 Subject: [PATCH 04/10] refactor (UBCryptoUtils): remove encryption routines They are no longer used anywhere. --- src/frameworks/UBCryptoUtils.cpp | 89 -------------------------------- src/frameworks/UBCryptoUtils.h | 4 -- 2 files changed, 93 deletions(-) diff --git a/src/frameworks/UBCryptoUtils.cpp b/src/frameworks/UBCryptoUtils.cpp index b5497cdc6..a4e4026c8 100644 --- a/src/frameworks/UBCryptoUtils.cpp +++ b/src/frameworks/UBCryptoUtils.cpp @@ -69,95 +69,6 @@ UBCryptoUtils::~UBCryptoUtils() #endif } - -QString UBCryptoUtils::symetricEncrypt(const QString& clear) -{ - QByteArray clearData = clear.toUtf8(); - - int cipheredLength = clearData.length() + AES_BLOCK_SIZE; - int paddingLength = 0; - unsigned char *ciphertext = (unsigned char *)malloc(cipheredLength); - -#if OPENSSL_VERSION_NUMBER >= 10100000L - if(!EVP_EncryptInit_ex(mAesEncryptContext, NULL, NULL, NULL, NULL)){ -#else - if(!EVP_EncryptInit_ex(&mAesEncryptContext, NULL, NULL, NULL, NULL)){ -#endif - free(ciphertext); - return QString(); - } - -#if OPENSSL_VERSION_NUMBER >= 10100000L - if(!EVP_EncryptUpdate(mAesEncryptContext, ciphertext, &cipheredLength, (unsigned char *)clearData.data(), clearData.length())){ -#else - if(!EVP_EncryptUpdate(&mAesEncryptContext, ciphertext, &cipheredLength, (unsigned char *)clearData.data(), clearData.length())){ -#endif - free(ciphertext); - return QString(); - } - - /* update ciphertext with the final remaining bytes */ -#if OPENSSL_VERSION_NUMBER >= 10100000L - if(!EVP_EncryptFinal_ex(mAesEncryptContext, ciphertext + cipheredLength, &paddingLength)){ -#else - if(!EVP_EncryptFinal_ex(&mAesEncryptContext, ciphertext + cipheredLength, &paddingLength)){ -#endif - free(ciphertext); - return QString(); - } - - QByteArray cipheredData((const char *)ciphertext, cipheredLength + paddingLength); - - free(ciphertext); - - return QString::fromLatin1(cipheredData.toBase64()); -} - - -QString UBCryptoUtils::symetricDecrypt(const QString& encrypted) -{ - QByteArray encryptedData = QByteArray::fromBase64(encrypted.toLatin1()); - - int encryptedLength = encryptedData.length(); - int paddingLength = 0; - unsigned char *plaintext = (unsigned char *)malloc(encryptedLength); - -#if OPENSSL_VERSION_NUMBER >= 10100000L - if(!EVP_DecryptInit_ex(mAesDecryptContext, NULL, NULL, NULL, NULL)){ -#else - if(!EVP_DecryptInit_ex(&mAesDecryptContext, NULL, NULL, NULL, NULL)){ -#endif - free(plaintext); - return QString(); - } - -#if OPENSSL_VERSION_NUMBER >= 10100000L - if(!EVP_DecryptUpdate(mAesDecryptContext, plaintext, &encryptedLength, (const unsigned char *)encryptedData.data(), encryptedData.length())){ -#else - if(!EVP_DecryptUpdate(&mAesDecryptContext, plaintext, &encryptedLength, (const unsigned char *)encryptedData.data(), encryptedData.length())){ -#endif - free(plaintext); - return QString(); - } - -#if OPENSSL_VERSION_NUMBER >= 10100000L - if(!EVP_DecryptFinal_ex(mAesDecryptContext, plaintext + encryptedLength, &paddingLength)){ -#else - if(!EVP_DecryptFinal_ex(&mAesDecryptContext, plaintext + encryptedLength, &paddingLength)){ -#endif - free(plaintext); - return QString(); - } - - int len = encryptedLength + paddingLength; - QByteArray clearData((const char *)plaintext, len); - - free(plaintext); - - return QString::fromUtf8(clearData);; -} - - void UBCryptoUtils::aesInit() { int i, nrounds = 5; diff --git a/src/frameworks/UBCryptoUtils.h b/src/frameworks/UBCryptoUtils.h index bf084f8ea..479c6ddc3 100644 --- a/src/frameworks/UBCryptoUtils.h +++ b/src/frameworks/UBCryptoUtils.h @@ -45,10 +45,6 @@ class UBCryptoUtils : public QObject static UBCryptoUtils* instance(); static void destroy(); - - QString symetricEncrypt(const QString& clear); - QString symetricDecrypt(const QString& encrypted); - private: UBCryptoUtils(QObject * pParent = 0); From f3044d904e2bd12520da0c976c5b3b52eb683b7b Mon Sep 17 00:00:00 2001 From: Vekhir Date: Thu, 20 Jun 2024 14:06:12 +0200 Subject: [PATCH 05/10] refactor (UBCryptoUtils): Remove last public functions No UBCryptoUtils object will ever created, so destroy() is a noop. Remove unused public functions --- src/core/UBApplication.cpp | 3 --- src/frameworks/UBCryptoUtils.cpp | 15 --------------- src/frameworks/UBCryptoUtils.h | 3 --- 3 files changed, 21 deletions(-) diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp index fef848639..9b420eabf 100644 --- a/src/core/UBApplication.cpp +++ b/src/core/UBApplication.cpp @@ -63,7 +63,6 @@ #include "ui_mainWindow.h" -#include "frameworks/UBCryptoUtils.h" #include "tools/UBToolsManager.h" #include "UBDisplayManager.h" @@ -171,8 +170,6 @@ UBApplication::~UBApplication() UBSettings::destroy(); - UBCryptoUtils::destroy(); - UBToolsManager::destroy(); if(mApplicationTranslator != NULL){ diff --git a/src/frameworks/UBCryptoUtils.cpp b/src/frameworks/UBCryptoUtils.cpp index a4e4026c8..4c5a6d029 100644 --- a/src/frameworks/UBCryptoUtils.cpp +++ b/src/frameworks/UBCryptoUtils.cpp @@ -37,21 +37,6 @@ UBCryptoUtils* UBCryptoUtils::sInstance(0); QString UBCryptoUtils::sAESKey("9ecHaspud9uD9ste5erAchehefrup3echej-caje6&thestawacuk=h#F3jet3aF"); QString UBCryptoUtils::sAESSalt("6f0083e0-a90c-11de-ac21-0002a5d5c51b"); -UBCryptoUtils* UBCryptoUtils::instance() -{ - if(!sInstance) - sInstance = new UBCryptoUtils(UBApplication::staticMemoryCleaner); - - return sInstance; -} - -void UBCryptoUtils::destroy() -{ - if (sInstance) - delete sInstance; - sInstance = NULL; -} - UBCryptoUtils::UBCryptoUtils(QObject * pParent) : QObject(pParent) diff --git a/src/frameworks/UBCryptoUtils.h b/src/frameworks/UBCryptoUtils.h index 479c6ddc3..a4d2c249e 100644 --- a/src/frameworks/UBCryptoUtils.h +++ b/src/frameworks/UBCryptoUtils.h @@ -42,9 +42,6 @@ class UBCryptoUtils : public QObject public: - static UBCryptoUtils* instance(); - static void destroy(); - private: UBCryptoUtils(QObject * pParent = 0); From a448788b5255e1b765ab46bca540398e3c7a5a02 Mon Sep 17 00:00:00 2001 From: Vekhir Date: Thu, 20 Jun 2024 14:16:46 +0200 Subject: [PATCH 06/10] refactor (src/frameworks): Delete UBCryptoUtils.{cpp,h} They provide no public functions and as such can be safely removed. Also remove them from the build system (qmake and cmake). --- src/frameworks/CMakeLists.txt | 2 - src/frameworks/UBCryptoUtils.cpp | 84 -------------------------------- src/frameworks/UBCryptoUtils.h | 66 ------------------------- src/frameworks/frameworks.pri | 2 - 4 files changed, 154 deletions(-) delete mode 100644 src/frameworks/UBCryptoUtils.cpp delete mode 100644 src/frameworks/UBCryptoUtils.h diff --git a/src/frameworks/CMakeLists.txt b/src/frameworks/CMakeLists.txt index aab3eb7be..0e4ce3f1c 100644 --- a/src/frameworks/CMakeLists.txt +++ b/src/frameworks/CMakeLists.txt @@ -3,8 +3,6 @@ target_sources(openboard PRIVATE UBBase32.h UBCoreGraphicsScene.cpp UBCoreGraphicsScene.h - UBCryptoUtils.cpp - UBCryptoUtils.h UBFileSystemUtils.cpp UBFileSystemUtils.h UBGeometryUtils.cpp diff --git a/src/frameworks/UBCryptoUtils.cpp b/src/frameworks/UBCryptoUtils.cpp deleted file mode 100644 index 4c5a6d029..000000000 --- a/src/frameworks/UBCryptoUtils.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2015-2022 Département de l'Instruction Publique (DIP-SEM) - * - * Copyright (C) 2013 Open Education Foundation - * - * Copyright (C) 2010-2013 Groupement d'Intérêt Public pour - * l'Education Numérique en Afrique (GIP ENA) - * - * This file is part of OpenBoard. - * - * OpenBoard is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 3 of the License, - * with a specific linking exception for the OpenSSL project's - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * OpenBoard is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with OpenBoard. If not, see . - */ - - - - -#include "UBCryptoUtils.h" - -#include - -#include "core/memcheck.h" - -UBCryptoUtils* UBCryptoUtils::sInstance(0); -QString UBCryptoUtils::sAESKey("9ecHaspud9uD9ste5erAchehefrup3echej-caje6&thestawacuk=h#F3jet3aF"); -QString UBCryptoUtils::sAESSalt("6f0083e0-a90c-11de-ac21-0002a5d5c51b"); - - -UBCryptoUtils::UBCryptoUtils(QObject * pParent) - : QObject(pParent) -{ - aesInit(); -} - - -UBCryptoUtils::~UBCryptoUtils() -{ - // TODO UB 4.x aes destroy -#if OPENSSL_VERSION_NUMBER >= 10100000L - EVP_CIPHER_CTX_free(mAesEncryptContext); - EVP_CIPHER_CTX_free(mAesDecryptContext); -#endif -} - -void UBCryptoUtils::aesInit() -{ - int i, nrounds = 5; - unsigned char key[32], iv[32]; - unsigned char *key_data = (unsigned char *)sAESKey.toLatin1().data(); - int key_data_len = sAESKey.length(); - - i = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha1(), (unsigned char *)sAESSalt.toLatin1().data(), key_data, - key_data_len, nrounds, key, iv); - - if (i != 32) - { - qWarning() << QString("Key size is %1 bits - should be 256 bits").arg(i); - return; - } - -#if OPENSSL_VERSION_NUMBER >= 10100000L - mAesEncryptContext = EVP_CIPHER_CTX_new(); - EVP_EncryptInit_ex(mAesEncryptContext, EVP_aes_256_cbc(), NULL, key, iv); - mAesDecryptContext = EVP_CIPHER_CTX_new(); - EVP_DecryptInit_ex(mAesDecryptContext, EVP_aes_256_cbc(), NULL, key, iv); -#else - EVP_CIPHER_CTX_init(&mAesEncryptContext); - EVP_EncryptInit_ex(&mAesEncryptContext, EVP_aes_256_cbc(), NULL, key, iv); - EVP_CIPHER_CTX_init(&mAesDecryptContext); - EVP_DecryptInit_ex(&mAesDecryptContext, EVP_aes_256_cbc(), NULL, key, iv); -#endif -} diff --git a/src/frameworks/UBCryptoUtils.h b/src/frameworks/UBCryptoUtils.h deleted file mode 100644 index a4d2c249e..000000000 --- a/src/frameworks/UBCryptoUtils.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2015-2022 Département de l'Instruction Publique (DIP-SEM) - * - * Copyright (C) 2013 Open Education Foundation - * - * Copyright (C) 2010-2013 Groupement d'Intérêt Public pour - * l'Education Numérique en Afrique (GIP ENA) - * - * This file is part of OpenBoard. - * - * OpenBoard is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 3 of the License, - * with a specific linking exception for the OpenSSL project's - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * OpenBoard is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with OpenBoard. If not, see . - */ - - - - -#ifndef UBCRYPTOUTILS_H_ -#define UBCRYPTOUTILS_H_ - -#include -#include - -#include "core/UBApplication.h" - - -class UBCryptoUtils : public QObject -{ - Q_OBJECT; - - public: - - private: - - UBCryptoUtils(QObject * pParent = 0); - virtual ~UBCryptoUtils(); - - static UBCryptoUtils* sInstance; - static QString sAESKey; - static QString sAESSalt; - - void aesInit(); - -#if OPENSSL_VERSION_NUMBER >= 10100000L - EVP_CIPHER_CTX *mAesEncryptContext; - EVP_CIPHER_CTX *mAesDecryptContext; -#else - EVP_CIPHER_CTX mAesEncryptContext; - EVP_CIPHER_CTX mAesDecryptContext; -#endif - -}; - -#endif /* UBCRYPTOUTILS_H_ */ diff --git a/src/frameworks/frameworks.pri b/src/frameworks/frameworks.pri index 74d6edbbe..4fa797f56 100644 --- a/src/frameworks/frameworks.pri +++ b/src/frameworks/frameworks.pri @@ -5,7 +5,6 @@ HEADERS += src/frameworks/UBGeometryUtils.h \ src/frameworks/UBStringUtils.h \ src/frameworks/UBVersion.h \ src/frameworks/UBCoreGraphicsScene.h \ - src/frameworks/UBCryptoUtils.h \ src/frameworks/UBBase32.h SOURCES += src/frameworks/UBGeometryUtils.cpp \ @@ -14,7 +13,6 @@ SOURCES += src/frameworks/UBGeometryUtils.cpp \ src/frameworks/UBStringUtils.cpp \ src/frameworks/UBVersion.cpp \ src/frameworks/UBCoreGraphicsScene.cpp \ - src/frameworks/UBCryptoUtils.cpp \ src/frameworks/UBBase32.cpp From c0cb4f10b97658d3cb0584dce4ce45f3af62d4ee Mon Sep 17 00:00:00 2001 From: Vekhir Date: Tue, 13 Aug 2024 15:25:31 +0200 Subject: [PATCH 07/10] feat: remove YT upload option It hasn't worked for a few years due to API changes made by YT. --- src/podcast/UBPodcastController.cpp | 15 --------------- src/podcast/UBPodcastController.h | 1 - 2 files changed, 16 deletions(-) diff --git a/src/podcast/UBPodcastController.cpp b/src/podcast/UBPodcastController.cpp index 442972898..5dfa96ec4 100644 --- a/src/podcast/UBPodcastController.cpp +++ b/src/podcast/UBPodcastController.cpp @@ -51,7 +51,6 @@ #include "UBAbstractVideoEncoder.h" -#include "podcast/youtube/UBYouTubePublisher.h" #include "podcast/intranet/UBIntranetPodcastPublisher.h" #include "UBPodcastRecordingPalette.h" @@ -98,7 +97,6 @@ UBPodcastController::UBPodcastController(QObject* pParent) , mSmallVideoSizeAction(0) , mMediumVideoSizeAction(0) , mFullVideoSizeAction(0) - , mYoutubePublicationAction(0) , mIntranetPublicationAction(0) { connect(UBApplication::applicationController, SIGNAL(mainModeChanged(UBApplicationController::MainMode)), @@ -174,7 +172,6 @@ void UBPodcastController::updateActionState() } } - UBSettings::settings()->podcastPublishToYoutube->set(mYoutubePublicationAction && mYoutubePublicationAction->isChecked()); UBSettings::settings()->podcastPublishToIntranet->set(mIntranetPublicationAction && mIntranetPublicationAction->isChecked()); } @@ -693,12 +690,6 @@ void UBPodcastController::encodingFinished(bool ok) UBIntranetPodcastPublisher* intranet = new UBIntranetPodcastPublisher(this); // Self destroyed intranet->publishVideo(mVideoEncoder->videoFileName(), elapsedRecordingMs()); } - - if (mYoutubePublicationAction && mYoutubePublicationAction->isChecked()) - { - UBYouTubePublisher* youTube = new UBYouTubePublisher(this); // Self destroyed - youTube->uploadVideo(mVideoEncoder->videoFileName()); - } } } else @@ -943,12 +934,6 @@ QList UBPodcastController::podcastPublicationActions() mPodcastPublicationActions << mIntranetPublicationAction; - mYoutubePublicationAction = new QAction(tr("Publish to Youtube"), this); - mYoutubePublicationAction->setCheckable(true); - mYoutubePublicationAction->setChecked(UBSettings::settings()->podcastPublishToYoutube->get().toBool()); - - mPodcastPublicationActions << mYoutubePublicationAction; - foreach(QAction* publicationAction, mPodcastPublicationActions) { connect(publicationAction, SIGNAL(toggled(bool)), this, SLOT(actionToggled(bool))); diff --git a/src/podcast/UBPodcastController.h b/src/podcast/UBPodcastController.h index 975857670..bb7d22ee6 100644 --- a/src/podcast/UBPodcastController.h +++ b/src/podcast/UBPodcastController.h @@ -182,7 +182,6 @@ class UBPodcastController : public QObject QList mPodcastPublicationActions; - QAction *mYoutubePublicationAction; QAction *mIntranetPublicationAction; QString mPodcastRecordingPath; From 2865e2a034ee4ef759ca54b5dcada765785998c1 Mon Sep 17 00:00:00 2001 From: Vekhir Date: Tue, 13 Aug 2024 15:39:05 +0200 Subject: [PATCH 08/10] refactor: Remove YouTubePublishingDialog The dialog is inaccessible and uploading doesn't work due to outdated API Youtube upload support gets removed, including this dialog --- src/podcast/youtube/UBYouTubePublisher.cpp | 124 +-------------------- src/podcast/youtube/UBYouTubePublisher.h | 21 ---- 2 files changed, 1 insertion(+), 144 deletions(-) diff --git a/src/podcast/youtube/UBYouTubePublisher.cpp b/src/podcast/youtube/UBYouTubePublisher.cpp index e45f19b91..995345482 100644 --- a/src/podcast/youtube/UBYouTubePublisher.cpp +++ b/src/podcast/youtube/UBYouTubePublisher.cpp @@ -65,33 +65,8 @@ UBYouTubePublisher::~UBYouTubePublisher() void UBYouTubePublisher::uploadVideo(const QString& videoFilePath) { mVideoFilePath = videoFilePath; - - UBYouTubePublishingDialog pub(videoFilePath, UBApplication::mainWindow); - - pub.title->setText(QFileInfo(mVideoFilePath).completeBaseName()); - pub.keywords->setText(qApp->applicationName()); - QString defaultEMail = UBSettings::settings()->youTubeUserEMail->get().toString(); - pub.email->setText(defaultEMail); - - if (pub.exec() == QDialog::Accepted) - { - mTitle = pub.title->text(); - mDescription = pub.description->toPlainText(); - mCategories << pub.category->itemData(pub.category->currentIndex()).toString(); - mKeywords = pub.keywords->text(); - - QString email = pub.email->text(); - UBSettings::settings()->youTubeUserEMail->set(email); - - QString password = pub.password->text(); - - postClientLoginRequest(email, password); - } - else - { - deleteLater(); - } + deleteLater(); } @@ -312,100 +287,3 @@ void UBYouTubePublisher::progress (qint64 bytesSent, qint64 bytesTotal ) UBApplication::showMessage(tr("Upload to YouTube in progress %1 %").arg(percentage), percentage < 100); } - - -UBYouTubePublishingDialog::UBYouTubePublishingDialog(const QString& videoFilePath, QWidget *parent) - : QDialog(parent) -{ - Q_UNUSED(videoFilePath); - - Ui::YouTubePublishingDialog::setupUi(this); - - QMap cats = categories(); - - category->clear(); - int index = 0; - foreach(QString cat, cats.keys()) - { - category->addItem(cats.value(cat), cat); - if(cat == "Education") - category->setCurrentIndex(index); - - index++; - } - - connect(dialogButtons, SIGNAL(accepted()), this, SLOT(accept())); - connect(dialogButtons, SIGNAL(rejected()), this, SLOT(reject())); - - connect(title, SIGNAL(textChanged(const QString&)), this, SLOT(updateUIState(const QString&))); - connect(description, SIGNAL(textChanged()), this, SLOT(updateUIState())); - connect(keywords, SIGNAL(textChanged(const QString&)), this, SLOT(updateUIState(const QString&))); - - connect(email, SIGNAL(textChanged(const QString&)), this, SLOT(updateUIState(const QString&))); - connect(password, SIGNAL(textChanged(const QString&)), this, SLOT(updateUIState(const QString&))); - connect(youtubeCredentialsPersistence,SIGNAL(clicked()), this, SLOT(updateCredentialPersistenceState())); - - dialogButtons->button(QDialogButtonBox::Ok)->setEnabled(false); - dialogButtons->button(QDialogButtonBox::Ok)->setText(tr("Upload")); - - UBSettings* settings = UBSettings::settings(); - - email->setText(settings->youTubeUserEMail->get().toString()); - - youtubeCredentialsPersistence->setChecked(UBSettings::settings()->youTubeCredentialsPersistence->get().toBool()); - updatePersistanceEnableState(); -} - - -void UBYouTubePublishingDialog::updateCredentialPersistenceState() -{ - UBSettings::settings()->youTubeCredentialsPersistence->set(QVariant(youtubeCredentialsPersistence->checkState())); -} - -void UBYouTubePublishingDialog::updatePersistanceEnableState() -{ - bool enabled = email->text().length() || password->text().length(); - youtubeCredentialsPersistence->setEnabled(enabled); - youtubeCredentialsPersistence->setStyleSheet(enabled ? "color:black;" : "color : lightgrey;"); -} - -void UBYouTubePublishingDialog::updateUIState(const QString& string) -{ - Q_UNUSED(string); - - bool ok = title->text().length() > 0 - && description->toPlainText().length() > 0 - && keywords->text().length() > 0 - && email->text().length() > 0 - && password->text().length() > 0; - - dialogButtons->button(QDialogButtonBox::Ok)->setEnabled(ok); - updatePersistanceEnableState(); -} - - -QMap UBYouTubePublishingDialog::categories() -{ - // TODO UB 4.x download localized list from - // http://code.google.com/apis/youtube/2.0/reference.html#Localized_Category_Lists - - QMap cats; - - cats.insert("Autos", tr("Autos & Vehicles")); - cats.insert("Music", tr("Music")); - cats.insert("Animals", tr("Pets & Animals")); - cats.insert("Sports", tr("Sports")); - cats.insert("Travel", tr("Travel & Events")); - cats.insert("Games", tr("Gaming")); - cats.insert("Comedy", tr("Comedy")); - cats.insert("People", tr("People & Blogs")); - cats.insert("News", tr("News & Politics")); - cats.insert("Entertainment", tr("Entertainment")); - cats.insert("Education", tr("Education")); - cats.insert("Howto", tr("Howto & Style")); - cats.insert("Nonprofit", tr("Nonprofits & Activism")); - cats.insert("Tech", tr("Science & Technology")); - - return cats; -} - diff --git a/src/podcast/youtube/UBYouTubePublisher.h b/src/podcast/youtube/UBYouTubePublisher.h index 91ee48f45..10350813a 100644 --- a/src/podcast/youtube/UBYouTubePublisher.h +++ b/src/podcast/youtube/UBYouTubePublisher.h @@ -32,8 +32,6 @@ #include -#include "ui_youTubePublishingDialog.h" - class UBServerXMLHttpRequest; class UBYouTubePublisher : public QObject @@ -81,23 +79,4 @@ class UBYouTubePublisher : public QObject }; - -class UBYouTubePublishingDialog : public QDialog, public Ui::YouTubePublishingDialog -{ - Q_OBJECT; - - public: - UBYouTubePublishingDialog(const QString& videoFilePath, QWidget *parent = 0); - ~UBYouTubePublishingDialog(){}; - - private: - QMap categories(); - void updatePersistanceEnableState(); - - private slots: - void updateUIState(const QString& = QString("")); - void updateCredentialPersistenceState(); - -}; - #endif /* UBYOUTUBEPUBLISHER_H_ */ From 4f5fa8025d25580f1807c62f9664abcafa6566c6 Mon Sep 17 00:00:00 2001 From: Vekhir Date: Tue, 13 Aug 2024 15:44:20 +0200 Subject: [PATCH 09/10] refactor: Remove UBYouTubePublisher Publishing to YouTube was non-functional due to API changes on their part. Since noone reported issues with it, it is reasonable to assume that there are no users. Since the functionality is unmaintained, remove it entirely. In previous commits, the upload function was made inaccessible. Now remove the actual files. --- src/podcast/CMakeLists.txt | 2 - src/podcast/podcast.pri | 2 - src/podcast/youtube/UBYouTubePublisher.cpp | 289 --------------------- src/podcast/youtube/UBYouTubePublisher.h | 82 ------ 4 files changed, 375 deletions(-) delete mode 100644 src/podcast/youtube/UBYouTubePublisher.cpp delete mode 100644 src/podcast/youtube/UBYouTubePublisher.h diff --git a/src/podcast/CMakeLists.txt b/src/podcast/CMakeLists.txt index ca7087809..fb7968d7d 100644 --- a/src/podcast/CMakeLists.txt +++ b/src/podcast/CMakeLists.txt @@ -7,8 +7,6 @@ target_sources(${PROJECT_NAME} PRIVATE UBPodcastRecordingPalette.h intranet/UBIntranetPodcastPublisher.cpp intranet/UBIntranetPodcastPublisher.h - youtube/UBYouTubePublisher.cpp - youtube/UBYouTubePublisher.h ) if(WIN32) diff --git a/src/podcast/podcast.pri b/src/podcast/podcast.pri index 556d5d6b8..30a1d70a9 100644 --- a/src/podcast/podcast.pri +++ b/src/podcast/podcast.pri @@ -2,13 +2,11 @@ HEADERS += src/podcast/UBPodcastController.h \ src/podcast/UBAbstractVideoEncoder.h \ src/podcast/UBPodcastRecordingPalette.h \ - src/podcast/youtube/UBYouTubePublisher.h \ src/podcast/intranet/UBIntranetPodcastPublisher.h \ SOURCES += src/podcast/UBPodcastController.cpp \ src/podcast/UBAbstractVideoEncoder.cpp \ src/podcast/UBPodcastRecordingPalette.cpp \ - src/podcast/youtube/UBYouTubePublisher.cpp \ src/podcast/intranet/UBIntranetPodcastPublisher.cpp \ win32 { diff --git a/src/podcast/youtube/UBYouTubePublisher.cpp b/src/podcast/youtube/UBYouTubePublisher.cpp deleted file mode 100644 index 995345482..000000000 --- a/src/podcast/youtube/UBYouTubePublisher.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Copyright (C) 2015-2022 Département de l'Instruction Publique (DIP-SEM) - * - * Copyright (C) 2013 Open Education Foundation - * - * Copyright (C) 2010-2013 Groupement d'Intérêt Public pour - * l'Education Numérique en Afrique (GIP ENA) - * - * This file is part of OpenBoard. - * - * OpenBoard is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 3 of the License, - * with a specific linking exception for the OpenSSL project's - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * OpenBoard is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with OpenBoard. If not, see . - */ - - - - -#include "UBYouTubePublisher.h" - - - -#include "frameworks/UBFileSystemUtils.h" - -#include "core/UBApplication.h" -#include "core/UBSettings.h" -#include "core/UBSetting.h" - -#include "gui/UBMainWindow.h" - -#include "network/UBNetworkAccessManager.h" -#include "network/UBServerXMLHttpRequest.h" - -#include "core/memcheck.h" - -// API key linked to account dev.mnemis@gmail.com -const QString UBYouTubePublisher::sYouTubeDeveloperKey("AI39si62ga82stA4YBr5JjkfuRsFT-QyC4UYsFn7yYQFMe_dzg8xOc0r91BOhxSEhEr0gdWJGNnDsYbv9wvpyROd2Yre-6Zh7g"); - -UBYouTubePublisher::UBYouTubePublisher(QObject* pParent) - : QObject(pParent) - , mAuthRequest(0) - , mUploadRequest(0) -{ - // NOOP -} - - -UBYouTubePublisher::~UBYouTubePublisher() -{ - // NOOP -} - - -void UBYouTubePublisher::uploadVideo(const QString& videoFilePath) -{ - mVideoFilePath = videoFilePath; - QString defaultEMail = UBSettings::settings()->youTubeUserEMail->get().toString(); - deleteLater(); -} - - -void UBYouTubePublisher::postClientLoginRequest(const QString& userName, const QString& password) -{ - QString mUserName = userName; - - QUrl url("https://www.google.com/youtube/accounts/ClientLogin"); - - mAuthRequest = new UBServerXMLHttpRequest(UBNetworkAccessManager::defaultAccessManager() - , "application/x-www-form-urlencoded"); // destroyed in postClientLoginResponse - - connect(mAuthRequest, SIGNAL(finished(bool, const QByteArray&)), this, SLOT(postClientLoginResponse(bool, const QByteArray&))); - - mAuthRequest->addHeader("X-GData-Key", sYouTubeDeveloperKey); - - QString payload = QString("Email=%1&Passwd=%2&service=youtube&source=%3") - .arg(userName) - .arg(password) - .arg(qApp->applicationName()); - - mAuthRequest->post(url, payload.toUtf8()); - -} - - -void UBYouTubePublisher::postClientLoginResponse(bool success, const QByteArray& pPayload) -{ - Q_UNUSED(success); - mAuthToken = ""; - - QString auth = QString::fromUtf8(pPayload); - - if (auth.contains("Auth=")) - { - QStringList lines = auth.split("\n"); - - foreach(QString line, lines) - { - if(line.startsWith("Auth=")) - { - mAuthToken = line.replace("Auth=", ""); - break; - } - } - } - - mAuthRequest->deleteLater(); - mAuthRequest = 0; - - if(mAuthToken.length() == 0) - { - UBApplication::showMessage(tr("YouTube authentication failed.")); - // success = false; - deleteLater(); - } - else - { - qDebug() << "Retreived youtube auth token" << mAuthToken; - postVideoUploadRequest(); - } -} - - -void UBYouTubePublisher::postVideoUploadRequest() -{ - /* - * POST /feeds/api/users/default/uploads HTTP/1.1 - Host: gdata.youtube.com - Authorization: GoogleLogin auth= - GData-Version: 2 - X-GData-Client: - X-GData-Key: key= - Slug: - Content-Type: multipart/related; boundary="" - Content-Length: - Connection: close - - -- - Content-Type: application/atom+xml; charset=UTF-8 - - API_XML_request - -- - Content-Type: - Content-Transfer-Encoding: binary - - - ---- - */ - - QFile videoFile(mVideoFilePath); - - if(!videoFile.open(QIODevice::ReadOnly)) - { - qWarning() << "Cannot open file" << mVideoFilePath << "for upload to youtube"; - return; - } - - QUrl url("http://uploads.gdata.youtube.com/feeds/api/users/default/uploads"); - - QString boundary = "---------------------------f93dcbA3"; - QString contentType = QString("multipart/related; boundary=\"%1\"").arg(boundary); - - mUploadRequest = new UBServerXMLHttpRequest(UBNetworkAccessManager::defaultAccessManager() - , contentType); // destroyed in postVideoUploadResponse - - mUploadRequest->setVerbose(true); - connect(mUploadRequest, SIGNAL(progress(qint64, qint64)), this, SLOT(progress(qint64, qint64))); - - connect(mUploadRequest, SIGNAL(finished(bool, const QByteArray&)), this, SLOT(postVideoUploadResponse(bool, const QByteArray&))); - - mUploadRequest->addHeader("X-GData-Key", "key=" + sYouTubeDeveloperKey); - mUploadRequest->addHeader("Authorization", QString("GoogleLogin auth=%1").arg(mAuthToken)); - mUploadRequest->addHeader("GData-Version", "2"); - - QFileInfo fi(mVideoFilePath); - mUploadRequest->addHeader("Slug", fi.fileName()); - mUploadRequest->addHeader("Connection", "close"); // do we really ned that ? - - QByteArray payload; - - payload.append(QString("\n--" + boundary + "\n").toUtf8()) - .append(QString("Content-Type: application/atom+xml; charset=UTF-8\n\n").toUtf8()) - .append(youtubeMetadata().toUtf8()); - - payload.append(QString("\n--" + boundary + "\n").toUtf8()); - - QString videoMimeType = UBFileSystemUtils::mimeTypeFromFileName(mVideoFilePath); - - payload.append((QString("Content-Type: %1\n").arg(videoMimeType)).toUtf8()) - .append(QString("Content-Transfer-Encoding: binary\n\n").toUtf8()); - - payload.append(videoFile.readAll()); - - payload.append(QString("\n--" + boundary + "--\n").toUtf8()); - - mUploadRequest->post(url, payload); -} - - -void UBYouTubePublisher::postVideoUploadResponse(bool success, const QByteArray& pPayload) -{ - mUploadRequest->deleteLater(); - - if(success) - { - UBApplication::showMessage("The video has been uploaded to youtube", false); - } - else - { - qWarning() << "error uploading video to youtube" << QString::fromUtf8(pPayload); - - UBApplication::showMessage(tr("Error while uploading video to YouTube (%1)").arg(QString::fromUtf8(pPayload)), false); - } - - deleteLater(); -} - - -QString UBYouTubePublisher::youtubeMetadata() -{ - QString workingTitle; - - if (mTitle.length() > 0) - { - workingTitle = mTitle; - } - else - { - workingTitle = QFileInfo(mVideoFilePath).completeBaseName(); - } - - QString metadata; - - metadata += "\n"; - metadata += "\n"; - metadata += " \n"; - metadata += QString(" %1\n").arg(workingTitle); - - QString workingDescription = mDescription; - - if (workingDescription.length() > 4900) - { - workingDescription = workingDescription.left(4900) + "..."; - } - - workingDescription += "\n\nhttp://www.openboard.org"; - - if(workingDescription.length() == 0) - { - workingDescription = workingTitle; - } - - metadata += QString(" %1\n").arg(workingDescription); - - foreach(QString cat, mCategories) - { - metadata += QString(" %1\n").arg(cat); - } - - if (mKeywords.length() > 0) - { - metadata += QString(" %1\n").arg(mKeywords); - } - - metadata += " \n"; - metadata += ""; - - return metadata; - -} - - -void UBYouTubePublisher::progress (qint64 bytesSent, qint64 bytesTotal ) -{ - int percentage = (((qreal)bytesSent / (qreal)bytesTotal ) * 100); - - UBApplication::showMessage(tr("Upload to YouTube in progress %1 %").arg(percentage), percentage < 100); -} - diff --git a/src/podcast/youtube/UBYouTubePublisher.h b/src/podcast/youtube/UBYouTubePublisher.h deleted file mode 100644 index 10350813a..000000000 --- a/src/podcast/youtube/UBYouTubePublisher.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2015-2022 Département de l'Instruction Publique (DIP-SEM) - * - * Copyright (C) 2013 Open Education Foundation - * - * Copyright (C) 2010-2013 Groupement d'Intérêt Public pour - * l'Education Numérique en Afrique (GIP ENA) - * - * This file is part of OpenBoard. - * - * OpenBoard is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 3 of the License, - * with a specific linking exception for the OpenSSL project's - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * OpenBoard is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with OpenBoard. If not, see . - */ - - - - -#ifndef UBYOUTUBEPUBLISHER_H_ -#define UBYOUTUBEPUBLISHER_H_ - -#include - -class UBServerXMLHttpRequest; - -class UBYouTubePublisher : public QObject -{ - Q_OBJECT; - - public: - UBYouTubePublisher(QObject* pParent = 0); - virtual ~UBYouTubePublisher(); - - public slots: - - void uploadVideo(const QString& videoFilePath); - - signals: - - void postClientLoginRequestFinished(bool success, const QString& authToken); - - private slots: - - void postClientLoginRequest(const QString& userName, const QString& password); - void postClientLoginResponse(bool success, const QByteArray& pPayload); - - void postVideoUploadRequest(); - void postVideoUploadResponse(bool success, const QByteArray& pPayload); - void progress(qint64 bytesSent, qint64 bytesTotal); - - private: - - QString youtubeMetadata(); - - static const QString sYouTubeDeveloperKey; - - QString mVideoFilePath; - QString mAuthToken; - QString mUserName; - - QString mTitle; - QString mDescription; - QString mKeywords; - QStringList mCategories; - - UBServerXMLHttpRequest *mAuthRequest; - UBServerXMLHttpRequest *mUploadRequest; - -}; - -#endif /* UBYOUTUBEPUBLISHER_H_ */ From 3f8871cb55a97f83f08a08b99c06b28e3a7ccffa Mon Sep 17 00:00:00 2001 From: Vekhir Date: Tue, 13 Aug 2024 15:59:28 +0200 Subject: [PATCH 10/10] refactor: Remove YT dialog ui and YT related settings The `youTubePublishingDialog.ui` form is unused since the corresponding dialog code got removed. Related settings like storing the username are removed. Translations have to be cleaned up at a later point. --- OpenBoard.pro | 1 - resources/etc/OpenBoard.config | 5 - resources/forms/CMakeLists.txt | 1 - resources/forms/youTubePublishingDialog.ui | 170 --------------------- src/core/UBSettings.cpp | 7 - src/core/UBSettings.h | 4 - 6 files changed, 188 deletions(-) delete mode 100644 resources/forms/youTubePublishingDialog.ui diff --git a/OpenBoard.pro b/OpenBoard.pro index 17fb4e75a..f82e6408b 100644 --- a/OpenBoard.pro +++ b/OpenBoard.pro @@ -76,7 +76,6 @@ FORMS += resources/forms/mainWindow.ui \ resources/forms/documents.ui \ resources/forms/blackoutWidget.ui \ resources/forms/trapFlash.ui \ - resources/forms/youTubePublishingDialog.ui \ resources/forms/capturePublishing.ui \ resources/forms/intranetPodcastPublishingDialog.ui diff --git a/resources/etc/OpenBoard.config b/resources/etc/OpenBoard.config index ce77e232e..d64ba0eff 100644 --- a/resources/etc/OpenBoard.config +++ b/resources/etc/OpenBoard.config @@ -132,7 +132,6 @@ UsePDFMerger=true [Podcast] AudioRecordingDevice=Default FramesPerSecond=10 -PublishToYouTube=false QuickTimeQuality=High VideoSize=Medium WindowsMediaBitsPerSecond=1700000 @@ -152,7 +151,3 @@ PrivateBrowsing=false SearchEngineUrl=https://www.qwant.com/?q=%1 ShowPageImediatelyOnMirroredScreen=false UseExternalBrowser=false - -[YouTube] -CredentialsPersistence=false -UserEMail= diff --git a/resources/forms/CMakeLists.txt b/resources/forms/CMakeLists.txt index 547ea5411..7e8d6f08a 100644 --- a/resources/forms/CMakeLists.txt +++ b/resources/forms/CMakeLists.txt @@ -8,5 +8,4 @@ target_sources(${PROJECT_NAME} PRIVATE mainWindow.ui preferences.ui trapFlash.ui - youTubePublishingDialog.ui ) diff --git a/resources/forms/youTubePublishingDialog.ui b/resources/forms/youTubePublishingDialog.ui deleted file mode 100644 index e6a78c79d..000000000 --- a/resources/forms/youTubePublishingDialog.ui +++ /dev/null @@ -1,170 +0,0 @@ - - - YouTubePublishingDialog - - - Qt::WindowModal - - - - 0 - 0 - 540 - 534 - - - - Publish Podcast to YouTube - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Title - - - - - - - 60 - - - - - - - Description - - - - - - - - 0 - 0 - - - - - 0 - 168 - - - - - - - - Keywords - - - - - - - OpenBoard - - - - - - - Category - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - - - - - YouTube Username - - - - - - - - - - YouTube Password - - - - - - - QLineEdit::Password - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:10pt;">By clicking 'Upload,' you certify that you own all rights to the content or that you are authorized by the owner to make the content publicly available on YouTube, and that it otherwise complies with the YouTube Terms of Service located at </span><a href="http://www.youtube.com/t/terms"><span style=" font-family:'Lucida Grande'; font-size:10pt; text-decoration: underline; color:#0000ff;">http://www.youtube.com/t/terms</span></a></p></body></html> - - - true - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - Restore credentials on reboot - - - true - - - - - - - - - - - diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index 372d6039c..017dbf094 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -431,10 +431,6 @@ void UBSettings::init() podcastWindowsMediaBitsPerSecond = new UBSetting(this, "Podcast", "WindowsMediaBitsPerSecond", 1700000); podcastQuickTimeQuality = new UBSetting(this, "Podcast", "QuickTimeQuality", "High"); - podcastPublishToYoutube = new UBSetting(this, "Podcast", "PublishToYouTube", false); - youTubeUserEMail = new UBSetting(this, "YouTube", "UserEMail", ""); - youTubeCredentialsPersistence = new UBSetting(this,"YouTube", "CredentialsPersistence",false); - communityUser = new UBSetting(this, "Community", "Username", ""); communityPsw = new UBSetting(this, "Community", "Password", ""); communityCredentialsPersistence = new UBSetting(this,"Community", "CredentialsPersistence",false); @@ -1421,9 +1417,6 @@ void UBSettings::cleanNonPersistentSettings() communityUser->set(QVariant("")); } - if(!youTubeCredentialsPersistence->get().toBool()){ - youTubeUserEMail->set(QVariant("")); - } proxyUser->set(QVariant("")); proxyPsw->set(QVariant("")); } diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h index 757ce05f4..727ad75ab 100644 --- a/src/core/UBSettings.h +++ b/src/core/UBSettings.h @@ -372,10 +372,6 @@ class UBSettings : public QObject UBSetting* podcastAudioRecordingDevice; UBSetting* podcastQuickTimeQuality; - UBSetting* podcastPublishToYoutube; - UBSetting* youTubeUserEMail; - UBSetting* youTubeCredentialsPersistence; - UBSetting* podcastPublishToIntranet; UBSetting* intranetPodcastPublishingUrl; UBSetting* intranetPodcastAuthor;