mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #811 from PhenomRetroShare/Add_OpenCertFileInHomeAddFriend
Add Open Cert File in Home Add Friend wizard.
This commit is contained in:
commit
88525e48c5
@ -345,6 +345,7 @@ void ConnectFriendWizard::initializePage(int id)
|
||||
connect(ui->userCertOldFormatButton, SIGNAL(clicked()), this, SLOT(toggleFormatState()));
|
||||
connect(ui->userCertCopyButton, SIGNAL(clicked()), this, SLOT(copyCert()));
|
||||
connect(ui->userCertPasteButton, SIGNAL(clicked()), this, SLOT(pasteCert()));
|
||||
connect(ui->userCertOpenButton, SIGNAL(clicked()), this, SLOT(openCert()));
|
||||
connect(ui->userCertSaveButton, SIGNAL(clicked()), this, SLOT(saveCert()));
|
||||
connect(ui->userCertMailButton, SIGNAL(clicked()), this, SLOT(runEmailClient()));
|
||||
connect(ui->friendCertEdit, SIGNAL(textChanged()), this, SLOT(friendCertChanged()));
|
||||
@ -1077,6 +1078,22 @@ void ConnectFriendWizard::pasteCert()
|
||||
ui->friendCertEdit->setPlainText(clipboard->text());
|
||||
}
|
||||
|
||||
void ConnectFriendWizard::openCert()
|
||||
{
|
||||
QString fileName ;
|
||||
if(!misc::getOpenFileName(this, RshareSettings::LASTDIR_CERT, tr("Select Certificate"), tr("RetroShare Certificate (*.rsc );;All Files (*)"),fileName))
|
||||
return ;
|
||||
|
||||
if (!fileName.isNull()) {
|
||||
QFile fileCert(fileName);
|
||||
if (fileCert.open(QIODevice::ReadOnly )) {
|
||||
QByteArray arrayCert(fileCert.readAll());
|
||||
ui->friendCertEdit->setPlainText(QString::fromUtf8(arrayCert));
|
||||
fileCert.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectFriendWizard::saveCert()
|
||||
{
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save as..."), "", tr("RetroShare Certificate (*.rsc );;All Files (*)"));
|
||||
|
@ -66,6 +66,7 @@ private slots:
|
||||
void showHelpUserCert();
|
||||
void copyCert();
|
||||
void pasteCert();
|
||||
void openCert();
|
||||
void saveCert();
|
||||
void friendCertChanged();
|
||||
void cleanFriendCert();
|
||||
|
@ -279,7 +279,7 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="friendFrame">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<layout class="QGridLayout" name="friendFrameGLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QToolButton" name="userCertPasteButton">
|
||||
<property name="sizePolicy">
|
||||
@ -316,6 +316,41 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QToolButton" name="userCertOpenButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>20</horstretch>
|
||||
<verstretch>20</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open Cert of your friend from File</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open certificate</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/svg/filesharing.svg</normaloff>:/icons/svg/filesharing.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="friendCertCleanLabel">
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images.qrc">:/images/accepted16.png</pixmap>
|
||||
@ -325,7 +360,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<item row="1" column="0" colspan="3">
|
||||
<widget class="RSPlainTextEdit" name="friendCertEdit">
|
||||
<property name="font">
|
||||
<font>
|
||||
|
Loading…
Reference in New Issue
Block a user