mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-09 17:45:15 -04:00
mods to support hidden nodes, and hidden certificate sharing.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-initdev@6721 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
bfd915864b
commit
1d6f99de0d
7 changed files with 311 additions and 155 deletions
|
@ -37,6 +37,7 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
|
|||
ui.setupUi(this);
|
||||
|
||||
connect(ui.new_gpg_key_checkbox, SIGNAL(clicked()), this, SLOT(newGPGKeyGenUiSetup()));
|
||||
connect(ui.hidden_checkbox, SIGNAL(clicked()), this, SLOT(hiddenUiSetup()));
|
||||
|
||||
connect(ui.genButton, SIGNAL(clicked()), this, SLOT(genPerson()));
|
||||
connect(ui.importIdentity_PB, SIGNAL(clicked()), this, SLOT(importIdentity()));
|
||||
|
@ -115,6 +116,7 @@ void GenCertDialog::init()
|
|||
ui.headerLabel2->setText(text);
|
||||
|
||||
newGPGKeyGenUiSetup();
|
||||
hiddenUiSetup();
|
||||
}
|
||||
|
||||
void GenCertDialog::newGPGKeyGenUiSetup() {
|
||||
|
@ -153,6 +155,28 @@ void GenCertDialog::newGPGKeyGenUiSetup() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void GenCertDialog::hiddenUiSetup()
|
||||
{
|
||||
|
||||
if (ui.hidden_checkbox->isChecked())
|
||||
{
|
||||
ui.hiddenaddr_input->show();
|
||||
ui.hiddenaddr_label->show();
|
||||
ui.label_hiddenaddr2->show();
|
||||
ui.hiddenport_label->show();
|
||||
ui.hiddenport_spinBox->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.hiddenaddr_input->hide();
|
||||
ui.hiddenaddr_label->hide();
|
||||
ui.label_hiddenaddr2->hide();
|
||||
ui.hiddenport_label->hide();
|
||||
ui.hiddenport_spinBox->hide();
|
||||
}
|
||||
}
|
||||
|
||||
void GenCertDialog::exportIdentity()
|
||||
{
|
||||
QString fname = QFileDialog::getSaveFileName(this,tr("Export Identity"), "",tr("RetroShare Identity files (*.asc)")) ;
|
||||
|
@ -203,6 +227,21 @@ void GenCertDialog::genPerson()
|
|||
std::string genLoc = ui.location_input->text().toUtf8().constData();
|
||||
std::string PGPId;
|
||||
|
||||
if (ui.hidden_checkbox->isChecked())
|
||||
{
|
||||
std::string hl = ui.hiddenaddr_input->text().toStdString();
|
||||
uint16_t port = ui.hiddenport_spinBox->value();
|
||||
if (!RsInit::SetHiddenLocation(hl, port)) /* parses it */
|
||||
{
|
||||
/* Message Dialog */
|
||||
QMessageBox::warning(this,
|
||||
tr("Invalid Hidden Location"),
|
||||
tr("Please put in a valid address of the form: 31769173498.onion:7800"),
|
||||
QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!genNewGPGKey) {
|
||||
if (genLoc.length() < 3) {
|
||||
/* Message Dialog */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue