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(); updateTitle();
QObject::connect(help_button,SIGNAL(clicked()),this,SLOT(on_help_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())); //QObject::connect(copy_button,SIGNAL(clicked()),this,SLOT(on_copy_button_clicked()));
} }
void AboutWidget::installAWidget() { void AboutWidget::installAWidget() {
@ -226,6 +226,9 @@ void AWidget::initImages()
/* Draw RetroShare version */ /* Draw RetroShare version */
p.drawText(QPointF(10, 50), QString("%1 : %2").arg(tr("Retroshare version"), Rshare::retroshareVersion(true))); 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 */ /* Draw Qt's version number */
p.drawText(QPointF(10, 90), QString("Qt %1 : %2").arg(tr("version"), QT_VERSION_STR)); 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: "; QString rsVerString = "RetroShare Version: ";
rsVerString+=Rshare::retroshareVersion(true); rsVerString+=Rshare::retroshareVersion(true);
verInfo+=rsVerString; verInfo+=rsVerString;
#ifdef RS_ONLYHIDDENNODE
verInfo+=" " + tr("Only Hidden Node");
#endif
verInfo+="\n"; 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.exportIdentity_PB, SIGNAL(clicked()), this, SLOT(exportIdentity()));
connect(ui.password_input, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels())); 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.name_input, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
connect(ui.node_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())); 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.name_input->setPlaceholderText(tr("Username"));
ui.nickname_input->setPlaceholderText(tr("Chat name")); ui.nickname_input->setPlaceholderText(tr("Chat name"));
ui.password_input->setPlaceholderText(tr("Password")); ui.password_input->setPlaceholderText(tr("Password"));
ui.password_input_2->setPlaceholderText(tr("Password again")); ui.password2_input->setPlaceholderText(tr("Password again"));
#endif #endif
ui.nickname_input->setMaxLength(RSID_MAXIMUM_NICKNAME_SIZE); ui.nickname_input->setMaxLength(RSID_MAXIMUM_NICKNAME_SIZE);
@ -189,6 +189,13 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
mAllFieldsOk = false ; mAllFieldsOk = false ;
mEntropyOk = 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(); initKeyList();
setupState(); setupState();
updateCheckLabels(); updateCheckLabels();
@ -292,8 +299,8 @@ void GenCertDialog::setupState()
ui.password_label->setVisible(true); ui.password_label->setVisible(true);
ui.password2_check_LB->setVisible(generate_new); ui.password2_check_LB->setVisible(generate_new);
ui.password_input_2->setVisible(generate_new); ui.password2_input->setVisible(generate_new);
ui.password_label_2->setVisible(generate_new); ui.password2_label->setVisible(generate_new);
ui.keylength_label->setVisible(adv_state); ui.keylength_label->setVisible(adv_state);
ui.keylength_comboBox->setVisible(adv_state); ui.keylength_comboBox->setVisible(adv_state);
@ -385,7 +392,7 @@ void GenCertDialog::updateCheckLabels()
mAllFieldsOk = false ; mAllFieldsOk = false ;
ui.password_check_LB ->setPixmap(bad) ; 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) ; ui.password2_check_LB ->setPixmap(good) ;
else else
{ {
@ -533,7 +540,7 @@ void GenCertDialog::genPerson()
return; return;
} }
if(ui.password_input->text() != ui.password_input_2->text()) if(ui.password_input->text() != ui.password2_input->text())
{ {
QMessageBox::warning(this, QMessageBox::warning(this,
tr("PGP key pair generation failure"), tr("PGP key pair generation failure"),
@ -550,8 +557,8 @@ void GenCertDialog::genPerson()
ui.name_input->hide(); ui.name_input->hide();
ui.nickname_label->hide(); ui.nickname_label->hide();
ui.nickname_input->hide(); ui.nickname_input->hide();
ui.password_label_2->hide(); ui.password2_label->hide();
ui.password_input_2->hide(); ui.password2_input->hide();
ui.password2_check_LB->hide(); ui.password2_check_LB->hide();
ui.password_check_LB->hide(); ui.password_check_LB->hide();
ui.password_label->hide(); ui.password_label->hide();

View file

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

View file

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

View file

@ -56,6 +56,11 @@ no_sqlcipher:CONFIG -= sqlcipher
CONFIG *= no_rs_autologin CONFIG *= no_rs_autologin
rs_autologin: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 # To disable GXS (General eXchange System) append the following
# assignation to qmake command line "CONFIG+=no_rs_gxs" # assignation to qmake command line "CONFIG+=no_rs_gxs"
CONFIG *= 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") 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 { no_rs_deprecatedwarning {
QMAKE_CXXFLAGS += -Wno-deprecated QMAKE_CXXFLAGS += -Wno-deprecated
QMAKE_CXXFLAGS += -Wno-deprecated-declarations QMAKE_CXXFLAGS += -Wno-deprecated-declarations