Merge pull request #653 from RetroPooh/master

chatlobby option to disable sending typing notifications; friend connect wizard minor tweaks
This commit is contained in:
csoler 2017-01-23 21:11:22 +01:00 committed by GitHub
commit ca5fa7afa8
9 changed files with 213 additions and 104 deletions

View File

@ -1088,8 +1088,8 @@ void ChatWidget::updateStatusTyping()
#ifdef ONLY_FOR_LINGUIST
tr("is typing...");
#endif
rsMsgs->sendStatusString(chatId, "is typing...");
if(!Settings->getChatDoNotSendIsTyping())
rsMsgs->sendStatusString(chatId, "is typing...");
lastStatusSendTime = time(NULL) ;
}
}

View File

@ -42,6 +42,7 @@
#include <retroshare/rsiface.h>
#include <retroshare/rsbanlist.h>
#include <retroshare/rsconfig.h>
#include "ConnectProgressDialog.h"
#include "gui/GetStartedDialog.h"
@ -103,7 +104,7 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
ui->fr_label->hide();
ui->requestinfolabel->hide();
connect(ui->acceptNoSignGPGCheckBox,SIGNAL(toggled(bool)), ui->_options_GB,SLOT(setEnabled(bool))) ;
connect(ui->addKeyToKeyring_CB,SIGNAL(toggled(bool)), ui->acceptNoSignGPGCheckBox,SLOT(setChecked(bool))) ;
@ -113,15 +114,36 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
connect(ui->aolButton, SIGNAL(clicked()), this, SLOT(inviteAol()));
connect(ui->yandexButton, SIGNAL(clicked()), this, SLOT(inviteYandex()));
connect(ui->emailButton, SIGNAL(clicked()), this, SLOT(runEmailClient2()));
connect(ui->toggleadvancedButton, SIGNAL(clicked()), this, SLOT(toggleAdvanced()));
subject = tr("RetroShare Invitation");
body = GetStartedDialog::GetInviteText();
body += "\n" + GetStartedDialog::GetCutBelowText();
body += "\n\n" + QString::fromUtf8(rsPeers->GetRetroshareInvite(false).c_str());
std::string advsetting;
if(rsConfig->getConfigurationOption(RS_CONFIG_ADVANCED, advsetting) && (advsetting == "YES"))
{
ui->toggleadvancedButton->setVisible(false);
}
else
{
ui->userFrame->hide(); // certificates page - top half with own cert and it's functions
ui->horizontalLayout_13->hide(); // Advanced options - key sign, whitelist, direct source ...
AdvancedVisible=false;
ui->userFrame->hide();
ui->emailLabel->hide(); // is it ever used?
ui->emailEdit->hide();
ui->trustLabel->hide();
ui->trustEdit->hide();
}
unsigned int onlineCount = 0, friendCount = 0;
rsPeers->getPeerCount (&friendCount, &onlineCount, false);
if(friendCount<30)
ui->makefriend_infolabel->hide();
updateStylesheet();
}
@ -1280,3 +1302,19 @@ void ConnectFriendWizard::runEmailClient2()
{
sendMail("", subject, body );
}
void ConnectFriendWizard::toggleAdvanced()
{
if(AdvancedVisible)
{
ui->horizontalLayout_13->hide();
ui->toggleadvancedButton->setText("Show advanced options");
AdvancedVisible=false;
}
else
{
ui->horizontalLayout_13->show();
ui->toggleadvancedButton->setText("Hide advanced options");
AdvancedVisible=true;
}
}

View File

