Added "Add friends Certificate" Button for Home View, for call easy the Text Page for Paste friends Cert faster.

This commit is contained in:
defnax 2016-12-14 15:20:03 +01:00
parent f3c4de2d3c
commit 96b6cd3d34
4 changed files with 108 additions and 68 deletions

View File

@ -24,6 +24,7 @@
#include "gui/notifyqt.h"
#include "gui/msgs/MessageComposer.h"
#include "gui/connect/ConnectFriendWizard.h"
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <QUrlQuery>
@ -48,6 +49,8 @@ HomePage::HomePage(QWidget *parent) :
updateOwnCert();
connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addFriend()));
QAction *CopyAction = new QAction(QIcon(),tr("Copy your Cert to Clipboard"), this);
connect(CopyAction, SIGNAL(triggered()), this, SLOT(copyCert()));
@ -135,3 +138,11 @@ void HomePage::saveCert()
ts << ui->userCertEdit->document()->toPlainText();
}
/** Add a Friends Text Certificate */
void HomePage::addFriend()
{
ConnectFriendWizard connwiz (this);
connwiz.setStartId(ConnectFriendWizard::Page_Text);
connwiz.exec ();
}

View File

@ -53,7 +53,7 @@ private slots:
void runEmailClient();
void copyCert();
void saveCert();
void addFriend();
private:
Ui::HomePage *ui;

View File

@ -6,49 +6,34 @@
<rect>
<x>0</x>
<y>0</y>
<width>771</width>
<height>560</height>
<width>886</width>
<height>584</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="3" column="1">
<widget class="QFrame" name="addFrame">
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="4">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="topMargin">
<number>0</number>
<property name="text">
<string/>
</property>
<property name="rightMargin">
<number>0</number>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/logo/logo_splash.png</pixmap>
</property>
<property name="bottomMargin">
<number>0</number>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</layout>
</widget>
</item>
<item row="2" column="0" rowspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>268</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<item row="3" column="1" colspan="2">
<layout class="QGridLayout" name="gridLayout">
<property name="topMargin">
<number>9</number>
@ -59,7 +44,7 @@
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="0" column="0">
<item row="1" column="0">
<widget class="QLabel" name="userCertLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@ -80,7 +65,7 @@
</property>
</widget>
</item>
<item row="0" column="1">
<item row="1" column="1">
<widget class="QToolButton" name="shareButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@ -112,7 +97,7 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<item row="2" column="0" colspan="2">
<widget class="QPlainTextEdit" name="userCertEdit">
<property name="font">
<font>
@ -122,6 +107,9 @@
<property name="whatsThis">
<string/>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>
@ -138,36 +126,25 @@
</item>
</layout>
</item>
<item row="2" column="2" rowspan="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="4" column="1">
<widget class="QFrame" name="addFrame">
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
<property name="topMargin">
<number>0</number>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>288</height>
</size>
<property name="rightMargin">
<number>0</number>
</property>
</spacer>
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/logo/logo_splash.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="3">
<item row="1" column="1" colspan="2">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
@ -184,6 +161,53 @@ private and secure decentralized commmunication platform.
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QFrame" name="addframe">
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>You get certificate from your friend?</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="addButton">
<property name="text">
<string>Add friends certificate</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/png/invite.png</normaloff>:/icons/png/invite.png</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>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>

View File

@ -681,3 +681,8 @@ HomePage QPlainTextEdit#friendCertEdit {
background: white;
}
HomePage QFrame#addframe{
border: 2px solid #0099cc;
border-radius: 6px;
background: white;
}