Reworked/fixed some settings.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7469 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2014-07-24 16:52:11 +00:00
parent 42e579a294
commit d355e8dd88
7 changed files with 558 additions and 557 deletions

View file

@ -87,9 +87,11 @@ PostedListWidget::~PostedListWidget()
{ {
// save settings // save settings
processSettings(false); processSettings(false);
delete(ui);
} }
void PostedListWidget::processSettings(bool load) void PostedListWidget::processSettings(bool /*load*/)
{ {
// Settings->beginGroup(QString("PostedListWidget")); // Settings->beginGroup(QString("PostedListWidget"));
// //

View file

@ -53,7 +53,7 @@ private:
/* GxsGroupFrameDialog */ /* GxsGroupFrameDialog */
virtual QString text(TextType type); virtual QString text(TextType type);
virtual QString icon(IconType type); virtual QString icon(IconType type);
virtual QString settingsGroupName() { return "GxsChannelDialog"; } virtual QString settingsGroupName() { return "ChannelDialog"; }
virtual GxsGroupDialog *createNewGroupDialog(TokenQueue *tokenQueue); virtual GxsGroupDialog *createNewGroupDialog(TokenQueue *tokenQueue);
virtual GxsGroupDialog *createGroupDialog(TokenQueue *tokenQueue, RsTokenService *tokenService, GxsGroupDialog::Mode mode, RsGxsGroupId groupId); virtual GxsGroupDialog *createGroupDialog(TokenQueue *tokenQueue, RsTokenService *tokenService, GxsGroupDialog::Mode mode, RsGxsGroupId groupId);
virtual int shareKeyType(); virtual int shareKeyType();

View file

@ -107,12 +107,14 @@ GxsChannelPostsWidget::~GxsChannelPostsWidget()
processSettings(false); processSettings(false);
delete(mAutoDownloadAction); delete(mAutoDownloadAction);
delete ui;
} }
void GxsChannelPostsWidget::processSettings(bool load) void GxsChannelPostsWidget::processSettings(bool /*load*/)
{ {
mInProcessSettings = true; mInProcessSettings = true;
// Settings->beginGroup(QString("GxsChannelDialog")); // Settings->beginGroup(QString("ChannelPostsWidget"));
// //
// if (load) { // if (load) {
// // load settings // // load settings

View file

@ -210,6 +210,9 @@ GxsForumThreadWidget::~GxsForumThreadWidget()
mFillThread = NULL; mFillThread = NULL;
} }
// save settings
processSettings(false);
delete ui; delete ui;
// delete(mTimer); // delete(mTimer);
@ -223,7 +226,7 @@ void GxsForumThreadWidget::processSettings(bool load)
QHeaderView *header = ui->threadTreeWidget->header(); QHeaderView *header = ui->threadTreeWidget->header();
Settings->beginGroup(QString("GxsForumsDialog")); Settings->beginGroup(QString("ForumThreadWidget"));
if (load) { if (load) {
// load settings // load settings
@ -449,7 +452,7 @@ bool GxsForumThreadWidget::eventFilter(QObject *obj, QEvent *event)
void GxsForumThreadWidget::togglethreadview() void GxsForumThreadWidget::togglethreadview()
{ {
// save state of button // save state of button
Settings->setValueToGroup("GxsForumsDialog", "expandButton", ui->expandButton->isChecked()); Settings->setValueToGroup("ForumThreadWidget", "expandButton", ui->expandButton->isChecked());
togglethreadview_internal(); togglethreadview_internal();
} }
@ -873,7 +876,7 @@ void GxsForumThreadWidget::insertThreads()
{ {
#ifdef DEBUG_FORUMS #ifdef DEBUG_FORUMS
/* get the current Forum */ /* get the current Forum */
std::cerr << "GxsForumsDialog::insertThreads()" << std::endl; std::cerr << "GxsForumThreadWidget::insertThreads()" << std::endl;
#endif #endif
if (mFillThread) { if (mFillThread) {
@ -905,7 +908,7 @@ void GxsForumThreadWidget::insertThreads()
mLastForumID.clear(); mLastForumID.clear();
#ifdef DEBUG_FORUMS #ifdef DEBUG_FORUMS
std::cerr << "GxsForumsDialog::insertThreads() Current Thread Invalid" << std::endl; std::cerr << "GxsForumThreadWidget::insertThreads() Current Thread Invalid" << std::endl;
#endif #endif
return; return;
@ -927,7 +930,7 @@ void GxsForumThreadWidget::insertForumThreads(const RsGxsForumGroup &group)
mStateHelper->setActive(TOKEN_TYPE_CURRENTFORUM, true); mStateHelper->setActive(TOKEN_TYPE_CURRENTFORUM, true);
#ifdef DEBUG_FORUMS #ifdef DEBUG_FORUMS
std::cerr << "GxsForumsDialog::insertThreads() Start filling Forum threads" << std::endl; std::cerr << "GxsForumThreadWidget::insertThreads() Start filling Forum threads" << std::endl;
#endif #endif
// create fill thread // create fill thread
@ -978,7 +981,7 @@ void GxsForumThreadWidget::insertForumThreads(const RsGxsForumGroup &group)
void GxsForumThreadWidget::fillThreads(QList<QTreeWidgetItem *> &threadList, bool expandNewMessages, QList<QTreeWidgetItem*> &itemToExpand) void GxsForumThreadWidget::fillThreads(QList<QTreeWidgetItem *> &threadList, bool expandNewMessages, QList<QTreeWidgetItem*> &itemToExpand)
{ {
#ifdef DEBUG_FORUMS #ifdef DEBUG_FORUMS
std::cerr << "GxsForumsDialog::fillThreads()" << std::endl; std::cerr << "GxsForumThreadWidget::fillThreads()" << std::endl;
#endif #endif
int index = 0; int index = 0;
@ -1050,7 +1053,7 @@ void GxsForumThreadWidget::fillThreads(QList<QTreeWidgetItem *> &threadList, boo
} }
#ifdef DEBUG_FORUMS #ifdef DEBUG_FORUMS
std::cerr << "GxsForumsDialog::fillThreads() done" << std::endl; std::cerr << "GxsForumThreadWidget::fillThreads() done" << std::endl;
#endif #endif
} }
@ -1192,7 +1195,7 @@ void GxsForumThreadWidget::insertPostData(const RsGxsForumMsg &msg)
if ((msg.mMeta.mGroupId != mForumId) || (msg.mMeta.mMsgId != mThreadId)) if ((msg.mMeta.mGroupId != mForumId) || (msg.mMeta.mMsgId != mThreadId))
{ {
std::cerr << "GxsForumsDialog::insertPostData() Ignoring Invalid Data...."; std::cerr << "GxsForumThreadWidget::insertPostData() Ignoring Invalid Data....";
std::cerr << std::endl; std::cerr << std::endl;
std::cerr << "\t CurrForumId: " << mForumId << " != msg.GroupId: " << msg.mMeta.mGroupId; std::cerr << "\t CurrForumId: " << mForumId << " != msg.GroupId: " << msg.mMeta.mGroupId;
std::cerr << std::endl; std::cerr << std::endl;
@ -1333,13 +1336,13 @@ void GxsForumThreadWidget::nextUnreadMessage()
// TODO // TODO
#if 0 #if 0
void GxsForumsDialog::removemessage() void GxsForumThreadWidget::removemessage()
{ {
//std::cerr << "GxsForumsDialog::removemessage()" << std::endl; //std::cerr << "GxsForumThreadWidget::removemessage()" << std::endl;
std::string cid, mid; std::string cid, mid;
if (!getCurrentMsg(cid, mid)) if (!getCurrentMsg(cid, mid))
{ {
//std::cerr << "GxsForumsDialog::removemessage()"; //std::cerr << "GxsForumThreadWidget::removemessage()";
//std::cerr << " No Message selected" << std::endl; //std::cerr << " No Message selected" << std::endl;
return; return;
} }
@ -1569,14 +1572,14 @@ static QString buildReplyHeader(const RsMsgMetaData &meta)
link.createMessage(meta.mAuthorId, ""); link.createMessage(meta.mAuthorId, "");
QString from = link.toHtml(); QString from = link.toHtml();
QString header = QString("<span>-----%1-----").arg(QApplication::translate("GxsForumsDialog", "Original Message")); QString header = QString("<span>-----%1-----").arg(QApplication::translate("GxsForumThreadWidget", "Original Message"));
header += QString("<br><font size='3'><strong>%1: </strong>%2</font><br>").arg(QApplication::translate("GxsForumsDialog", "From"), from); header += QString("<br><font size='3'><strong>%1: </strong>%2</font><br>").arg(QApplication::translate("GxsForumThreadWidget", "From"), from);
header += QString("<br><font size='3'><strong>%1: </strong>%2</font><br>").arg(QApplication::translate("GxsForumsDialog", "Sent"), DateTime::formatLongDateTime(meta.mPublishTs)); header += QString("<br><font size='3'><strong>%1: </strong>%2</font><br>").arg(QApplication::translate("GxsForumThreadWidget", "Sent"), DateTime::formatLongDateTime(meta.mPublishTs));
header += QString("<font size='3'><strong>%1: </strong>%2</font></span><br>").arg(QApplication::translate("GxsForumsDialog", "Subject"), QString::fromUtf8(meta.mMsgName.c_str())); header += QString("<font size='3'><strong>%1: </strong>%2</font></span><br>").arg(QApplication::translate("GxsForumThreadWidget", "Subject"), QString::fromUtf8(meta.mMsgName.c_str()));
header += "<br>"; header += "<br>";
header += QApplication::translate("GxsForumsDialog", "On %1, %2 wrote:").arg(DateTime::formatDateTime(meta.mPublishTs), from); header += QApplication::translate("GxsForumThreadWidget", "On %1, %2 wrote:").arg(DateTime::formatDateTime(meta.mPublishTs), from);
return header; return header;
} }
@ -1597,7 +1600,7 @@ void GxsForumThreadWidget::replyMessageData(const RsGxsForumMsg &msg)
{ {
if ((msg.mMeta.mGroupId != mForumId) || (msg.mMeta.mMsgId != mThreadId)) if ((msg.mMeta.mGroupId != mForumId) || (msg.mMeta.mMsgId != mThreadId))
{ {
std::cerr << "GxsForumsDialog::replyMessageData() ERROR Message Ids have changed!"; std::cerr << "GxsForumThreadWidget::replyMessageData() ERROR Message Ids have changed!";
std::cerr << std::endl; std::cerr << std::endl;
return; return;
} }
@ -1628,7 +1631,7 @@ void GxsForumThreadWidget::changedViewBox()
} }
// save index // save index
Settings->setValueToGroup("GxsForumsDialog", "viewBox", ui->viewBox->currentIndex()); Settings->setValueToGroup("ForumThreadWidget", "viewBox", ui->viewBox->currentIndex());
ui->threadTreeWidget->clear(); ui->threadTreeWidget->clear();
@ -1649,7 +1652,7 @@ void GxsForumThreadWidget::filterColumnChanged(int column)
} }
// save index // save index
Settings->setValueToGroup("GxsForumsDialog", "filterColumn", column); Settings->setValueToGroup("ForumThreadWidget", "filterColumn", column);
} }
void GxsForumThreadWidget::filterItems(const QString& text) void GxsForumThreadWidget::filterItems(const QString& text)
@ -1708,7 +1711,7 @@ void GxsForumThreadWidget::requestGroup_CurrentForum()
std::list<RsGxsGroupId> grpIds; std::list<RsGxsGroupId> grpIds;
grpIds.push_back(mForumId); grpIds.push_back(mForumId);
std::cerr << "GxsForumsDialog::requestGroup_CurrentForum(" << mForumId << ")"; std::cerr << "GxsForumThreadWidget::requestGroup_CurrentForum(" << mForumId << ")";
std::cerr << std::endl; std::cerr << std::endl;
uint32_t token; uint32_t token;
@ -1717,7 +1720,7 @@ void GxsForumThreadWidget::requestGroup_CurrentForum()
void GxsForumThreadWidget::loadGroup_CurrentForum(const uint32_t &token) void GxsForumThreadWidget::loadGroup_CurrentForum(const uint32_t &token)
{ {
std::cerr << "GxsForumsDialog::loadGroup_CurrentForum()"; std::cerr << "GxsForumThreadWidget::loadGroup_CurrentForum()";
std::cerr << std::endl; std::cerr << std::endl;
std::vector<RsGxsForumGroup> groups; std::vector<RsGxsForumGroup> groups;
@ -1729,7 +1732,7 @@ void GxsForumThreadWidget::loadGroup_CurrentForum(const uint32_t &token)
} }
else else
{ {
std::cerr << "GxsForumsDialog::loadGroupSummary_CurrentForum() ERROR Invalid Number of Groups..."; std::cerr << "GxsForumThreadWidget::loadGroupSummary_CurrentForum() ERROR Invalid Number of Groups...";
std::cerr << std::endl; std::cerr << std::endl;
mStateHelper->setLoading(TOKEN_TYPE_CURRENTFORUM, false); mStateHelper->setLoading(TOKEN_TYPE_CURRENTFORUM, false);
@ -1753,7 +1756,7 @@ void GxsForumThreadWidget::requestMsgData_InsertPost(const RsGxsGrpMsgIdPair &ms
RsTokReqOptions opts; RsTokReqOptions opts;
opts.mReqType = GXS_REQUEST_TYPE_MSG_RELATED_DATA; opts.mReqType = GXS_REQUEST_TYPE_MSG_RELATED_DATA;
std::cerr << "GxsForumsDialog::requestMsgData_InsertPost(" << msgId.first << "," << msgId.second << ")"; std::cerr << "GxsForumThreadWidget::requestMsgData_InsertPost(" << msgId.first << "," << msgId.second << ")";
std::cerr << std::endl; std::cerr << std::endl;
std::vector<RsGxsGrpMsgIdPair> msgIds; std::vector<RsGxsGrpMsgIdPair> msgIds;
@ -1767,7 +1770,7 @@ void GxsForumThreadWidget::requestMsgData_InsertPost(const RsGxsGrpMsgIdPair &ms
RsTokReqOptions opts; RsTokReqOptions opts;
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
std::cerr << "GxsForumsDialog::requestMsgData_InsertPost(" << msgId.first << "," << msgId.second << ")"; std::cerr << "GxsForumThreadWidget::requestMsgData_InsertPost(" << msgId.first << "," << msgId.second << ")";
std::cerr << std::endl; std::cerr << std::endl;
GxsMsgReq msgIds; GxsMsgReq msgIds;
@ -1783,13 +1786,13 @@ void GxsForumThreadWidget::loadMsgData_InsertPost(const uint32_t &token)
{ {
mStateHelper->setLoading(TOKEN_TYPE_INSERT_POST, false); mStateHelper->setLoading(TOKEN_TYPE_INSERT_POST, false);
std::cerr << "GxsForumsDialog::loadMsgData_InsertPost()"; std::cerr << "GxsForumThreadWidget::loadMsgData_InsertPost()";
std::cerr << std::endl; std::cerr << std::endl;
std::vector<RsGxsForumMsg> msgs; std::vector<RsGxsForumMsg> msgs;
if (rsGxsForums->getMsgData(token, msgs)) { if (rsGxsForums->getMsgData(token, msgs)) {
if (msgs.size() != 1) { if (msgs.size() != 1) {
std::cerr << "GxsForumsDialog::loadMsgData_InsertPost() ERROR Wrong number of answers"; std::cerr << "GxsForumThreadWidget::loadMsgData_InsertPost() ERROR Wrong number of answers";
std::cerr << std::endl; std::cerr << std::endl;
mStateHelper->setActive(TOKEN_TYPE_INSERT_POST, false); mStateHelper->setActive(TOKEN_TYPE_INSERT_POST, false);
mStateHelper->clear(TOKEN_TYPE_INSERT_POST); mStateHelper->clear(TOKEN_TYPE_INSERT_POST);
@ -1797,7 +1800,7 @@ void GxsForumThreadWidget::loadMsgData_InsertPost(const uint32_t &token)
} }
insertPostData(msgs[0]); insertPostData(msgs[0]);
} else { } else {
std::cerr << "GxsForumsDialog::loadMsgData_InsertPost() ERROR Missing Message Data..."; std::cerr << "GxsForumThreadWidget::loadMsgData_InsertPost() ERROR Missing Message Data...";
std::cerr << std::endl; std::cerr << std::endl;
mStateHelper->setActive(TOKEN_TYPE_INSERT_POST, false); mStateHelper->setActive(TOKEN_TYPE_INSERT_POST, false);
@ -1813,7 +1816,7 @@ void GxsForumThreadWidget::requestMsgData_ReplyMessage(const RsGxsGrpMsgIdPair &
RsTokReqOptions opts; RsTokReqOptions opts;
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
std::cerr << "GxsForumsDialog::requestMsgData_ReplyMessage(" << msgId.first << "," << msgId.second << ")"; std::cerr << "GxsForumThreadWidget::requestMsgData_ReplyMessage(" << msgId.first << "," << msgId.second << ")";
std::cerr << std::endl; std::cerr << std::endl;
GxsMsgReq msgIds; GxsMsgReq msgIds;
@ -1826,7 +1829,7 @@ void GxsForumThreadWidget::requestMsgData_ReplyMessage(const RsGxsGrpMsgIdPair &
void GxsForumThreadWidget::loadMsgData_ReplyMessage(const uint32_t &token) void GxsForumThreadWidget::loadMsgData_ReplyMessage(const uint32_t &token)
{ {
std::cerr << "GxsForumsDialog::loadMsgData_ReplyMessage()"; std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage()";
std::cerr << std::endl; std::cerr << std::endl;
std::vector<RsGxsForumMsg> msgs; std::vector<RsGxsForumMsg> msgs;
@ -1834,7 +1837,7 @@ void GxsForumThreadWidget::loadMsgData_ReplyMessage(const uint32_t &token)
{ {
if (msgs.size() != 1) if (msgs.size() != 1)
{ {
std::cerr << "GxsForumsDialog::loadMsgData_ReplyMessage() ERROR Wrong number of answers"; std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage() ERROR Wrong number of answers";
std::cerr << std::endl; std::cerr << std::endl;
return; return;
} }
@ -1843,7 +1846,7 @@ void GxsForumThreadWidget::loadMsgData_ReplyMessage(const uint32_t &token)
} }
else else
{ {
std::cerr << "GxsForumsDialog::loadMsgData_ReplyMessage() ERROR Missing Message Data..."; std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage() ERROR Missing Message Data...";
std::cerr << std::endl; std::cerr << std::endl;
} }
} }
@ -1853,7 +1856,7 @@ void GxsForumThreadWidget::loadMsgData_ReplyMessage(const uint32_t &token)
void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenRequest &req) void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenRequest &req)
{ {
std::cerr << "GxsForumsDialog::loadRequest() UserType: " << req.mUserType; std::cerr << "GxsForumThreadWidget::loadRequest() UserType: " << req.mUserType;
std::cerr << std::endl; std::cerr << std::endl;
if (queue == mThreadQueue) if (queue == mThreadQueue)
@ -1874,7 +1877,7 @@ void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenReque
break; break;
default: default:
std::cerr << "GxsForumsDialog::loadRequest() ERROR: INVALID TYPE"; std::cerr << "GxsForumThreadWidget::loadRequest() ERROR: INVALID TYPE";
std::cerr << std::endl; std::cerr << std::endl;
break; break;
} }

View file

@ -48,7 +48,7 @@ private:
/* GxsGroupFrameDialog */ /* GxsGroupFrameDialog */
virtual QString text(TextType type); virtual QString text(TextType type);
virtual QString icon(IconType type); virtual QString icon(IconType type);
virtual QString settingsGroupName() { return "GxsForumsDialog"; } virtual QString settingsGroupName() { return "ForumsDialog"; }
virtual GxsGroupDialog *createNewGroupDialog(TokenQueue *tokenQueue); virtual GxsGroupDialog *createNewGroupDialog(TokenQueue *tokenQueue);
virtual GxsGroupDialog *createGroupDialog(TokenQueue *tokenQueue, RsTokenService *tokenService, GxsGroupDialog::Mode mode, RsGxsGroupId groupId); virtual GxsGroupDialog *createGroupDialog(TokenQueue *tokenQueue, RsTokenService *tokenService, GxsGroupDialog::Mode mode, RsGxsGroupId groupId);
virtual int shareKeyType(); virtual int shareKeyType();

File diff suppressed because it is too large Load diff

View file

@ -20,7 +20,6 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
****************************************************************/ ****************************************************************/
#ifndef _RSHARESETTINGS_H #ifndef _RSHARESETTINGS_H
#define _RSHARESETTINGS_H #define _RSHARESETTINGS_H
@ -60,7 +59,6 @@
//Forward declaration. //Forward declaration.
class QWidget; class QWidget;
class QTableWidget;
class QToolBar; class QToolBar;
class QMainWindow; class QMainWindow;
@ -90,151 +88,151 @@ public:
class RshareSettings : public RSettings class RshareSettings : public RSettings
{ {
public: public:
enum enumLastDir enum enumLastDir
{ {
LASTDIR_EXTRAFILE, LASTDIR_EXTRAFILE,
LASTDIR_CERT, LASTDIR_CERT,
LASTDIR_HISTORY, LASTDIR_HISTORY,
LASTDIR_IMAGES, LASTDIR_IMAGES,
LASTDIR_MESSAGES, LASTDIR_MESSAGES,
LASTDIR_BLOGS, LASTDIR_BLOGS,
LASTDIR_SOUNDS LASTDIR_SOUNDS
}; };
enum enumToasterPosition enum enumToasterPosition
{ {
TOASTERPOS_TOPLEFT, TOASTERPOS_TOPLEFT,
TOASTERPOS_TOPRIGHT, TOASTERPOS_TOPRIGHT,
TOASTERPOS_BOTTOMLEFT, TOASTERPOS_BOTTOMLEFT,
TOASTERPOS_BOTTOMRIGHT TOASTERPOS_BOTTOMRIGHT
}; };
enum enumMsgOpen enum enumMsgOpen
{ {
MSG_OPEN_TAB, MSG_OPEN_TAB,
MSG_OPEN_WINDOW MSG_OPEN_WINDOW
}; };
public: public:
/* create settings object */ /* create settings object */
static void Create(bool forceCreateNew = false); static void Create(bool forceCreateNew = false);
/** Gets the currently preferred language code for RShare. */ /** Gets the currently preferred language code for RShare. */
QString getLanguageCode(); QString getLanguageCode();
/** Saves the preferred language code. */ /** Saves the preferred language code. */
void setLanguageCode(QString languageCode); void setLanguageCode(QString languageCode);
/** Gets the interface style key (e.g., "windows", "motif", etc.) */
QString getInterfaceStyle();
/** Sets the interface style key. */
void setInterfaceStyle(QString styleKey);
/** Sets the stylesheet */
void setSheetName(QString sheet);
/** Gets the stylesheet */
QString getSheetName();
/** Gets the page button Location.*/ /** Gets the interface style key (e.g., "windows", "motif", etc.) */
bool getPageButtonLoc(); QString getInterfaceStyle();
/** Sets the page button Location.*/ /** Sets the interface style key. */
void setPageButtonLoc(bool onToolBar); void setInterfaceStyle(QString styleKey);
/** Gets the action button Location.*/ /** Sets the stylesheet */
bool getActionButtonLoc(); void setSheetName(QString sheet);
/** Sets the action button Location.*/ /** Gets the stylesheet */
void setActionButtonLoc(bool onToolBar); QString getSheetName();
/** Gets the tool button's style.*/ /** Gets the page button Location.*/
Qt::ToolButtonStyle getToolButtonStyle(); bool getPageButtonLoc();
/** Sets the tool button's style.*/ /** Sets the page button Location.*/
void setToolButtonStyle(Qt::ToolButtonStyle style); void setPageButtonLoc(bool onToolBar);
/** Gets the tool button's size.*/ /** Gets the action button Location.*/
int getToolButtonSize(); bool getActionButtonLoc();
/** Sets the tool button's size.*/ /** Sets the action button Location.*/
void setToolButtonSize(int size); void setActionButtonLoc(bool onToolBar);
/** Gets the list item icon's size.*/ /** Gets the tool button's style.*/
int getListItemIconSize(); Qt::ToolButtonStyle getToolButtonStyle();
/** Sets the list item icon's size.*/ /** Sets the tool button's style.*/
void setListItemIconSize(int size); void setToolButtonStyle(Qt::ToolButtonStyle style);
/** Returns true if RetroShare's main window should be visible when the /** Gets the tool button's size.*/
int getToolButtonSize();
/** Sets the tool button's size.*/
void setToolButtonSize(int size);
/** Gets the list item icon's size.*/
int getListItemIconSize();
/** Sets the list item icon's size.*/
void setListItemIconSize(int size);
/** Returns true if RetroShare's main window should be visible when the
* application starts. */ * application starts. */
bool getStartMinimized(); bool getStartMinimized();
/** Sets whether to show main window when the application starts. */ /** Sets whether to show main window when the application starts. */
void setStartMinimized(bool startMinimized); void setStartMinimized(bool startMinimized);
bool getCloseToTray(); bool getCloseToTray();
void setCloseToTray(bool closeToTray); void setCloseToTray(bool closeToTray);
/** Returns true if RetroShare should start on system boot. */ /** Returns true if RetroShare should start on system boot. */
bool runRetroshareOnBoot(bool &minimized); bool runRetroshareOnBoot(bool &minimized);
/** Set whether to run RetroShare on system boot. */ /** Set whether to run RetroShare on system boot. */
void setRunRetroshareOnBoot(bool run, bool minimized); void setRunRetroshareOnBoot(bool run, bool minimized);
/** Returns true if the user can set retroshare as protocol */ /** Returns true if the user can set retroshare as protocol */
bool canSetRetroShareProtocol(); bool canSetRetroShareProtocol();
/** Returns true if retroshare:// is registered as protocol */ /** Returns true if retroshare:// is registered as protocol */
bool getRetroShareProtocol(); bool getRetroShareProtocol();
/** Register retroshare:// as protocl */ /** Register retroshare:// as protocl */
bool setRetroShareProtocol(bool value); bool setRetroShareProtocol(bool value);
/* Get the destination log file. */ /* Get the destination log file. */
QString getLogFile(); QString getLogFile();
/** Set the destination log file. */ /** Set the destination log file. */
void setLogFile(QString file); void setLogFile(QString file);
QString getLastDir(enumLastDir type); QString getLastDir(enumLastDir type);
void setLastDir(enumLastDir type, const QString &lastDir); void setLastDir(enumLastDir type, const QString &lastDir);
/* Get the bandwidth graph line filter. */ /* Get the bandwidth graph line filter. */
uint getBWGraphFilter(); uint getBWGraphFilter();
/** Set the bandwidth graph line filter. */ /** Set the bandwidth graph line filter. */
void setBWGraphFilter(uint line, bool status); void setBWGraphFilter(uint line, bool status);
/** Set the bandwidth graph opacity setting. */ /** Set the bandwidth graph opacity setting. */
int getBWGraphOpacity(); int getBWGraphOpacity();
/** Set the bandwidth graph opacity settings. */ /** Set the bandwidth graph opacity settings. */
void setBWGraphOpacity(int value); void setBWGraphOpacity(int value);
/** Gets whether the bandwidth graph is always on top. */ /** Gets whether the bandwidth graph is always on top. */
bool getBWGraphAlwaysOnTop(); bool getBWGraphAlwaysOnTop();
/** Sets whether the bandwidth graph is always on top. */ /** Sets whether the bandwidth graph is always on top. */
void setBWGraphAlwaysOnTop(bool alwaysOnTop); void setBWGraphAlwaysOnTop(bool alwaysOnTop);
uint getNewsFeedFlags();
void setNewsFeedFlags(uint flags);
uint getChatFlags(); uint getNewsFeedFlags();
void setChatFlags(uint flags); void setNewsFeedFlags(uint flags);
uint getChatLobbyFlags(); uint getChatFlags();
void setChatLobbyFlags(uint flags); void setChatFlags(uint flags);
uint getNotifyFlags(); uint getChatLobbyFlags();
void setNotifyFlags(uint flags); void setChatLobbyFlags(uint flags);
uint getTrayNotifyFlags(); uint getNotifyFlags();
void setTrayNotifyFlags(uint flags); void setNotifyFlags(uint flags);
uint getTrayNotifyBlinkFlags(); uint getTrayNotifyFlags();
void setTrayNotifyBlinkFlags(uint flags); void setTrayNotifyFlags(uint flags);
uint getMessageFlags(); uint getTrayNotifyBlinkFlags();
void setMessageFlags(uint flags); void setTrayNotifyBlinkFlags(uint flags);
bool getDisplayTrayChatLobby(); uint getMessageFlags();
void setDisplayTrayChatLobby(bool bValue); void setMessageFlags(uint flags);
bool getDisplayTrayGroupChat();
void setDisplayTrayGroupChat(bool bValue);
bool getAddFeedsAtEnd(); bool getDisplayTrayChatLobby();
void setAddFeedsAtEnd(bool bValue); void setDisplayTrayChatLobby(bool bValue);
bool getDisplayTrayGroupChat();
void setDisplayTrayGroupChat(bool bValue);
bool getChatSendMessageWithCtrlReturn(); bool getAddFeedsAtEnd();
void setChatSendMessageWithCtrlReturn(bool bValue); void setAddFeedsAtEnd(bool bValue);
bool getChatSendMessageWithCtrlReturn();
void setChatSendMessageWithCtrlReturn(bool bValue);
void setChatSearchCharToStartSearch(int iValue); void setChatSearchCharToStartSearch(int iValue);
int getChatSearchCharToStartSearch(); int getChatSearchCharToStartSearch();
@ -257,92 +255,91 @@ public:
void setChatSearchFoundColor(QRgb rgbValue); void setChatSearchFoundColor(QRgb rgbValue);
QRgb getChatSearchFoundColor(); QRgb getChatSearchFoundColor();
enumToasterPosition getToasterPosition(); enumToasterPosition getToasterPosition();
void setToasterPosition(enumToasterPosition position); void setToasterPosition(enumToasterPosition position);
QPoint getToasterMargin(); QPoint getToasterMargin();
void setToasterMargin(QPoint margin); void setToasterMargin(QPoint margin);
/* chat font */ /* chat font */
QString getChatScreenFont(); QString getChatScreenFont();
void setChatScreenFont(const QString &font); void setChatScreenFont(const QString &font);
/* chat styles */ /* chat styles */
void getPublicChatStyle(QString &stylePath, QString &styleVariant); void getPublicChatStyle(QString &stylePath, QString &styleVariant);
void setPublicChatStyle(const QString &stylePath, const QString &styleVariant); void setPublicChatStyle(const QString &stylePath, const QString &styleVariant);
void getPrivateChatStyle(QString &stylePath, QString &styleVariant); void getPrivateChatStyle(QString &stylePath, QString &styleVariant);
void setPrivateChatStyle(const QString &stylePath, const QString &styleVariant); void setPrivateChatStyle(const QString &stylePath, const QString &styleVariant);
void getHistoryChatStyle(QString &stylePath, QString &styleVariant); void getHistoryChatStyle(QString &stylePath, QString &styleVariant);
void setHistoryChatStyle(const QString &stylePath, const QString &styleVariant); void setHistoryChatStyle(const QString &stylePath, const QString &styleVariant);
/* Chat */ /* Chat */
int getPublicChatHistoryCount(); int getPublicChatHistoryCount();
void setPublicChatHistoryCount(int value); void setPublicChatHistoryCount(int value);
int getPrivateChatHistoryCount(); int getPrivateChatHistoryCount();
void setPrivateChatHistoryCount(int value); void setPrivateChatHistoryCount(int value);
int getLobbyChatHistoryCount(); int getLobbyChatHistoryCount();
void setLobbyChatHistoryCount(int value); void setLobbyChatHistoryCount(int value);
//! Save placement, state and size information of a window. //! Save placement, state and size information of a window.
void saveWidgetInformation(QWidget *widget); void saveWidgetInformation(QWidget *widget);
//! Load placement, state and size information of a window. //! Load placement, state and size information of a window.
void loadWidgetInformation(QWidget *widget); void loadWidgetInformation(QWidget *widget);
//! Method overload. Save window and toolbar information. //! Method overload. Save window and toolbar information.
void saveWidgetInformation(QMainWindow *widget, QToolBar *toolBar); void saveWidgetInformation(QMainWindow *widget, QToolBar *toolBar);
//! Method overload. Restore window and toolbar information. //! Method overload. Restore window and toolbar information.
void loadWidgetInformation(QMainWindow *widget, QToolBar *toolBar); void loadWidgetInformation(QMainWindow *widget, QToolBar *toolBar);
/* MainWindow */ /* MainWindow */
int getLastPageInMainWindow (); int getLastPageInMainWindow ();
void setLastPageInMainWindow (int value); void setLastPageInMainWindow (int value);
uint getStatusBarFlags(); uint getStatusBarFlags();
void setStatusBarFlags(uint flags); void setStatusBarFlags(uint flags);
void setStatusBarFlag(uint flag, bool enable); void setStatusBarFlag(uint flag, bool enable);
/* Messages */ /* Message */
bool getMsgSetToReadOnActivate(); bool getMsgSetToReadOnActivate();
void setMsgSetToReadOnActivate(bool value); void setMsgSetToReadOnActivate(bool value);
bool getMsgLoadEmbeddedImages(); bool getMsgLoadEmbeddedImages();
void setMsgLoadEmbeddedImages(bool value); void setMsgLoadEmbeddedImages(bool value);
enumMsgOpen getMsgOpen(); enumMsgOpen getMsgOpen();
void setMsgOpen(enumMsgOpen value); void setMsgOpen(enumMsgOpen value);
/* Forums */ /* Forum */
bool getForumMsgSetToReadOnActivate(); bool getForumMsgSetToReadOnActivate();
void setForumMsgSetToReadOnActivate(bool value); void setForumMsgSetToReadOnActivate(bool value);
bool getForumExpandNewMessages(); bool getForumExpandNewMessages();
void setForumExpandNewMessages(bool value); void setForumExpandNewMessages(bool value);
bool getForumLoadEmbeddedImages(); bool getForumLoadEmbeddedImages();
void setForumLoadEmbeddedImages(bool value); void setForumLoadEmbeddedImages(bool value);
/* GroupFrameSettings */ /* GroupFrame settings */
bool getGroupFrameSettings(GroupFrameSettings::Type type, GroupFrameSettings &groupFrameSettings); bool getGroupFrameSettings(GroupFrameSettings::Type type, GroupFrameSettings &groupFrameSettings);
void setGroupFrameSettings(GroupFrameSettings::Type type, const GroupFrameSettings &groupFrameSettings); void setGroupFrameSettings(GroupFrameSettings::Type type, const GroupFrameSettings &groupFrameSettings);
/* time before idle */ /* time before idle */
uint getMaxTimeBeforeIdle(); uint getMaxTimeBeforeIdle();
void setMaxTimeBeforeIdle(uint value); void setMaxTimeBeforeIdle(uint value);
protected: protected:
/** Default constructor. */ /** Default constructor. */
RshareSettings(); RshareSettings();
void initSettings(); void initSettings();
/* member for fast access */ /* member for fast access */
int m_maxTimeBeforeIdle; int m_maxTimeBeforeIdle;
}; };
// the one and only global settings object // the one and only global settings object
extern RshareSettings *Settings; extern RshareSettings *Settings;
#endif #endif