diff --git a/resources/forms/preferences.ui b/resources/forms/preferences.ui
index 3bb29323..1893778a 100644
--- a/resources/forms/preferences.ui
+++ b/resources/forms/preferences.ui
@@ -681,7 +681,7 @@
-
-
+
0
@@ -1342,7 +1342,7 @@ p, li { white-space: pre-wrap; }
<tr>
<td style="border: none;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">Open-Sankoré version 1.4 , Copyright (C) 2010-2012 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)<br /><br />Open-Sankoré est un logiciel libre : vous pouvez le redistribuer et/ou le modifier en respectant les termes de la Lesser GNU general Public Licence (GNU LGPL) telle que publiée par la Free Software Foundation en version 2 ou une version plus récente.<br />Vous pouvez consulter et charger le code source du logiciel sur </span><a href="https://github.com/Sankore"><span style=" font-size:11pt; text-decoration: underline; color:#0000ff;"><https://github.com/Sankore></span></a><span style=" font-size:11pt;"><br />Open-Sankoré est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE, sans même la garantie implicite de COMMERCIALISATION ou D'ADAPTATION A UN OBJET PARTICULIER.<br />Veuillez consulter la licence Lesser GNU General Public Licence située dans l'onglet Licences ou consulter le site </span><a href="http://www.gnu.org/licenses/"><span style=" font-size:11pt; text-decoration: underline; color:#0000ff;"><http://www.gnu.org/licenses/></span></a><span style=" font-size:11pt;">.<br /><br />Open-Sankoré is free software: you can redistribute it and/or modify it under the terms of the Lesser GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or any later version. You can find the source code of this software at </span><a href="https://github.com/Sankore"><span style=" font-size:11pt; text-decoration: underline; color:#0000ff;"><https://github.com/Sankore></span></a><span style=" font-size:11pt;"><br />Open-Sankoré 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 Lesser GNU General Public License below for more details.<br /><br /></span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">Contact : <br />Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)<br />Délégation Interministérielle à l'Education Numérique en Afrique<br />20 Avenue Ségur Paris 75007<br />Téléphone : 01 43 17 68 08<br />email: </span><a href="mailto:contact@sankore.org"><span style=" font-size:11pt; text-decoration: underline; color:#0000ff;">contact@sankore.org</span></a><span style=" font-size:11pt;">"</span></p></td></tr></table></body></html>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">Contact : <br />Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)<br />Délégation Interministérielle à l'Education Numérique en Afrique<br />20 Avenue Ségur Paris 75007<br />Téléphone : 01 43 17 68 08<br />email: </span><a href="mailto:contact@sankore.org"><span style=" font-size:11pt; text-decoration: underline; color:#0000ff;">contact@sankore.org</span></a><span style=" font-size:11pt;">"</span></p></td></tr></table></body></html>
diff --git a/resources/forms/youTubePublishingDialog.ui b/resources/forms/youTubePublishingDialog.ui
index e7b83b67..b07f7994 100644
--- a/resources/forms/youTubePublishingDialog.ui
+++ b/resources/forms/youTubePublishingDialog.ui
@@ -123,7 +123,7 @@
- -
+
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
@@ -143,13 +143,23 @@ p, li { white-space: pre-wrap; }
- -
+
-
QDialogButtonBox::Cancel|QDialogButtonBox::Ok
+ -
+
+
+ Restore credentials on reboot
+
+
+ true
+
+
+
diff --git a/src/core/UBPreferencesController.cpp b/src/core/UBPreferencesController.cpp
index 44879aaa..64fb3b20 100644
--- a/src/core/UBPreferencesController.cpp
+++ b/src/core/UBPreferencesController.cpp
@@ -163,7 +163,7 @@ void UBPreferencesController::wire()
//network
connect(mPreferencesUI->Username_textBox, SIGNAL(editingFinished()), this, SLOT(onCommunityUsernameChanged()));
connect(mPreferencesUI->Password_textEdit, SIGNAL(editingFinished()), this, SLOT(onCommunityPasswordChanged()));
- connect(mPreferencesUI->PSDataPersistenceCheckBox,SIGNAL(clicked()),this, SLOT(onCommunityPersistenceChanged()));
+ connect(mPreferencesUI->PSCredentialsPersistenceCheckBox,SIGNAL(clicked()),this, SLOT(onCommunityPersistenceChanged()));
// about tab
connect(mPreferencesUI->checkSoftwareUpdateAtLaunchCheckBox, SIGNAL(clicked(bool)), settings->appEnableAutomaticSoftwareUpdates, SLOT(setBool(bool)));
@@ -217,7 +217,7 @@ void UBPreferencesController::init()
mMarkerProperties->opacitySlider->setValue(settings->boardMarkerAlpha->get().toDouble() * 100);
//network
- mPreferencesUI->PSDataPersistenceCheckBox->setChecked(settings->getCommunityDataPersistence());
+ mPreferencesUI->PSCredentialsPersistenceCheckBox->setChecked(settings->getCommunityDataPersistence());
persistanceCheckboxUpdate();
}
@@ -238,14 +238,14 @@ void UBPreferencesController::onCommunityPasswordChanged()
void UBPreferencesController::onCommunityPersistenceChanged()
{
- UBSettings::settings()->setCommunityPersistence(mPreferencesUI->PSDataPersistenceCheckBox->isChecked());
+ UBSettings::settings()->setCommunityPersistence(mPreferencesUI->PSCredentialsPersistenceCheckBox->isChecked());
}
void UBPreferencesController::persistanceCheckboxUpdate()
{
bool checkBoxEnabled = mPreferencesUI->Username_textBox->text().length() || mPreferencesUI->Password_textEdit->text().length();
- mPreferencesUI->PSDataPersistenceCheckBox->setEnabled(checkBoxEnabled);
- mPreferencesUI->PSDataPersistenceCheckBox->setStyleSheet(checkBoxEnabled ? "color:black;" : "color:lightgray;");
+ mPreferencesUI->PSCredentialsPersistenceCheckBox->setEnabled(checkBoxEnabled);
+ mPreferencesUI->PSCredentialsPersistenceCheckBox->setStyleSheet(checkBoxEnabled ? "color:black;" : "color:lightgray;");
}
diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp
index 55a8e5f8..77142126 100644
--- a/src/core/UBSettings.cpp
+++ b/src/core/UBSettings.cpp
@@ -350,6 +350,7 @@ void UBSettings::init()
podcastPublishToYoutube = new UBSetting(this, "Podcast", "PublishToYouTube", false);
youTubeUserEMail = new UBSetting(this, "YouTube", "UserEMail", "");
+ youTubeCredentialsPersistence = new UBSetting(this,"YouTube", "CredentialsPersistence",false);
uniboardWebEMail = new UBSetting(this, "UniboardWeb", "EMail", "");
uniboardWebAuthor = new UBSetting(this, "UniboardWeb", "Author", "");
@@ -357,7 +358,7 @@ void UBSettings::init()
communityUser = new UBSetting(this, "Community", "Username", "");
communityPsw = new UBSetting(this, "Community", "Password", "");
- communityDataPersistence = new UBSetting(this,"Community", "DataPeristence",true);
+ communityCredentialsPersistence = new UBSetting(this,"Community", "CredentialsPersistence",false);
QStringList uris = UBToolsManager::manager()->allToolIDs();
@@ -1185,7 +1186,7 @@ void UBSettings::setCommunityPassword(const QString &password)
void UBSettings::setCommunityPersistence(const bool persistence)
{
- communityDataPersistence->set(QVariant(persistence));
+ communityCredentialsPersistence->set(QVariant(persistence));
}
int UBSettings::libraryIconSize(){
@@ -1233,8 +1234,13 @@ void UBSettings::closing()
void UBSettings::cleanNonPersistentSettings()
{
- if(!communityDataPersistence->get().toBool()){
+ if(!communityCredentialsPersistence->get().toBool()){
communityPsw->set(QVariant(""));
communityUser->set(QVariant(""));
}
+
+ if(!youTubeCredentialsPersistence->get().toBool()){
+ removePassword(youTubeUserEMail->get().toString());
+ youTubeUserEMail->set(QVariant(""));
+ }
}
diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h
index a66de501..32e353d9 100644
--- a/src/core/UBSettings.h
+++ b/src/core/UBSettings.h
@@ -96,7 +96,7 @@ class UBSettings : public QObject
void setCommunityUsername(const QString& username);
QString communityPassword();
void setCommunityPassword(const QString& password);
- bool getCommunityDataPersistence(){return communityDataPersistence->get().toBool();}
+ bool getCommunityDataPersistence(){return communityCredentialsPersistence->get().toBool();}
void setCommunityPersistence(const bool persistence);
int libraryIconSize();
@@ -305,6 +305,7 @@ class UBSettings : public QObject
UBSetting* podcastPublishToYoutube;
UBSetting* youTubeUserEMail;
+ UBSetting* youTubeCredentialsPersistence;
UBSetting* uniboardWebEMail;
UBSetting* uniboardWebAuthor;
@@ -340,7 +341,7 @@ class UBSettings : public QObject
UBSetting* communityUser;
UBSetting* communityPsw;
- UBSetting* communityDataPersistence;
+ UBSetting* communityCredentialsPersistence;
UBSetting* pageSize;
UBSetting* pageDpi;
diff --git a/src/podcast/youtube/UBYouTubePublisher.cpp b/src/podcast/youtube/UBYouTubePublisher.cpp
index ac6e0216..0878657d 100644
--- a/src/podcast/youtube/UBYouTubePublisher.cpp
+++ b/src/podcast/youtube/UBYouTubePublisher.cpp
@@ -335,10 +335,25 @@ UBYouTubePublishingDialog::UBYouTubePublishingDialog(const QString& videoFilePat
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"));
+ youtubeCredentialsPersistence->setChecked(UBSettings::settings()->youTubeCredentialsPersistence->get().toBool());
+}
+
+
+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 lightgray;");
}
void UBYouTubePublishingDialog::updateUIState(const QString& string)
diff --git a/src/podcast/youtube/UBYouTubePublisher.h b/src/podcast/youtube/UBYouTubePublisher.h
index f6c0d34d..fdea6314 100644
--- a/src/podcast/youtube/UBYouTubePublisher.h
+++ b/src/podcast/youtube/UBYouTubePublisher.h
@@ -78,9 +78,11 @@ class UBYouTubePublishingDialog : public QDialog, public Ui::YouTubePublishingDi
private:
QMap categories();
+ void updatePersistanceEnableState();
private slots:
void updateUIState(const QString& = QString(""));
+ void updateCredentialPersistenceState();
};