store discourse api key

This commit is contained in:
Stojce Slavkovski 2014-05-02 22:16:19 +02:00
parent 852756e84d
commit d3fecd7a31
5 changed files with 41 additions and 3 deletions

View file

@ -44,3 +44,9 @@ SnapshotShareDialog::SnapshotShareDialog(QString fileName, QWidget* parent) : QD
ui.snapshotWidget->setPixmap(snaphsotPixmap);
ui.snapshotWidget->adjustSize();
}
void SnapshotShareDialog::accept() {
// post to Discourse forum
close();
}

View file

@ -20,6 +20,9 @@ public:
private:
QString _fileName;
Ui_SnapshotShareDialog ui;
private slots:
void accept();
};
#endif /* defined(__hifi__snapshotShareDialog__) */

View file

@ -311,5 +311,22 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
<resources/>
<connections/>
<connections>
<connection>
<sender>shareButton</sender>
<signal>clicked()</signal>
<receiver>SnapshotShareDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>420</x>
<y>565</y>
</hint>
<hint type="destinationlabel">
<x>250</x>
<y>307</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View file

@ -16,7 +16,8 @@
DataServerAccountInfo::DataServerAccountInfo() :
_accessToken(),
_username(),
_xmppPassword()
_xmppPassword(),
_discourseApiKey()
{
}
@ -29,6 +30,7 @@ DataServerAccountInfo::DataServerAccountInfo(const QJsonObject& jsonObject) :
QJsonObject userJSONObject = jsonObject["user"].toObject();
setUsername(userJSONObject["username"].toString());
setXMPPPassword(userJSONObject["xmpp_password"].toString());
setDiscourseApiKey(userJSONObject["discourse_api_key"].toString());
}
DataServerAccountInfo::DataServerAccountInfo(const DataServerAccountInfo& otherInfo) {
@ -65,6 +67,12 @@ void DataServerAccountInfo::setXMPPPassword(const QString& xmppPassword) {
}
}
void DataServerAccountInfo::setDiscourseApiKey(const QString& discourseApiKey) {
if (_discourseApiKey != discourseApiKey) {
_discourseApiKey = discourseApiKey;
}
}
QDataStream& operator<<(QDataStream &out, const DataServerAccountInfo& info) {
out << info._accessToken << info._username << info._xmppPassword;
return out;

View file

@ -31,7 +31,10 @@ public:
const QString& getXMPPPassword() const { return _xmppPassword; }
void setXMPPPassword(const QString& xmppPassword);
const QString& getDiscourseApiKey() const { return _discourseApiKey; }
void setDiscourseApiKey(const QString& discourseApiKey);
friend QDataStream& operator<<(QDataStream &out, const DataServerAccountInfo& info);
friend QDataStream& operator>>(QDataStream &in, DataServerAccountInfo& info);
private:
@ -40,6 +43,7 @@ private:
OAuthAccessToken _accessToken;
QString _username;
QString _xmppPassword;
QString _discourseApiKey;
};
#endif // hifi_DataServerAccountInfo_h