mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
added people settings page, removed debug output
This commit is contained in:
parent
9d9b790a3e
commit
5bbaa1e8e5
7 changed files with 204 additions and 7 deletions
55
retroshare-gui/src/gui/settings/PeoplePage.cpp
Normal file
55
retroshare-gui/src/gui/settings/PeoplePage.cpp
Normal file
|
@ -0,0 +1,55 @@
|
|||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2006, crypton
|
||||
*
|
||||
* 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 "PeoplePage.h"
|
||||
#include "rsharesettings.h"
|
||||
#include "retroshare/rsreputations.h"
|
||||
|
||||
PeoplePage::PeoplePage(QWidget * parent, Qt::WindowFlags flags)
|
||||
: ConfigPage(parent, flags)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
setAttribute(Qt::WA_QuitOnClose, false);
|
||||
}
|
||||
|
||||
PeoplePage::~PeoplePage()
|
||||
{
|
||||
}
|
||||
|
||||
/** Saves the changes on this page */
|
||||
bool PeoplePage::save(QString &/*errmsg*/)
|
||||
{
|
||||
if(!ui.identityBan_CB->isChecked())
|
||||
rsReputations->setNodeAutoBanThreshold(0) ;
|
||||
else
|
||||
rsReputations->setNodeAutoBanThreshold(ui.identityBanThreshold_SB->value()) ;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Loads the settings for this page */
|
||||
void PeoplePage::load()
|
||||
{
|
||||
uint32_t ban_limit = rsReputations->nodeAutoBanThreshold() ;
|
||||
|
||||
ui.identityBan_CB->setChecked(ban_limit > 0) ;
|
||||
ui.identityBanThreshold_SB->setValue(ban_limit) ;
|
||||
}
|
50
retroshare-gui/src/gui/settings/PeoplePage.h
Normal file
50
retroshare-gui/src/gui/settings/PeoplePage.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2006, crypton
|
||||
*
|
||||
* 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 PEOPLEPAGE_H
|
||||
#define PEOPLEPAGE_H
|
||||
|
||||
#include <retroshare-gui/configpage.h>
|
||||
#include "ui_PeoplePage.h"
|
||||
|
||||
class PeoplePage : public ConfigPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PeoplePage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
|
||||
~PeoplePage();
|
||||
|
||||
/** 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(":/icons/friends_128.png") ; }
|
||||
virtual QString pageName() const { return tr("People") ; }
|
||||
virtual QString helpText() const { return ""; }
|
||||
|
||||
private:
|
||||
Ui::PeoplePage ui;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
84
retroshare-gui/src/gui/settings/PeoplePage.ui
Normal file
84
retroshare-gui/src/gui/settings/PeoplePage.ui
Normal file
|
@ -0,0 +1,84 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PeoplePage</class>
|
||||
<widget class="QWidget" name="PeoplePage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1153</width>
|
||||
<height>441</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="generalGroupBox">
|
||||
<property name="title">
|
||||
<string>Identities handling</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="identityBan_CB">
|
||||
<property name="text">
|
||||
<string>ban all identities of a node when more than</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="identityBanThreshold_SB">
|
||||
<property name="maximum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string> of them have a negative opinion</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<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>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -36,6 +36,7 @@
|
|||
#include "RelayPage.h"
|
||||
#include "ChatPage.h"
|
||||
#include "ChannelPage.h"
|
||||
#include "PeoplePage.h"
|
||||
#include "MessagePage.h"
|
||||
#include "ForumPage.h"
|
||||
#include "PostedPage.h"
|
||||
|
@ -142,6 +143,7 @@ RSettingsWin::initStackedWidget()
|
|||
addPage(new PluginsPage() );
|
||||
addPage(new NotifyPage());
|
||||
addPage(new CryptoPage());
|
||||
addPage(new PeoplePage());
|
||||
addPage(new ChatPage());
|
||||
addPage(new MessagePage());
|
||||
addPage(new ChannelPage());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue