mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-02 11:16:34 -04:00
reworked settings
now there is only one global object for loading and saving settings RshareSettings *Settings; the class RSettings can be used too, but it is not prefered, because the default settings has no affect git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2964 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e68e6b54ef
commit
6baf56285b
39 changed files with 336 additions and 390 deletions
|
@ -22,13 +22,13 @@
|
|||
#include "rsiface/rspeers.h" //for rsPeers variable
|
||||
#include "rsiface/rsiface.h"
|
||||
|
||||
#include "rsharesettings.h"
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
#include <rshare.h>
|
||||
#include "ChatPage.h"
|
||||
|
||||
#include "rsettings.h"
|
||||
|
||||
/** Constructor */
|
||||
ChatPage::ChatPage(QWidget * parent, Qt::WFlags flags)
|
||||
: ConfigPage(parent, flags)
|
||||
|
@ -52,12 +52,14 @@ ChatPage::closeEvent (QCloseEvent * event)
|
|||
bool
|
||||
ChatPage::save(QString &errmsg)
|
||||
{
|
||||
RSettings settings(QString("Chat"));
|
||||
Settings->beginGroup(QString("Chat"));
|
||||
|
||||
settings.setValue(QString::fromUtf8("Emoteicons_PrivatChat"), emotePrivatChat());
|
||||
settings.setValue(QString::fromUtf8("Emoteicons_GroupChat"), emoteGroupChat());
|
||||
settings.setValue(QString::fromUtf8("GroupChat_History"), groupchatHistory());
|
||||
settings.setValue(QString::fromUtf8("ChatScreenFont"), fontTempChat.toString());
|
||||
Settings->setValue(QString::fromUtf8("Emoteicons_PrivatChat"), emotePrivatChat());
|
||||
Settings->setValue(QString::fromUtf8("Emoteicons_GroupChat"), emoteGroupChat());
|
||||
Settings->setValue(QString::fromUtf8("GroupChat_History"), groupchatHistory());
|
||||
Settings->setValue(QString::fromUtf8("ChatScreenFont"), fontTempChat.toString());
|
||||
|
||||
Settings->endGroup();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -66,14 +68,16 @@ ChatPage::save(QString &errmsg)
|
|||
void
|
||||
ChatPage::load()
|
||||
{
|
||||
RSettings settings(QString("Chat"));
|
||||
Settings->beginGroup(QString("Chat"));
|
||||
|
||||
ui.checkBox_emoteprivchat->setChecked(settings.value(QString::fromUtf8("Emoteicons_PrivatChat"), true).toBool());
|
||||
ui.checkBox_emotegroupchat->setChecked(settings.value(QString::fromUtf8("Emoteicons_GroupChat"), true).toBool());
|
||||
ui.checkBox_groupchathistory->setChecked(settings.value(QString::fromUtf8("GroupChat_History"), true).toBool());
|
||||
ui.checkBox_emoteprivchat->setChecked(Settings->value(QString::fromUtf8("Emoteicons_PrivatChat"), true).toBool());
|
||||
ui.checkBox_emotegroupchat->setChecked(Settings->value(QString::fromUtf8("Emoteicons_GroupChat"), true).toBool());
|
||||
ui.checkBox_groupchathistory->setChecked(Settings->value(QString::fromUtf8("GroupChat_History"), true).toBool());
|
||||
|
||||
fontTempChat.fromString(Settings->value(QString::fromUtf8("ChatScreenFont")).toString());
|
||||
|
||||
Settings->endGroup();
|
||||
|
||||
fontTempChat.fromString(settings.value(QString::fromUtf8("ChatScreenFont")).toString());
|
||||
|
||||
ui.labelChatFontPreview->setText(fontTempChat.rawName());
|
||||
ui.labelChatFontPreview->setFont(fontTempChat);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue