From f488dbd15a4abfeeb293ace16d03c0de0eff0f2e Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 6 Jan 2013 02:30:10 +0000 Subject: [PATCH] Added new option for GxsForums and FeedReader - Open all forums/feeds in new tab. Option=on (standard) - no standard tab - new tab by single click - no menu entry "Open in new tab" Option=off: - standard tab (not closeable) - open in standard tab by single click - menu entry "Open in new tab" - open new tab with middle mouse button git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6060 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- plugins/FeedReader/gui/FeedReaderConfig.cpp | 4 +- plugins/FeedReader/gui/FeedReaderConfig.h | 3 + plugins/FeedReader/gui/FeedReaderConfig.ui | 7 + plugins/FeedReader/gui/FeedReaderDialog.cpp | 76 +++++-- plugins/FeedReader/gui/FeedReaderDialog.h | 3 + .../gui/FeedReaderMessageWidget.cpp | 7 +- plugins/FeedReader/gui/FeedReaderNotify.cpp | 8 +- plugins/FeedReader/gui/FeedReaderNotify.h | 8 +- .../FeedReader/gui/FeedReaderUserNotify.cpp | 2 +- plugins/FeedReader/gui/PreviewFeedDialog.cpp | 4 +- plugins/FeedReader/interface/rsFeedReader.h | 4 +- plugins/FeedReader/lang/FeedReader_en.ts | 194 +++++++++++------- plugins/FeedReader/services/p3FeedReader.cc | 46 ++--- retroshare-gui/src/gui/ForumsDialog.cpp | 2 +- retroshare-gui/src/gui/GxsForumsDialog.cpp | 67 ++++-- retroshare-gui/src/gui/GxsForumsDialog.h | 3 + .../src/gui/common/GroupTreeWidget.cpp | 5 + .../src/gui/common/GroupTreeWidget.h | 3 + .../src/gui/common/GroupTreeWidget.ui | 7 +- .../src/gui/common/RSTreeWidget.cpp | 23 ++- retroshare-gui/src/gui/common/RSTreeWidget.h | 6 +- .../gui/gxsforums/GxsForumThreadWidget.cpp | 2 +- retroshare-gui/src/gui/notifyqt.cpp | 5 + retroshare-gui/src/gui/notifyqt.h | 3 + retroshare-gui/src/gui/settings/ForumPage.cpp | 6 +- retroshare-gui/src/gui/settings/ForumPage.ui | 18 +- .../src/gui/settings/rsettingswin.cpp | 5 + .../src/gui/settings/rsharesettings.cpp | 24 ++- .../src/gui/settings/rsharesettings.h | 16 +- retroshare-gui/src/lang/retroshare_en.ts | 49 +++-- 30 files changed, 425 insertions(+), 185 deletions(-) diff --git a/plugins/FeedReader/gui/FeedReaderConfig.cpp b/plugins/FeedReader/gui/FeedReaderConfig.cpp index 2b9102c9c..dd100e0f0 100644 --- a/plugins/FeedReader/gui/FeedReaderConfig.cpp +++ b/plugins/FeedReader/gui/FeedReaderConfig.cpp @@ -50,7 +50,8 @@ void FeedReaderConfig::load() { ui->updateIntervalSpinBox->setValue(rsFeedReader->getStandardUpdateInterval() / 60); ui->storageTimeSpinBox->setValue(rsFeedReader->getStandardStorageTime() / (60 * 60 *24)); - ui->setMsgToReadOnActivate->setChecked(Settings->valueFromGroup("FeedReaderDialog", "SetMsgToReadOnActivate", true).toBool()); + ui->setMsgToReadOnActivate->setChecked(FeedReaderSetting_SetMsgToReadOnActivate()); + ui->openAllInNewTabCheckBox->setChecked(FeedReaderSetting_OpenAllInNewTab()); std::string proxyAddress; uint16_t proxyPort; @@ -67,6 +68,7 @@ bool FeedReaderConfig::save(QString &/*errmsg*/) rsFeedReader->setStandardStorageTime(ui->storageTimeSpinBox->value() * 60 *60 * 24); rsFeedReader->setStandardProxy(ui->useProxyCheckBox->isChecked(), ui->proxyAddressLineEdit->text().toUtf8().constData(), ui->proxyPortSpinBox->value()); Settings->setValueToGroup("FeedReaderDialog", "SetMsgToReadOnActivate", ui->setMsgToReadOnActivate->isChecked()); + Settings->setValueToGroup("FeedReaderDialog", "OpenAllInNewTab", ui->openAllInNewTabCheckBox->isChecked()); return true; } diff --git a/plugins/FeedReader/gui/FeedReaderConfig.h b/plugins/FeedReader/gui/FeedReaderConfig.h index ed846269a..ccd831b5d 100644 --- a/plugins/FeedReader/gui/FeedReaderConfig.h +++ b/plugins/FeedReader/gui/FeedReaderConfig.h @@ -28,6 +28,9 @@ namespace Ui { class FeedReaderConfig; } +#define FeedReaderSetting_SetMsgToReadOnActivate() Settings->valueFromGroup("FeedReaderDialog", "SetMsgToReadOnActivate", true).toBool() +#define FeedReaderSetting_OpenAllInNewTab() Settings->valueFromGroup("FeedReaderDialog", "OpenAllInNewTab", true).toBool() + class FeedReaderConfig : public ConfigPage { Q_OBJECT diff --git a/plugins/FeedReader/gui/FeedReaderConfig.ui b/plugins/FeedReader/gui/FeedReaderConfig.ui index 36deae46b..988c15bec 100644 --- a/plugins/FeedReader/gui/FeedReaderConfig.ui +++ b/plugins/FeedReader/gui/FeedReaderConfig.ui @@ -125,6 +125,13 @@ + + + + Open all feeds in new tab + + + diff --git a/plugins/FeedReader/gui/FeedReaderDialog.cpp b/plugins/FeedReader/gui/FeedReaderDialog.cpp index cc1b40fe3..fc4656b54 100644 --- a/plugins/FeedReader/gui/FeedReaderDialog.cpp +++ b/plugins/FeedReader/gui/FeedReaderDialog.cpp @@ -29,10 +29,12 @@ #include "FeedReaderMessageWidget.h" #include "ui_FeedReaderDialog.h" #include "FeedReaderNotify.h" +#include "FeedReaderConfig.h" #include "AddFeedDialog.h" #include "FeedReaderStringDefs.h" #include "gui/common/RSTreeWidgetItem.h" #include "gui/settings/rsharesettings.h" +#include "gui/notifyqt.h" #include "FeedReaderUserNotify.h" #include "interface/rsFeedReader.h" @@ -61,11 +63,14 @@ FeedReaderDialog::FeedReaderDialog(RsFeedReader *feedReader, QWidget *parent) mProcessSettings = false; mOpenFeedIds = NULL; + mMessageWidget = NULL; mNotify = new FeedReaderNotify(); mFeedReader->setNotify(mNotify); - connect(mNotify, SIGNAL(notifyFeedChanged(QString,int)), this, SLOT(feedChanged(QString,int))); - connect(mNotify, SIGNAL(notifyMsgChanged(QString,QString,int)), this, SLOT(msgChanged(QString,QString,int))); + connect(mNotify, SIGNAL(feedChanged(QString,int)), this, SLOT(feedChanged(QString,int))); + connect(mNotify, SIGNAL(msgChanged(QString,QString,int)), this, SLOT(msgChanged(QString,QString,int))); + + connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); /* connect signals */ connect(ui->feedTreeWidget, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(feedTreeItemActivated(QTreeWidgetItem*))); @@ -74,6 +79,7 @@ FeedReaderDialog::FeedReaderDialog(RsFeedReader *feedReader, QWidget *parent) connect(ui->feedTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(feedTreeItemActivated(QTreeWidgetItem*))); } connect(ui->feedTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(feedTreeCustomPopupMenu(QPoint))); + connect(ui->feedTreeWidget, SIGNAL(signalMouseMiddleButtonClicked(QTreeWidgetItem*)), this, SLOT(feedTreeMiddleButtonClicked(QTreeWidgetItem*))); connect(ui->messageTabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(messageTabCloseRequested(int))); connect(ui->messageTabWidget, SIGNAL(currentChanged(int)), this, SLOT(messageTabChanged(int))); @@ -94,10 +100,10 @@ FeedReaderDialog::FeedReaderDialog(RsFeedReader *feedReader, QWidget *parent) mRootItem->setData(COLUMN_FEED_DATA, ROLE_FEED_ICON, QIcon(":/images/Root.png")); mRootItem->setExpanded(true); - /* set initial size the splitter */ - QList sizes; - sizes << 300 << width(); // Qt calculates the right sizes - ui->splitter->setSizes(sizes); + /* set initial size the splitter */ + QList sizes; + sizes << 300 << width(); // Qt calculates the right sizes + ui->splitter->setSizes(sizes); /* load settings */ processSettings(true); @@ -107,9 +113,7 @@ FeedReaderDialog::FeedReaderDialog(RsFeedReader *feedReader, QWidget *parent) ui->feedTreeWidget->installEventFilter(this); - mMessageWidget = createMessageWidget(""); - // remove close button of the the first tab - ui->messageTabWidget->hideCloseButton(ui->messageTabWidget->indexOf(mMessageWidget)); + settingsChanged(); feedTreeItemActivated(NULL); } @@ -176,6 +180,22 @@ void FeedReaderDialog::processSettings(bool load) mProcessSettings = false; } +void FeedReaderDialog::settingsChanged() +{ + if (FeedReaderSetting_OpenAllInNewTab()) { + if (mMessageWidget) { + delete(mMessageWidget); + mMessageWidget = NULL; + } + } else { + if (!mMessageWidget) { + mMessageWidget = createMessageWidget(""); + // remove close button of the the first tab + ui->messageTabWidget->hideCloseButton(ui->messageTabWidget->indexOf(mMessageWidget)); + } + } +} + void FeedReaderDialog::addFeedToExpand(const std::string &feedId) { if (mOpenFeedIds == NULL) { @@ -279,11 +299,13 @@ void FeedReaderDialog::feedTreeCustomPopupMenu(QPoint /*point*/) action->setEnabled(false); } - contextMnu.addSeparator(); + if (!FeedReaderSetting_OpenAllInNewTab()) { + contextMnu.addSeparator(); - action = contextMnu.addAction(QIcon(""), tr("Open in new tab"), this, SLOT(openInNewTab())); - if (!item || folder || feedMessageWidget(feedId)) { - action->setEnabled(false); + action = contextMnu.addAction(QIcon(""), tr("Open in new tab"), this, SLOT(openInNewTab())); + if (!item || folder || feedMessageWidget(feedId)) { + action->setEnabled(false); + } } contextMnu.addSeparator(); @@ -565,7 +587,7 @@ FeedReaderMessageWidget *FeedReaderDialog::feedMessageWidget(const std::string & int tabCount = ui->messageTabWidget->count(); for (int index = 0; index < tabCount; ++index) { FeedReaderMessageWidget *childWidget = dynamic_cast(ui->messageTabWidget->widget(index)); - if (childWidget == mMessageWidget) { + if (mMessageWidget && childWidget == mMessageWidget) { continue; } if (childWidget && childWidget->feedId() == id) { @@ -607,17 +629,35 @@ void FeedReaderDialog::feedTreeItemActivated(QTreeWidgetItem *item) /* search exisiting tab */ FeedReaderMessageWidget *messageWidget = feedMessageWidget(feedId); if (!messageWidget) { - /* not found, use standard tab */ - messageWidget = mMessageWidget; - messageWidget->setFeedId(feedId); + if (mMessageWidget) { + /* not found, use standard tab */ + messageWidget = mMessageWidget; + messageWidget->setFeedId(feedId); + } else { + /* create new tab */ + messageWidget = createMessageWidget(feedId); + } } ui->messageTabWidget->setCurrentWidget(messageWidget); } +void FeedReaderDialog::feedTreeMiddleButtonClicked(QTreeWidgetItem *item) +{ + if (!item) { + return; + } + + openFeedInNewTab(item->data(COLUMN_FEED_DATA, ROLE_FEED_ID).toString().toStdString()); +} + void FeedReaderDialog::openInNewTab() { - std::string feedId = currentFeedId(); + openFeedInNewTab(currentFeedId()); +} + +void FeedReaderDialog::openFeedInNewTab(const std::string &feedId) +{ if (feedId.empty()) { return; } diff --git a/plugins/FeedReader/gui/FeedReaderDialog.h b/plugins/FeedReader/gui/FeedReaderDialog.h index 361a4d29f..496d78181 100644 --- a/plugins/FeedReader/gui/FeedReaderDialog.h +++ b/plugins/FeedReader/gui/FeedReaderDialog.h @@ -50,8 +50,10 @@ protected: bool eventFilter(QObject *obj, QEvent *ev); private slots: + void settingsChanged(); void feedTreeCustomPopupMenu(QPoint point); void feedTreeItemActivated(QTreeWidgetItem *item); + void feedTreeMiddleButtonClicked(QTreeWidgetItem *item); void openInNewTab(); void newFolder(); void newFeed(); @@ -75,6 +77,7 @@ private: void getExpandedFeedIds(QList &feedIds); void updateFeeds(const std::string &parentId, QTreeWidgetItem *parentItem); void updateFeedItem(QTreeWidgetItem *item, FeedInfo &info); + void openFeedInNewTab(const std::string &feedId); void calculateFeedItems(); void calculateFeedItem(QTreeWidgetItem *item, uint32_t &unreadCount, bool &loading); diff --git a/plugins/FeedReader/gui/FeedReaderMessageWidget.cpp b/plugins/FeedReader/gui/FeedReaderMessageWidget.cpp index ee6d42484..bc09c4ab8 100644 --- a/plugins/FeedReader/gui/FeedReaderMessageWidget.cpp +++ b/plugins/FeedReader/gui/FeedReaderMessageWidget.cpp @@ -8,6 +8,7 @@ #include "FeedReaderMessageWidget.h" #include "ui_FeedReaderMessageWidget.h" #include "FeedReaderNotify.h" +#include "FeedReaderConfig.h" #include "gui/common/RSTreeWidgetItem.h" #include "gui/settings/rsharesettings.h" @@ -38,8 +39,8 @@ FeedReaderMessageWidget::FeedReaderMessageWidget(const std::string &feedId, RsFe mUnreadCount = 0; /* connect signals */ - connect(mNotify, SIGNAL(notifyFeedChanged(QString,int)), this, SLOT(feedChanged(QString,int))); - connect(mNotify, SIGNAL(notifyMsgChanged(QString,QString,int)), this, SLOT(msgChanged(QString,QString,int))); + connect(mNotify, SIGNAL(feedChanged(QString,int)), this, SLOT(feedChanged(QString,int))); + connect(mNotify, SIGNAL(msgChanged(QString,QString,int)), this, SLOT(msgChanged(QString,QString,int))); connect(ui->msgTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(msgItemChanged())); connect(ui->msgTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(msgItemClicked(QTreeWidgetItem*,int))); @@ -554,7 +555,7 @@ void FeedReaderMessageWidget::updateCurrentMessage() return; } - bool setToReadOnActive = Settings->valueFromGroup("FeedReaderDialog", "SetMsgToReadOnActivate", true).toBool(); + bool setToReadOnActive = FeedReaderSetting_SetMsgToReadOnActivate(); bool isnew = item->data(COLUMN_MSG_DATA, ROLE_MSG_NEW).toBool(); bool read = item->data(COLUMN_MSG_DATA, ROLE_MSG_READ).toBool(); diff --git a/plugins/FeedReader/gui/FeedReaderNotify.cpp b/plugins/FeedReader/gui/FeedReaderNotify.cpp index 59853c114..650310939 100644 --- a/plugins/FeedReader/gui/FeedReaderNotify.cpp +++ b/plugins/FeedReader/gui/FeedReaderNotify.cpp @@ -25,12 +25,12 @@ FeedReaderNotify::FeedReaderNotify() : QObject() { } -void FeedReaderNotify::feedChanged(const std::string &feedId, int type) +void FeedReaderNotify::notifyFeedChanged(const std::string &feedId, int type) { - emit notifyFeedChanged(QString::fromStdString(feedId), type); + emit feedChanged(QString::fromStdString(feedId), type); } -void FeedReaderNotify::msgChanged(const std::string &feedId, const std::string &msgId, int type) +void FeedReaderNotify::notifyMsgChanged(const std::string &feedId, const std::string &msgId, int type) { - emit notifyMsgChanged(QString::fromStdString(feedId), QString::fromStdString(msgId), type); + emit msgChanged(QString::fromStdString(feedId), QString::fromStdString(msgId), type); } diff --git a/plugins/FeedReader/gui/FeedReaderNotify.h b/plugins/FeedReader/gui/FeedReaderNotify.h index 572b540ac..869b04fca 100644 --- a/plugins/FeedReader/gui/FeedReaderNotify.h +++ b/plugins/FeedReader/gui/FeedReaderNotify.h @@ -33,12 +33,12 @@ public: FeedReaderNotify(); /* RsFeedReaderNotify */ - virtual void feedChanged(const std::string &feedId, int type); - virtual void msgChanged(const std::string &feedId, const std::string &msgId, int type); + virtual void notifyFeedChanged(const std::string &feedId, int type); + virtual void notifyMsgChanged(const std::string &feedId, const std::string &msgId, int type); signals: - void notifyFeedChanged(const QString &feedId, int type); - void notifyMsgChanged(const QString &feedId, const QString &msgId, int type); + void feedChanged(const QString &feedId, int type); + void msgChanged(const QString &feedId, const QString &msgId, int type); }; #endif diff --git a/plugins/FeedReader/gui/FeedReaderUserNotify.cpp b/plugins/FeedReader/gui/FeedReaderUserNotify.cpp index ae6d81b89..86a752017 100644 --- a/plugins/FeedReader/gui/FeedReaderUserNotify.cpp +++ b/plugins/FeedReader/gui/FeedReaderUserNotify.cpp @@ -30,7 +30,7 @@ FeedReaderUserNotify::FeedReaderUserNotify(FeedReaderDialog *feedReaderDialog, RsFeedReader *feedReader, FeedReaderNotify *notify, QObject *parent) : UserNotify(parent), mFeedReaderDialog(feedReaderDialog), mFeedReader(feedReader), mNotify(notify) { - connect(mNotify, SIGNAL(notifyMsgChanged(QString,QString,int)), this, SLOT(updateIcon()), Qt::QueuedConnection); + connect(mNotify, SIGNAL(msgChanged(QString,QString,int)), this, SLOT(updateIcon()), Qt::QueuedConnection); } bool FeedReaderUserNotify::hasSetting(QString &name) diff --git a/plugins/FeedReader/gui/PreviewFeedDialog.cpp b/plugins/FeedReader/gui/PreviewFeedDialog.cpp index 79f2eed44..f200404b0 100644 --- a/plugins/FeedReader/gui/PreviewFeedDialog.cpp +++ b/plugins/FeedReader/gui/PreviewFeedDialog.cpp @@ -160,8 +160,8 @@ PreviewFeedDialog::PreviewFeedDialog(RsFeedReader *feedReader, FeedReaderNotify connect(ui->xpathUseListWidget->itemDelegate(), SIGNAL(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)), this, SLOT(xpathCloseEditor(QWidget*,QAbstractItemDelegate::EndEditHint))); connect(ui->xpathRemoveListWidget->itemDelegate(), SIGNAL(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)), this, SLOT(xpathCloseEditor(QWidget*,QAbstractItemDelegate::EndEditHint))); - connect(mNotify, SIGNAL(notifyFeedChanged(QString,int)), this, SLOT(feedChanged(QString,int))); - connect(mNotify, SIGNAL(notifyMsgChanged(QString,QString,int)), this, SLOT(msgChanged(QString,QString,int))); + connect(mNotify, SIGNAL(feedChanged(QString,int)), this, SLOT(feedChanged(QString,int))); + connect(mNotify, SIGNAL(msgChanged(QString,QString,int)), this, SLOT(msgChanged(QString,QString,int))); // ui->documentTreeWidget->setItemDelegate(new PreviewItemDelegate(ui->documentTreeWidget)); ui->structureFrame->hide(); diff --git a/plugins/FeedReader/interface/rsFeedReader.h b/plugins/FeedReader/interface/rsFeedReader.h index dc3efd1b3..e93dac8bc 100644 --- a/plugins/FeedReader/interface/rsFeedReader.h +++ b/plugins/FeedReader/interface/rsFeedReader.h @@ -164,8 +164,8 @@ class RsFeedReaderNotify public: RsFeedReaderNotify() {} - virtual void feedChanged(const std::string &/*feedId*/, int /*type*/) {} - virtual void msgChanged(const std::string &/*feedId*/, const std::string &/*msgId*/, int /*type*/) {} + virtual void notifyFeedChanged(const std::string &/*feedId*/, int /*type*/) {} + virtual void notifyMsgChanged(const std::string &/*feedId*/, const std::string &/*msgId*/, int /*type*/) {} }; class RsFeedReader diff --git a/plugins/FeedReader/lang/FeedReader_en.ts b/plugins/FeedReader/lang/FeedReader_en.ts index 117a94055..f8ca8792d 100644 --- a/plugins/FeedReader/lang/FeedReader_en.ts +++ b/plugins/FeedReader/lang/FeedReader_en.ts @@ -9,147 +9,147 @@ - + Authentication (not yet supported) - + Feed needs authentication - + User - + Password - + Update interval - + Use standard update interval - + Interval in minutes (0 = manual) - + Last update - + Never - + Storage time - + Use standard storage time - + Days (0 = off) - + Proxy - + Use standard proxy - + Server - + : - + Preview - + Type - + Forum - + Local Feed - + Misc - + Activated - + Use name and description from feed - + Update forum information - + Embed images (experimental for local feeds) - + Save complete web page (experimental for local feeds) - + Description: - + RSS-Feed-URL: - + Name: @@ -259,7 +259,12 @@ - + + Open all feeds in new tab + + + + FeedReader @@ -272,104 +277,119 @@ - + + Add new feed + + + + + Update feed + + + + Message Folders - + New - + Feed - + Folder - + + Open in new tab + + + + Edit - + Delete - + Update - + Activate - + Deactivate - + No name - + Add new folder - + Please enter a name for the folder - - + + Create folder - - + + Cannot create folder. - + Remove folder - + Remove feed - + Do you want to remove the folder %1? - + Do you want to remove the feed %1? - + Edit folder - + Please enter a new name for the folder @@ -382,90 +402,120 @@ - + + Mark messages as read + + + + + ... + + + + + Mark messages as unread + + + + + Mark all messages as read + + + + + Remove messages + + + + + Update feed + + + + Search forums - - + + Title - - + + Date - - + + Author - + Search Title - + Search Date - + Search Author - + Open link in browser - + Copy link to clipboard - + No name - + Mark as read - + Mark as unread - + Mark all as read - + Copy link - + Remove - + Hide - + Expand diff --git a/plugins/FeedReader/services/p3FeedReader.cc b/plugins/FeedReader/services/p3FeedReader.cc index 6f94b58a4..65c4818ee 100644 --- a/plugins/FeedReader/services/p3FeedReader.cc +++ b/plugins/FeedReader/services/p3FeedReader.cc @@ -340,7 +340,7 @@ RsFeedAddResult p3FeedReader::addFolder(const std::string parentId, const std::s IndicateConfigChanged(); if (mNotify) { - mNotify->feedChanged(feedId, NOTIFY_TYPE_ADD); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_ADD); } return RS_FEED_ADD_RESULT_SUCCESS; @@ -380,7 +380,7 @@ RsFeedAddResult p3FeedReader::setFolder(const std::string &feedId, const std::st IndicateConfigChanged(); if (mNotify) { - mNotify->feedChanged(feedId, NOTIFY_TYPE_MOD); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD); } return RS_FEED_ADD_RESULT_SUCCESS; @@ -427,7 +427,7 @@ RsFeedAddResult p3FeedReader::addFeed(const FeedInfo &feedInfo, std::string &fee IndicateConfigChanged(); if (mNotify) { - mNotify->feedChanged(feedId, NOTIFY_TYPE_ADD); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_ADD); } return RS_FEED_ADD_RESULT_SUCCESS; @@ -496,7 +496,7 @@ RsFeedAddResult p3FeedReader::setFeed(const std::string &feedId, const FeedInfo IndicateConfigChanged(); if (mNotify) { - mNotify->feedChanged(feedId, NOTIFY_TYPE_MOD); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD); } if (!forumId.empty()) { @@ -602,7 +602,7 @@ bool p3FeedReader::removeFeed(const std::string &feedId) /* only notify remove of feed */ std::list::iterator it; for (it = removedFeedIds.begin(); it != removedFeedIds.end(); ++it) { - mNotify->feedChanged(*it, NOTIFY_TYPE_DEL); + mNotify->notifyFeedChanged(*it, NOTIFY_TYPE_DEL); } } @@ -648,7 +648,7 @@ bool p3FeedReader::addPreviewFeed(const FeedInfo &feedInfo, std::string &feedId) } if (mNotify) { - mNotify->feedChanged(feedId, NOTIFY_TYPE_ADD); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_ADD); } { @@ -766,8 +766,8 @@ bool p3FeedReader::removeMsg(const std::string &feedId, const std::string &msgId } if (mNotify) { - mNotify->feedChanged(feedId, NOTIFY_TYPE_MOD); - mNotify->msgChanged(feedId, msgId, NOTIFY_TYPE_DEL); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD); + mNotify->notifyMsgChanged(feedId, msgId, NOTIFY_TYPE_DEL); } return true; @@ -814,11 +814,11 @@ bool p3FeedReader::removeMsgs(const std::string &feedId, const std::listfeedChanged(feedId, NOTIFY_TYPE_MOD); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD); std::list::iterator it; for (it = removedMsgs.begin(); it != removedMsgs.end(); ++it) { - mNotify->msgChanged(feedId, *it, NOTIFY_TYPE_DEL); + mNotify->notifyMsgChanged(feedId, *it, NOTIFY_TYPE_DEL); } } @@ -1061,7 +1061,7 @@ bool p3FeedReader::processFeed(const std::string &feedId) if (mNotify) { for (it = notifyIds.begin(); it != notifyIds.end(); ++it) { - mNotify->feedChanged(*it, NOTIFY_TYPE_MOD); + mNotify->notifyFeedChanged(*it, NOTIFY_TYPE_MOD); } } @@ -1110,8 +1110,8 @@ bool p3FeedReader::setMessageRead(const std::string &feedId, const std::string & if (changed) { IndicateConfigChanged(); if (mNotify) { - mNotify->feedChanged(feedId, NOTIFY_TYPE_MOD); - mNotify->msgChanged(feedId, msgId, NOTIFY_TYPE_MOD); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD); + mNotify->notifyMsgChanged(feedId, msgId, NOTIFY_TYPE_MOD); } } @@ -1187,7 +1187,7 @@ int p3FeedReader::tick() if (mNotify) { for (it = notifyIds.begin(); it != notifyIds.end(); ++it) { - mNotify->feedChanged(*it, NOTIFY_TYPE_MOD); + mNotify->notifyFeedChanged(*it, NOTIFY_TYPE_MOD); } } @@ -1244,7 +1244,7 @@ void p3FeedReader::cleanFeeds() if (mNotify) { std::list >::iterator it; for (it = removedMsgIds.begin(); it != removedMsgIds.end(); ++it) { - mNotify->msgChanged(it->first, it->second, NOTIFY_TYPE_DEL); + mNotify->notifyMsgChanged(it->first, it->second, NOTIFY_TYPE_DEL); } } } @@ -1474,7 +1474,7 @@ bool p3FeedReader::getFeedToDownload(RsFeedReaderFeed &feed, const std::string & } if (mNotify) { - mNotify->feedChanged(feedId, NOTIFY_TYPE_MOD); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD); } return true; @@ -1525,7 +1525,7 @@ void p3FeedReader::onDownloadSuccess(const std::string &feedId, const std::strin } if (mNotify) { - mNotify->feedChanged(feedId, NOTIFY_TYPE_MOD); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD); } } @@ -1562,7 +1562,7 @@ void p3FeedReader::onDownloadError(const std::string &feedId, RsFeedReaderErrorS } if (mNotify) { - mNotify->feedChanged(feedId, NOTIFY_TYPE_MOD); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD); } } @@ -1617,7 +1617,7 @@ bool p3FeedReader::getFeedToProcess(RsFeedReaderFeed &feed, const std::string &n } if (mNotify) { - mNotify->feedChanged(feedId, NOTIFY_TYPE_MOD); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD); } return true; @@ -1832,11 +1832,11 @@ void p3FeedReader::onProcessSuccess_addMsgs(const std::string &feedId, std::list } if (mNotify) { - mNotify->feedChanged(feedId, NOTIFY_TYPE_MOD); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD); std::list::iterator it; for (it = addedMsgs.begin(); it != addedMsgs.end(); ++it) { - mNotify->msgChanged(feedId, *it, NOTIFY_TYPE_ADD); + mNotify->notifyMsgChanged(feedId, *it, NOTIFY_TYPE_ADD); } } } @@ -1874,7 +1874,7 @@ void p3FeedReader::onProcessError(const std::string &feedId, RsFeedReaderErrorSt } if (mNotify) { - mNotify->feedChanged(feedId, NOTIFY_TYPE_MOD); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD); } } @@ -1930,7 +1930,7 @@ void p3FeedReader::setFeedInfo(const std::string &feedId, const std::string &nam } if (mNotify) { - mNotify->feedChanged(feedId, NOTIFY_TYPE_MOD); + mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD); } } diff --git a/retroshare-gui/src/gui/ForumsDialog.cpp b/retroshare-gui/src/gui/ForumsDialog.cpp index 802994ad4..8487304ef 100644 --- a/retroshare-gui/src/gui/ForumsDialog.cpp +++ b/retroshare-gui/src/gui/ForumsDialog.cpp @@ -1765,7 +1765,7 @@ ForumsFillThread::ForumsFillThread(ForumsDialog *parent) stopped = false; compareRole = NULL; - expandNewMessages = Settings->getExpandNewMessages(); + expandNewMessages = Settings->getForumExpandNewMessages(); fillComplete = false; filterColumn = 0; diff --git a/retroshare-gui/src/gui/GxsForumsDialog.cpp b/retroshare-gui/src/gui/GxsForumsDialog.cpp index 1e34607c8..9ebcddaac 100644 --- a/retroshare-gui/src/gui/GxsForumsDialog.cpp +++ b/retroshare-gui/src/gui/GxsForumsDialog.cpp @@ -29,6 +29,7 @@ #include "settings/rsharesettings.h" #include "RetroShareLink.h" #include "channels/ShareKey.h" +#include "common/RSTreeWidget.h" #include "notifyqt.h" // These should be in retroshare/ folder. @@ -69,13 +70,16 @@ GxsForumsDialog::GxsForumsDialog(QWidget *parent) /* Setup Queue */ mForumQueue = new TokenQueue(rsGxsForums->getTokenService(), this); + mThreadWidget = NULL; connect(ui.forumTreeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT(forumListCustomPopupMenu(QPoint))); connect(ui.newForumButton, SIGNAL(clicked()), this, SLOT(newforum())); connect(ui.forumTreeWidget, SIGNAL(treeItemActivated(QString)), this, SLOT(changedForum(QString))); + connect(ui.forumTreeWidget->treeWidget(), SIGNAL(signalMouseMiddleButtonClicked(QTreeWidgetItem*)), this, SLOT(forumTreeMiddleButtonClicked(QTreeWidgetItem*))); connect(ui.threadTabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(threadTabCloseRequested(int))); connect(ui.threadTabWidget, SIGNAL(currentChanged(int)), this, SLOT(threadTabChanged(int))); connect(NotifyQt::getInstance(), SIGNAL(forumMsgReadSatusChanged(QString,QString,int)), this, SLOT(forumMsgReadSatusChanged(QString,QString,int))); + connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); // HACK - TEMPORARY HIJACKING THIS BUTTON FOR REFRESH. connect(ui.refreshButton, SIGNAL(clicked()), this, SLOT(forceUpdateDisplay())); @@ -97,9 +101,7 @@ GxsForumsDialog::GxsForumsDialog(QWidget *parent) // load settings processSettings(true); - mThreadWidget = createThreadWidget(""); - // remove close button of the the first tab - ui.threadTabWidget->hideCloseButton(ui.threadTabWidget->indexOf(mThreadWidget)); + settingsChanged(); /* Hide platform specific features */ #ifdef Q_WS_WIN @@ -120,11 +122,11 @@ GxsForumsDialog::~GxsForumsDialog() // return new GxsForumUserNotify(parent); //} -void GxsForumsDialog::processSettings(bool bLoad) +void GxsForumsDialog::processSettings(bool load) { Settings->beginGroup(QString("GxsForumsDialog")); - if (bLoad) { + if (load) { // load settings // state of splitter @@ -136,11 +138,27 @@ void GxsForumsDialog::processSettings(bool bLoad) Settings->setValue("Splitter", ui.splitter->saveState()); } - ui.forumTreeWidget->processSettings(Settings, bLoad); + ui.forumTreeWidget->processSettings(Settings, load); Settings->endGroup(); } +void GxsForumsDialog::settingsChanged() +{ + if (Settings->getForumOpenAllInNewTab()) { + if (mThreadWidget) { + delete(mThreadWidget); + mThreadWidget = NULL; + } + } else { + if (!mThreadWidget) { + mThreadWidget = createThreadWidget(""); + // remove close button of the the first tab + ui.threadTabWidget->hideCloseButton(ui.threadTabWidget->indexOf(mThreadWidget)); + } + } +} + void GxsForumsDialog::forumListCustomPopupMenu(QPoint /*point*/) { int subscribeFlags = ui.forumTreeWidget->subscribeFlags(QString::fromStdString(mForumId)); @@ -153,9 +171,11 @@ void GxsForumsDialog::forumListCustomPopupMenu(QPoint /*point*/) action = contextMnu.addAction(QIcon(IMAGE_UNSUBSCRIBE), tr("Unsubscribe to Forum"), this, SLOT(unsubscribeToForum())); action->setEnabled (!mForumId.empty() && IS_GROUP_SUBSCRIBED(subscribeFlags)); - action = contextMnu.addAction(QIcon(""), tr("Open in new tab"), this, SLOT(openInNewTab())); - if (mForumId.empty() || forumThreadWidget(mForumId)) { - action->setEnabled(false); + if (!Settings->getForumOpenAllInNewTab()) { + action = contextMnu.addAction(QIcon(""), tr("Open in new tab"), this, SLOT(openInNewTab())); + if (mForumId.empty() || forumThreadWidget(mForumId)) { + action->setEnabled(false); + } } contextMnu.addSeparator(); @@ -335,7 +355,7 @@ GxsForumThreadWidget *GxsForumsDialog::forumThreadWidget(const std::string &foru int tabCount = ui.threadTabWidget->count(); for (int index = 0; index < tabCount; ++index) { GxsForumThreadWidget *childWidget = dynamic_cast(ui.threadTabWidget->widget(index)); - if (childWidget == mThreadWidget) { + if (mThreadWidget && childWidget == mThreadWidget) { continue; } if (childWidget && childWidget->forumId() == forumId) { @@ -370,25 +390,40 @@ void GxsForumsDialog::changedForum(const QString &forumId) GxsForumThreadWidget *threadWidget = forumThreadWidget(mForumId); if (!threadWidget) { - /* not found, use standard tab */ - threadWidget = mThreadWidget; - threadWidget->setForumId(mForumId); + if (mThreadWidget) { + /* not found, use standard tab */ + threadWidget = mThreadWidget; + threadWidget->setForumId(mForumId); + } else { + /* create new tab */ + threadWidget = createThreadWidget(mForumId); + } } ui.threadTabWidget->setCurrentWidget(threadWidget); } +void GxsForumsDialog::forumTreeMiddleButtonClicked(QTreeWidgetItem *item) +{ + openForumInNewTab(ui.forumTreeWidget->itemId(item).toStdString()); +} + void GxsForumsDialog::openInNewTab() { - if (mForumId.empty()) { + openForumInNewTab(mForumId); +} + +void GxsForumsDialog::openForumInNewTab(const std::string &forumId) +{ + if (forumId.empty()) { return; } /* search exisiting tab */ - GxsForumThreadWidget *threadWidget = forumThreadWidget(mForumId); + GxsForumThreadWidget *threadWidget = forumThreadWidget(forumId); if (!threadWidget) { /* not found, create new tab */ - threadWidget = createThreadWidget(mForumId); + threadWidget = createThreadWidget(forumId); } ui.threadTabWidget->setCurrentWidget(threadWidget); diff --git a/retroshare-gui/src/gui/GxsForumsDialog.h b/retroshare-gui/src/gui/GxsForumsDialog.h index fd501b162..198e6845e 100644 --- a/retroshare-gui/src/gui/GxsForumsDialog.h +++ b/retroshare-gui/src/gui/GxsForumsDialog.h @@ -57,6 +57,7 @@ public: virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req); private slots: + void settingsChanged(); void forceUpdateDisplay(); // TEMP HACK FN. /** Create the context popup menu and it's submenus */ @@ -66,6 +67,7 @@ private slots: void newforum(); void changedForum(const QString &forumId); + void forumTreeMiddleButtonClicked(QTreeWidgetItem *item); void openInNewTab(); void threadTabCloseRequested(int index); void threadTabChanged(int index); @@ -93,6 +95,7 @@ private: // void forumInfoToGroupItemInfo(const ForumInfo &forumInfo, GroupItemInfo &groupItemInfo); void forumInfoToGroupItemInfo(const RsGroupMetaData &forumInfo, GroupItemInfo &groupItemInfo); + void openForumInNewTab(const std::string &forumId); void forumSubscribe(bool subscribe); void processSettings(bool load); diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index b845e0133..e53f5e5f8 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -434,6 +434,11 @@ QTreeWidgetItem *GroupTreeWidget::activateId(const QString &id, bool focus) return item; } +RSTreeWidget *GroupTreeWidget::treeWidget() +{ + return ui->treeWidget; +} + int GroupTreeWidget::subscribeFlags(const QString &id) { QTreeWidgetItem *item = getItemFromId(id); diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.h b/retroshare-gui/src/gui/common/GroupTreeWidget.h index 3875e5f11..868a69bdd 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.h +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.h @@ -30,6 +30,7 @@ class QToolButton; class RshareSettings; class RSTreeWidgetItemCompareRole; +class RSTreeWidget; #define GROUPTREEWIDGET_COLOR_STANDARD -1 #define GROUPTREEWIDGET_COLOR_CATEGORY 0 @@ -89,6 +90,8 @@ public: QTreeWidgetItem *getItemFromId(const QString &id); QTreeWidgetItem *activateId(const QString &id, bool focus); + RSTreeWidget *treeWidget(); + QColor textColorCategory() const { return mTextColor[GROUPTREEWIDGET_COLOR_CATEGORY]; } QColor textColorPrivateKey() const { return mTextColor[GROUPTREEWIDGET_COLOR_PRIVATEKEY]; } diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.ui b/retroshare-gui/src/gui/common/GroupTreeWidget.ui index bd1b8c835..adfd667df 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.ui +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.ui @@ -21,7 +21,7 @@ - + true @@ -72,6 +72,11 @@ QLineEdit
gui/common/LineEditClear.h
+ + RSTreeWidget + QTreeWidget +
gui/common/RSTreeWidget.h
+
diff --git a/retroshare-gui/src/gui/common/RSTreeWidget.cpp b/retroshare-gui/src/gui/common/RSTreeWidget.cpp index e863e3be2..75e817aeb 100644 --- a/retroshare-gui/src/gui/common/RSTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/RSTreeWidget.cpp @@ -20,6 +20,7 @@ ****************************************************************/ #include +#include #include "RSTreeWidget.h" @@ -29,7 +30,7 @@ RSTreeWidget::RSTreeWidget(QWidget *parent) : QTreeWidget(parent) void RSTreeWidget::setPlaceholderText(const QString &text) { - placeholderText = text; + mPlaceholderText = text; viewport()->repaint(); } @@ -37,7 +38,7 @@ void RSTreeWidget::paintEvent(QPaintEvent *event) { QTreeWidget::paintEvent(event); - if (placeholderText.isEmpty() == false && model() && model()->rowCount() == 0) { + if (mPlaceholderText.isEmpty() == false && model() && model()->rowCount() == 0) { QWidget *vieportWidget = viewport(); QPainter painter(vieportWidget); @@ -47,6 +48,22 @@ void RSTreeWidget::paintEvent(QPaintEvent *event) pen.setColor(color); painter.setPen(pen); - painter.drawText(QRect(QPoint(), vieportWidget->size()), Qt::AlignHCenter | Qt::AlignVCenter | Qt::TextWordWrap, placeholderText); + painter.drawText(QRect(QPoint(), vieportWidget->size()), Qt::AlignHCenter | Qt::AlignVCenter | Qt::TextWordWrap, mPlaceholderText); } } + +void RSTreeWidget::mousePressEvent(QMouseEvent *event) +{ + if (event->buttons() & Qt::MiddleButton) { + if (receivers(SIGNAL(signalMouseMiddleButtonClicked(QTreeWidgetItem*))) > 0) { + QTreeWidgetItem *item = itemAt(event->pos()); + if (item) { + setCurrentItem(item); + emit signalMouseMiddleButtonClicked(item); + } + return; // eat event + } + } + + QTreeWidget::mousePressEvent(event); +} diff --git a/retroshare-gui/src/gui/common/RSTreeWidget.h b/retroshare-gui/src/gui/common/RSTreeWidget.h index 80a0f0d05..d5bdb39ad 100644 --- a/retroshare-gui/src/gui/common/RSTreeWidget.h +++ b/retroshare-gui/src/gui/common/RSTreeWidget.h @@ -34,10 +34,14 @@ public: void setPlaceholderText(const QString &text); +signals: + void signalMouseMiddleButtonClicked(QTreeWidgetItem *item); + protected: void paintEvent(QPaintEvent *event); + virtual void mousePressEvent(QMouseEvent *event); - QString placeholderText; + QString mPlaceholderText; }; #endif diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index b180fc1a6..e70cee75c 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -958,7 +958,7 @@ void GxsForumThreadWidget::insertForumThreads(const RsGroupMetaData &fi) mFillThread->mFilterColumn = ui->filterLineEdit->currentFilter(); mFillThread->mFilterColumn = COLUMN_THREAD_TITLE; mFillThread->mSubscribeFlags = mSubscribeFlags; - mFillThread->mExpandNewMessages = Settings->getExpandNewMessages(); + mFillThread->mExpandNewMessages = Settings->getForumExpandNewMessages(); mFillThread->mViewType = ui->viewBox->currentIndex(); if (mLastViewType != mFillThread->mViewType || mLastForumID != mForumId) { mFillThread->mFillComplete = true; diff --git a/retroshare-gui/src/gui/notifyqt.cpp b/retroshare-gui/src/gui/notifyqt.cpp index d03782bb6..1c3c9c9d8 100644 --- a/retroshare-gui/src/gui/notifyqt.cpp +++ b/retroshare-gui/src/gui/notifyqt.cpp @@ -837,6 +837,11 @@ void NotifyQt::notifyChatStyleChanged(int /*ChatStyle::enumStyleType*/ styleType emit chatStyleChanged(styleType); } +void NotifyQt::notifySettingsChanged() +{ + emit settingsChanged(); +} + void NotifyQt::startWaitingToasters() { { diff --git a/retroshare-gui/src/gui/notifyqt.h b/retroshare-gui/src/gui/notifyqt.h index fb90cee4f..cb4b0f300 100644 --- a/retroshare-gui/src/gui/notifyqt.h +++ b/retroshare-gui/src/gui/notifyqt.h @@ -66,6 +66,8 @@ class NotifyQt: public QObject, public NotifyBase void testToaster(uint notifyFlags, /*RshareSettings::enumToasterPosition*/ int position, QPoint margin); + void notifySettingsChanged(); + signals: // It's beneficial to send info to the GUI using signals, because signals are thread-safe // as they get queued by Qt. @@ -107,6 +109,7 @@ class NotifyQt: public QObject, public NotifyBase /* Notify from GUI */ void chatStyleChanged(int /*ChatStyle::enumStyleType*/ styleType); + void settingsChanged(); public slots: void UpdateGUI(); /* called by timer */ diff --git a/retroshare-gui/src/gui/settings/ForumPage.cpp b/retroshare-gui/src/gui/settings/ForumPage.cpp index c14548c6d..c877178d0 100644 --- a/retroshare-gui/src/gui/settings/ForumPage.cpp +++ b/retroshare-gui/src/gui/settings/ForumPage.cpp @@ -42,7 +42,8 @@ bool ForumPage::save(QString &/*errmsg*/) { Settings->setForumMsgSetToReadOnActivate(ui.setMsgToReadOnActivate->isChecked()); - Settings->setExpandNewMessages(ui.expandNewMessages->isChecked()); + Settings->setForumExpandNewMessages(ui.expandNewMessages->isChecked()); + Settings->setForumOpenAllInNewTab(ui.openAllInNewTabCheckBox->isChecked()); return true; } @@ -52,5 +53,6 @@ void ForumPage::load() { ui.setMsgToReadOnActivate->setChecked(Settings->getForumMsgSetToReadOnActivate()); - ui.expandNewMessages->setChecked(Settings->getExpandNewMessages()); + ui.expandNewMessages->setChecked(Settings->getForumExpandNewMessages()); + ui.openAllInNewTabCheckBox->setChecked(Settings->getForumOpenAllInNewTab()); } diff --git a/retroshare-gui/src/gui/settings/ForumPage.ui b/retroshare-gui/src/gui/settings/ForumPage.ui index 18baeae84..30ed15f11 100644 --- a/retroshare-gui/src/gui/settings/ForumPage.ui +++ b/retroshare-gui/src/gui/settings/ForumPage.ui @@ -34,7 +34,7 @@
- + Qt::Vertical @@ -47,6 +47,22 @@ + + + + New forum + + + + + + Open all forums in new tab + + + + + +
diff --git a/retroshare-gui/src/gui/settings/rsettingswin.cpp b/retroshare-gui/src/gui/settings/rsettingswin.cpp index b86e50eda..c1daa9027 100644 --- a/retroshare-gui/src/gui/settings/rsettingswin.cpp +++ b/retroshare-gui/src/gui/settings/rsettingswin.cpp @@ -39,6 +39,7 @@ #include "ForumPage.h" #include "PluginsPage.h" #include "rsharesettings.h" +#include "gui/notifyqt.h" #define IMAGE_GENERAL ":/images/kcmsystem24.png" @@ -202,5 +203,9 @@ RSettingsWin::saveChanges() /* call to RsIface save function.... */ //rsicontrol -> ConfigSave(); + if (NotifyQt::getInstance()) { + NotifyQt::getInstance()->notifySettingsChanged(); + } + close(); } diff --git a/retroshare-gui/src/gui/settings/rsharesettings.cpp b/retroshare-gui/src/gui/settings/rsharesettings.cpp index 541a048f5..1b641217f 100644 --- a/retroshare-gui/src/gui/settings/rsharesettings.cpp +++ b/retroshare-gui/src/gui/settings/rsharesettings.cpp @@ -698,9 +698,9 @@ bool RshareSettings::getMsgSetToReadOnActivate () return valueFromGroup("MessageDialog", "SetMsgToReadOnActivate", true).toBool(); } -void RshareSettings::setMsgSetToReadOnActivate (bool bValue) +void RshareSettings::setMsgSetToReadOnActivate (bool value) { - setValueToGroup("MessageDialog", "SetMsgToReadOnActivate", bValue); + setValueToGroup("MessageDialog", "SetMsgToReadOnActivate", value); } RshareSettings::enumMsgOpen RshareSettings::getMsgOpen() @@ -735,19 +735,29 @@ bool RshareSettings::getForumMsgSetToReadOnActivate () return valueFromGroup("ForumDialog", "SetMsgToReadOnActivate", true).toBool(); } -void RshareSettings::setForumMsgSetToReadOnActivate (bool bValue) +void RshareSettings::setForumMsgSetToReadOnActivate(bool value) { - setValueToGroup("ForumDialog", "SetMsgToReadOnActivate", bValue); + setValueToGroup("ForumDialog", "SetMsgToReadOnActivate", value); } -bool RshareSettings::getExpandNewMessages() +bool RshareSettings::getForumExpandNewMessages() { return valueFromGroup("ForumDialog", "ExpandNewMessages", true).toBool(); } -void RshareSettings::setExpandNewMessages (bool bValue) +void RshareSettings::setForumExpandNewMessages(bool value) { - setValueToGroup("ForumDialog", "ExpandNewMessages", bValue); + setValueToGroup("ForumDialog", "ExpandNewMessages", value); +} + +bool RshareSettings::getForumOpenAllInNewTab() +{ + return valueFromGroup("ForumDialog", "OpenAllInNewTab", true).toBool(); +} + +bool RshareSettings::setForumOpenAllInNewTab(bool value) +{ + setValueToGroup("ForumDialog", "OpenAllInNewTab", value); } /* time before idle */ diff --git a/retroshare-gui/src/gui/settings/rsharesettings.h b/retroshare-gui/src/gui/settings/rsharesettings.h index 063372654..b7ed16b97 100644 --- a/retroshare-gui/src/gui/settings/rsharesettings.h +++ b/retroshare-gui/src/gui/settings/rsharesettings.h @@ -236,21 +236,23 @@ public: void setStatusBarFlag(uint flag, bool enable); /* Messages */ - bool getMsgSetToReadOnActivate (); - void setMsgSetToReadOnActivate (bool bValue); + bool getMsgSetToReadOnActivate(); + void setMsgSetToReadOnActivate(bool value); enumMsgOpen getMsgOpen(); void setMsgOpen(enumMsgOpen value); /* Forums */ - bool getForumMsgSetToReadOnActivate (); - void setForumMsgSetToReadOnActivate (bool bValue); - bool getExpandNewMessages (); - void setExpandNewMessages (bool bValue); + bool getForumMsgSetToReadOnActivate(); + void setForumMsgSetToReadOnActivate(bool value); + bool getForumExpandNewMessages(); + void setForumExpandNewMessages(bool value); + bool getForumOpenAllInNewTab(); + bool setForumOpenAllInNewTab(bool value); /* time before idle */ uint getMaxTimeBeforeIdle(); - void setMaxTimeBeforeIdle(uint nValue); + void setMaxTimeBeforeIdle(uint value); protected: /** Default constructor. */ diff --git a/retroshare-gui/src/lang/retroshare_en.ts b/retroshare-gui/src/lang/retroshare_en.ts index 38806a551..87304b748 100644 --- a/retroshare-gui/src/lang/retroshare_en.ts +++ b/retroshare-gui/src/lang/retroshare_en.ts @@ -4172,6 +4172,14 @@ p, li { white-space: pre-wrap; } Forum + + New forum + + + + Open all forums in new tab + + ForumUserNotify @@ -5885,6 +5893,10 @@ p, li { white-space: pre-wrap; } Search Content + + No name + + GxsForumsDialog @@ -5988,6 +6000,10 @@ p, li { white-space: pre-wrap; } On %1, %2 wrote: + + Open in new tab + + GxsForumsFillThread @@ -6315,6 +6331,14 @@ p, li { white-space: pre-wrap; } <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } +</style></head><body style=" font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt; font-weight:600;">About RetroShare</span></p></body></html> + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:9pt; font-weight:400; font-style:normal;"> <p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">RetroShare is an Open Source cross-platform, </span></p> <p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">private and secure decentralized commmunication platform. </span></p> @@ -6323,11 +6347,12 @@ p, li { white-space: pre-wrap; } <p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">RetroShare provides file sharing, chat, messages and channels</span></p> <p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">Useful external links to more information:</span></p> -<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" font-size:8pt;" align="justify" style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://retroshare.sourceforge.net"><span style=" text-decoration: underline; color:#0000ff;">Retroshare Webpage</span></a></li> -<li style=" font-size:8pt;" align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://retroshare.sourceforge.net/wiki/index.php/Main_Page"><span style=" text-decoration: underline; color:#0000ff;">Retroshare Wiki</span></a></li> -<li style=" font-size:8pt; text-decoration: underline; color:#0000ff;" align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://retroshare.sourceforge.net/forum/">RetroShare's Forum</a></li> -<li style=" font-size:8pt;" align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://sourceforge.net/projects/retroshare/"><span style=" text-decoration: underline; color:#0000ff;">Retroshare Project Page</span></a></li> -<li style=" font-size:8pt;" align="justify" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.lunamutt.com"><span style=" text-decoration: underline; color:#0000ff;">Lunamutt Homepage.</span></a></li></ul></body></html> +<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" font-size:8pt;" align="justify" style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://retroshare.sourceforge.net"><span style=" font-size:12pt; text-decoration: underline; color:#0000ff;">Retroshare Webpage</span></a></li> +<li style=" font-size:12pt; text-decoration: underline; color:#0000ff;" align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://retroshare.sourceforge.net">Retroshare Wiki</a></li> +<li style=" font-size:12pt; text-decoration: underline; color:#0000ff;" align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://retroshare.sourceforge.net">RetroShare's Forum</a></li> +<li style=" font-size:12pt; text-decoration: underline; color:#0000ff;" align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://retroshare.sourceforge.net">Retroshare Project Page</a></li> +<li style=" font-size:12pt; text-decoration: underline; color:#0000ff;" align="justify" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://retroshare.sourceforge.net">RetroShare Team Blog</a></li> +<li style=" font-size:12pt; text-decoration: underline; color:#0000ff;" align="justify" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://retroshare.sourceforge.net">RetroShare Dev Twiter</a></li></ul></body></html> @@ -6340,21 +6365,15 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">French</span><span style=" font-size:8pt;">:Temet</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">Polish: </span><span style=" font-size:8pt;">Jarek</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">Serbian</span><span style=" font-size:8pt;">: Kunalagon Umuhanik &lt;kunalagon@gmail.com&gt;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">Spanish: </span><span style=" font-family:'Courier New,courier';">Manuel Montero &lt;Senpai&gt; </span><a href="http://pagina.de/senpai&amp;gt"><span style=" font-family:'Courier New,courier'; text-decoration: underline; color:#0000ff;">http://pagina.de/senpai</span></a></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">Swedish:</span><span style=" font-size:8pt;"> dnylander</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">RetroShare Website Translators:</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt; font-weight:600;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">Swedish: </span><span style=" font-size:8pt;"> Daniel Wester</span><span style=" font-size:8pt; font-weight:600;"> &lt;</span><span style=" font-size:8pt;">wester@speedmail.se</span><span style=" font-size:8pt; font-weight:600;">&gt;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">German: </span><span style=" font-size:8pt;">Jan</span><span style=" font-size:8pt; font-weight:600;"> </span><span style=" font-size:8pt;">Keller</span><span style=""> &lt;</span><span style=" font-size:8pt;">trilarion@users.sourceforge.net</span><span style="">&gt;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Polish: </span><span style="">Maciej Mrug</span></p></body></html> - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt; font-weight:600;">About RetroShare</span></p></body></html> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">German: </span><span style=" font-size:8pt;">Jan</span><span style=" font-size:8pt; font-weight:600;"> </span><span style=" font-size:8pt;">Keller</span> &lt;<span style=" font-size:8pt;">trilarion@users.sourceforge.net</span>&gt;</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Polish: </span>Maciej Mrug</p></body></html>