@ -90,13 +90,15 @@ private slots:
void inviteAol();
void inviteYandex();
void toggleAdvanced();
private:
// returns the translated error string for the error code (to be found in rspeers.h)
QString getErrorString(uint32_t) ;
void updateStylesheet();
void setTitleText(QWizardPage *page, const QString &title);
bool AdvancedVisible;
private:
bool error;
RsPeerDetails peerDetails;

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>691</width>
<height>533</height>
<width>620</width>
<height>530</height>
</rect>
</property>
<property name="windowTitle">
@ -1264,6 +1264,9 @@ resources.</string>
</item>
<item row="6" column="1">
<widget class="QPlainTextEdit" name="signersEdit">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Signing a friend's key is a way to express your trust into this friend, to your other friends. The signatures below cryptographically attest that owners of the listed keys recognise the current PGP key as authentic.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
@ -1297,108 +1300,132 @@ resources.</string>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<layout class="QVBoxLayout" name="verticalLayout_18">
<item>
<widget class="QCheckBox" name="addKeyToKeyring_CB">
<property name="text">
<string>Add key to keyring</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="signGPGCheckBox">
<property name="text">
<string>Authenticate friend (Sign PGP Key)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="acceptNoSignGPGCheckBox">
<property name="text">
<string>Add as friend to connect with</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<widget class="QCheckBox" name="_addIPToWhiteList_CB_2">
<property name="text">
<string>Add IP to whitelist</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="_addIPToWhiteList_ComboBox_2"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="groupLabel">
<property name="text">
<string>Add friend to group:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="groupComboBox"/>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_19">
<item>
<widget class="QGroupBox" name="_options_GB">
<property name="title">
<string>Options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<widget class="QPushButton" name="toggleadvancedButton">
<property name="text">
<string>Show Advanced options</string>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="horizontalLayout_13">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<property name="spacing">
<number>6</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_18">
<item>
<widget class="QCheckBox" name="addKeyToKeyring_CB">
<property name="text">
<string>Add key to keyring</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="signGPGCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Signing a friend's key is a way to express your trust into this friend, to your other friends. It helps them to decide whether to allow connections from that key based on your own trust. Signing a key is absolutely optional and cannot be undone, so do it wisely.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Authenticate friend (Sign PGP Key)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="acceptNoSignGPGCheckBox">
<property name="text">
<string>Add as friend to connect with</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<widget class="QCheckBox" name="_direct_transfer_CB_2">
<widget class="QCheckBox" name="_addIPToWhiteList_CB_2">
<property name="text">
<string>Can be used as direct source</string>
<string>Add IP to whitelist</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_allow_push_CB_2">
<property name="text">
<string>Auto-download recommended files</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_require_WL_CB_2">
<property name="text">
<string>Require whitelist clearance to connect</string>
</property>
</widget>
<widget class="QComboBox" name="_addIPToWhiteList_ComboBox_2"/>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>38</width>
<height>38</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="groupLabel">
<property name="text">
<string>Add friend to group:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="groupComboBox"/>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_19">
<item>
<widget class="QGroupBox" name="_options_GB">
<property name="title">
<string>Options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<widget class="QCheckBox" name="_direct_transfer_CB_2">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;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.&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;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.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Can be used as direct source</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_allow_push_CB_2">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;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.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Auto-download recommended files</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_require_WL_CB_2">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;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 &amp;quot;security feed items&amp;quot; in the News Feed section. From there, you can whitelist/blacklist their IP. Applies to all locations of the same node.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Require whitelist clearance to connect</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>38</width>
<height>38</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="StyledLabel" name="requestinfolabel">
@ -1480,6 +1507,19 @@ resources.</string>
</property>
</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>
<widget class="QWizardPage" name="FriendRecommendationsPage">

View File

@ -34,6 +34,7 @@
#include "gui/chat/ChatDialog.h"
#include "gui/notifyqt.h"
#include "rsharesettings.h"
#include <retroshare/rsconfig.h>
#include <retroshare/rshistory.h>
#include <retroshare/rsmsgs.h>
@ -131,7 +132,8 @@ ChatPage::save(QString &/*errmsg*/)
Settings->setChatSendMessageWithCtrlReturn(ui.sendMessageWithCtrlReturn->isChecked());
Settings->setChatSendAsPlainTextByDef(ui.sendAsPlainTextByDef->isChecked());
Settings->setChatLoadEmbeddedImages(ui.loadEmbeddedImages->isChecked());
Settings->setChatDoNotSendIsTyping(ui.DontSendTyping->isChecked());
Settings->setChatSearchCharToStartSearch(ui.sbSearch_CharToStart->value());
Settings->setChatSearchCaseSensitively(ui.cbSearch_CaseSensitively->isChecked());
Settings->setChatSearchWholeWords(ui.cbSearch_WholeWords->isChecked());
@ -240,6 +242,13 @@ ChatPage::load()
ui.sendMessageWithCtrlReturn->setChecked(Settings->getChatSendMessageWithCtrlReturn());
ui.sendAsPlainTextByDef->setChecked(Settings->getChatSendAsPlainTextByDef());
ui.loadEmbeddedImages->setChecked(Settings->getChatLoadEmbeddedImages());
ui.DontSendTyping->setChecked(Settings->getChatDoNotSendIsTyping());
std::string advsetting;
if(rsConfig->getConfigurationOption(RS_CONFIG_ADVANCED, advsetting) && (advsetting == "YES"))
{ }
else
ui.DontSendTyping->hide();
ui.sbSearch_CharToStart->setValue(Settings->getChatSearchCharToStartSearch());
ui.cbSearch_CaseSensitively->setChecked(Settings->getChatSearchCaseSensitively());

View File

@ -271,6 +271,13 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="DontSendTyping">
<property name="text">
<string>Do not send typing notifications</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -26,7 +26,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="tabNetConf">
<attribute name="title">

View File

@ -514,6 +514,16 @@ void RshareSettings::setChatSendMessageWithCtrlReturn(bool bValue)
setValueToGroup("Chat", "SendMessageWithCtrlReturn", bValue);
}
bool RshareSettings::getChatDoNotSendIsTyping()
{
return valueFromGroup("Chat", "DoNotSendIsTyping", false).toBool();
}
void RshareSettings::setChatDoNotSendIsTyping(bool bValue)
{
setValueToGroup("Chat", "DoNotSendIsTyping", bValue);
}
bool RshareSettings::getChatSendAsPlainTextByDef()
{
return valueFromGroup("Chat", "SendAsPlainTextByDef", false).toBool();

View File

@ -210,6 +210,9 @@ public:
bool getChatSendMessageWithCtrlReturn();
void setChatSendMessageWithCtrlReturn(bool bValue);
bool getChatDoNotSendIsTyping();
void setChatDoNotSendIsTyping(bool bValue);
bool getChatSendAsPlainTextByDef();
void setChatSendAsPlainTextByDef(bool bValue);