Improving the Certificate Page for Connect Wizard:

Added place holder text for Cert Field
renamed some strings
Improved layout for easy paste key and display the errors.
This commit is contained in:
defnax 2016-12-21 19:07:57 +01:00
parent f3e699a5d7
commit aca36a3e37
3 changed files with 79 additions and 88 deletions

View File

@ -968,6 +968,8 @@ void ConnectFriendWizard::cleanFriendCert()
if (cert.empty()) {
ui->friendCertCleanLabel->setPixmap(QPixmap(":/images/delete.png"));
ui->friendCertCleanLabel->setToolTip("");
ui->friendCertCleanLabel->setStyleSheet("");
} else {
std::string cleanCert;
int error_code;
@ -979,6 +981,7 @@ void ConnectFriendWizard::cleanFriendCert()
QTextCursor textCursor = ui->friendCertEdit->textCursor();
ui->friendCertEdit->setPlainText(QString::fromUtf8(cleanCert.c_str()));
ui->friendCertEdit->setTextCursor(textCursor);
ui->friendCertCleanLabel->setStyleSheet("");
connect(ui->friendCertEdit, SIGNAL(textChanged()), this, SLOT(friendCertChanged()));
}
} else {
@ -994,7 +997,8 @@ void ConnectFriendWizard::cleanFriendCert()
errorMsg = tr("No checksum found (the last 5 chars should be separated by a '=' char), or no newline after tag line (e.g. line beginning with Version:)") ;
break ;
default:
errorMsg = tr("Unknown error. Your cert is probably not even a certificate.") ;
errorMsg = tr("Fake certificate: take any real certificate, and replace some of the letters randomly") ;
ui->friendCertCleanLabel->setStyleSheet("QLabel#friendCertCleanLabel {border: 2px solid red; border-radius: 6px;}");
}
}
}
@ -1002,6 +1006,7 @@ void ConnectFriendWizard::cleanFriendCert()
ui->friendCertCleanLabel->setPixmap(certValid ? QPixmap(":/images/accepted16.png") : QPixmap(":/images/delete.png"));
ui->friendCertCleanLabel->setToolTip(errorMsg);
ui->friendCertCleanLabel->setText(errorMsg);
ui->TextPage->setComplete(certValid);
}

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>691</width>
<height>522</height>
<height>533</height>
</rect>
</property>
<property name="windowTitle">
@ -82,10 +82,10 @@
</widget>
<widget class="ConnectFriendPage" name="TextPage">
<property name="title">
<string>Text certificate</string>
<string>RetroShare certificate</string>
</property>
<property name="subTitle">
<string>Use text representation of the PGP certificates.</string>
<string>Please paste below your friend's Retroshare certificate</string>
</property>
<attribute name="pageId">
<string notr="true">ConnectFriendWizard::Page_Text</string>
@ -278,84 +278,71 @@
</widget>
</item>
<item>
<widget class="QLabel" name="friendCertLabel">
<property name="text">
<string>Please, paste your friend's Retroshare certificate into the box below</string>
</property>
<widget class="QFrame" name="friendFrame">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QToolButton" name="userCertPasteButton">
<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>Paste Cert of your friend from Clipboard</string>
</property>
<property name="text">
<string>Paste certificate</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/copyrslink.png</normaloff>:/images/copyrslink.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="friendCertCleanLabel">
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/accepted16.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QPlainTextEdit" name="friendCertEdit">
<property name="font">
<font>
<family>Courier New</family>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This box expects your friend's Retroshare certificate. WARNING: this is different from your friend's PGP key. Do not paste your friend's PGP key here (not even a part of it). It's not going to work.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>
<property name="placeholderText">
<string>Please, paste your friend's Retroshare certificate into the box below</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPlainTextEdit" name="friendCertEdit">
<property name="font">
<font>
<family>Courier New</family>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This box expects your friend's Retroshare certificate. WARNING: this is different from your friend's PGP key. Do not paste your friend's PGP key here (not even a part of it). It's not going to work.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QToolButton" name="userCertPasteButton">
<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>Paste Cert of your friend from Clipboard</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/copyrslink.png</normaloff>:/images/copyrslink.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="friendCertCleanLabel">
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/accepted16.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="ConnectFriendPage" name="CertificatePage">

View File

@ -664,8 +664,7 @@ ConnectFriendWizard QRadioButton {
}
ConnectFriendWizard QPlainTextEdit#friendCertEdit {
border: 2px solid #0099cc;
border-radius: 6px;
border: none;
background: white;
}
@ -675,14 +674,14 @@ HomePage QPlainTextEdit#userCertEdit {
background: white;
}
HomePage QPlainTextEdit#friendCertEdit {
border: 2px solid #0099cc;
border-radius: 6px;
background: white;
}
HomePage QFrame#addframe{
border: 2px solid #0099cc;
border-radius: 6px;
background: white;
}
ConnectFriendWizard QFrame#friendFrame {
border: 2px solid #0099cc;
border-radius: 6px;
background: white;
}