mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -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
3 changed files with 55 additions and 2 deletions
|
@ -345,6 +345,7 @@ void ConnectFriendWizard::initializePage(int id)
|
||||||
connect(ui->userCertOldFormatButton, SIGNAL(clicked()), this, SLOT(toggleFormatState()));
|
connect(ui->userCertOldFormatButton, SIGNAL(clicked()), this, SLOT(toggleFormatState()));
|
||||||
connect(ui->userCertCopyButton, SIGNAL(clicked()), this, SLOT(copyCert()));
|
connect(ui->userCertCopyButton, SIGNAL(clicked()), this, SLOT(copyCert()));
|
||||||
connect(ui->userCertPasteButton, SIGNAL(clicked()), this, SLOT(pasteCert()));
|
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->userCertSaveButton, SIGNAL(clicked()), this, SLOT(saveCert()));
|
||||||
connect(ui->userCertMailButton, SIGNAL(clicked()), this, SLOT(runEmailClient()));
|
connect(ui->userCertMailButton, SIGNAL(clicked()), this, SLOT(runEmailClient()));
|
||||||
connect(ui->friendCertEdit, SIGNAL(textChanged()), this, SLOT(friendCertChanged()));
|
connect(ui->friendCertEdit, SIGNAL(textChanged()), this, SLOT(friendCertChanged()));
|
||||||
|
@ -1077,6 +1078,22 @@ void ConnectFriendWizard::pasteCert()
|
||||||
ui->friendCertEdit->setPlainText(clipboard->text());
|
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()
|
void ConnectFriendWizard::saveCert()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save as..."), "", tr("RetroShare Certificate (*.rsc );;All Files (*)"));
|
QString fileName = QFileDialog::getSaveFileName(this, tr("Save as..."), "", tr("RetroShare Certificate (*.rsc );;All Files (*)"));
|
||||||
|
|
|
@ -66,6 +66,7 @@ private slots:
|
||||||
void showHelpUserCert();
|
void showHelpUserCert();
|
||||||
void copyCert();
|
void copyCert();
|
||||||
void pasteCert();
|
void pasteCert();
|
||||||
|
void openCert();
|
||||||
void saveCert();
|
void saveCert();
|
||||||
void friendCertChanged();
|
void friendCertChanged();
|
||||||
void cleanFriendCert();
|
void cleanFriendCert();
|
||||||
|
|
|
@ -279,7 +279,7 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="friendFrame">
|
<widget class="QFrame" name="friendFrame">
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="friendFrameGLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QToolButton" name="userCertPasteButton">
|
<widget class="QToolButton" name="userCertPasteButton">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -316,6 +316,41 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<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">
|
<widget class="QLabel" name="friendCertCleanLabel">
|
||||||
<property name="pixmap">
|
<property name="pixmap">
|
||||||
<pixmap resource="../images.qrc">:/images/accepted16.png</pixmap>
|
<pixmap resource="../images.qrc">:/images/accepted16.png</pixmap>
|
||||||
|
@ -325,7 +360,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" colspan="2">
|
<item row="1" column="0" colspan="3">
|
||||||
<widget class="RSPlainTextEdit" name="friendCertEdit">
|
<widget class="RSPlainTextEdit" name="friendCertEdit">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue