diff --git a/retroshare-gui/src/gui/connect/InviteDialog.cpp b/retroshare-gui/src/gui/connect/InviteDialog.cpp index 687aafbde..c83e8cabd 100644 --- a/retroshare-gui/src/gui/connect/InviteDialog.cpp +++ b/retroshare-gui/src/gui/connect/InviteDialog.cpp @@ -22,6 +22,7 @@ #include "InviteDialog.h" #include "rsiface/rsiface.h" +#include "rsiface/rspeers.h" #include /** Default constructor */ @@ -37,6 +38,7 @@ InviteDialog::InviteDialog(QWidget *parent, Qt::WFlags flags) connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(cancelbutton())); connect(ui.emailButton, SIGNAL(clicked()), this, SLOT(emailbutton())); connect(ui.doneButton, SIGNAL(clicked()), this, SLOT(closebutton())); + connect(ui.sCertButton, SIGNAL(clicked()), this, SLOT(savecertbutton())); //setFixedSize(QSize(434, 462)); } @@ -103,4 +105,14 @@ void InviteDialog::setInfo(std::string invite) ui.emailText->setText(QString::fromStdString(invite)); } +void InviteDialog::savecertbutton(void) +{ + std::string filename = rsPeers->getPeerName(rsPeers->getOwnId()); // file name will be user name + filename += ".pqi"; // append retroshare cert extension + QString qdir = QFileDialog::getExistingDirectory(this, tr("Please Choose Directory to Save Certificate"), "", + false); // get current directory + + qdir += tr(filename.c_str()); // append file name to directory + rsPeers->SaveCertificateToFile(rsPeers->getOwnId(), qdir.toStdString()); // save to file +} diff --git a/retroshare-gui/src/gui/connect/InviteDialog.h b/retroshare-gui/src/gui/connect/InviteDialog.h index 6fabab842..2629442c0 100644 --- a/retroshare-gui/src/gui/connect/InviteDialog.h +++ b/retroshare-gui/src/gui/connect/InviteDialog.h @@ -24,6 +24,7 @@ #define _INVITEDIALOG_H #include +#include #include "ui_InviteDialog.h" @@ -45,6 +46,8 @@ private slots: void closebutton(); void cancelbutton(); void emailbutton(); + /// saves your certificate to file to send to friends + void savecertbutton(); private: diff --git a/retroshare-gui/src/gui/connect/InviteDialog.ui b/retroshare-gui/src/gui/connect/InviteDialog.ui index 3a275eddb..b50c15dcc 100644 --- a/retroshare-gui/src/gui/connect/InviteDialog.ui +++ b/retroshare-gui/src/gui/connect/InviteDialog.ui @@ -44,7 +44,7 @@ - + true @@ -52,7 +52,7 @@ <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'Helvetica'; font-size:10pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Arial'; font-size:8pt;"></p></body></html> @@ -60,7 +60,7 @@ p, li { white-space: pre-wrap; } - + @@ -496,19 +496,6 @@ p, li { white-space: pre-wrap; } - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -535,7 +522,7 @@ p, li { white-space: pre-wrap; } - + @@ -548,6 +535,39 @@ p, li { white-space: pre-wrap; } + + + + Save Cert To File + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + +