mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-04-22 16:09:18 -04:00
moved node-wide options to node details
This commit is contained in:
parent
a4931edee0
commit
f5ad8b49be
@ -2076,6 +2076,23 @@ bool p3PeerMgrIMPL::saveList(bool &cleanup, std::list<RsItem *>& saveData)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool p3PeerMgrIMPL::getMaxRates(const RsPeerId& pid,uint32_t& maxUp,uint32_t& maxDn)
|
||||
{
|
||||
RsPgpId pgp_id ;
|
||||
|
||||
{
|
||||
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/
|
||||
|
||||
std::map<RsPeerId, peerState>::const_iterator it = mFriendList.find(pid) ;
|
||||
|
||||
if(it == mFriendList.end())
|
||||
return false ;
|
||||
|
||||
pgp_id = it->second.gpg_id ;
|
||||
}
|
||||
return getMaxRates(pgp_id,maxUp,maxDn) ;
|
||||
}
|
||||
|
||||
bool p3PeerMgrIMPL::getMaxRates(const RsPgpId& pid,uint32_t& maxUp,uint32_t& maxDn)
|
||||
{
|
||||
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/
|
||||
|
@ -211,6 +211,7 @@ virtual uint32_t getHiddenType(const RsPeerId &ssl_id) = 0;
|
||||
virtual int getFriendCount(bool ssl, bool online) = 0;
|
||||
virtual bool setMaxRates(const RsPgpId& pid,uint32_t maxR,uint32_t minR)=0;
|
||||
virtual bool getMaxRates(const RsPgpId& pid,uint32_t& maxR,uint32_t& minR)=0;
|
||||
virtual bool getMaxRates(const RsPeerId& pid,uint32_t& maxR,uint32_t& minR)=0;
|
||||
|
||||
/************* DEPRECIATED FUNCTIONS (TO REMOVE) ********/
|
||||
|
||||
@ -327,6 +328,7 @@ virtual bool haveOnceConnected();
|
||||
|
||||
virtual bool setMaxRates(const RsPgpId& pid,uint32_t maxR,uint32_t minR);
|
||||
virtual bool getMaxRates(const RsPgpId& pid,uint32_t& maxR,uint32_t& minR);
|
||||
virtual bool getMaxRates(const RsPeerId& pid,uint32_t& maxR,uint32_t& minR);
|
||||
|
||||
/************************************************************************************************/
|
||||
/* Extra IMPL Functions (used by p3LinkMgr, p3NetMgr + Setup) */
|
||||
|
@ -433,6 +433,7 @@ public:
|
||||
virtual void setServicePermissionFlags(const RsPgpId& gpg_id,const ServicePermissionFlags& flags) = 0;
|
||||
|
||||
virtual bool setPeerMaximumRates(const RsPgpId& pid,uint32_t maxUploadRate,uint32_t maxDownloadRate) =0;
|
||||
virtual bool getPeerMaximumRates(const RsPeerId& pid,uint32_t& maxUploadRate,uint32_t& maxDownloadRate) =0;
|
||||
virtual bool getPeerMaximumRates(const RsPgpId& pid,uint32_t& maxUploadRate,uint32_t& maxDownloadRate) =0;
|
||||
};
|
||||
|
||||
|
@ -241,6 +241,10 @@ bool p3Peers::isFriend(const RsPeerId &ssl_id)
|
||||
return mPeerMgr->isFriend(ssl_id);
|
||||
}
|
||||
|
||||
bool p3Peers::getPeerMaximumRates(const RsPeerId& pid,uint32_t& maxUploadRate,uint32_t& maxDownloadRate)
|
||||
{
|
||||
return mPeerMgr->getMaxRates(pid,maxUploadRate,maxDownloadRate) ;
|
||||
}
|
||||
bool p3Peers::getPeerMaximumRates(const RsPgpId& pid,uint32_t& maxUploadRate,uint32_t& maxDownloadRate)
|
||||
{
|
||||
return mPeerMgr->getMaxRates(pid,maxUploadRate,maxDownloadRate) ;
|
||||
|
@ -141,6 +141,7 @@ public:
|
||||
|
||||
virtual bool setPeerMaximumRates(const RsPgpId& pid,uint32_t maxUploadRate,uint32_t maxDownloadRate);
|
||||
virtual bool getPeerMaximumRates(const RsPgpId& pid,uint32_t& maxUploadRate,uint32_t& maxDownloadRate);
|
||||
virtual bool getPeerMaximumRates(const RsPeerId& pid,uint32_t& maxUploadRate,uint32_t& maxDownloadRate);
|
||||
private:
|
||||
|
||||
p3LinkMgr *mLinkMgr;
|
||||
|
@ -123,17 +123,6 @@ ConfCertDialog::~ConfCertDialog()
|
||||
}
|
||||
|
||||
|
||||
void ConfCertDialog::setServiceFlags()
|
||||
{
|
||||
ServicePermissionFlags flags(0) ;
|
||||
|
||||
if( ui._direct_transfer_CB->isChecked()) flags = flags | RS_NODE_PERM_DIRECT_DL ;
|
||||
if( ui._allow_push_CB->isChecked()) flags = flags | RS_NODE_PERM_ALLOW_PUSH ;
|
||||
if( ui._require_WL_CB->isChecked()) flags = flags | RS_NODE_PERM_REQUIRE_WL ;
|
||||
|
||||
rsPeers->setServicePermissionFlags(pgpId,flags) ;
|
||||
}
|
||||
|
||||
void ConfCertDialog::loadAll()
|
||||
{
|
||||
for(QMap<RsPeerId, ConfCertDialog*>::iterator it = instances_ssl.begin(); it != instances_ssl.end(); ++it) it.value()->load();
|
||||
@ -153,13 +142,6 @@ void ConfCertDialog::load()
|
||||
return;
|
||||
}
|
||||
|
||||
ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_DIRECT_DL ) ;
|
||||
ui._allow_push_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ;
|
||||
ui._require_WL_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_REQUIRE_WL) ;
|
||||
|
||||
ui.maxUploadSpeed_SB->setValue(detail.maxRateUp) ;
|
||||
ui.maxDownloadSpeed_SB->setValue(detail.maxRateDn) ;
|
||||
|
||||
//ui.pgpfingerprint->setText(QString::fromUtf8(detail.name.c_str()));
|
||||
ui.peerid->setText(QString::fromStdString(detail.id.toStdString()));
|
||||
|
||||
@ -392,13 +374,6 @@ void ConfCertDialog::applyDialog()
|
||||
}
|
||||
}
|
||||
|
||||
setServiceFlags() ;
|
||||
|
||||
uint32_t max_upload_speed = ui.maxUploadSpeed_SB->value() ;
|
||||
uint32_t max_download_speed = ui.maxDownloadSpeed_SB->value();
|
||||
|
||||
rsPeers->setPeerMaximumRates(pgpId,max_upload_speed,max_download_speed);
|
||||
|
||||
loadAll();
|
||||
close();
|
||||
}
|
||||
|
@ -76,11 +76,7 @@ private:
|
||||
|
||||
private slots:
|
||||
void applyDialog();
|
||||
//void makeFriend();
|
||||
//void denyFriend();
|
||||
//void signGPGKey();
|
||||
void loadInvitePage();
|
||||
void setServiceFlags();
|
||||
|
||||
void showHelpDialog();
|
||||
/** Called when a child window requests the given help <b>topic</b>. */
|
||||
|
@ -35,6 +35,7 @@
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<zorder>stabWidget</zorder>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
@ -60,7 +61,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="stabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="icon">
|
||||
@ -407,6 +408,13 @@
|
||||
<string>Retroshare Certificate</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Use this certificate to make friends:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="userCertificateText"/>
|
||||
</item>
|
||||
@ -436,119 +444,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_4">
|
||||
<attribute name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/admin-16.png</normaloff>:/images/admin-16.png</iconset>
|
||||
</attribute>
|
||||
<attribute name="title">
|
||||
<string>Options</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>These options apply to all locations of the same node:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="_direct_transfer_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p align="justify">Retroshare periodically checks your friend lists for browsable files matching your transfers, to establish a direct transfer. In this case, your friend knows you're downloading the file.</p><p align="justify">To prevent this behavior for this friend only, uncheck this box. You can still perform a direct transfer if you explicitly ask for it, by e.g. downloading from your friend's file list. This setting is applied to all locations of the same node.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use as direct source, when available</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="_allow_push_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This option allows you to automatically download a file that is recommended in an message coming from this node. This can be used for instance to send files between your own nodes. Applied to all locations of the same node.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Auto-download recommended files from this node</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="_require_WL_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Peers that have this option cannot connect if their connection address is not in the whitelist. This protects you from traffic forwarding attacks. When used, rejected peers will be reported by &quot;security feed items&quot; in the News Feed section. From there, you can whitelist/blacklist their IP. Applies to all locations of the same node.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Require white list clearance</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Max upload speed (0=unlimited)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Max download speed (0=unlimited)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="maxUploadSpeed_SB">
|
||||
<property name="suffix">
|
||||
<string> kB/s</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="maxDownloadSpeed_SB">
|
||||
<property name="suffix">
|
||||
<string> kB/s</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>196</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -169,6 +169,13 @@ void PGPKeyDialog::load()
|
||||
ui.pgpfingerprint->show();
|
||||
ui.pgpfingerprint_label->show();
|
||||
|
||||
ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_DIRECT_DL ) ;
|
||||
ui._allow_push_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ;
|
||||
ui._require_WL_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_REQUIRE_WL) ;
|
||||
|
||||
ui.maxUploadSpeed_SB->setValue(detail.maxRateUp) ;
|
||||
ui.maxDownloadSpeed_SB->setValue(detail.maxRateDn) ;
|
||||
|
||||
// ui.loc->hide();
|
||||
// ui.label_loc->hide();
|
||||
// ui.statusline->hide();
|
||||
@ -323,7 +330,6 @@ void PGPKeyDialog::loadKeyPage()
|
||||
ui.userCertificateText_2->setToolTip(helptext) ;
|
||||
}
|
||||
|
||||
|
||||
void PGPKeyDialog::applyDialog()
|
||||
{
|
||||
std::cerr << "PGPKeyDialog::applyDialog() called" << std::endl ;
|
||||
@ -343,6 +349,19 @@ void PGPKeyDialog::applyDialog()
|
||||
if(ui.trustlevel_CB->currentIndex() != detail.trustLvl)
|
||||
rsPeers->trustGPGCertificate(pgpId, ui.trustlevel_CB->currentIndex());
|
||||
|
||||
uint32_t max_upload_speed = ui.maxUploadSpeed_SB->value() ;
|
||||
uint32_t max_download_speed = ui.maxDownloadSpeed_SB->value();
|
||||
|
||||
rsPeers->setPeerMaximumRates(pgpId,max_upload_speed,max_download_speed);
|
||||
|
||||
ServicePermissionFlags flags(0) ;
|
||||
|
||||
if( ui._direct_transfer_CB->isChecked()) flags = flags | RS_NODE_PERM_DIRECT_DL ;
|
||||
if( ui._allow_push_CB->isChecked()) flags = flags | RS_NODE_PERM_ALLOW_PUSH ;
|
||||
if( ui._require_WL_CB->isChecked()) flags = flags | RS_NODE_PERM_REQUIRE_WL ;
|
||||
|
||||
rsPeers->setServicePermissionFlags(pgpId,flags) ;
|
||||
|
||||
//setServiceFlags() ;
|
||||
|
||||
loadAll();
|
||||
|
@ -27,7 +27,7 @@
|
||||
<item>
|
||||
<widget class="QTabWidget" name="stabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
@ -295,6 +295,23 @@ p, li { white-space: pre-wrap; }
|
||||
<string>ASCII format</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="textBrowser">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!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:'Sans'; font-size:9pt; 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;">Below is the node's PGP key. It identifies the node and all its locations. A &quot;Retroshare certificate&quot; that you can exchange in order to make friends, is in the the &quot;details&quot; of each separate location.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="userCertificateText_2">
|
||||
<property name="sizePolicy">
|
||||
@ -321,6 +338,115 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>Options</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>These options apply to all locations of the same node:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="_direct_transfer_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p align="justify">Retroshare periodically checks your friend lists for browsable files matching your transfers, to establish a direct transfer. In this case, your friend knows you're downloading the file.</p><p align="justify">To prevent this behavior for this friend only, uncheck this box. You can still perform a direct transfer if you explicitly ask for it, by e.g. downloading from your friend's file list. This setting is applied to all locations of the same node.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use as direct source, when available</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="_allow_push_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This option allows you to automatically download a file that is recommended in an message coming from this node. This can be used for instance to send files between your own nodes. Applied to all locations of the same node.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Auto-download recommended files from this node</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="_require_WL_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Peers that have this option cannot connect if their connection address is not in the whitelist. This protects you from traffic forwarding attacks. When used, rejected peers will be reported by &quot;security feed items&quot; in the News Feed section. From there, you can whitelist/blacklist their IP. Applies to all locations of the same node.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Require white list clearance</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Max upload speed (0=unlimited)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Max download speed (0=unlimited)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="maxUploadSpeed_SB">
|
||||
<property name="suffix">
|
||||
<string> kB/s</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="maxDownloadSpeed_SB">
|
||||
<property name="suffix">
|
||||
<string> kB/s</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>274</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -334,6 +460,9 @@ p, li { white-space: pre-wrap; }
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>stabWidget</zorder>
|
||||
<zorder>headerFrame</zorder>
|
||||
<zorder>buttonBox</zorder>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
Loading…
x
Reference in New Issue
Block a user