mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-24 22:30:42 -04:00
- Added settings page for Posted.
- Added new base class for GroupFrame settings for settings pages. - Moved usage of GroupFrame settings (forum, channel and posted) to base class. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7468 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0bcc8697ef
commit
42e579a294
22 changed files with 377 additions and 122 deletions
|
@ -27,8 +27,7 @@
|
||||||
#include "PostedListWidget.h"
|
#include "PostedListWidget.h"
|
||||||
#include "PostedUserNotify.h"
|
#include "PostedUserNotify.h"
|
||||||
//#include "gui/channels/ShareKey.h"
|
//#include "gui/channels/ShareKey.h"
|
||||||
//#include "gui/settings/rsharesettings.h"
|
#include "gui/settings/rsharesettings.h"
|
||||||
//#include "gui/notifyqt.h"
|
|
||||||
|
|
||||||
#include <retroshare/rsposted.h>
|
#include <retroshare/rsposted.h>
|
||||||
|
|
||||||
|
@ -36,9 +35,6 @@
|
||||||
PostedDialog::PostedDialog(QWidget *parent)
|
PostedDialog::PostedDialog(QWidget *parent)
|
||||||
: GxsGroupFrameDialog(rsPosted, parent)
|
: GxsGroupFrameDialog(rsPosted, parent)
|
||||||
{
|
{
|
||||||
// connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
|
|
||||||
|
|
||||||
settingsChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PostedDialog::~PostedDialog()
|
PostedDialog::~PostedDialog()
|
||||||
|
@ -98,12 +94,6 @@ QString PostedDialog::icon(IconType type)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void PostedDialog::settingsChanged()
|
|
||||||
{
|
|
||||||
setSingleTab(true /*!Settings->getPostedOpenAllInNewTab()*/);
|
|
||||||
setHideTabBarWithOneTab(true /*Settings->getPostedHideTabBarWithOneTab()*/);
|
|
||||||
}
|
|
||||||
|
|
||||||
GxsGroupDialog *PostedDialog::createNewGroupDialog(TokenQueue *tokenQueue)
|
GxsGroupDialog *PostedDialog::createNewGroupDialog(TokenQueue *tokenQueue)
|
||||||
{
|
{
|
||||||
return new PostedGroupDialog(tokenQueue, this);
|
return new PostedGroupDialog(tokenQueue, this);
|
||||||
|
|
|
@ -46,9 +46,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_UNKNOWN; }
|
virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_UNKNOWN; }
|
||||||
|
virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Posted; }
|
||||||
private slots:
|
|
||||||
void settingsChanged();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/* GxsGroupFrameDialog */
|
/* GxsGroupFrameDialog */
|
||||||
|
|
|
@ -138,6 +138,11 @@ void GxsGroupFrameDialog::initUi()
|
||||||
// load settings
|
// load settings
|
||||||
mSettingsName = settingsGroupName();
|
mSettingsName = settingsGroupName();
|
||||||
processSettings(true);
|
processSettings(true);
|
||||||
|
|
||||||
|
if (groupFrameSettingsType() != GroupFrameSettings::Nothing) {
|
||||||
|
connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
|
||||||
|
settingsChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsGroupFrameDialog::showEvent(QShowEvent *event)
|
void GxsGroupFrameDialog::showEvent(QShowEvent *event)
|
||||||
|
@ -177,6 +182,15 @@ void GxsGroupFrameDialog::processSettings(bool load)
|
||||||
Settings->endGroup();
|
Settings->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GxsGroupFrameDialog::settingsChanged()
|
||||||
|
{
|
||||||
|
GroupFrameSettings groupFrameSettings;
|
||||||
|
if (Settings->getGroupFrameSettings(groupFrameSettingsType(), groupFrameSettings)) {
|
||||||
|
setSingleTab(!groupFrameSettings.mOpenAllInNewTab);
|
||||||
|
setHideTabBarWithOneTab(groupFrameSettings.mHideTabBarWithOneTab);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GxsGroupFrameDialog::setSingleTab(bool singleTab)
|
void GxsGroupFrameDialog::setSingleTab(bool singleTab)
|
||||||
{
|
{
|
||||||
if (singleTab) {
|
if (singleTab) {
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "gui/gxs/RsGxsUpdateBroadcastPage.h"
|
#include "gui/gxs/RsGxsUpdateBroadcastPage.h"
|
||||||
#include "RsAutoUpdatePage.h"
|
#include "RsAutoUpdatePage.h"
|
||||||
#include "gui/RetroShareLink.h"
|
#include "gui/RetroShareLink.h"
|
||||||
|
#include "gui/settings/rsharesettings.h"
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
@ -84,15 +85,16 @@ protected:
|
||||||
RsGxsGroupId groupId() { return mGroupId; }
|
RsGxsGroupId groupId() { return mGroupId; }
|
||||||
void setSingleTab(bool singleTab);
|
void setSingleTab(bool singleTab);
|
||||||
void setHideTabBarWithOneTab(bool hideTabBarWithOneTab);
|
void setHideTabBarWithOneTab(bool hideTabBarWithOneTab);
|
||||||
bool getCurrentGroupName(QString& name);
|
bool getCurrentGroupName(QString& name);
|
||||||
virtual RetroShareLink::enumType getLinkType() = 0;
|
virtual RetroShareLink::enumType getLinkType() = 0;
|
||||||
|
virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Nothing; }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void todo();
|
void todo();
|
||||||
|
|
||||||
/** Create the context popup menu and it's submenus */
|
/** Create the context popup menu and it's submenus */
|
||||||
void groupTreeCustomPopupMenu(QPoint point);
|
void groupTreeCustomPopupMenu(QPoint point);
|
||||||
|
void settingsChanged();
|
||||||
|
|
||||||
void restoreGroupKeys();
|
void restoreGroupKeys();
|
||||||
void newGroup();
|
void newGroup();
|
||||||
|
|
|
@ -32,9 +32,6 @@
|
||||||
GxsChannelDialog::GxsChannelDialog(QWidget *parent)
|
GxsChannelDialog::GxsChannelDialog(QWidget *parent)
|
||||||
: GxsGroupFrameDialog(rsGxsChannels, parent)
|
: GxsGroupFrameDialog(rsGxsChannels, parent)
|
||||||
{
|
{
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
|
|
||||||
|
|
||||||
settingsChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GxsChannelDialog::~GxsChannelDialog()
|
GxsChannelDialog::~GxsChannelDialog()
|
||||||
|
@ -97,12 +94,6 @@ QString GxsChannelDialog::icon(IconType type)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsChannelDialog::settingsChanged()
|
|
||||||
{
|
|
||||||
setSingleTab(!Settings->getChannelOpenAllInNewTab());
|
|
||||||
setHideTabBarWithOneTab(Settings->getChannelHideTabBarWithOneTab());
|
|
||||||
}
|
|
||||||
|
|
||||||
GxsGroupDialog *GxsChannelDialog::createNewGroupDialog(TokenQueue *tokenQueue)
|
GxsGroupDialog *GxsChannelDialog::createNewGroupDialog(TokenQueue *tokenQueue)
|
||||||
{
|
{
|
||||||
return new GxsChannelGroupDialog(tokenQueue, this);
|
return new GxsChannelGroupDialog(tokenQueue, this);
|
||||||
|
|
|
@ -43,9 +43,10 @@ public:
|
||||||
virtual UserNotify *getUserNotify(QObject *parent);
|
virtual UserNotify *getUserNotify(QObject *parent);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_CHANNEL; }
|
virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_CHANNEL; }
|
||||||
|
virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Channel; }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void settingsChanged();
|
|
||||||
void toggleAutoDownload();
|
void toggleAutoDownload();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "GxsForumGroupDialog.h"
|
#include "GxsForumGroupDialog.h"
|
||||||
#include "GxsForumThreadWidget.h"
|
#include "GxsForumThreadWidget.h"
|
||||||
#include "GxsForumUserNotify.h"
|
#include "GxsForumUserNotify.h"
|
||||||
#include "gui/settings/rsharesettings.h"
|
|
||||||
#include "gui/notifyqt.h"
|
#include "gui/notifyqt.h"
|
||||||
#include "gui/channels/ShareKey.h"
|
#include "gui/channels/ShareKey.h"
|
||||||
|
|
||||||
|
@ -31,9 +30,6 @@
|
||||||
GxsForumsDialog::GxsForumsDialog(QWidget *parent)
|
GxsForumsDialog::GxsForumsDialog(QWidget *parent)
|
||||||
: GxsGroupFrameDialog(rsGxsForums, parent)
|
: GxsGroupFrameDialog(rsGxsForums, parent)
|
||||||
{
|
{
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
|
|
||||||
|
|
||||||
settingsChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GxsForumsDialog::~GxsForumsDialog()
|
GxsForumsDialog::~GxsForumsDialog()
|
||||||
|
@ -74,11 +70,6 @@ QString GxsForumsDialog::text(TextType type)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
RetroShareLink::enumType GxsForumsDialog::getLinkType()
|
|
||||||
{
|
|
||||||
return RetroShareLink::TYPE_FORUM;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString GxsForumsDialog::icon(IconType type)
|
QString GxsForumsDialog::icon(IconType type)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -101,12 +92,6 @@ QString GxsForumsDialog::icon(IconType type)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsForumsDialog::settingsChanged()
|
|
||||||
{
|
|
||||||
setSingleTab(!Settings->getForumOpenAllInNewTab());
|
|
||||||
setHideTabBarWithOneTab(Settings->getForumHideTabBarWithOneTab());
|
|
||||||
}
|
|
||||||
|
|
||||||
GxsGroupDialog *GxsForumsDialog::createNewGroupDialog(TokenQueue *tokenQueue)
|
GxsGroupDialog *GxsForumsDialog::createNewGroupDialog(TokenQueue *tokenQueue)
|
||||||
{
|
{
|
||||||
return new GxsForumGroupDialog(tokenQueue, this);
|
return new GxsForumGroupDialog(tokenQueue, this);
|
||||||
|
|
|
@ -41,11 +41,8 @@ public:
|
||||||
virtual UserNotify *getUserNotify(QObject *parent);
|
virtual UserNotify *getUserNotify(QObject *parent);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_FORUM; }
|
||||||
RetroShareLink::enumType getLinkType();
|
virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Forum; }
|
||||||
|
|
||||||
private slots:
|
|
||||||
void settingsChanged();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/* GxsGroupFrameDialog */
|
/* GxsGroupFrameDialog */
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
#include "ChannelPage.h"
|
#include "ChannelPage.h"
|
||||||
#include "rshare.h"
|
|
||||||
#include "rsharesettings.h"
|
#include "rsharesettings.h"
|
||||||
|
|
||||||
ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags)
|
ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags)
|
||||||
|
@ -37,8 +36,7 @@ ChannelPage::~ChannelPage()
|
||||||
/** Saves the changes on this page */
|
/** Saves the changes on this page */
|
||||||
bool ChannelPage::save(QString &/*errmsg*/)
|
bool ChannelPage::save(QString &/*errmsg*/)
|
||||||
{
|
{
|
||||||
Settings->setChannelOpenAllInNewTab(ui.openAllInNewTabCheckBox->isChecked());
|
ui.groupFrameSettingsWidget->saveSettings(GroupFrameSettings::Channel);
|
||||||
Settings->setChannelHideTabBarWithOneTab(ui.hideTabBarWithOneTabCheckBox->isChecked());
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -46,6 +44,5 @@ bool ChannelPage::save(QString &/*errmsg*/)
|
||||||
/** Loads the settings for this page */
|
/** Loads the settings for this page */
|
||||||
void ChannelPage::load()
|
void ChannelPage::load()
|
||||||
{
|
{
|
||||||
ui.openAllInNewTabCheckBox->setChecked(Settings->getChannelOpenAllInNewTab());
|
ui.groupFrameSettingsWidget->loadSettings(GroupFrameSettings::Channel);
|
||||||
ui.hideTabBarWithOneTabCheckBox->setChecked(Settings->getChannelHideTabBarWithOneTab());
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,24 +31,21 @@
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="openAllInNewTabCheckBox">
|
<widget class="GroupFrameSettingsWidget" name="groupFrameSettingsWidget" native="true"/>
|
||||||
<property name="text">
|
|
||||||
<string>Open all forums in new tab</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="hideTabBarWithOneTabCheckBox">
|
|
||||||
<property name="text">
|
|
||||||
<string>Hide tabbar with one open tab</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>GroupFrameSettingsWidget</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>gui/settings/GroupFrameSettingsWidget.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
#include "ForumPage.h"
|
#include "ForumPage.h"
|
||||||
#include "rshare.h"
|
|
||||||
#include "rsharesettings.h"
|
#include "rsharesettings.h"
|
||||||
|
|
||||||
ForumPage::ForumPage(QWidget * parent, Qt::WindowFlags flags)
|
ForumPage::ForumPage(QWidget * parent, Qt::WindowFlags flags)
|
||||||
|
@ -39,10 +38,10 @@ bool ForumPage::save(QString &/*errmsg*/)
|
||||||
{
|
{
|
||||||
Settings->setForumMsgSetToReadOnActivate(ui.setMsgToReadOnActivate->isChecked());
|
Settings->setForumMsgSetToReadOnActivate(ui.setMsgToReadOnActivate->isChecked());
|
||||||
Settings->setForumExpandNewMessages(ui.expandNewMessages->isChecked());
|
Settings->setForumExpandNewMessages(ui.expandNewMessages->isChecked());
|
||||||
Settings->setForumOpenAllInNewTab(ui.openAllInNewTabCheckBox->isChecked());
|
|
||||||
Settings->setForumHideTabBarWithOneTab(ui.hideTabBarWithOneTabCheckBox->isChecked());
|
|
||||||
Settings->setForumLoadEmbeddedImages(ui.loadEmbeddedImages->isChecked());
|
Settings->setForumLoadEmbeddedImages(ui.loadEmbeddedImages->isChecked());
|
||||||
|
|
||||||
|
ui.groupFrameSettingsWidget->saveSettings(GroupFrameSettings::Forum);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +50,7 @@ void ForumPage::load()
|
||||||
{
|
{
|
||||||
ui.setMsgToReadOnActivate->setChecked(Settings->getForumMsgSetToReadOnActivate());
|
ui.setMsgToReadOnActivate->setChecked(Settings->getForumMsgSetToReadOnActivate());
|
||||||
ui.expandNewMessages->setChecked(Settings->getForumExpandNewMessages());
|
ui.expandNewMessages->setChecked(Settings->getForumExpandNewMessages());
|
||||||
ui.openAllInNewTabCheckBox->setChecked(Settings->getForumOpenAllInNewTab());
|
|
||||||
ui.hideTabBarWithOneTabCheckBox->setChecked(Settings->getForumHideTabBarWithOneTab());
|
|
||||||
ui.loadEmbeddedImages->setChecked(Settings->getForumLoadEmbeddedImages());
|
ui.loadEmbeddedImages->setChecked(Settings->getForumLoadEmbeddedImages());
|
||||||
|
|
||||||
|
ui.groupFrameSettingsWidget->loadSettings(GroupFrameSettings::Forum);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,24 +61,21 @@
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="openAllInNewTabCheckBox">
|
<widget class="GroupFrameSettingsWidget" name="groupFrameSettingsWidget" native="true"/>
|
||||||
<property name="text">
|
|
||||||
<string>Open all forums in new tab</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="hideTabBarWithOneTabCheckBox">
|
|
||||||
<property name="text">
|
|
||||||
<string>Hide tabbar with one open tab</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>GroupFrameSettingsWidget</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>gui/settings/GroupFrameSettingsWidget.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
39
retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.cpp
Normal file
39
retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.cpp
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#include "GroupFrameSettingsWidget.h"
|
||||||
|
#include "ui_GroupFrameSettingsWidget.h"
|
||||||
|
|
||||||
|
GroupFrameSettingsWidget::GroupFrameSettingsWidget(QWidget *parent) :
|
||||||
|
QWidget(parent),
|
||||||
|
ui(new Ui::GroupFrameSettingsWidget)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
mEnable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
GroupFrameSettingsWidget::~GroupFrameSettingsWidget()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupFrameSettingsWidget::loadSettings(GroupFrameSettings::Type type)
|
||||||
|
{
|
||||||
|
GroupFrameSettings groupFrameSettings;
|
||||||
|
if (Settings->getGroupFrameSettings(type, groupFrameSettings)) {
|
||||||
|
ui->openAllInNewTabCheckBox->setChecked(groupFrameSettings.mOpenAllInNewTab);
|
||||||
|
ui->hideTabBarWithOneTabCheckBox->setChecked(groupFrameSettings.mHideTabBarWithOneTab);
|
||||||
|
} else {
|
||||||
|
hide();
|
||||||
|
mEnable = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupFrameSettingsWidget::saveSettings(GroupFrameSettings::Type type)
|
||||||
|
{
|
||||||
|
if (mEnable) {
|
||||||
|
GroupFrameSettings groupFrameSettings;
|
||||||
|
groupFrameSettings.mOpenAllInNewTab = ui->openAllInNewTabCheckBox->isChecked();
|
||||||
|
groupFrameSettings.mHideTabBarWithOneTab = ui->hideTabBarWithOneTabCheckBox->isChecked();
|
||||||
|
|
||||||
|
Settings->setGroupFrameSettings(type, groupFrameSettings);
|
||||||
|
}
|
||||||
|
}
|
28
retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.h
Normal file
28
retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.h
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#ifndef GROUPFRAMESETTINGSWIDGET_H
|
||||||
|
#define GROUPFRAMESETTINGSWIDGET_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include "gui/settings/rsharesettings.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class GroupFrameSettingsWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
class GroupFrameSettingsWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit GroupFrameSettingsWidget(QWidget *parent = 0);
|
||||||
|
~GroupFrameSettingsWidget();
|
||||||
|
|
||||||
|
void loadSettings(GroupFrameSettings::Type type);
|
||||||
|
void saveSettings(GroupFrameSettings::Type type);
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool mEnable;
|
||||||
|
Ui::GroupFrameSettingsWidget *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // GROUPFRAMESETTINGSWIDGET_H
|
47
retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.ui
Normal file
47
retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.ui
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>GroupFrameSettingsWidget</class>
|
||||||
|
<widget class="QWidget" name="GroupFrameSettingsWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>40</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="openAllInNewTabCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Open all forums in new tab</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="hideTabBarWithOneTabCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Hide tabbar with one open tab</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
50
retroshare-gui/src/gui/settings/PostedPage.cpp
Normal file
50
retroshare-gui/src/gui/settings/PostedPage.cpp
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
/****************************************************************
|
||||||
|
* RetroShare is distributed under the following license:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014, RetroShare Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
****************************************************************/
|
||||||
|
|
||||||
|
#include "PostedPage.h"
|
||||||
|
#include "ui_PostedPage.h"
|
||||||
|
#include "rsharesettings.h"
|
||||||
|
|
||||||
|
PostedPage::PostedPage(QWidget * parent, Qt::WindowFlags flags)
|
||||||
|
: ConfigPage(parent, flags),
|
||||||
|
ui(new Ui::PostedPage)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
setAttribute(Qt::WA_QuitOnClose, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
PostedPage::~PostedPage()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Saves the changes on this page */
|
||||||
|
bool PostedPage::save(QString &/*errmsg*/)
|
||||||
|
{
|
||||||
|
ui->groupFrameSettingsWidget->saveSettings(GroupFrameSettings::Posted);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Loads the settings for this page */
|
||||||
|
void PostedPage::load()
|
||||||
|
{
|
||||||
|
ui->groupFrameSettingsWidget->loadSettings(GroupFrameSettings::Posted);
|
||||||
|
}
|
53
retroshare-gui/src/gui/settings/PostedPage.h
Normal file
53
retroshare-gui/src/gui/settings/PostedPage.h
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
/****************************************************************
|
||||||
|
* RetroShare is distributed under the following license:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014, RetroShare Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
****************************************************************/
|
||||||
|
|
||||||
|
#ifndef POSTEDPAGE_H
|
||||||
|
#define POSTEDPAGE_H
|
||||||
|
|
||||||
|
#include <retroshare-gui/configpage.h>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class PostedPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
class PostedPage : public ConfigPage
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
PostedPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
|
||||||
|
~PostedPage();
|
||||||
|
|
||||||
|
/** Saves the changes on this page */
|
||||||
|
virtual bool save(QString &errmsg);
|
||||||
|
/** Loads the settings for this page */
|
||||||
|
virtual void load();
|
||||||
|
|
||||||
|
virtual QPixmap iconPixmap() const { return QPixmap(":/images/posted_32.png") ; }
|
||||||
|
virtual QString pageName() const { return tr("Posted") ; }
|
||||||
|
virtual QString helpText() const { return ""; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::PostedPage *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // !POSTEDPAGE_H
|
||||||
|
|
51
retroshare-gui/src/gui/settings/PostedPage.ui
Normal file
51
retroshare-gui/src/gui/settings/PostedPage.ui
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>PostedPage</class>
|
||||||
|
<widget class="QWidget" name="PostedPage">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>423</width>
|
||||||
|
<height>340</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<item row="1" column="0">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QGroupBox" name="tabsGroupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Tabs</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="GroupFrameSettingsWidget" name="groupFrameSettingsWidget" native="true"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>GroupFrameSettingsWidget</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>gui/settings/GroupFrameSettingsWidget.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
|
@ -38,6 +38,7 @@
|
||||||
#include "ChannelPage.h"
|
#include "ChannelPage.h"
|
||||||
#include "MessagePage.h"
|
#include "MessagePage.h"
|
||||||
#include "ForumPage.h"
|
#include "ForumPage.h"
|
||||||
|
#include "PostedPage.h"
|
||||||
#include "PluginsPage.h"
|
#include "PluginsPage.h"
|
||||||
#include "ServicePermissionsPage.h"
|
#include "ServicePermissionsPage.h"
|
||||||
#include "rsharesettings.h"
|
#include "rsharesettings.h"
|
||||||
|
@ -143,6 +144,7 @@ RSettingsWin::initStackedWidget()
|
||||||
addPage(new MessagePage());
|
addPage(new MessagePage());
|
||||||
addPage(new ChannelPage());
|
addPage(new ChannelPage());
|
||||||
addPage(new ForumPage());
|
addPage(new ForumPage());
|
||||||
|
addPage(new PostedPage());
|
||||||
addPage(new ChatPage());
|
addPage(new ChatPage());
|
||||||
addPage(new AppearancePage());
|
addPage(new AppearancePage());
|
||||||
addPage(new SoundPage() );
|
addPage(new SoundPage() );
|
||||||
|
|
|
@ -983,44 +983,44 @@ void RshareSettings::setForumExpandNewMessages(bool value)
|
||||||
setValueToGroup("ForumDialog", "ExpandNewMessages", value);
|
setValueToGroup("ForumDialog", "ExpandNewMessages", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RshareSettings::getForumOpenAllInNewTab()
|
static QString groupFrameSettingsTypeToString(GroupFrameSettings::Type type)
|
||||||
{
|
{
|
||||||
return valueFromGroup("ForumDialog", "OpenAllInNewTab", false).toBool();
|
switch (type) {
|
||||||
|
case GroupFrameSettings::Nothing:
|
||||||
|
return "";
|
||||||
|
case GroupFrameSettings::Forum:
|
||||||
|
return "Forum";
|
||||||
|
case GroupFrameSettings::Channel:
|
||||||
|
return "Channel";
|
||||||
|
case GroupFrameSettings::Posted:
|
||||||
|
return "Posted";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void RshareSettings::setForumOpenAllInNewTab(bool value)
|
bool RshareSettings::getGroupFrameSettings(GroupFrameSettings::Type type, GroupFrameSettings &groupFrameSettings)
|
||||||
{
|
{
|
||||||
setValueToGroup("ForumDialog", "OpenAllInNewTab", value);
|
QString group = groupFrameSettingsTypeToString(type);
|
||||||
|
if (group.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
groupFrameSettings.mOpenAllInNewTab = valueFromGroup(group, "OpenAllInNewTab", false).toBool();
|
||||||
|
groupFrameSettings.mHideTabBarWithOneTab = valueFromGroup(group, "HideTabBarWithOneTab", true).toBool();
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RshareSettings::getForumHideTabBarWithOneTab()
|
void RshareSettings::setGroupFrameSettings(GroupFrameSettings::Type type, const GroupFrameSettings &groupFrameSettings)
|
||||||
{
|
{
|
||||||
return valueFromGroup("ForumDialog", "HideTabBarWithOneTab", true).toBool();
|
QString group = groupFrameSettingsTypeToString(type);
|
||||||
}
|
if (group.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
void RshareSettings::setForumHideTabBarWithOneTab(bool value)
|
setValueToGroup(group, "OpenAllInNewTab", groupFrameSettings.mOpenAllInNewTab);
|
||||||
{
|
setValueToGroup(group, "HideTabBarWithOneTab", groupFrameSettings.mHideTabBarWithOneTab);
|
||||||
setValueToGroup("ForumDialog", "HideTabBarWithOneTab", value);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RshareSettings::getChannelOpenAllInNewTab()
|
|
||||||
{
|
|
||||||
return valueFromGroup("ChannelDialog", "OpenAllInNewTab", false).toBool();
|
|
||||||
}
|
|
||||||
|
|
||||||
void RshareSettings::setChannelOpenAllInNewTab(bool value)
|
|
||||||
{
|
|
||||||
setValueToGroup("ChannelDialog", "OpenAllInNewTab", value);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RshareSettings::getChannelHideTabBarWithOneTab()
|
|
||||||
{
|
|
||||||
return valueFromGroup("ChannelDialog", "HideTabBarWithOneTab", true).toBool();
|
|
||||||
}
|
|
||||||
|
|
||||||
void RshareSettings::setChannelHideTabBarWithOneTab(bool value)
|
|
||||||
{
|
|
||||||
setValueToGroup("ChannelDialog", "HideTabBarWithOneTab", value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* time before idle */
|
/* time before idle */
|
||||||
|
|
|
@ -64,6 +64,23 @@ class QTableWidget;
|
||||||
class QToolBar;
|
class QToolBar;
|
||||||
class QMainWindow;
|
class QMainWindow;
|
||||||
|
|
||||||
|
class GroupFrameSettings
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum Type { Nothing, Forum, Channel, Posted };
|
||||||
|
|
||||||
|
public:
|
||||||
|
GroupFrameSettings()
|
||||||
|
{
|
||||||
|
mOpenAllInNewTab = false;
|
||||||
|
mHideTabBarWithOneTab = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool mOpenAllInNewTab;
|
||||||
|
bool mHideTabBarWithOneTab;
|
||||||
|
};
|
||||||
|
|
||||||
/** Handles saving and restoring RShares's settings
|
/** Handles saving and restoring RShares's settings
|
||||||
*
|
*
|
||||||
* NOTE: Qt 4.1 documentation states that constructing a QSettings object is
|
* NOTE: Qt 4.1 documentation states that constructing a QSettings object is
|
||||||
|
@ -303,18 +320,12 @@ public:
|
||||||
void setForumMsgSetToReadOnActivate(bool value);
|
void setForumMsgSetToReadOnActivate(bool value);
|
||||||
bool getForumExpandNewMessages();
|
bool getForumExpandNewMessages();
|
||||||
void setForumExpandNewMessages(bool value);
|
void setForumExpandNewMessages(bool value);
|
||||||
bool getForumOpenAllInNewTab();
|
|
||||||
void setForumOpenAllInNewTab(bool value);
|
|
||||||
bool getForumHideTabBarWithOneTab();
|
|
||||||
void setForumHideTabBarWithOneTab(bool value);
|
|
||||||
bool getForumLoadEmbeddedImages();
|
bool getForumLoadEmbeddedImages();
|
||||||
void setForumLoadEmbeddedImages(bool value);
|
void setForumLoadEmbeddedImages(bool value);
|
||||||
|
|
||||||
/* Channels */
|
/* GroupFrameSettings */
|
||||||
bool getChannelOpenAllInNewTab();
|
bool getGroupFrameSettings(GroupFrameSettings::Type type, GroupFrameSettings &groupFrameSettings);
|
||||||
void setChannelOpenAllInNewTab(bool value);
|
void setGroupFrameSettings(GroupFrameSettings::Type type, const GroupFrameSettings &groupFrameSettings);
|
||||||
bool getChannelHideTabBarWithOneTab();
|
|
||||||
void setChannelHideTabBarWithOneTab(bool value);
|
|
||||||
|
|
||||||
/* time before idle */
|
/* time before idle */
|
||||||
uint getMaxTimeBeforeIdle();
|
uint getMaxTimeBeforeIdle();
|
||||||
|
|
|
@ -420,9 +420,11 @@ HEADERS += rshare.h \
|
||||||
gui/settings/TransferPage.h \
|
gui/settings/TransferPage.h \
|
||||||
gui/settings/ChatPage.h \
|
gui/settings/ChatPage.h \
|
||||||
gui/settings/ChannelPage.h \
|
gui/settings/ChannelPage.h \
|
||||||
|
gui/settings/PostedPage.h \
|
||||||
gui/settings/RelayPage.h \
|
gui/settings/RelayPage.h \
|
||||||
gui/settings/ServicePermissionsPage.h \
|
gui/settings/ServicePermissionsPage.h \
|
||||||
gui/settings/AddFileAssociationDialog.h \
|
gui/settings/AddFileAssociationDialog.h \
|
||||||
|
gui/settings/GroupFrameSettingsWidget.h \
|
||||||
gui/toaster/MessageToaster.h \
|
gui/toaster/MessageToaster.h \
|
||||||
gui/toaster/OnlineToaster.h \
|
gui/toaster/OnlineToaster.h \
|
||||||
gui/toaster/DownloadToaster.h \
|
gui/toaster/DownloadToaster.h \
|
||||||
|
@ -581,10 +583,12 @@ FORMS += gui/StartDialog.ui \
|
||||||
gui/settings/SoundPage.ui \
|
gui/settings/SoundPage.ui \
|
||||||
gui/settings/ChatPage.ui \
|
gui/settings/ChatPage.ui \
|
||||||
gui/settings/ChannelPage.ui \
|
gui/settings/ChannelPage.ui \
|
||||||
|
gui/settings/PostedPage.ui \
|
||||||
gui/settings/RelayPage.ui \
|
gui/settings/RelayPage.ui \
|
||||||
gui/settings/ServicePermissionsPage.ui \
|
gui/settings/ServicePermissionsPage.ui \
|
||||||
gui/settings/GlobalRouterStatistics.ui \
|
gui/settings/GlobalRouterStatistics.ui \
|
||||||
gui/settings/PluginItem.ui \
|
gui/settings/PluginItem.ui \
|
||||||
|
gui/settings/GroupFrameSettingsWidget.ui \
|
||||||
gui/toaster/MessageToaster.ui \
|
gui/toaster/MessageToaster.ui \
|
||||||
gui/toaster/OnlineToaster.ui \
|
gui/toaster/OnlineToaster.ui \
|
||||||
gui/toaster/DownloadToaster.ui \
|
gui/toaster/DownloadToaster.ui \
|
||||||
|
@ -783,9 +787,11 @@ SOURCES += main.cpp \
|
||||||
gui/settings/TransferPage.cpp \
|
gui/settings/TransferPage.cpp \
|
||||||
gui/settings/ChatPage.cpp \
|
gui/settings/ChatPage.cpp \
|
||||||
gui/settings/ChannelPage.cpp \
|
gui/settings/ChannelPage.cpp \
|
||||||
|
gui/settings/PostedPage.cpp \
|
||||||
gui/settings/RelayPage.cpp \
|
gui/settings/RelayPage.cpp \
|
||||||
gui/settings/ServicePermissionsPage.cpp \
|
gui/settings/ServicePermissionsPage.cpp \
|
||||||
gui/settings/AddFileAssociationDialog.cpp \
|
gui/settings/AddFileAssociationDialog.cpp \
|
||||||
|
gui/settings/GroupFrameSettingsWidget.cpp \
|
||||||
gui/statusbar/peerstatus.cpp \
|
gui/statusbar/peerstatus.cpp \
|
||||||
gui/statusbar/natstatus.cpp \
|
gui/statusbar/natstatus.cpp \
|
||||||
gui/statusbar/dhtstatus.cpp \
|
gui/statusbar/dhtstatus.cpp \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue