fixed issue 1164

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 0aec9cc4ae
commit 233415d24a
  1. 4
      resources/forms/preferences.ui
  2. 14
      resources/forms/youTubePublishingDialog.ui
  3. 10
      src/core/UBPreferencesController.cpp
  4. 12
      src/core/UBSettings.cpp
  5. 5
      src/core/UBSettings.h
  6. 15
      src/podcast/youtube/UBYouTubePublisher.cpp
  7. 2
      src/podcast/youtube/UBYouTubePublisher.h

@ -681,7 +681,7 @@
</spacer> </spacer>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="QCheckBox" name="PSDataPersistenceCheckBox"> <widget class="QCheckBox" name="PSCredentialsPersistenceCheckBox">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1342,7 +1342,7 @@ p, li { white-space: pre-wrap; }
&lt;tr&gt; &lt;tr&gt;
&lt;td style=&quot;border: none;&quot;&gt; &lt;td style=&quot;border: none;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Open-Sankoré version 1.4 , Copyright (C) 2010-2012 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;Vous pouvez consulter et charger le code source du logiciel sur &lt;/span&gt;&lt;a href=&quot;https://github.com/Sankore&quot;&gt;&lt;span style=&quot; font-size:11pt; text-decoration: underline; color:#0000ff;&quot;&gt;&amp;lt;https://github.com/Sankore&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;&lt;br /&gt;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.&lt;br /&gt;Veuillez consulter la licence Lesser GNU General Public Licence située dans l'onglet Licences ou consulter le site &lt;/span&gt;&lt;a href=&quot;http://www.gnu.org/licenses/&quot;&gt;&lt;span style=&quot; font-size:11pt; text-decoration: underline; color:#0000ff;&quot;&gt;&amp;lt;http://www.gnu.org/licenses/&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;.&lt;br /&gt;&lt;br /&gt;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 &lt;/span&gt;&lt;a href=&quot;https://github.com/Sankore&quot;&gt;&lt;span style=&quot; font-size:11pt; text-decoration: underline; color:#0000ff;&quot;&gt;&amp;lt;https://github.com/Sankore&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Open-Sankoré version 1.4 , Copyright (C) 2010-2012 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;Vous pouvez consulter et charger le code source du logiciel sur &lt;/span&gt;&lt;a href=&quot;https://github.com/Sankore&quot;&gt;&lt;span style=&quot; font-size:11pt; text-decoration: underline; color:#0000ff;&quot;&gt;&amp;lt;https://github.com/Sankore&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;&lt;br /&gt;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.&lt;br /&gt;Veuillez consulter la licence Lesser GNU General Public Licence située dans l'onglet Licences ou consulter le site &lt;/span&gt;&lt;a href=&quot;http://www.gnu.org/licenses/&quot;&gt;&lt;span style=&quot; font-size:11pt; text-decoration: underline; color:#0000ff;&quot;&gt;&amp;lt;http://www.gnu.org/licenses/&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;.&lt;br /&gt;&lt;br /&gt;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 &lt;/span&gt;&lt;a href=&quot;https://github.com/Sankore&quot;&gt;&lt;span style=&quot; font-size:11pt; text-decoration: underline; color:#0000ff;&quot;&gt;&amp;lt;https://github.com/Sankore&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Contact : &lt;br /&gt;Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)&lt;br /&gt;Délégation Interministérielle à l'Education Numérique en Afrique&lt;br /&gt;20 Avenue Ségur Paris 75007&lt;br /&gt;Téléphone : 01 43 17 68 08&lt;br /&gt;email: &lt;/span&gt;&lt;a href=&quot;mailto:contact@sankore.org&quot;&gt;&lt;span style=&quot; font-size:11pt; text-decoration: underline; color:#0000ff;&quot;&gt;contact@sankore.org&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Contact : &lt;br /&gt;Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)&lt;br /&gt;Délégation Interministérielle à l'Education Numérique en Afrique&lt;br /&gt;20 Avenue Ségur Paris 75007&lt;br /&gt;Téléphone : 01 43 17 68 08&lt;br /&gt;email: &lt;/span&gt;&lt;a href=&quot;mailto:contact@sankore.org&quot;&gt;&lt;span style=&quot; font-size:11pt; text-decoration: underline; color:#0000ff;&quot;&gt;contact@sankore.org&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
</widget> </widget>
</item> </item>

