Merge pull request #1001 from PhenomRetroShare/Add_OnlyHiddenNodeCF

Add Only Hidden Node configure flag
This commit is contained in:
csoler 2017-09-05 20:59:16 +02:00 committed by GitHub
commit f9102e5964
5 changed files with 42 additions and 19 deletions

View File

@ -60,8 +60,8 @@ AboutWidget::AboutWidget(QWidget* parent)
updateTitle();
QObject::connect(help_button,SIGNAL(clicked()),this,SLOT(on_help_button_clicked()));
QObject::connect(copy_button,SIGNAL(clicked()),this,SLOT(on_copy_button_clicked()));
//QObject::connect(help_button,SIGNAL(clicked()),this,SLOT(on_help_button_clicked()));
//QObject::connect(copy_button,SIGNAL(clicked()),this,SLOT(on_copy_button_clicked()));
}
void AboutWidget::installAWidget() {
@ -226,6 +226,9 @@ void AWidget::initImages()
/* Draw RetroShare version */
p.drawText(QPointF(10, 50), QString("%1 : %2").arg(tr("Retroshare version"), Rshare::retroshareVersion(true)));
#ifdef RS_ONLYHIDDENNODE
p.drawText(QPointF(10, 70), QString("Only Hidden Node"));
#endif
/* Draw Qt's version number */
p.drawText(QPointF(10, 90), QString("Qt %1 : %2").arg(tr("version"), QT_VERSION_STR));
@ -938,6 +941,9 @@ void AboutWidget::on_copy_button_clicked()
QString rsVerString = "RetroShare Version: ";
rsVerString+=Rshare::retroshareVersion(true);
verInfo+=rsVerString;
#ifdef RS_ONLYHIDDENNODE
verInfo+=" " + tr("Only Hidden Node");
#endif
verInfo+="\n";

View File

@ -144,7 +144,7 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
connect(ui.exportIdentity_PB, SIGNAL(clicked()), this, SLOT(exportIdentity()));
connect(ui.password_input, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
connect(ui.password_input_2, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
connect(ui.password2_input, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
connect(ui.name_input, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
connect(ui.node_input, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
connect(ui.reuse_existing_node_CB, SIGNAL(toggled(bool)), this, SLOT(updateCheckLabels()));
@ -172,7 +172,7 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
ui.name_input->setPlaceholderText(tr("Username"));
ui.nickname_input->setPlaceholderText(tr("Chat name"));
ui.password_input->setPlaceholderText(tr("Password"));
ui.password_input_2->setPlaceholderText(tr("Password again"));
ui.password2_input->setPlaceholderText(tr("Password again"));
#endif
ui.nickname_input->setMaxLength(RSID_MAXIMUM_NICKNAME_SIZE);
@ -189,6 +189,13 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
mAllFieldsOk = false ;
mEntropyOk = false ;
#ifdef RS_ONLYHIDDENNODE
ui.adv_checkbox->setChecked(true);
ui.adv_checkbox->setVisible(false);
ui.nodeType_CB->setCurrentIndex(1);
ui.nodeType_CB->setEnabled(false);
#endif
initKeyList();
setupState();
updateCheckLabels();
@ -292,8 +299,8 @@ void GenCertDialog::setupState()
ui.password_label->setVisible(true);
ui.password2_check_LB->setVisible(generate_new);
ui.password_input_2->setVisible(generate_new);
ui.password_label_2->setVisible(generate_new);
ui.password2_input->setVisible(generate_new);
ui.password2_label->setVisible(generate_new);
ui.keylength_label->setVisible(adv_state);
ui.keylength_comboBox->setVisible(adv_state);
@ -385,7 +392,7 @@ void GenCertDialog::updateCheckLabels()
mAllFieldsOk = false ;
ui.password_check_LB ->setPixmap(bad) ;
}
if(ui.password_input->text().length() >= 3 && ui.password_input->text() == ui.password_input_2->text())
if(ui.password_input->text().length() >= 3 && ui.password_input->text() == ui.password2_input->text())
ui.password2_check_LB ->setPixmap(good) ;
else
{
@ -533,7 +540,7 @@ void GenCertDialog::genPerson()
return;
}
if(ui.password_input->text() != ui.password_input_2->text())
if(ui.password_input->text() != ui.password2_input->text())
{
QMessageBox::warning(this,
tr("PGP key pair generation failure"),
@ -550,8 +557,8 @@ void GenCertDialog::genPerson()
ui.name_input->hide();
ui.nickname_label->hide();
ui.nickname_input->hide();
ui.password_label_2->hide();
ui.password_input_2->hide();
ui.password2_label->hide();
ui.password2_input->hide();
ui.password2_check_LB->hide();
ui.password_check_LB->hide();
ui.password_label->hide();

View File

@ -50,12 +50,12 @@
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="profileframeVLayout">
<property name="leftMargin">
<number>9</number>
</property>
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="RSLabel">
<property name="text">
<string/>
</property>
@ -115,7 +115,7 @@
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QGridLayout" name="gridLayout">
<layout class="QGridLayout" name="profile_groupBoxGLayout">
<property name="leftMargin">
<number>24</number>
</property>
@ -176,7 +176,7 @@
</widget>
</item>
<item row="8" column="2">
<widget class="QLineEdit" name="password_input_2">
<widget class="QLineEdit" name="password2_input">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -283,7 +283,7 @@
</widget>
</item>
<item row="4" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="nameHLayout">
<item>
<widget class="QLineEdit" name="name_input">
<property name="sizePolicy">
@ -604,7 +604,7 @@
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="password_label_2">
<widget class="QLabel" name="password2_label">
<property name="maximumSize">
<size>
<width>24</width>
@ -713,7 +713,7 @@
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<spacer name="mainVSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@ -750,7 +750,7 @@
<tabstop>name_input</tabstop>
<tabstop>node_input</tabstop>
<tabstop>password_input</tabstop>
<tabstop>password_input_2</tabstop>
<tabstop>password2_input</tabstop>
<tabstop>keylength_comboBox</tabstop>
<tabstop>exportIdentity_PB</tabstop>
<tabstop>genPGPuser</tabstop>

View File

@ -697,7 +697,7 @@ GenCertDialog QLineEdit#hiddenaddr_input {
background: white;
font: bold;
}
GenCertDialog QLineEdit#password_input_2 {
GenCertDialog QLineEdit#password2_input {
border: 2px solid #0099cc;
border-radius: 6px;
background: white;

View File

@ -56,6 +56,11 @@ no_sqlcipher:CONFIG -= sqlcipher
CONFIG *= no_rs_autologin
rs_autologin:CONFIG -= no_rs_autologin
# To have only hidden node generation append the following assignation
# to qmake command line "CONFIG+=rs_onlyhiddennode"
CONFIG *= no_rs_onlyhiddennode
rs_onlyhiddennode:CONFIG -= no_rs_onlyhiddennode
# To disable GXS (General eXchange System) append the following
# assignation to qmake command line "CONFIG+=no_rs_gxs"
CONFIG *= rs_gxs
@ -223,6 +228,11 @@ rs_autologin {
warning("You have enabled RetroShare auto-login, this is discouraged. The usage of auto-login on some linux distributions may allow someone having access to your session to steal the SSL keys of your node location and therefore compromise your security")
}
rs_onlyhiddennode {
DEFINES *= RS_ONLYHIDDENNODE
warning("QMAKE: You have enabled only hidden node.")
}
no_rs_deprecatedwarning {
QMAKE_CXXFLAGS += -Wno-deprecated
QMAKE_CXXFLAGS += -Wno-deprecated-declarations