2010-09-10 18:38:46 +00:00
|
|
|
/****************************************************************
|
|
|
|
* This file is distributed under the following license:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 - 2010, RetroShare Team
|
|
|
|
*
|
|
|
|
* This program 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; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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 this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
#ifndef _RSHAREPEERSETTINGS_H
|
|
|
|
#define _RSHAREPEERSETTINGS_H
|
|
|
|
|
|
|
|
#include <QSettings>
|
|
|
|
|
2011-04-09 22:52:52 +00:00
|
|
|
class RSStyle;
|
|
|
|
|
2010-09-10 18:38:46 +00:00
|
|
|
/** Handles saving and restoring RShares's settings for peers */
|
|
|
|
class RsharePeerSettings : public QSettings
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/* create settings object */
|
|
|
|
static void Create ();
|
|
|
|
|
2014-03-17 20:56:06 +00:00
|
|
|
QString getPrivateChatColor(const RsPeerId &peerId);
|
|
|
|
void setPrivateChatColor(const RsPeerId &peerId, const QString &value);
|
2010-09-10 18:38:46 +00:00
|
|
|
|
2014-03-17 20:56:06 +00:00
|
|
|
QString getPrivateChatFont(const RsPeerId &peerId);
|
|
|
|
void setPrivateChatFont(const RsPeerId &peerId, const QString &value);
|
2010-09-10 18:38:46 +00:00
|
|
|
|
2014-03-17 20:56:06 +00:00
|
|
|
bool getPrivateChatOnTop(const RsPeerId &peerId);
|
|
|
|
void setPrivateChatOnTop(const RsPeerId &peerId, bool value);
|
2011-07-08 22:33:26 +00:00
|
|
|
|
2014-03-17 20:56:06 +00:00
|
|
|
void saveWidgetInformation(const RsPeerId &peerId, QWidget *widget);
|
|
|
|
void loadWidgetInformation(const RsPeerId &peerId, QWidget *widget);
|
2010-11-15 20:49:24 +00:00
|
|
|
|
2014-03-17 20:56:06 +00:00
|
|
|
bool getShowAvatarFrame(const RsPeerId &peerId);
|
|
|
|
void setShowAvatarFrame(const RsPeerId &peerId, bool value);
|
2011-03-26 23:19:28 +00:00
|
|
|
|
2014-03-17 20:56:06 +00:00
|
|
|
bool getShowParticipantsFrame(const RsPeerId &peerId);
|
|
|
|
void setShowParticipantsFrame(const RsPeerId &peerId, bool value);
|
2012-01-17 20:36:36 +00:00
|
|
|
|
2014-03-17 20:56:06 +00:00
|
|
|
void getStyle(const RsPeerId &peerId, const QString &name, RSStyle &style);
|
|
|
|
void setStyle(const RsPeerId &peerId, const QString &name, RSStyle &style);
|
2011-04-09 22:52:52 +00:00
|
|
|
|
2010-09-10 18:38:46 +00:00
|
|
|
protected:
|
|
|
|
/** Default constructor. */
|
|
|
|
RsharePeerSettings();
|
|
|
|
|
2014-03-17 20:56:06 +00:00
|
|
|
bool getSettingsIdOfPeerId(const RsPeerId &peerId, std::string &settingsId);
|
2012-01-17 20:36:36 +00:00
|
|
|
void cleanDeadIds();
|
2010-09-10 18:38:46 +00:00
|
|
|
|
|
|
|
/* get value of peer */
|
2014-03-17 20:56:06 +00:00
|
|
|
QVariant get(const RsPeerId &peerId, const QString &key, const QVariant &defaultValue = QVariant());
|
2010-09-10 18:38:46 +00:00
|
|
|
/* set value of peer */
|
2014-03-17 20:56:06 +00:00
|
|
|
void set(const RsPeerId &peerId, const QString &key, const QVariant &value);
|
2010-09-10 18:38:46 +00:00
|
|
|
|
|
|
|
/* map for fast access of the gpg id to the ssl id */
|
2014-03-17 20:56:06 +00:00
|
|
|
std::map<RsPeerId, std::string> m_SslToGpg;
|
2010-09-10 18:38:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// the one and only global settings object
|
|
|
|
extern RsharePeerSettings *PeerSettings;
|
|
|
|
|
|
|
|
#endif
|