Added export Friendslist to Profile Page

This commit is contained in:
defnax 2024-03-15 20:10:20 +01:00
parent 80a5705aea
commit 21c2312952
4 changed files with 347 additions and 325 deletions

View File

@ -88,6 +88,7 @@ public slots:
void setShowUnconnected(bool hidden);
void setShowState(bool show);
void headerContextMenuRequested(QPoint);
void exportFriendlistClicked();
private slots:
void sortColumn(int col,Qt::SortOrder so);
@ -164,6 +165,5 @@ private slots:
void editGroup();
void removeGroup();
void exportFriendlistClicked();
void importFriendlistClicked();
};

View File

@ -34,6 +34,7 @@
#include <gui/connect/ConfCertDialog.h>
#include <gui/profile/ProfileManager.h>
#include <gui/statistics/StatisticsWindow.h>
#include <gui/common/NewFriendList.h>
#include <retroshare/rspeers.h> //for rsPeers variable
#include <retroshare/rsdisc.h> //for rsPeers variable
@ -60,6 +61,7 @@ CryptoPage::CryptoPage(QWidget * parent, Qt::WindowFlags flags)
//connect(ui.exportprofile,SIGNAL(clicked()), this, SLOT(profilemanager()));
connect(ui.exportprofile,SIGNAL(clicked()), this, SLOT(exportProfile()));
connect(ui.exportfriendslist,SIGNAL(clicked()), this, SLOT(exportFriendsList()) );
// Remove this because it duplicates functionality of the HomePage.
ui.retroshareId_LB->hide();
@ -229,3 +231,8 @@ void CryptoPage::showStats()
{
StatisticsWindow::showYourself();
}
void CryptoPage::exportFriendsList()
{
NewFriendList().exportFriendlistClicked();
}

View File

@ -51,6 +51,7 @@ class CryptoPage : public ConfigPage
bool fileSave();
bool fileSaveAs();
void showStats();
void exportFriendsList();
private:
QString fileName;

View File

@ -13,25 +13,11 @@
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QStackedWidget" name="stackedWidget">
<widget class="QWidget" name="stackPageNodeInfo" native="true">
<widget class="QWidget" name="stackPageNodeInfo">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox_1">
<layout class="QGridLayout" name="gridLayout_4">
<item row="6" column="0">
<widget class="QLabel" name="retroshareId_LB">
<property name="text">
<string>Retroshare ID:</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Statistics:</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="3">
<widget class="QLabel" name="peerid">
<property name="sizePolicy">
@ -51,13 +37,6 @@
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>PGP fingerprint:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
@ -77,99 +56,6 @@
</property>
</widget>
</item>
<item row="14" column="2">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="1" colspan="2">
<widget class="QLabel" name="friendsEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="14" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Export Profile:</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="3">
<widget class="QLabel" name="pgpfingerprint">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="3">
<widget class="QLabel" name="pgpid">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_16">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Online since:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_8">
<property name="sizePolicy">
@ -189,184 +75,10 @@
</property>
</widget>
</item>
<item row="0" column="0" colspan="4">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="publicIcon">
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/info16.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="publicLabel">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<item row="6" column="0">
<widget class="QLabel" name="retroshareId_LB">
<property name="text">
<string>Public Information</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="1" colspan="3">
<widget class="QLabel" name="country">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="14" column="1">
<widget class="QPushButton" name="exportprofile">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use this button to export your profile key. You can then import it in a different computer and make a new node with the same profile. Doing so, existing friends that you also add to the new node will automatically recognise that new node as friend.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Export</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Software Version:</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QPushButton" name="showStats_PB">
<property name="text">
<string>Show statistics</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="4">
<layout class="QGridLayout" name="gridLayout">
<property name="topMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="otherIcon">
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/info16.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="otherLabel">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Other Information</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="11" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="13" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Profile path:</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_9">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Friend nodes:</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="3">
<widget class="QLabel" name="name">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
<string>Retroshare ID:</string>
</property>
</widget>
</item>
@ -407,22 +119,80 @@
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<item row="2" column="1" colspan="3">
<widget class="QLabel" name="country">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>PGP fingerprint:</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="4">
<layout class="QGridLayout" name="gridLayout">
<property name="topMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="otherIcon">
<property name="maximumSize">
<size>
<width>100</width>
<height>0</height>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="text">
<string>Name:</string>
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/info16.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="otherLabel">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Other Information</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="11" column="1">
<widget class="QPushButton" name="showStats_PB">
<property name="text">
<string>Show statistics</string>
</property>
</widget>
</item>
<item row="14" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Export Profile:</string>
</property>
</widget>
</item>
@ -448,8 +218,8 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_7">
<item row="8" column="0">
<widget class="QLabel" name="label_9">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -463,23 +233,7 @@
</size>
</property>
<property name="text">
<string>PGP Id :</string>
</property>
</widget>
</item>
<item row="6" column="1" colspan="3">
<widget class="QLabel" name="retroshareId_content_LB">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
<string>Friend nodes:</string>
</property>
</widget>
</item>
@ -502,6 +256,100 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>PGP Id :</string>
</property>
</widget>
</item>
<item row="14" column="1">
<widget class="QPushButton" name="exportprofile">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use this button to export your profile key. You can then import it in a different computer and make a new node with the same profile. Doing so, existing friends that you also add to the new node will automatically recognise that new node as friend.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Export</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Statistics:</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="3">
<widget class="QLabel" name="name">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_16">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Online since:</string>
</property>
</widget>
</item>
<item row="13" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Profile path:</string>
</property>
</widget>
</item>
<item row="11" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="13" column="1" colspan="2">
<widget class="QLabel" name="labelpath">
<property name="font">
@ -515,6 +363,172 @@
</property>
</widget>
</item>
<item row="8" column="1" colspan="2">
<widget class="QLabel" name="friendsEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Software Version:</string>
</property>
</widget>
</item>
<item row="6" column="1" colspan="3">
<widget class="QLabel" name="retroshareId_content_LB">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="4" column="1" colspan="3">
<widget class="QLabel" name="pgpid">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="3">
<widget class="QLabel" name="pgpfingerprint">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Name:</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="4">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="publicIcon">
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/info16.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="publicLabel">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Public Information</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="15" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Export Friendslist:</string>
</property>
</widget>
</item>
<item row="15" column="1">
<widget class="QPushButton" name="exportfriendslist">
<property name="text">
<string>Export</string>
</property>
</widget>
</item>
<item row="14" column="2" rowspan="2">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
@ -533,7 +547,7 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="stackPageCertificate" native="true">
<widget class="QWidget" name="stackPageCertificate">
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<widget class="QPlainTextEdit" name="certplainTextEdit">