- moved the chat setting to the section [Chat]

- cleaned some comments of the settings classes

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2940 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-05-18 18:02:51 +00:00
parent 3e968b68c3
commit a8c4b3b107
7 changed files with 23 additions and 43 deletions

View File

@ -51,24 +51,6 @@
#include <time.h>
#include <sys/stat.h>
#include <QTextCodec>
#include <QTextEdit>
#include <QTextCursor>
#include <QTextList>
#include <QTextStream>
#include <QTextDocumentFragment>
#include <QContextMenuEvent>
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QPixmap>
#include <QMessageBox>
#include <QHeaderView>
#include <QtGui/QKeyEvent>
#include <QHashIterator>
#include <QDesktopServices>
#include <QSound>
/* Images for context menu icons */
@ -167,17 +149,16 @@ PeersDialog::PeersDialog(QWidget *parent)
pxm.fill(_currentColor);
ui.colorChatButton->setIcon(pxm);
RshareSettings settings;
RSettings settings(QString("Chat"));
mCurrentFont.fromString(settings.value(QString::fromUtf8("ChatScreenFont")).toString());
ui.lineEdit->setFont(mCurrentFont);
setChatInfo(tr("Welcome to RetroShare's group chat."),
QString::fromUtf8("blue"));
QStringList him;
setChatInfo(tr("Welcome to RetroShare's group chat."), QString::fromUtf8("blue"));
if (settings.value(QString::fromUtf8("GroupChat_History"), true).toBool())
{
QStringList him;
historyKeeper.getMessages(him, "", "THIS", 8);
foreach(QString mess, him)
ui.msgText->append(mess);
@ -1034,8 +1015,10 @@ void PeersDialog::insertChat()
RsChat::embedHtml(doc, body, defEmbedAhref);
// embed smileys
settings.beginGroup("Chat");
if (settings.value(QString::fromUtf8("Emoteicons_GroupChat"), true).toBool())
RsChat::embedHtml(doc, body, defEmbedImg);
settings.endGroup();
msgContents = doc.toString(-1); // -1 removes any annoying carriage return misinterpreted by QTextEdit
extraTxt += msgContents;
@ -1305,7 +1288,9 @@ void PeersDialog::setFont()
ui.lineEdit->setFont(mCurrentFont);
ui.lineEdit->setTextColor(_currentColor);
RshareSettings settings;
settings.beginGroup("Chat");
settings.setValue(QString::fromUtf8("ChatScreenFont"), mCurrentFont.toString());
settings.endGroup();
ui.lineEdit->setFocus();

View File

@ -291,7 +291,7 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci)
std::cout << "PopupChatDialog:addChatMsg message : " << message.toStdString() << std::endl;
#endif
RshareSettings settings;
RSettings settings(QString("Chat"));
if (settings.value(QString::fromUtf8("Emoteicons_PrivatChat"), true).toBool())
{
QHashIterator<QString, QString> i(smileys);
@ -301,8 +301,8 @@ std::cout << "PopupChatDialog:addChatMsg message : " << message.toStdString() <<
foreach(QString code, i.key().split("|"))
message.replace(code, "<img src=\"" + i.value() + "\" />");
}
}
}
history /*<< nickColor << color << font << fontSize*/ << timestamp << name << message;
QString formatMsg = loadEmptyStyle()/*.replace(nickColor)

View File

@ -21,17 +21,13 @@
#include "rsiface/rspeers.h" //for rsPeers variable
#include "rsiface/rsiface.h"
#include "rsharesettings.h"
#include <QtGui>
#include <QClipboard>
#include <rshare.h>
#include "ChatPage.h"
#include <sstream>
#include <iostream>
#include <set>
#include "RSettings.h"
/** Constructor */
ChatPage::ChatPage(QWidget * parent, Qt::WFlags flags)
@ -56,13 +52,13 @@ ChatPage::closeEvent (QCloseEvent * event)
bool
ChatPage::save(QString &errmsg)
{
RshareSettings settings;
RSettings settings(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());
return true;
}
@ -70,7 +66,7 @@ ChatPage::save(QString &errmsg)
void
ChatPage::load()
{
RshareSettings settings;
RSettings settings(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());

View File

@ -81,7 +81,7 @@ RSettings::defaultValue(const QString &key) const
return QVariant();
}
/** Resets all of Vidalia's settings. */
/** Resets all settings. */
void
RSettings::reset()
{

View File

@ -33,16 +33,16 @@ class RSettings : public QSettings
public:
/** Default constructor. The optional parameter <b>group</b> can be used to
* set a prefix that will be prepended to keys specified to VSettings in
* set a prefix that will be prepended to keys specified to RSettings in
* value() and setValue(). */
RSettings(const QString group = QString());
/** Default constructor. The optional parameter <b>group</b> can be used to
* set a prefix that will be prepended to keys specified to VSettings in
* set a prefix that will be prepended to keys specified to RSettings in
* value() and setValue(). */
RSettings(std::string fileName, const QString group = QString());
/** Resets all of Vidalia's settings. */
/** Resets all settings. */
static void reset();
/** Returns the saved value associated with <b>key</b>. If no value has been

View File

@ -252,7 +252,7 @@ void RshareSettings::setNotifyFlags(uint flags)
setValue(SETTING_NOTIFY_FLAGS, flags);
}
/** Returns true if Vidalia is set to run on system boot. */
/** Returns true if RetroShare is set to run on system boot. */
bool
RshareSettings::runRetroshareOnBoot()
{
@ -268,7 +268,7 @@ RshareSettings::runRetroshareOnBoot()
#endif
}
/** If <b>run</b> is set to true, then Vidalia will run on system boot. */
/** If <b>run</b> is set to true, then RetroShare will run on system boot. */
void
RshareSettings::setRunRetroshareOnBoot(bool run)
{

View File

@ -38,8 +38,7 @@ class QTableWidget;
class QToolBar;
class QMainWindow;
/** Handles saving and restoring RShares's settings, such as the
* location of Tor, the control port, etc.
/** Handles saving and restoring RShares's settings
*
* NOTE: Qt 4.1 documentation states that constructing a QSettings object is
* "very fast", so we shouldn't need to create a global instance of this
@ -75,7 +74,7 @@ public:
/** Returns true if RetroShare's main window should be visible when the
* application starts. */
bool showMainWindowAtStart();
/** Sets whether to show Vidalia's main window when the application starts. */
/** Sets whether to show main window when the application starts. */
void setShowMainWindowAtStart(bool show);
/** Returns true if RetroShare should start on system boot. */