@ -123,7 +123,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="1"> <item row="10" column="1">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
@ -143,13 +143,23 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="1"> <item row="11" column="1">
<widget class="QDialogButtonBox" name="dialogButtons"> <widget class="QDialogButtonBox" name="dialogButtons">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="1">
<widget class="QCheckBox" name="youtubeCredentialsPersistence">
<property name="text">
<string>Restore credentials on reboot</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>

@ -163,7 +163,7 @@ void UBPreferencesController::wire()
//network //network
connect(mPreferencesUI->Username_textBox, SIGNAL(editingFinished()), this, SLOT(onCommunityUsernameChanged())); connect(mPreferencesUI->Username_textBox, SIGNAL(editingFinished()), this, SLOT(onCommunityUsernameChanged()));
connect(mPreferencesUI->Password_textEdit, SIGNAL(editingFinished()), this, SLOT(onCommunityPasswordChanged())); 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 // about tab
connect(mPreferencesUI->checkSoftwareUpdateAtLaunchCheckBox, SIGNAL(clicked(bool)), settings->appEnableAutomaticSoftwareUpdates, SLOT(setBool(bool))); 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); mMarkerProperties->opacitySlider->setValue(settings->boardMarkerAlpha->get().toDouble() * 100);
//network //network
mPreferencesUI->PSDataPersistenceCheckBox->setChecked(settings->getCommunityDataPersistence()); mPreferencesUI->PSCredentialsPersistenceCheckBox->setChecked(settings->getCommunityDataPersistence());
persistanceCheckboxUpdate(); persistanceCheckboxUpdate();
} }
@ -238,14 +238,14 @@ void UBPreferencesController::onCommunityPasswordChanged()
void UBPreferencesController::onCommunityPersistenceChanged() void UBPreferencesController::onCommunityPersistenceChanged()
{ {
UBSettings::settings()->setCommunityPersistence(mPreferencesUI->PSDataPersistenceCheckBox->isChecked()); UBSettings::settings()->setCommunityPersistence(mPreferencesUI->PSCredentialsPersistenceCheckBox->isChecked());
} }
void UBPreferencesController::persistanceCheckboxUpdate() void UBPreferencesController::persistanceCheckboxUpdate()
{ {
bool checkBoxEnabled = mPreferencesUI->Username_textBox->text().length() || mPreferencesUI->Password_textEdit->text().length(); bool checkBoxEnabled = mPreferencesUI->Username_textBox->text().length() || mPreferencesUI->Password_textEdit->text().length();
mPreferencesUI->PSDataPersistenceCheckBox->setEnabled(checkBoxEnabled); mPreferencesUI->PSCredentialsPersistenceCheckBox->setEnabled(checkBoxEnabled);
mPreferencesUI->PSDataPersistenceCheckBox->setStyleSheet(checkBoxEnabled ? "color:black;" : "color:lightgray;"); mPreferencesUI->PSCredentialsPersistenceCheckBox->setStyleSheet(checkBoxEnabled ? "color:black;" : "color:lightgray;");
} }

@ -350,6 +350,7 @@ void UBSettings::init()
podcastPublishToYoutube = new UBSetting(this, "Podcast", "PublishToYouTube", false); podcastPublishToYoutube = new UBSetting(this, "Podcast", "PublishToYouTube", false);
youTubeUserEMail = new UBSetting(this, "YouTube", "UserEMail", ""); youTubeUserEMail = new UBSetting(this, "YouTube", "UserEMail", "");
youTubeCredentialsPersistence = new UBSetting(this,"YouTube", "CredentialsPersistence",false);
uniboardWebEMail = new UBSetting(this, "UniboardWeb", "EMail", ""); uniboardWebEMail = new UBSetting(this, "UniboardWeb", "EMail", "");
uniboardWebAuthor = new UBSetting(this, "UniboardWeb", "Author", ""); uniboardWebAuthor = new UBSetting(this, "UniboardWeb", "Author", "");
@ -357,7 +358,7 @@ void UBSettings::init()
communityUser = new UBSetting(this, "Community", "Username", ""); communityUser = new UBSetting(this, "Community", "Username", "");
communityPsw = new UBSetting(this, "Community", "Password", ""); 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(); QStringList uris = UBToolsManager::manager()->allToolIDs();
@ -1185,7 +1186,7 @@ void UBSettings::setCommunityPassword(const QString &password)
void UBSettings::setCommunityPersistence(const bool persistence) void UBSettings::setCommunityPersistence(const bool persistence)
{ {
communityDataPersistence->set(QVariant(persistence)); communityCredentialsPersistence->set(QVariant(persistence));
} }
int UBSettings::libraryIconSize(){ int UBSettings::libraryIconSize(){
@ -1233,8 +1234,13 @@ void UBSettings::closing()
void UBSettings::cleanNonPersistentSettings() void UBSettings::cleanNonPersistentSettings()
{ {
if(!communityDataPersistence->get().toBool()){ if(!communityCredentialsPersistence->get().toBool()){
communityPsw->set(QVariant("")); communityPsw->set(QVariant(""));
communityUser->set(QVariant("")); communityUser->set(QVariant(""));
} }
if(!youTubeCredentialsPersistence->get().toBool()){
removePassword(youTubeUserEMail->get().toString());
youTubeUserEMail->set(QVariant(""));
}
} }

@ -96,7 +96,7 @@ class UBSettings : public QObject
void setCommunityUsername(const QString& username); void setCommunityUsername(const QString& username);
QString communityPassword(); QString communityPassword();
void setCommunityPassword(const QString& password); void setCommunityPassword(const QString& password);
bool getCommunityDataPersistence(){return communityDataPersistence->get().toBool();} bool getCommunityDataPersistence(){return communityCredentialsPersistence->get().toBool();}
void setCommunityPersistence(const bool persistence); void setCommunityPersistence(const bool persistence);
int libraryIconSize(); int libraryIconSize();
@ -305,6 +305,7 @@ class UBSettings : public QObject
UBSetting* podcastPublishToYoutube; UBSetting* podcastPublishToYoutube;
UBSetting* youTubeUserEMail; UBSetting* youTubeUserEMail;
UBSetting* youTubeCredentialsPersistence;
UBSetting* uniboardWebEMail; UBSetting* uniboardWebEMail;
UBSetting* uniboardWebAuthor; UBSetting* uniboardWebAuthor;
@ -340,7 +341,7 @@ class UBSettings : public QObject
UBSetting* communityUser; UBSetting* communityUser;
UBSetting* communityPsw; UBSetting* communityPsw;
UBSetting* communityDataPersistence; UBSetting* communityCredentialsPersistence;
UBSetting* pageSize; UBSetting* pageSize;
UBSetting* pageDpi; UBSetting* pageDpi;

@ -335,10 +335,25 @@ UBYouTubePublishingDialog::UBYouTubePublishingDialog(const QString& videoFilePat
connect(email, 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(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)->setEnabled(false);
dialogButtons->button(QDialogButtonBox::Ok)->setText(tr("Upload")); 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) void UBYouTubePublishingDialog::updateUIState(const QString& string)

@ -78,9 +78,11 @@ class UBYouTubePublishingDialog : public QDialog, public Ui::YouTubePublishingDi
private: private:
QMap<QString, QString> categories(); QMap<QString, QString> categories();
void updatePersistanceEnableState();
private slots: private slots:
void updateUIState(const QString& = QString("")); void updateUIState(const QString& = QString(""));
void updateCredentialPersistenceState();
}; };

Loading…
Cancel
Save