From 4d9f07e797f5c651c92bc5275c207a4e930898d4 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 26 Mar 2011 23:19:28 +0000 Subject: [PATCH] Saved the visible state of the avatar picture in private chat for the friend. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4105 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/chat/PopupChatDialog.cpp | 4 +++- retroshare-gui/src/gui/settings/RsharePeerSettings.cpp | 10 ++++++++++ retroshare-gui/src/gui/settings/RsharePeerSettings.h | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index a2affc63a..b8aa7cfd7 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -107,7 +107,7 @@ PopupChatDialog::PopupChatDialog(const std::string &id, const QString &name, QWi style.setStyleFromSettings(ChatStyle::TYPE_PRIVATE); /* Hide or show the frames */ - showAvatarFrame(true); + showAvatarFrame(PeerSettings->getShowAvatarFrame(dialogId)); ui.infoframe->setVisible(false); ui.statusmessagelabel->hide(); @@ -750,6 +750,8 @@ void PopupChatDialog::showAvatarFrame(bool show) ui.avatarFrameButton->setToolTip(tr("Show Avatar")); ui.avatarFrameButton->setIcon(QIcon(":images/show_toolbox_frame.png")); } + + PeerSettings->setShowAvatarFrame(dialogId, show); } void PopupChatDialog::on_closeInfoFrameButton_clicked() diff --git a/retroshare-gui/src/gui/settings/RsharePeerSettings.cpp b/retroshare-gui/src/gui/settings/RsharePeerSettings.cpp index 355e9c33e..580e943cd 100644 --- a/retroshare-gui/src/gui/settings/RsharePeerSettings.cpp +++ b/retroshare-gui/src/gui/settings/RsharePeerSettings.cpp @@ -196,3 +196,13 @@ void RsharePeerSettings::loadWidgetInformation(const std::string &peerId, QWidge endGroup(); endGroup(); } + +bool RsharePeerSettings::getShowAvatarFrame(const std::string &peerId) +{ + return get(peerId, "ShowAvatarFrame", true).toBool(); +} + +void RsharePeerSettings::setShowAvatarFrame(const std::string &peerId, bool value) +{ + return set(peerId, "ShowAvatarFrame", value); +} diff --git a/retroshare-gui/src/gui/settings/RsharePeerSettings.h b/retroshare-gui/src/gui/settings/RsharePeerSettings.h index fe1694647..c312ad77c 100644 --- a/retroshare-gui/src/gui/settings/RsharePeerSettings.h +++ b/retroshare-gui/src/gui/settings/RsharePeerSettings.h @@ -40,6 +40,9 @@ public: void saveWidgetInformation(const std::string &peerId, QWidget *widget); void loadWidgetInformation(const std::string &peerId, QWidget *widget); + bool getShowAvatarFrame(const std::string &peerId); + void setShowAvatarFrame(const std::string &peerId, bool value); + protected: /** Default constructor. */ RsharePeerSettings();