made 2 different pages in ConfCertDialog for PGP key and RS certificate. Removed the old format checkbox.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8055 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-03-19 22:27:52 +00:00
parent 1f4d827140
commit 62dba4aee4
2 changed files with 72 additions and 35 deletions

View file

@ -84,13 +84,13 @@ ConfCertDialog::ConfCertDialog(const RsPeerId& id, const RsPgpId &pgp_id, QWidge
/* Invoke Qt Designer generated QObject setup routine */ /* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this); ui.setupUi(this);
if(id.isNull()) // if(id.isNull())
ui._useOldFormat_CB->setChecked(true) ; // ui._useOldFormat_CB->setChecked(true) ;
else // else
{ // {
ui._useOldFormat_CB->setChecked(false) ; // ui._useOldFormat_CB->setChecked(false) ;
ui._useOldFormat_CB->setEnabled(false) ; // ui._useOldFormat_CB->setEnabled(false) ;
} // }
ui.headerFrame->setHeaderImage(QPixmap(":/images/user/identityinfo64.png")); ui.headerFrame->setHeaderImage(QPixmap(":/images/user/identityinfo64.png"));
ui.headerFrame->setHeaderText(tr("Friend Details")); ui.headerFrame->setHeaderText(tr("Friend Details"));
@ -106,10 +106,7 @@ ConfCertDialog::ConfCertDialog(const RsPeerId& id, const RsPgpId &pgp_id, QWidge
connect(ui.signKeyButton, SIGNAL(clicked()), this, SLOT(signGPGKey())); connect(ui.signKeyButton, SIGNAL(clicked()), this, SLOT(signGPGKey()));
connect(ui.trusthelpButton, SIGNAL(clicked()), this, SLOT(showHelpDialog())); connect(ui.trusthelpButton, SIGNAL(clicked()), this, SLOT(showHelpDialog()));
connect(ui._shouldAddSignatures_CB, SIGNAL(toggled(bool)), this, SLOT(loadInvitePage())); connect(ui._shouldAddSignatures_CB, SIGNAL(toggled(bool)), this, SLOT(loadInvitePage()));
connect(ui._useOldFormat_CB, SIGNAL(toggled(bool)), this, SLOT(loadInvitePage())); connect(ui._shouldAddSignatures_CB_2, SIGNAL(toggled(bool)), this, SLOT(loadInvitePage()));
// connect(ui._anonymous_routing_CB, SIGNAL(toggled(bool)), this, SLOT(setServiceFlags()));
// connect(ui._discovery_CB, SIGNAL(toggled(bool)), this, SLOT(setServiceFlags()));
// connect(ui._forums_channels_CB, SIGNAL(toggled(bool)), this, SLOT(setServiceFlags()));
ui.avatar->setFrameType(AvatarWidget::NORMAL_FRAME); ui.avatar->setFrameType(AvatarWidget::NORMAL_FRAME);
@ -176,6 +173,7 @@ void ConfCertDialog::load()
ui.make_friend_button->setToolTip("") ; ui.make_friend_button->setToolTip("") ;
} }
ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_DIRECT_DL ) ; ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_DIRECT_DL ) ;
ui._allow_push_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ; ui._allow_push_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ;
@ -262,6 +260,7 @@ void ConfCertDialog::load()
ui.stabWidget->setTabEnabled(2,true) ; ui.stabWidget->setTabEnabled(2,true) ;
ui.stabWidget->setTabEnabled(3,true) ; ui.stabWidget->setTabEnabled(3,true) ;
ui.stabWidget->setTabEnabled(4,true) ;
} }
else else
{ {
@ -290,7 +289,8 @@ void ConfCertDialog::load()
ui.stabWidget->setTabEnabled(2,true) ; ui.stabWidget->setTabEnabled(2,true) ;
ui.stabWidget->setTabEnabled(3,false) ; ui.stabWidget->setTabEnabled(3,false) ;
ui._useOldFormat_CB->setEnabled(false) ; ui.stabWidget->setTabEnabled(4,false) ;
//ui._useOldFormat_CB->setEnabled(false) ;
} }
if (detail.gpg_id == rsPeers->getGPGOwnId()) { if (detail.gpg_id == rsPeers->getGPGOwnId()) {
@ -419,12 +419,20 @@ void ConfCertDialog::loadInvitePage()
close(); close();
return; return;
} }
std::string invite ; std::string pgp_key = rsPeers->getPGPKey(detail.gpg_id,ui._shouldAddSignatures_CB_2->isChecked()) ; // this needs to be a SSL id
if(detail.isOnlyGPGdetail) ui.userCertificateText_2->setReadOnly(true);
invite = rsPeers->getPGPKey(detail.gpg_id,ui._shouldAddSignatures_CB->isChecked()) ; // this needs to be a SSL id ui.userCertificateText_2->setMinimumHeight(200);
else ui.userCertificateText_2->setMinimumWidth(530);
invite = rsPeers->GetRetroshareInvite(detail.id,ui._shouldAddSignatures_CB->isChecked()) ; // this needs to be a SSL id QFont font("Courier New",10,50,false);
font.setStyleHint(QFont::TypeWriter,QFont::PreferMatch);
font.setStyle(QFont::StyleNormal);
ui.userCertificateText_2->setFont(font);
ui.userCertificateText_2->setText(QString::fromUtf8(pgp_key.c_str()));
if(!detail.isOnlyGPGdetail)
{
std::string invite = rsPeers->GetRetroshareInvite(detail.id,ui._shouldAddSignatures_CB->isChecked()) ; // this needs to be a SSL id
ui.userCertificateText->setReadOnly(true); ui.userCertificateText->setReadOnly(true);
ui.userCertificateText->setMinimumHeight(200); ui.userCertificateText->setMinimumHeight(200);
@ -434,6 +442,8 @@ void ConfCertDialog::loadInvitePage()
font.setStyle(QFont::StyleNormal); font.setStyle(QFont::StyleNormal);
ui.userCertificateText->setFont(font); ui.userCertificateText->setFont(font);
ui.userCertificateText->setText(QString::fromUtf8(invite.c_str())); ui.userCertificateText->setText(QString::fromUtf8(invite.c_str()));
}
} }

View file

@ -60,7 +60,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QTabWidget" name="stabWidget"> <widget class="QTabWidget" name="stabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>2</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="icon"> <attribute name="icon">
@ -759,6 +759,40 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_7">
<attribute name="title">
<string>PGP Key</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTextEdit" name="userCertificateText_2"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="_shouldAddSignatures_CB_2">
<property name="text">
<string>Include signatures</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3"> <widget class="QWidget" name="tab_3">
<attribute name="icon"> <attribute name="icon">
<iconset resource="../images.qrc"> <iconset resource="../images.qrc">
@ -780,13 +814,6 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="_useOldFormat_CB">
<property name="text">
<string>Use old key format</string>
</property>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer_2"> <spacer name="horizontalSpacer_2">
<property name="orientation"> <property name="orientation">