fixed hide some options with old certificate format

This commit is contained in:
csoler 2022-02-14 21:51:30 +01:00
parent b9a4cdcd50
commit 53d43324db
2 changed files with 18 additions and 8 deletions

View File

@ -78,6 +78,13 @@ HomePage::HomePage(QWidget *parent) :
menu->addAction(RecAction);
menu->addSeparator();
mUseOldFormatact = new QAction(QIcon(), tr("Use old certificate format"),this);
mUseOldFormatact->setToolTip(tr("Displays the certificate format used up to version 0.6.5\nOld Retroshare nodes will not understand the\nnew short format"));
connect(mUseOldFormatact, SIGNAL(triggered()), this, SLOT(switchCertificateFormat()));
mUseOldFormatact->setCheckable(true);
mUseOldFormatact->setChecked(false);
menu->addAction(mUseOldFormatact);
if(!RsAccounts::isHiddenNode())
{
mIncludeLocIPact = new QAction(QIcon(), tr("Include current local IP"),this);
@ -105,13 +112,6 @@ HomePage::HomePage(QWidget *parent) :
menu->addAction(mIncludeIPHistoryact);
}
mUseOldFormatact = new QAction(QIcon(), tr("Use old certificate format"),this);
mUseOldFormatact->setToolTip(tr("Displays the certificate format used up to version 0.6.5\nOld Retroshare nodes will not understand the\nnew short format"));
connect(mUseOldFormatact, SIGNAL(triggered()), this, SLOT(updateOwnCert()));
mUseOldFormatact->setCheckable(true);
mUseOldFormatact->setChecked(false);
menu->addAction(mUseOldFormatact);
ui->shareButton->setMenu(menu);
connect(ui->openwebhelp,SIGNAL(clicked()), this,SLOT(openWebHelp())) ;
@ -164,6 +164,15 @@ void HomePage::handleEvent(std::shared_ptr<const RsEvent> e)
}
}
void HomePage::switchCertificateFormat()
{
whileBlocking(mIncludeDNSact)->setVisible(!mUseOldFormatact->isChecked());
whileBlocking(mIncludeLocIPact)->setVisible(!mUseOldFormatact->isChecked());
whileBlocking(mIncludeExtIPact)->setVisible(!mUseOldFormatact->isChecked());
updateOwnCert();
}
#ifdef DEAD_CODE
void HomePage::certContextMenu(QPoint /*point*/)
{
@ -247,7 +256,7 @@ void HomePage::updateOwnCert()
getOwnCert(certificate,description);
if(!mUseOldFormatact->isChecked()) // in this case we have to split the cert for a bettr display
if(!mUseOldFormatact->isChecked()) // in this case we have to split the cert for a better display
{
QString S;
QString txt;

View File

@ -63,6 +63,7 @@ private slots:
void webMail();
void openWebHelp() ;
void recommendFriends();
void switchCertificateFormat();
private:
Ui::HomePage *ui;