fixed conflicts with master

This commit is contained in:
csoler 2019-12-14 18:27:41 +01:00
commit da6e7f9e9b
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
50 changed files with 1735 additions and 771 deletions

View File

@ -37,7 +37,7 @@ export NATIVE_LIBS_TOOLCHAIN_PATH="${HOME}/Builds/android-toolchains/retroshare-
export ANDROID_NDK_ARCH="arm"
## The Android API level the Android device you want to target
export ANDROID_PLATFORM_VER="19"
export ANDROID_PLATFORM_VER="16"
## The number of core that yout host CPU have (just to speed up compilation) set
## it to 1 if unsure
@ -60,30 +60,28 @@ project and in the Projects left menu add the newly created kit if not already
present, so you can select it on the build type selection button down on the
left.
As we use a custom toolchain one more step is needed +
Now you need to set properly a few options like `JSONAPI_GENERATOR_EXE` and
disable some of RetroShare modules like `retroshare-gui` that are not available
on Android so you will have to go to
_Qt Creator left pane -> Projects -> Build and Run -> Android SOMESTUFF kit ->
Build Environement -> Add
Build Steps -> qmake -> Additional arguments_ +
Variable: +NATIVE_LIBS_TOOLCHAIN_PATH+
Value: +Same value as NATIVE_LIBS_TOOLCHAIN_PATH in Preparing The Environement step+
Some of RetroShare modules like +retroshare-gui+ and +WebUI+ are not available
on Android so to be able to compile RetroShare without errors you will have to
go to +
_Qt Creator left pane -> Projects -> Build and Run -> Android SOMESTUFF kit ->
Build Steps -> qmake -> Additional arguments_
and add the following configurations
and add the following configurations (change `Your_Path` according to your
deployment)
[source,makefile]
-------------------------------------------------------------------------------
CONFIG+=no_retroshare_gui CONFIG+=no_retroshare_nogui CONFIG+=no_retroshare_plugins CONFIG+=retroshare_android_service CONFIG+=libresapilocalserver CONFIG+=no_libresapihttpserver CONFIG+=retroshare_qml_app
CONFIG+=retroshare_service CONFIG+=rs_jsonapi CONFIG+=rs_deep_search
RS_UPNP_LIB=miniupnpc
JSONAPI_GENERATOR_EXE=Your_Path/jsonapi-generator/src/jsonapi-generator
NATIVE_LIBS_TOOLCHAIN_PATH=Your_Path/retroshare-android-16-arm/
CONFIG+=no_retroshare_gui CONFIG+=no_rs_service_webui_terminal_password
CONFIG+=no_rs_service_terminal_login
-------------------------------------------------------------------------------
TIP: Some versions of QtCreator try to find the Android SDK in
+/opt/android/sdk+. A workaround to this is to make a symbolic link there
`/opt/android/sdk`. A workaround to this is to make a symbolic link there
pointing to your SDK installation path, like
+mkdir -p /opt/android/sdk && ln -s /home/user/android-sdk-linux
/opt/android/sdk+
@ -117,7 +115,7 @@ only solution is to uninstall the app and then install the new APK but if you do
it also the application data and your precious cryptographic keys, friend list
etc. will be lost forever.
To avoid that you can attempt to manually backup and then restore from the
command-line (+adb backup+ seems not working either) to change the app source
command-line (`adb backup` seems not working either) to change the app source
without erasing the appliation data.
CAUTION: Following steps require root access on your Android device

View File

@ -79,6 +79,12 @@ virtual int dhtInfoCallback(const bdId *id, uint32_t type, uint32_t flags, std::
virtual int dhtIsBannedCallback(const sockaddr_in *addr, bool *isBanned)
{
if(!rsBanList)
{
*isBanned = true; // rsBanList is not enabled yet. For security, default to banned.
return 0;
}
// check whether ip filtering is enabled
// if not return 0 to signal that no filter is available
if(!rsBanList->ipFilteringEnabled())

View File

@ -69,12 +69,12 @@ bool HashStorage::hashingProcessPaused()
static std::string friendlyUnit(uint64_t val)
{
const std::string units[5] = {"B","KB","MB","GB","TB"};
const std::string units[6] = {"B","KB","MB","GB","TB","PB"};
char buf[50] ;
double fact = 1.0 ;
for(unsigned int i=0; i<5; ++i)
for(unsigned int i=0; i<6; ++i)
if(double(val)/fact < 1024.0)
{
sprintf(buf,"%2.2f",double(val)/fact) ;

View File

@ -21,6 +21,7 @@
* *
*******************************************************************************/
#include <unistd.h>
#include <algorithm>
#include "pqi/pqihash.h"
#include "rsgenexchange.h"
@ -38,8 +39,7 @@
#include "rsgxsutil.h"
#include "rsserver/p3face.h"
#include "retroshare/rsevents.h"
#include <algorithm>
#include "util/radix64.h"
#define PUB_GRP_MASK 0x000f
#define RESTR_GRP_MASK 0x00f0
@ -3432,6 +3432,71 @@ bool RsGenExchange::localSearch( const std::string& matchString,
return mNetService->search(matchString, results);
}
bool RsGenExchange::exportGroupBase64(
std::string& radix, const RsGxsGroupId& groupId, std::string& errMsg )
{
constexpr auto fname = __PRETTY_FUNCTION__;
const auto failure = [&](const std::string& err)
{
errMsg = err;
RsErr() << fname << " " << err << std::endl;
return false;
};
if(groupId.isNull()) return failure("groupId cannot be null");
const std::list<RsGxsGroupId> groupIds({groupId});
RsTokReqOptions opts;
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
uint32_t token;
mDataAccess->requestGroupInfo(
token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds);
RsTokenService::GxsRequestStatus wtStatus = mDataAccess->waitToken(token);
if(wtStatus != RsTokenService::COMPLETE)
return failure( "waitToken(...) failed with: " +
std::to_string(wtStatus) );
uint8_t* buf = nullptr;
uint32_t size;
RsGxsGroupId grpId;
if(!getSerializedGroupData(token, grpId, buf, size))
return failure("failed retrieving GXS data");
Radix64::encode(buf, static_cast<int>(size), radix);
free(buf);
return true;
}
bool RsGenExchange::importGroupBase64(
const std::string& radix, RsGxsGroupId& groupId,
std::string& errMsg )
{
constexpr auto fname = __PRETTY_FUNCTION__;
const auto failure = [&](const std::string& err)
{
errMsg = err;
RsErr() << fname << " " << err << std::endl;
return false;
};
if(radix.empty()) return failure("radix is empty");
std::vector<uint8_t> mem = Radix64::decode(radix);
if(mem.empty()) return failure("radix seems corrupted");
// On success this also import the group as pending validation
if(!deserializeGroupData(
mem.data(), static_cast<uint32_t>(mem.size()),
reinterpret_cast<RsGxsGroupId*>(&groupId) ))
return failure("failed deserializing group");
return true;
}
RsGxsChanges::RsGxsChanges() :
RsEvent(RsEventType::GXS_CHANGES), mServiceType(RsServiceType::NONE),
mService(nullptr) {}
RsGxsIface::~RsGxsIface() = default;
RsGxsGroupSummary::~RsGxsGroupSummary() = default;

View File

@ -95,7 +95,8 @@ typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsGxsMsgItem*> > GxsMsgRelatedDa
class RsGixs;
class RsGenExchange : public RsNxsObserver, public RsTickingThread, public RsGxsIface
class RsGenExchange : public RsNxsObserver, public RsTickingThread,
public RsGxsIface
{
public:
@ -325,6 +326,19 @@ public:
bool localSearch( const std::string& matchString,
std::list<RsGxsGroupSummary>& results );
/// @see RsGxsIface
bool exportGroupBase64(
std::string& radix, const RsGxsGroupId& groupId,
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string)
) override;
/// @see RsGxsIface
bool importGroupBase64(
const std::string& radix,
RsGxsGroupId& groupId = RS_DEFAULT_STORAGE_PARAM(RsGxsGroupId),
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string)
) override;
protected:
bool messagePublicationTest(const RsGxsMsgMetaData&) ;

View File

@ -152,9 +152,6 @@ private:
/// @see p3Config::saveDone
void saveDone() override;
uint16_t mPort;
std::string mBindAddress;
/// Called when new JSON API auth token is requested to be authorized
std::function<bool(const std::string&, const std::string& passwd)>
mNewAccessRequestCallback;

View File

@ -432,6 +432,61 @@ public:
const std::function<void (const RsGxsGroupSummary& result)>& multiCallback,
rstime_t maxWait = 30 ) = 0;
/// default base URL used for channels links @see exportChannelLink
static const std::string DEFAULT_CHANNEL_BASE_URL;
/// Link query field used to store channel name @see exportChannelLink
static const std::string CHANNEL_URL_NAME_FIELD;
/// Link query field used to store channel id @see exportChannelLink
static const std::string CHANNEL_URL_ID_FIELD;
/// Link query field used to store channel data @see exportChannelLink
static const std::string CHANNEL_URL_DATA_FIELD;
/** Link query field used to store channel message title
* @see exportChannelLink */
static const std::string CHANNEL_URL_MSG_TITLE_FIELD;
/// Link query field used to store channel message id @see exportChannelLink
static const std::string CHANNEL_URL_MSG_ID_FIELD;
/**
* @brief Get link to a channel
* @jsonapi{development}
* @param[out] link storage for the generated link
* @param[in] chanId Id of the channel of which we want to generate a link
* @param[in] includeGxsData if true include the channel GXS group data so
* the receiver can subscribe to the channel even if she hasn't received it
* through GXS yet
* @param[in] baseUrl URL into which to sneak in the RetroShare link
* radix, this is primarly useful to induce applications into making the
* link clickable, or to disguise the RetroShare link into a
* "normal" looking web link. If empty the GXS data link will be outputted
* in plain base64 format.
* @param[out] errMsg optional storage for error message, meaningful only in
* case of failure
* @return false if something failed, true otherwhise
*/
virtual bool exportChannelLink(
std::string& link, const RsGxsGroupId& chanId,
bool includeGxsData = true,
const std::string& baseUrl = RsGxsChannels::DEFAULT_CHANNEL_BASE_URL,
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string) ) = 0;
/**
* @brief Import channel from full link
* @param[in] link channel link either in radix or link format
* @param[out] chanId optional storage for parsed channel id
* @param[out] errMsg optional storage for error message, meaningful only in
* case of failure
* @return false if some error occurred, true otherwise
*/
virtual bool importChannelLink(
const std::string& link,
RsGxsGroupId& chanId = RS_DEFAULT_STORAGE_PARAM(RsGxsGroupId),
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string) ) = 0;
/* Following functions are deprecated as they expose internal functioning
* semantic, instead of a safe to use API */

View File

@ -317,6 +317,54 @@ public:
virtual bool cancelCircleMembership(
const RsGxsId& ownGxsId, const RsGxsCircleId& circleId ) = 0;
/// default base URL used for circle links @see exportCircleLink
static const std::string DEFAULT_CIRCLE_BASE_URL;
/// Circle link query field used to store circle name @see exportCircleLink
static const std::string CIRCLE_URL_NAME_FIELD;
/// Circle link query field used to store circle id @see exportCircleLink
static const std::string CIRCLE_URL_ID_FIELD;
/// Circle link query field used to store circle data @see exportCircleLink
static const std::string CIRCLE_URL_DATA_FIELD;
/**
* @brief Get link to a circle
* @jsonapi{development}
* @param[out] link storage for the generated link
* @param[in] circleId Id of the circle of which we want to generate a link
* @param[in] includeGxsData if true include the circle GXS group data so
* the receiver can request circle membership even if the circle hasn't
* propagated through GXS to her yet
* @param[in] baseUrl URL into which to sneak in the RetroShare circle link
* radix, this is primarly useful to induce applications into making the
* link clickable, or to disguise the RetroShare circle link into a
* "normal" looking web link. If empty the circle data link will be
* outputted in plain base64 format.
* @param[out] errMsg optional storage for error message, meaningful only in
* case of failure
* @return false if something failed, true otherwhise
*/
virtual bool exportCircleLink(
std::string& link, const RsGxsCircleId& circleId,
bool includeGxsData = true,
const std::string& baseUrl = RsGxsCircles::DEFAULT_CIRCLE_BASE_URL,
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string) ) = 0;
/**
* @brief Import circle from full link
* @param[in] link circle link either in radix or link format
* @param[out] circleId optional storage for parsed circle id
* @param[out] errMsg optional storage for error message, meaningful only in
* case of failure
* @return false if some error occurred, true otherwise
*/
virtual bool importCircleLink(
const std::string& link,
RsGxsCircleId& circleId = RS_DEFAULT_STORAGE_PARAM(RsGxsCircleId),
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string) ) = 0;
RS_DEPRECATED_FOR("getCirclesSummaries getCirclesInfo")
virtual bool getGroupData(
const uint32_t& token, std::vector<RsGxsCircleGroup>& groups ) = 0;

View File

@ -268,6 +268,62 @@ public:
virtual bool subscribeToForum( const RsGxsGroupId& forumId,
bool subscribe ) = 0;
/// default base URL used for forums links @see exportForumLink
static const std::string DEFAULT_FORUM_BASE_URL;
/// Link query field used to store forum name @see exportForumLink
static const std::string FORUM_URL_NAME_FIELD;
/// Link query field used to store forum id @see exportForumLink
static const std::string FORUM_URL_ID_FIELD;
/// Link query field used to store forum data @see exportForumLink
static const std::string FORUM_URL_DATA_FIELD;
/** Link query field used to store forum message title
* @see exportChannelLink */
static const std::string FORUM_URL_MSG_TITLE_FIELD;
/// Link query field used to store forum message id @see exportChannelLink
static const std::string FORUM_URL_MSG_ID_FIELD;
/**
* @brief Get link to a forum
* @jsonapi{development}
* @param[out] link storage for the generated link
* @param[in] forumId Id of the forum of which we want to generate a link
* @param[in] includeGxsData if true include the forum GXS group data so
* the receiver can subscribe to the forum even if she hasn't received it
* through GXS yet
* @param[in] baseUrl URL into which to sneak in the RetroShare link
* radix, this is primarly useful to induce applications into making the
* link clickable, or to disguise the RetroShare link into a
* "normal" looking web link. If empty the GXS data link will be outputted
* in plain base64 format.
* @param[out] errMsg optional storage for error message, meaningful only in
* case of failure
* @return false if something failed, true otherwhise
*/
virtual bool exportForumLink(
std::string& link, const RsGxsGroupId& forumId,
bool includeGxsData = true,
const std::string& baseUrl = RsGxsForums::DEFAULT_FORUM_BASE_URL,
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string) ) = 0;
/**
* @brief Import forum from full link
* @param[in] link forum link either in radix or URL format
* @param[out] forumId optional storage for parsed forum id
* @param[out] errMsg optional storage for error message, meaningful only in
* case of failure
* @return false if some error occurred, true otherwise
*/
virtual bool importForumLink(
const std::string& link,
RsGxsGroupId& forumId = RS_DEFAULT_STORAGE_PARAM(RsGxsGroupId),
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string) ) = 0;
/**
* @brief Create forum. Blocking API.
* @jsonapi{development}

View File

@ -68,6 +68,8 @@ struct RsGxsGroupSummary : RsSerializable
RS_SERIAL_PROCESS(mPopularity);
RS_SERIAL_PROCESS(mSearchContext);
}
~RsGxsGroupSummary();
};
@ -108,8 +110,6 @@ struct RsGxsChanges : RsEvent
*/
struct RsGxsIface
{
virtual ~RsGxsIface() {}
/*!
* Gxs services should call this for automatic handling of
* changes, send
@ -238,4 +238,32 @@ struct RsGxsIface
virtual RsReputationLevel minReputationForForwardingMessages(
uint32_t group_sign_flags,uint32_t identity_flags ) = 0;
/**
* @brief Export group public data in base64 format
* @jsonapi{development}
* @param[out] radix storage for the generated base64 data
* @param[in] groupId Id of the group of which to output the data
* @param[out] errMsg optional storage for error message, meaningful only in
* case of failure
* @return false if something failed, true otherwhise
*/
virtual bool exportGroupBase64(
std::string& radix, const RsGxsGroupId& groupId,
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string) ) = 0;
/**
* @brief Import group public data from base64 string
* @param[in] radix group invite in radix format
* @param[out] groupId optional storage for imported group id
* @param[out] errMsg optional storage for error message, meaningful only in
* case of failure
* @return false if some error occurred, true otherwise
*/
virtual bool importGroupBase64(
const std::string& radix,
RsGxsGroupId& groupId = RS_DEFAULT_STORAGE_PARAM(RsGxsGroupId),
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string) ) = 0;
virtual ~RsGxsIface();
};

View File

@ -296,47 +296,7 @@ protected:
uint32_t token,
std::chrono::milliseconds maxWait = std::chrono::milliseconds(500),
std::chrono::milliseconds checkEvery = std::chrono::milliseconds(2))
{
#if defined(__ANDROID__) && (__ANDROID_API__ < 24)
auto wkStartime = std::chrono::steady_clock::now();
int maxWorkAroundCnt = 10;
LLwaitTokenBeginLabel:
#endif
auto timeout = std::chrono::steady_clock::now() + maxWait;
auto st = requestStatus(token);
while( !(st == RsTokenService::FAILED || st >= RsTokenService::COMPLETE)
&& std::chrono::steady_clock::now() < timeout )
{
std::this_thread::sleep_for(checkEvery);
st = requestStatus(token);
}
#if defined(__ANDROID__) && (__ANDROID_API__ < 24)
/* Work around for very slow/old android devices, we don't expect this
* to be necessary on newer devices. If it take unreasonably long
* something worser is already happening elsewere and we return anyway.
*/
if( st > RsTokenService::FAILED && st < RsTokenService::COMPLETE
&& maxWorkAroundCnt-- > 0 )
{
maxWait *= 10;
checkEvery *= 3;
std::cerr << __PRETTY_FUNCTION__ << " Slow Android device "
<< " workaround st: " << st
<< " maxWorkAroundCnt: " << maxWorkAroundCnt
<< " maxWait: " << maxWait.count()
<< " checkEvery: " << checkEvery.count() << std::endl;
goto LLwaitTokenBeginLabel;
}
std::cerr << __PRETTY_FUNCTION__ << " lasted: "
<< std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::steady_clock::now() - wkStartime ).count()
<< "ms" << std::endl;
#endif
return st;
}
{ return mTokenService.waitToken(token, maxWait, checkEvery); }
private:
RsGxsIface& mGxs;

View File

@ -95,14 +95,17 @@ struct GxsReputation : RsSerializable
int32_t mPeerOpinion;
/// @see RsSerializable
void serial_process( RsGenericSerializer::SerializeJob j,
RsGenericSerializer::SerializeContext& ctx )
void serial_process(
RsGenericSerializer::SerializeJob j,
RsGenericSerializer::SerializeContext& ctx ) override
{
RS_SERIAL_PROCESS(mOverallScore);
RS_SERIAL_PROCESS(mIdScore);
RS_SERIAL_PROCESS(mOwnOpinion);
RS_SERIAL_PROCESS(mPeerOpinion);
}
~GxsReputation() override;
};
@ -110,7 +113,6 @@ struct RsGxsIdGroup : RsSerializable
{
RsGxsIdGroup() :
mLastUsageTS(0), mPgpKnown(false), mIsAContact(false) {}
virtual ~RsGxsIdGroup() {}
RsGroupMetaData mMeta;
@ -149,6 +151,8 @@ struct RsGxsIdGroup : RsSerializable
/// @see RsSerializable
void serial_process( RsGenericSerializer::SerializeJob j,
RsGenericSerializer::SerializeContext& ctx ) override;
~RsGxsIdGroup() override;
};
// DATA TYPE FOR EXTERNAL INTERFACE.
@ -331,8 +335,9 @@ struct RsIdentityDetails : RsSerializable
std::map<RsIdentityUsage,rstime_t> mUseCases;
/// @see RsSerializable
virtual void serial_process(RsGenericSerializer::SerializeJob j,
RsGenericSerializer::SerializeContext& ctx)
virtual void serial_process(
RsGenericSerializer::SerializeJob j,
RsGenericSerializer::SerializeContext& ctx ) override
{
RS_SERIAL_PROCESS(mId);
RS_SERIAL_PROCESS(mNickname);
@ -344,6 +349,8 @@ struct RsIdentityDetails : RsSerializable
RS_SERIAL_PROCESS(mLastUsageTS);
RS_SERIAL_PROCESS(mUseCases);
}
~RsIdentityDetails() override;
};
@ -434,26 +441,6 @@ struct RsIdentity : RsGxsIfaceHelper
*/
virtual bool isOwnId(const RsGxsId& id) = 0;
/**
* @brief Get base64 representation of an identity
* @jsonapi{development}
* @param[in] id Id of the identity
* @param[out] base64String storage for the identity base64
* @return false on error, true otherwise
*/
virtual bool identityToBase64( const RsGxsId& id,
std::string& base64String ) = 0;
/**
* @brief Import identity from base64 representation
* @jsonapi{development}
* @param[in] base64String base64 representation of the identity to import
* @param[out] id storage for the identity id
* @return false on error, true otherwise
*/
virtual bool identityFromBase64( const std::string& base64String,
RsGxsId& id ) = 0;
/**
* @brief Get identities summaries list.
* @jsonapi{development}
@ -528,8 +515,55 @@ struct RsIdentity : RsGxsIfaceHelper
*/
virtual bool requestIdentity(const RsGxsId& id) = 0;
/// default base URL used for indentity links @see exportIdentityLink
static const std::string DEFAULT_IDENTITY_BASE_URL;
RS_DEPRECATED
/// Link query field used to store indentity name @see exportIdentityLink
static const std::string IDENTITY_URL_NAME_FIELD;
/// Link query field used to store indentity id @see exportIdentityLink
static const std::string IDENTITY_URL_ID_FIELD;
/// Link query field used to store indentity data @see exportIdentityLink
static const std::string IDENTITY_URL_DATA_FIELD;
/**
* @brief Get link to a identity
* @jsonapi{development}
* @param[out] link storage for the generated link
* @param[in] id Id of the identity of which you want to generate a link
* @param[in] includeGxsData if true include the identity GXS group data so
* the receiver can make use of the identity even if she hasn't received it
* through GXS yet
* @param[in] baseUrl URL into which to sneak in the RetroShare link
* radix, this is primarly useful to induce applications into making the
* link clickable, or to disguise the RetroShare link into a
* "normal" looking web link. If empty the GXS data link will be outputted
* in plain base64 format.
* @param[out] errMsg optional storage for error message, meaningful only in
* case of failure
* @return false if something failed, true otherwhise
*/
virtual bool exportIdentityLink(
std::string& link, const RsGxsId& id,
bool includeGxsData = true,
const std::string& baseUrl = RsIdentity::DEFAULT_IDENTITY_BASE_URL,
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string) ) = 0;
/**
* @brief Import identity from full link
* @param[in] link identity link either in radix or link format
* @param[out] id optional storage for parsed identity
* @param[out] errMsg optional storage for error message, meaningful only in
* case of failure
* @return false if some error occurred, true otherwise
*/
virtual bool importIdentityLink(
const std::string& link,
RsGxsId& id = RS_DEFAULT_STORAGE_PARAM(RsGxsId),
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string) ) = 0;
RS_DEPRECATED_FOR(exportIdentityLink)
virtual bool getGroupSerializedData(
const uint32_t& token,
std::map<RsGxsId,std::string>& serialized_groups ) = 0;
@ -547,10 +581,10 @@ struct RsIdentity : RsGxsIfaceHelper
RS_DEPRECATED
virtual uint32_t nbRegularContacts() =0;
RS_DEPRECATED_FOR(identityToBase64)
RS_DEPRECATED_FOR(exportIdentityLink)
virtual bool serialiseIdentityToMemory( const RsGxsId& id,
std::string& radix_string ) = 0;
RS_DEPRECATED_FOR(identityFromBase64)
RS_DEPRECATED_FOR(importIdentityLink)
virtual bool deserialiseIdentityFromMemory( const std::string& radix_string,
RsGxsId* id = nullptr ) = 0;

View File

@ -3,7 +3,9 @@
* *
* libretroshare: retroshare core library *
* *
* Copyright 2012-2012 by Robert Fernie, Chris Evi-Parker *
* Copyright (C) 2012 Chris Evi-Parker *
* Copyright (C) 2012 Robert Fernie <retroshare@lunamutt.com> *
* Copyright (C) 2018-2019 Gioacchino Mazzurco <gio@eigenlab.org> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
@ -19,8 +21,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef RSTOKENSERVICE_H
#define RSTOKENSERVICE_H
#pragma once
#include <inttypes.h>
#include <string>
@ -28,6 +29,7 @@
#include "retroshare/rsgxsifacetypes.h"
#include "util/rsdeprecate.h"
#include "util/rsdebug.h"
// TODO CLEANUP: GXS_REQUEST_TYPE_* should be an inner enum of RsTokReqOptions
#define GXS_REQUEST_TYPE_GROUP_DATA 0x00010000
@ -113,7 +115,6 @@ struct RsTokReqOptions
*/
class RsTokenService
{
public:
enum GxsRequestStatus : uint8_t
@ -220,6 +221,59 @@ public:
* @return false if unusuccessful in cancelling request, true if successful
*/
virtual bool cancelRequest(const uint32_t &token) = 0;
};
#endif // RSTOKENSERVICE_H
/**
* Block caller while request is being processed.
* Useful for blocking API implementation.
* @param[in] token token associated to the request caller is waiting for
* @param[in] maxWait maximum waiting time in milliseconds
* @param[in] checkEvery time in millisecond between status checks
*/
RsTokenService::GxsRequestStatus waitToken(
uint32_t token,
std::chrono::milliseconds maxWait = std::chrono::milliseconds(500),
std::chrono::milliseconds checkEvery = std::chrono::milliseconds(2))
{
#if defined(__ANDROID__) && (__ANDROID_API__ < 24)
auto wkStartime = std::chrono::steady_clock::now();
int maxWorkAroundCnt = 10;
LLwaitTokenBeginLabel:
#endif
auto timeout = std::chrono::steady_clock::now() + maxWait;
auto st = requestStatus(token);
while( !(st == RsTokenService::FAILED || st >= RsTokenService::COMPLETE)
&& std::chrono::steady_clock::now() < timeout )
{
std::this_thread::sleep_for(checkEvery);
st = requestStatus(token);
}
#if defined(__ANDROID__) && (__ANDROID_API__ < 24)
/* Work around for very slow/old android devices, we don't expect this
* to be necessary on newer devices. If it take unreasonably long
* something worser is already happening elsewere and we return anyway.
*/
if( st > RsTokenService::FAILED && st < RsTokenService::COMPLETE
&& maxWorkAroundCnt-- > 0 )
{
maxWait *= 10;
checkEvery *= 3;
Dbg3() << __PRETTY_FUNCTION__ << " Slow Android device "
<< " workaround st: " << st
<< " maxWorkAroundCnt: " << maxWorkAroundCnt
<< " maxWait: " << maxWait.count()
<< " checkEvery: " << checkEvery.count() << std::endl;
goto LLwaitTokenBeginLabel;
}
Dbg3() << __PRETTY_FUNCTION__ << " lasted: "
<< std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::steady_clock::now() - wkStartime ).count()
<< "ms" << std::endl;
#endif
return st;
}
RS_SET_CONTEXT_DEBUG_LEVEL(2)
};

View File

@ -2478,6 +2478,85 @@ void p3GxsChannels::cleanTimedOutCallbacks()
} // RS_STACK_MUTEX(mDistantChannelsCallbacksMapMutex)
}
bool p3GxsChannels::exportChannelLink(
std::string& link, const RsGxsGroupId& chanId, bool includeGxsData,
const std::string& baseUrl, std::string& errMsg )
{
constexpr auto fname = __PRETTY_FUNCTION__;
const auto failure = [&](const std::string& err)
{
errMsg = err;
RsErr() << fname << " " << err << std::endl;
return false;
};
if(chanId.isNull()) return failure("chanId cannot be null");
const bool outputRadix = baseUrl.empty();
if(outputRadix && !includeGxsData) return
failure("includeGxsData must be true if format requested is base64");
if( includeGxsData &&
!RsGenExchange::exportGroupBase64(link, chanId, errMsg) )
return failure(errMsg);
if(outputRadix) return true;
std::vector<RsGxsChannelGroup> chansInfo;
if( !getChannelsInfo(std::list<RsGxsGroupId>({chanId}), chansInfo)
|| chansInfo.empty() )
return failure("failure retrieving channel information");
RsUrl inviteUrl(baseUrl);
inviteUrl.setQueryKV(CHANNEL_URL_ID_FIELD, chanId.toStdString());
inviteUrl.setQueryKV(CHANNEL_URL_NAME_FIELD, chansInfo[0].mMeta.mGroupName);
if(includeGxsData) inviteUrl.setQueryKV(CHANNEL_URL_DATA_FIELD, link);
link = inviteUrl.toString();
return true;
}
bool p3GxsChannels::importChannelLink(
const std::string& link, RsGxsGroupId& chanId, std::string& errMsg )
{
constexpr auto fname = __PRETTY_FUNCTION__;
const auto failure = [&](const std::string& err)
{
errMsg = err;
RsErr() << fname << " " << err << std::endl;
return false;
};
if(link.empty()) return failure("link is empty");
const std::string* radixPtr(&link);
RsUrl url(link);
const auto& query = url.query();
const auto qIt = query.find(CHANNEL_URL_DATA_FIELD);
if(qIt != query.end()) radixPtr = &qIt->second;
if(radixPtr->empty()) return failure(CHANNEL_URL_DATA_FIELD + " is empty");
if(!RsGenExchange::importGroupBase64(*radixPtr, chanId, errMsg))
return failure(errMsg);
return true;
}
/*static*/ const std::string RsGxsChannels::DEFAULT_CHANNEL_BASE_URL =
"retroshare:///channels";
/*static*/ const std::string RsGxsChannels::CHANNEL_URL_NAME_FIELD =
"chanName";
/*static*/ const std::string RsGxsChannels::CHANNEL_URL_ID_FIELD =
"chanId";
/*static*/ const std::string RsGxsChannels::CHANNEL_URL_DATA_FIELD =
"chanData";
/*static*/ const std::string RsGxsChannels::CHANNEL_URL_MSG_TITLE_FIELD =
"chanMsgTitle";
/*static*/ const std::string RsGxsChannels::CHANNEL_URL_MSG_ID_FIELD =
"chanMsgId";
RsGxsChannelGroup::~RsGxsChannelGroup() = default;
RsGxsChannelPost::~RsGxsChannelPost() = default;
RsGxsChannels::~RsGxsChannels() = default;

View File

@ -246,9 +246,24 @@ virtual bool ExtraFileRemove(const RsFileHash &hash);
bool subscribeToChannel( const RsGxsGroupId &groupId,
bool subscribe ) override;
/// Implementation of @see RsGxsChannels::setPostRead
/// @see RsGxsChannels
virtual bool markRead(const RsGxsGrpMsgIdPair& msgId, bool read);
/// @see RsGxsChannels
bool exportChannelLink(
std::string& link, const RsGxsGroupId& chanId,
bool includeGxsData = true,
const std::string& baseUrl = DEFAULT_CHANNEL_BASE_URL,
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string)
) override;
/// @see RsGxsChannels
bool importChannelLink(
const std::string& link,
RsGxsGroupId& chanId = RS_DEFAULT_STORAGE_PARAM(RsGxsGroupId),
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string)
) override;
virtual bool shareChannelKeys(
const RsGxsGroupId& channelId, const std::set<RsPeerId>& peers );

View File

@ -365,6 +365,76 @@ bool p3GxsCircles::inviteIdsToCircle( const std::set<RsGxsId>& identities,
return editCircle(circleGrp);
}
bool p3GxsCircles::exportCircleLink(
std::string& link, const RsGxsCircleId& circleId,
bool includeGxsData, const std::string& baseUrl, std::string& errMsg )
{
constexpr auto fname = __PRETTY_FUNCTION__;
const auto failure = [&](const std::string& err)
{
errMsg = err;
RsErr() << fname << " " << err << std::endl;
return false;
};
if(circleId.isNull()) return failure("circleId cannot be null");
const bool outputRadix = baseUrl.empty();
if(outputRadix && !includeGxsData) return
failure("includeGxsData must be true if format requested is base64");
RsGxsGroupId&& groupId = static_cast<RsGxsGroupId>(circleId);
if( includeGxsData &&
!RsGenExchange::exportGroupBase64(link, groupId, errMsg) )
return failure(errMsg);
if(outputRadix) return true;
std::vector<RsGxsCircleGroup> circlesInfo;
if( !getCirclesInfo(
std::list<RsGxsGroupId>({groupId}), circlesInfo )
|| circlesInfo.empty() )
return failure("failure retrieving circle information");
RsUrl inviteUrl(baseUrl);
inviteUrl.setQueryKV(CIRCLE_URL_ID_FIELD, circleId.toStdString());
inviteUrl.setQueryKV(CIRCLE_URL_NAME_FIELD, circlesInfo[0].mMeta.mGroupName);
if(includeGxsData) inviteUrl.setQueryKV(CIRCLE_URL_DATA_FIELD, link);
link = inviteUrl.toString();
return true;
}
bool p3GxsCircles::importCircleLink(
const std::string& link, RsGxsCircleId& circleId,
std::string& errMsg )
{
constexpr auto fname = __PRETTY_FUNCTION__;
const auto failure = [&](const std::string& err)
{
errMsg = err;
RsErr() << fname << " " << err << std::endl;
return false;
};
if(link.empty()) return failure("link is empty");
const std::string* radixPtr(&link);
RsUrl url(link);
const auto& query = url.query();
const auto qIt = query.find(CIRCLE_URL_DATA_FIELD);
if(qIt != query.end()) radixPtr = &qIt->second;
if(radixPtr->empty()) return failure(CIRCLE_URL_DATA_FIELD + " is empty");
if(!RsGenExchange::importGroupBase64(
*radixPtr, reinterpret_cast<RsGxsGroupId&>(circleId), errMsg) )
return failure(errMsg);
return true;
}
uint32_t p3GxsCircles::circleAuthenPolicy()
{
uint32_t policy = 0;
@ -545,7 +615,8 @@ void p3GxsCircles::notifyChanges(std::vector<RsGxsNotify *> &changes)
/******************* RsCircles Interface ***************************************/
/********************************************************************************/
bool p3GxsCircles:: getCircleDetails(const RsGxsCircleId &id, RsGxsCircleDetails &details)
bool p3GxsCircles::getCircleDetails(
const RsGxsCircleId& id, RsGxsCircleDetails& details)
{
#ifdef DEBUG_CIRCLES
@ -2335,6 +2406,12 @@ bool p3GxsCircles::processMembershipRequests(uint32_t token)
return true ;
}
/*static*/ const std::string RsGxsCircles::DEFAULT_CIRCLE_BASE_URL =
"retroshare:///circles";
/*static*/ const std::string RsGxsCircles::CIRCLE_URL_NAME_FIELD = "circleName";
/*static*/ const std::string RsGxsCircles::CIRCLE_URL_ID_FIELD = "circleId";
/*static*/ const std::string RsGxsCircles::CIRCLE_URL_DATA_FIELD = "circleData";
RsGxsCircles::~RsGxsCircles() = default;
RsGxsCircleMsg::~RsGxsCircleMsg() = default;
RsGxsCircleDetails::~RsGxsCircleDetails() = default;

View File

@ -169,14 +169,15 @@ class RsGxsCircleCache
class PgpAuxUtils;
class p3GxsCircles: public RsGxsCircleExchange, public RsGxsCircles, public GxsTokenQueue, public RsTickEvent
class p3GxsCircles: public RsGxsCircleExchange, public RsGxsCircles,
public GxsTokenQueue, public RsTickEvent
{
public:
p3GxsCircles(RsGeneralDataService* gds, RsNetworkExchangeService* nes, p3IdService *identities, PgpAuxUtils *pgpUtils);
public:
p3GxsCircles(
RsGeneralDataService* gds, RsNetworkExchangeService* nes,
p3IdService* identities, PgpAuxUtils* pgpUtils );
virtual RsServiceInfo getServiceInfo();
/*********** External Interface ***************/
RsServiceInfo getServiceInfo() override;
/// @see RsGxsCircles
bool createCircle(
@ -212,6 +213,21 @@ virtual RsServiceInfo getServiceInfo();
const RsGxsMessageId& msgId,
RsGxsCircleMsg& msg) override;
/// @see RsGxsCircles
bool exportCircleLink(
std::string& link, const RsGxsCircleId& circleId,
bool includeGxsData = true,
const std::string& baseUrl = DEFAULT_CIRCLE_BASE_URL,
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string)
) override;
/// @see RsGxsCircles
bool importCircleLink(
const std::string& link,
RsGxsCircleId& circleId = RS_DEFAULT_STORAGE_PARAM(RsGxsCircleId),
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string)
) override;
virtual bool getCircleDetails(const RsGxsCircleId &id, RsGxsCircleDetails &details);
virtual bool getCircleExternalIdList(std::list<RsGxsCircleId> &circleIds);

View File

@ -689,6 +689,72 @@ bool p3GxsForums::subscribeToForum(
return true;
}
bool p3GxsForums::exportForumLink(
std::string& link, const RsGxsGroupId& forumId, bool includeGxsData,
const std::string& baseUrl, std::string& errMsg )
{
constexpr auto fname = __PRETTY_FUNCTION__;
const auto failure = [&](const std::string& err)
{
errMsg = err;
RsErr() << fname << " " << err << std::endl;
return false;
};
if(forumId.isNull()) return failure("forumId cannot be null");
const bool outputRadix = baseUrl.empty();
if(outputRadix && !includeGxsData) return
failure("includeGxsData must be true if format requested is base64");
if( includeGxsData &&
!RsGenExchange::exportGroupBase64(link, forumId, errMsg) )
return failure(errMsg);
if(outputRadix) return true;
std::vector<RsGxsForumGroup> forumsInfo;
if( !getForumsInfo(std::list<RsGxsGroupId>({forumId}), forumsInfo)
|| forumsInfo.empty() )
return failure("failure retrieving forum information");
RsUrl inviteUrl(baseUrl);
inviteUrl.setQueryKV(FORUM_URL_ID_FIELD, forumId.toStdString());
inviteUrl.setQueryKV(FORUM_URL_NAME_FIELD, forumsInfo[0].mMeta.mGroupName);
if(includeGxsData) inviteUrl.setQueryKV(FORUM_URL_DATA_FIELD, link);
link = inviteUrl.toString();
return true;
}
bool p3GxsForums::importForumLink(
const std::string& link, RsGxsGroupId& forumId, std::string& errMsg )
{
constexpr auto fname = __PRETTY_FUNCTION__;
const auto failure = [&](const std::string& err)
{
errMsg = err;
RsErr() << fname << " " << err << std::endl;
return false;
};
if(link.empty()) return failure("link is empty");
const std::string* radixPtr(&link);
RsUrl url(link);
const auto& query = url.query();
const auto qIt = query.find(FORUM_URL_DATA_FIELD);
if(qIt != query.end()) radixPtr = &qIt->second;
if(radixPtr->empty()) return failure(FORUM_URL_DATA_FIELD + " is empty");
if(!RsGenExchange::importGroupBase64(*radixPtr, forumId, errMsg))
return failure(errMsg);
return true;
}
bool p3GxsForums::createGroup(uint32_t &token, RsGxsForumGroup &group)
{
std::cerr << "p3GxsForums::createGroup()" << std::endl;
@ -1018,6 +1084,19 @@ bool RsGxsForumGroup::canEditPosts(const RsGxsId& id) const
id == mMeta.mAuthorId;
}
/*static*/ const std::string RsGxsForums::DEFAULT_FORUM_BASE_URL =
"retroshare:///forums";
/*static*/ const std::string RsGxsForums::FORUM_URL_NAME_FIELD =
"forumName";
/*static*/ const std::string RsGxsForums::FORUM_URL_ID_FIELD =
"forumId";
/*static*/ const std::string RsGxsForums::FORUM_URL_DATA_FIELD =
"forumData";
/*static*/ const std::string RsGxsForums::FORUM_URL_MSG_TITLE_FIELD =
"forumMsgTitle";
/*static*/ const std::string RsGxsForums::FORUM_URL_MSG_ID_FIELD =
"forumMsgId";
RsGxsForumGroup::~RsGxsForumGroup() = default;
RsGxsForumMsg::~RsGxsForumMsg() = default;
RsGxsForums::~RsGxsForums() = default;

View File

@ -110,6 +110,21 @@ public:
virtual bool subscribeToForum( const RsGxsGroupId& forumId,
bool subscribe );
/// @see RsGxsForums
bool exportForumLink(
std::string& link, const RsGxsGroupId& forumId,
bool includeGxsData = true,
const std::string& baseUrl = DEFAULT_FORUM_BASE_URL,
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string)
) override;
/// @see RsGxsForums
bool importForumLink(
const std::string& link,
RsGxsGroupId& forumId = RS_DEFAULT_STORAGE_PARAM(RsGxsGroupId),
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string)
) override;
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsForumGroup> &groups);
virtual bool getMsgData(const uint32_t &token, std::vector<RsGxsForumMsg> &msgs);
virtual bool getMsgMetaData(const uint32_t &token, GxsMsgMetaMap& msg_metas);

View File

@ -817,10 +817,6 @@ bool p3IdService::isKnownId(const RsGxsId& id)
std::find(mOwnIds.begin(), mOwnIds.end(),id) != mOwnIds.end();
}
bool p3IdService::identityToBase64( const RsGxsId& id,
std::string& base64String )
{ return serialiseIdentityToMemory(id, base64String); }
bool p3IdService::serialiseIdentityToMemory( const RsGxsId& id,
std::string& radix_string )
{
@ -882,10 +878,6 @@ void p3IdService::handle_get_serialized_grp(uint32_t token)
mSerialisedIdentities[RsGxsId(id)] = s ;
}
bool p3IdService::identityFromBase64(
const std::string& base64String, RsGxsId& id )
{ return deserialiseIdentityFromMemory(base64String, &id); }
bool p3IdService::deserialiseIdentityFromMemory(const std::string& radix_string,
RsGxsId* id /* = nullptr */)
{
@ -4717,15 +4709,89 @@ void p3IdService::handle_event(uint32_t event_type, const std::string &/*elabel*
}
}
/*static*/ const std::string RsIdentity::DEFAULT_IDENTITY_BASE_URL =
"retroshare:///identities";
/*static*/ const std::string RsIdentity::IDENTITY_URL_NAME_FIELD = "identityName";
/*static*/ const std::string RsIdentity::IDENTITY_URL_ID_FIELD = "identityId";
/*static*/ const std::string RsIdentity::IDENTITY_URL_DATA_FIELD = "identityData";
bool p3IdService::exportIdentityLink(
std::string& link, const RsGxsId& id, bool includeGxsData,
const std::string& baseUrl, std::string& errMsg )
{
constexpr auto fname = __PRETTY_FUNCTION__;
const auto failure = [&](const std::string& err)
{
errMsg = err;
RsErr() << fname << " " << err << std::endl;
return false;
};
if(id.isNull()) return failure("id cannot be null");
const bool outputRadix = baseUrl.empty();
if(outputRadix && !includeGxsData) return
failure("includeGxsData must be true if format requested is base64");
if( includeGxsData &&
!RsGenExchange::exportGroupBase64(
link, reinterpret_cast<const RsGxsGroupId&>(id), errMsg ) )
return failure(errMsg);
if(outputRadix) return true;
std::vector<RsGxsIdGroup> idsInfo;
if( !getIdentitiesInfo(std::set<RsGxsId>({id}), idsInfo )
|| idsInfo.empty() )
return failure("failure retrieving identity information");
RsUrl inviteUrl(baseUrl);
inviteUrl.setQueryKV(IDENTITY_URL_ID_FIELD, id.toStdString());
inviteUrl.setQueryKV(IDENTITY_URL_NAME_FIELD, idsInfo[0].mMeta.mGroupName);
if(includeGxsData) inviteUrl.setQueryKV(IDENTITY_URL_DATA_FIELD, link);
link = inviteUrl.toString();
return true;
}
bool p3IdService::importIdentityLink(
const std::string& link, RsGxsId& id, std::string& errMsg )
{
constexpr auto fname = __PRETTY_FUNCTION__;
const auto failure = [&](const std::string& err)
{
errMsg = err;
RsErr() << fname << " " << err << std::endl;
return false;
};
if(link.empty()) return failure("link is empty");
const std::string* radixPtr(&link);
RsUrl url(link);
const auto& query = url.query();
const auto qIt = query.find(IDENTITY_URL_DATA_FIELD);
if(qIt != query.end()) radixPtr = &qIt->second;
if(radixPtr->empty()) return failure(IDENTITY_URL_DATA_FIELD + " is empty");
if(!RsGenExchange::importGroupBase64(
*radixPtr, reinterpret_cast<RsGxsGroupId&>(id), errMsg ))
return failure(errMsg);
return true;
}
void RsGxsIdGroup::serial_process(
RsGenericSerializer::SerializeJob j,
RsGenericSerializer::SerializeContext& ctx )
{
RS_SERIAL_PROCESS(mMeta);
RS_SERIAL_PROCESS(mPgpIdHash);
//RS_SERIAL_PROCESS(mPgpIdSign);
RS_SERIAL_PROCESS(mRecognTags);
//RS_SERIAL_PROCESS(mImage);
RS_SERIAL_PROCESS(mPgpIdSign);
RS_SERIAL_PROCESS(mImage);
RS_SERIAL_PROCESS(mLastUsageTS);
RS_SERIAL_PROCESS(mPgpKnown);
RS_SERIAL_PROCESS(mIsAContact);
@ -4798,3 +4864,6 @@ RsIdentityUsage::RsIdentityUsage() :
RsIdentity::~RsIdentity() = default;
RsReputationInfo::~RsReputationInfo() = default;
RsGixs::~RsGixs() = default;
RsIdentityDetails::~RsIdentityDetails() = default;
GxsReputation::~GxsReputation() = default;
RsGxsIdGroup::~RsGxsIdGroup() = default;

View File

@ -293,13 +293,32 @@ public:
/// @see RsIdentity
bool getOwnPseudonimousIds(std::vector<RsGxsId>& ids) override;
/// @see RsIdentity
bool getOwnIds(
std::list<RsGxsId> &ownIds, bool signed_only = false ) override;
/// @see RsIdentity
bool isKnownId(const RsGxsId& id) override;
/// @see RsIdentity
bool isOwnId(const RsGxsId& key_id) override;
/// @see RsIdentity
bool exportIdentityLink(
std::string& link, const RsGxsId& id,
bool includeGxsData = true,
const std::string& baseUrl = DEFAULT_IDENTITY_BASE_URL,
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string)
) override;
/// @see RsIdentity
bool importIdentityLink(
const std::string& link,
RsGxsId& id = RS_DEFAULT_STORAGE_PARAM(RsGxsId),
std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string)
) override;
virtual bool signData( const uint8_t* data,
uint32_t data_size,
const RsGxsId& signer_id,
@ -354,17 +373,10 @@ public:
const RsIdentityUsage &use_info );
virtual bool requestPrivateKey(const RsGxsId &id);
/// @see RsIdentity
bool identityToBase64( const RsGxsId& id,
std::string& base64String ) override;
/// @see RsIdentity
bool identityFromBase64( const std::string& base64String,
RsGxsId& id ) override;
RS_DEPRECATED_FOR(exportIdentityLink)
virtual bool serialiseIdentityToMemory(const RsGxsId& id,
std::string& radix_string);
RS_DEPRECATED_FOR(importIdentityLink)
virtual bool deserialiseIdentityFromMemory(const std::string& radix_string,
RsGxsId* id = nullptr);

View File

@ -973,8 +973,7 @@ void AboutWidget::on_copy_button_clicked()
verInfo+=addLibraries("libretroshare", libraries);
#ifdef RS_JSONAPI
// No version number available for restbed apparently.
//
// Disabled because I could not find how to get restbed version number
// /* Add version numbers of RetroShare */
// // Add versions here. Find a better place.
// libraries.clear();

View File

@ -7,30 +7,13 @@
<x>0</x>
<y>0</y>
<width>594</width>
<height>594</height>
<height>352</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
@ -73,6 +56,16 @@
</item>
</layout>
</item>
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
<resources>

View File

@ -71,11 +71,12 @@
#define IMAGE_CREATE ""
#define IMAGE_PUBLIC ":/icons/png/chats.png"
#define IMAGE_PRIVATE ":/icons/png/chats-private.png"
#define IMAGE_SIGNED ":/icons/png/chats-signed.png"
#define IMAGE_SUBSCRIBE ":/icons/png/enter.png"
#define IMAGE_UNSUBSCRIBE ":/icons/png/leave2.png"
#define IMAGE_PEER_ENTERING ":images/user/add_user24.png"
#define IMAGE_PEER_LEAVING ":images/user/remove_user24.png"
#define IMAGE_TYPING ":images/typing.png"
#define IMAGE_TYPING ":icons/png/typing.png"
#define IMAGE_MESSAGE ":images/chat.png"
#define IMAGE_AUTOSUBSCRIBE ":images/accepted16.png"
#define IMAGE_COPYRSLINK ":/icons/png/copy.png"

View File

@ -86,12 +86,11 @@ p, li { white-space: pre-wrap; }
&lt;p align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-weight:600;&quot;&gt;RetroShare provides file sharing, chat, messages and channels&lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:600;&quot;&gt;Useful external links to more information:&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot; align=&quot;justify&quot; style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://retroshare.sourceforge.net&quot;&gt;&lt;span style=&quot; font-size:12pt; text-decoration: underline; color:#0000ff;&quot;&gt;Retroshare Webpage&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt; text-decoration: underline; color:#0000ff;&quot; align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://retroshare.sourceforge.net&quot;&gt;&lt;span style=&quot; color:#007af4;&quot;&gt;Retroshare Wiki&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt; text-decoration: underline; color:#0000ff;&quot; align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://retroshare.sourceforge.net&quot;&gt;&lt;span style=&quot; color:#007af4;&quot;&gt;RetroShare's Forum&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt; text-decoration: underline; color:#0000ff;&quot; align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://retroshare.sourceforge.net&quot;&gt;&lt;span style=&quot; color:#007af4;&quot;&gt;Retroshare Project Page&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt; text-decoration: underline; color:#0000ff;&quot; align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://retroshare.sourceforge.net&quot;&gt;&lt;span style=&quot; color:#007af4;&quot;&gt;RetroShare Team Blog&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt; text-decoration: underline; color:#0000ff;&quot; align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://retroshare.sourceforge.net&quot;&gt;&lt;span style=&quot; color:#007af4;&quot;&gt;RetroShare Dev Twitter&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot; align=&quot;justify&quot; style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;https://retroshare.cc/&quot;&gt;&lt;span style=&quot; font-size:12pt; text-decoration: underline; color:#007af4;&quot;&gt;Retroshare Webpage&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt; text-decoration: underline; color:#0000ff;&quot; align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;https://retroshare.readthedocs.io/&quot;&gt;&lt;span style=&quot; color:#007af4;&quot;&gt;Retroshare Wiki&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt; text-decoration: underline; color:#0000ff;&quot; align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;https://github.com/RetroShare/RetroShare&quot;&gt;&lt;span style=&quot; color:#007af4;&quot;&gt;Retroshare Project Page&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt; text-decoration: underline; color:#0000ff;&quot; align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;https://retroshareteam.wordpress.com/&quot;&gt;&lt;span style=&quot; color:#007af4;&quot;&gt;RetroShare Team Blog&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt; text-decoration: underline; color:#0000ff;&quot; align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;https://twitter.com/retroshare&quot;&gt;&lt;span style=&quot; color:#007af4;&quot;&gt;RetroShare Dev Twitter&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
@ -308,8 +307,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>550</width>
<height>36</height>
<width>566</width>
<height>18</height>
</rect>
</property>
<property name="sizePolicy">

View File

@ -18,16 +18,16 @@
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>6</number>
<number>1</number>
</property>
<property name="topMargin">
<number>0</number>
<number>1</number>
</property>
<property name="rightMargin">
<number>6</number>
<number>1</number>
</property>
<property name="bottomMargin">
<number>0</number>
<number>1</number>
</property>
<property name="spacing">
<number>0</number>
@ -563,7 +563,7 @@
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/svg/exit-red.svg</normaloff>:/icons/svg/exit-red.svg</iconset>
<normaloff>:/icons/png/exit2.png</normaloff>:/icons/png/exit2.png</iconset>
</property>
</widget>
</item>

View File

@ -23,6 +23,7 @@
#include "PostedListWidget.h"
#include "ui_PostedListWidget.h"
#include "gui/gxs/GxsIdDetails.h"
#include "PostedCreatePostDialog.h"
#include "PostedItem.h"
#include "gui/common/UIStateHelper.h"
@ -36,6 +37,8 @@
#define POSTED_DEFAULT_LISTING_LENGTH 10
#define POSTED_MAX_INDEX 10000
#define TOPIC_DEFAULT_IMAGE ":/icons/png/posted.png"
/** Constructor */
PostedListWidget::PostedListWidget(const RsGxsGroupId &postedId, QWidget *parent)
: GxsMessageFramePostWidget(rsPosted, parent),
@ -81,7 +84,7 @@ PostedListWidget::PostedListWidget(const RsGxsGroupId &postedId, QWidget *parent
available posts from your subscribed friends, and make the \
links visible to all other friends.</p><p>Afterwards you can unsubscribe from the context menu of the links list at left.</p>"));
ui->infoframe->hide();
ui->infoframe->hide();
/* load settings */
processSettings(true);
@ -311,6 +314,17 @@ void PostedListWidget::insertPostedDetails(const RsPostedGroup &group)
mStateHelper->setWidgetEnabled(ui->submitPostButton, IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags));
ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags));
ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags)) ;
/* IMAGE */
QPixmap topicImage;
if (group.mGroupImage.mData != NULL) {
GxsIdDetails::loadPixmapFromData(group.mGroupImage.mData, group.mGroupImage.mSize, topicImage,GxsIdDetails::ORIGINAL);
} else {
topicImage = QPixmap(TOPIC_DEFAULT_IMAGE);
}
ui->logoLabel->setPixmap(topicImage);
ui->namelabel->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str()));
ui->poplabel->setText(QString::number( group.mMeta.mPop));
RetroShareLink link;
@ -341,6 +355,8 @@ void PostedListWidget::insertPostedDetails(const RsPostedGroup &group)
link = RetroShareLink::createMessage(group.mMeta.mAuthorId, "");
ui->infoAdministrator->setText(link.toHtml());
ui->createdinfolabel->setText(DateTime::formatLongDateTime(group.mMeta.mPublishTs));
QString distrib_string ( "[unknown]" );
switch(group.mMeta.mCircleType)
@ -527,7 +543,8 @@ void PostedListWidget::applyRanking()
void PostedListWidget::blank()
{
clearPosts();
clearPosts();
ui->infoframe->hide();
}
void PostedListWidget::clearPosts()
{

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>761</width>
<width>616</width>
<height>428</height>
</rect>
</property>
@ -243,14 +243,52 @@
<property name="checkable">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="logoLabel">
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="pixmap">
<pixmap resource="../icons.qrc">:/icons/png/postedlinks.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="namelabel">
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QFormLayout" name="formLayout">
<property name="topMargin">
<number>6</number>
</property>
<item row="2" column="0">
<widget class="QLabel" name="label">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<weight>75</weight>
@ -258,11 +296,24 @@
</font>
</property>
<property name="text">
<string>Administrator:</string>
<string>Popularity</string>
</property>
</widget>
</item>
<item row="0" column="0">
<item row="0" column="1">
<widget class="QLabel" name="poplabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="infoPostsLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
@ -277,11 +328,87 @@
</font>
</property>
<property name="text">
<string>Posts:</string>
<string>Posts</string>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="1" column="1">
<widget class="QLabel" name="infoPosts">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">0</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="createdlabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Created</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="createdinfolabel">
<property name="text">
<string>unknown</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Administrator:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="GxsIdLabel" name="infoAdministrator">
<property name="text">
<string>unknown</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Distribution:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="infoDistribution">
<property name="text">
<string>unknown</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="infoLastPostLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
@ -300,85 +427,51 @@
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QTextBrowser" name="infoDescription">
<property name="html">
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Description&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="openLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="infoDescriptionLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Description:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="GxsIdLabel" name="infoAdministrator">
<property name="text">
<string>unknown</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="infoPosts">
<property name="text">
<string notr="true">0</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="3" column="1">
<widget class="QLabel" name="infoLastPost">
<property name="text">
<string notr="true">unknown</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Distribution:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="infoDistribution">
<property name="text">
<string>unknown</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>421</width>
<height>114</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" colspan="2">
<widget class="QTextBrowser" name="infoDescription">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="html">
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Description&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="openLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -395,7 +488,7 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>759</width>
<width>614</width>
<height>16</height>
</rect>
</property>
@ -428,6 +521,11 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
<customwidgets>
<customwidget>
<class>GxsIdLabel</class>
<extends>QLabel</extends>
<header>gui/gxs/GxsIdLabel.h</header>
</customwidget>
<customwidget>
<class>SubscribeToolButton</class>
<extends>QToolButton</extends>
@ -438,11 +536,6 @@ p, li { white-space: pre-wrap; }
<extends>QComboBox</extends>
<header>gui/gxs/GxsIdChooser.h</header>
</customwidget>
<customwidget>
<class>GxsIdLabel</class>
<extends>QLabel</extends>
<header>gui/gxs/GxsIdLabel.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../images.qrc"/>

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>543</width>
<height>208</height>
<width>565</width>
<height>209</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_1">
@ -41,10 +41,7 @@
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0" rowspan="2">
<item row="0" column="0" rowspan="3">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="AvatarWidget" name="avatar">
@ -122,7 +119,7 @@
</property>
</widget>
</item>
<item row="1" column="1" colspan="4">
<item row="1" column="1" colspan="3">
<widget class="QLabel" name="chatTextlabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@ -150,7 +147,7 @@
</property>
</widget>
</item>
<item row="3" column="0" colspan="5">
<item row="2" column="1" colspan="3">
<widget class="QFrame" name="buttonFrame">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
@ -308,7 +305,7 @@
</layout>
</widget>
</item>
<item row="2" column="0" colspan="5">
<item row="3" column="0" colspan="4">
<widget class="QFrame" name="messageFrame">
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">

View File

@ -347,6 +347,10 @@
<property name="text">
<string>Edit</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/pencil-edit-button.png</normaloff>:/icons/png/pencil-edit-button.png</iconset>
</property>
</widget>
</item>
<item>

View File

@ -150,22 +150,6 @@
</item>
<item row="1" column="1" colspan="2">
<layout class="QHBoxLayout" name="buttonHLayout">
<item>
<spacer name="buttonHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>388</width>
<height>21</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="sendmsgButton">
<property name="focusPolicy">
@ -215,6 +199,22 @@
</property>
</widget>
</item>
<item>
<spacer name="buttonHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>388</width>
<height>21</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="expandButton">
<property name="sizePolicy">

View File

@ -468,6 +468,8 @@ void GxsGroupDialog::updateFromExistingMeta(const QString &description)
else
ui.lastpostline->setText(DateTime::formatLongDateTime(mGrpMeta.mLastPost));
ui.authorLabel->setId(mGrpMeta.mAuthorId);
ui.createdline->setText(DateTime::formatLongDateTime(mGrpMeta.mPublishTs));
link = RetroShareLink::createMessage(mGrpMeta.mAuthorId, "");
ui.authorLabel->setText(link.toHtml());

View File

@ -621,27 +621,10 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="6" column="0">
<widget class="QLabel" name="distributionLabel">
<item row="10" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Distribution:</string>
</property>
</widget>
</item>
<item row="10" column="2">
<widget class="GxsIdLabel" name="moderatorsLabel">
<property name="text">
<string>TextLabel</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Name</string>
<string>Author</string>
</property>
</widget>
</item>
@ -652,6 +635,13 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
@ -659,6 +649,75 @@
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QLabel" name="antiSpamValueLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="antiSpamLabel">
<property name="text">
<string>Anti Spam:</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLineEdit" name="lastpostline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="commentsValueLabel">
<property name="text">
<string>TextLabel</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="commentsLabel">
<property name="text">
<string>Comments:</string>
</property>
</widget>
</item>
<item row="10" column="2">
<widget class="GxsIdLabel" name="authorLabel">
<property name="text">
<string>GxsIdLabel</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>ID</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLineEdit" name="IDline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Posts</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="postsline">
<property name="text">
@ -669,63 +728,7 @@
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLineEdit" name="nameline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Posts</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Moderators:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="popline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLineEdit" name="lastpostline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>ID</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="commentsLabel">
<property name="text">
<string>Comments:</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="antiSpamLabel">
<property name="text">
<string>Anti Spam:</string>
</property>
</widget>
</item>
<item row="6" column="2">
<item row="7" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLabel" name="distributionValueLabel">
@ -746,29 +749,36 @@
</item>
</layout>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_7">
<item row="7" column="0">
<widget class="QLabel" name="distributionLabel">
<property name="text">
<string>Author</string>
<string>Distribution:</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QLabel" name="antiSpamValueLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLineEdit" name="IDline">
<item row="0" column="2">
<widget class="QLineEdit" name="nameline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLabel" name="commentsValueLabel">
<item row="1" column="2">
<widget class="QLineEdit" name="popline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Moderators:</string>
</property>
</widget>
</item>
<item row="11" column="2">
<widget class="GxsIdLabel" name="moderatorsLabel">
<property name="text">
<string>TextLabel</string>
</property>
@ -777,13 +787,13 @@
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="GxsIdLabel" name="authorLabel">
<item row="4" column="2">
<widget class="QLineEdit" name="createdline"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>GxsIdLabel</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
<string>Created</string>
</property>
</widget>
</item>

View File

@ -34,9 +34,9 @@
#define COLUMN_FILENAME 0
#define COLUMN_SIZE 1
#define COLUMN_TITLE 2
#define COLUMN_PUBLISHED 3
#define COLUMN_STATUS 4
#define COLUMN_STATUS 2
#define COLUMN_TITLE 3
#define COLUMN_PUBLISHED 4
#define COLUMN_COUNT 5
#define COLUMN_DATA 0
@ -107,9 +107,10 @@ void GxsChannelFilesWidget::addFiles(const RsGxsChannelPost &post, bool related)
treeItem->setData(COLUMN_DATA, ROLE_MESSAGE_ID, qVariantFromValue(post.mMeta.mMsgId));
treeItem->setData(COLUMN_DATA, ROLE_FILE_HASH, qVariantFromValue(file.mHash));
treeItem->setData(COLUMN_DATA, ROLE_MSG, QString::fromUtf8(post.mMsg.c_str()));
treeItem->setTextAlignment(COLUMN_SIZE, Qt::AlignRight) ;
ui->treeWidget->addTopLevelItem(treeItem);
QWidget *statusWidget = new GxsChannelFilesStatusWidget(post.mMeta.mGroupId, post.mMeta.mMsgId, file);
ui->treeWidget->setItemWidget(treeItem, COLUMN_STATUS, statusWidget);

View File

@ -300,6 +300,8 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
link = RetroShareLink::createMessage(group.mMeta.mAuthorId, "");
ui->infoAdministrator->setText(link.toHtml());
ui->infoCreated->setText(DateTime::formatLongDateTime(group.mMeta.mPublishTs));
QString distrib_string ( "[unknown]" );
switch(group.mMeta.mCircleType)

View File

@ -344,6 +344,71 @@
<property name="bottomMargin">
<number>9</number>
</property>
<item row="1" column="0">
<widget class="QLabel" name="infoLastPostLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" 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>Last Post:</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="3">
<widget class="QTextBrowser" name="infoDescription">
<property name="html">
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Description&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="openLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="infoDescriptionLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Description:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Created:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="font">
@ -376,82 +441,6 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="infoLastPostLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" 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>Last Post:</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QTextBrowser" name="infoDescription">
<property name="html">
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Description&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="openLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="infoDescriptionLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Description:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="GxsIdLabel" name="infoAdministrator">
<property name="text">
<string>unknown</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="infoPosts">
<property name="text">
<string notr="true">0</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="infoLastPost">
<property name="text">
<string notr="true">unknown</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="font">
@ -465,13 +454,44 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="3" column="1">
<item row="4" column="1" colspan="2">
<widget class="QLabel" name="infoCreated">
<property name="text">
<string>unknown</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QLabel" name="infoDistribution">
<property name="text">
<string>unknown</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="GxsIdLabel" name="infoAdministrator">
<property name="text">
<string>unknown</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QLabel" name="infoLastPost">
<property name="text">
<string notr="true">unknown</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QLabel" name="infoPosts">
<property name="text">
<string notr="true">0</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -532,16 +552,16 @@ p, li { white-space: pre-wrap; }
<zorder>infoWidget</zorder>
</widget>
<customwidgets>
<customwidget>
<class>SubscribeToolButton</class>
<extends>QToolButton</extends>
<header>gui/common/SubscribeToolButton.h</header>
</customwidget>
<customwidget>
<class>GxsIdLabel</class>
<extends>QLabel</extends>
<header>gui/gxs/GxsIdLabel.h</header>
</customwidget>
<customwidget>
<class>SubscribeToolButton</class>
<extends>QToolButton</extends>
<header>gui/common/SubscribeToolButton.h</header>
</customwidget>
<customwidget>
<class>StyledElidedLabel</class>
<extends>QLabel</extends>

View File

@ -1,7 +1,7 @@
<!--/****************************************************************
* This file is distributed under the following license:
*
* Copyright (c) 2008, defnax
* This file is distributed under the following license:
*
* Copyright (c) 2008, defnax
* Copyright (c) 2008, edmanm
*
* This program is free software; you can redistribute it and/or
@ -36,25 +36,49 @@
<h1>The RetroShare Team:</h1>
<p></p>
<h2>Lead Developers</h2>
<h2>RetroShare Founder</h2>
<ul>
<li>&nbsp;<a href="mailto:drbob7@users.sourceforge.net">drbob7</a></li>
<li>&nbsp;<a href="mailto:defnax@users.sourceforge.net">defnax</a></li>
<li>&nbsp;<a href="mailto:csoler@users.sourceforge.net">csoler</a></li>
<li>&nbsp;<a href="mailto:chrisparker126@users.sourceforge.net">chrisparker126</a></li>
<li>&nbsp;<a href="mailto:thunder2@users.sourceforge.net">thunder2</a></li>
</ul>
<h2>Lead Developers</h2>
<ul>
<li>&nbsp;<a href="https://github.com/csoler">csoler</a></li>
<li>&nbsp;<a href="https://github.com/G10h4ck">G10h4ck</a></li>
</ul>
<h2>Packager</h2>
<h2>Active Developers</h2>
<ul>
<li>&nbsp;<a href="mailto:notdefine@users.sourceforge.net">notdefine</a></li>
<li>&nbsp;<a href="mailto:agent725@users.sourceforge.net">agent725</a></li>
<li>&nbsp;<a href="mailto:defnax@users.sourceforge.net">defnax</a></li>
<li>&nbsp;<a href="https://github.com/PhenomRetroShare">Phenom</a></li>
<li>&nbsp;<a href="https://github.com/hunbernd">anmo</a></li>
<li>&nbsp;<a href="mailto:thunder2@users.sourceforge.net">thunder2</a></li>
</ul>
<h2>Developed RetroShare mobile & Emoty</h2>
<ul>
<li>&nbsp;<a href="https://github.com/kdebiec">Konrad</a></li>
</ul>
<h2>RetroChess Developers</h2>
<ul>
<li>&nbsp;<a href="https://github.com/Texas-C">Texas-C</a></li>
<li>&nbsp;<a href="https://github.com/chozabu">Chozabu</a></li>
</ul>
<h2>Developed plugins</h2>
<ul>
<li>&nbsp;<a href="https://github.com/chozabu">Chozabu</a></li>
<li>&nbsp;<a href="https://github.com/electron128">Electron</a></li>
</ul>
<h2>Past Developers</h2>
<ul>
<li>&nbsp;<a href="mailto:chrisparker126@users.sourceforge.net">chrisparker126</a></li>
<li>&nbsp;<a href="mailto:joss17@users.sourceforge.net">joss17</a></li>
<li>&nbsp;<a href="mailto:alexandrut@users.sourceforge.net">alexandrut</a></li>
<li>&nbsp;<a href="mailto:pacman123@users.sourceforge.net">nishant</a></li>
@ -65,7 +89,8 @@
<li>&nbsp;<a href="mailto:rwoodruff91@users.sourceforge.net">rwoodruff91</a></li>
<li>&nbsp;<a href="mailto:raghu-dev@users.sourceforge.net">raghu-dev</a></li>
<li>&nbsp;<a href="mailto:the_mgt@users.sourceforge.net">the_mgt</a></li>
<li>&nbsp;<a href="mailto:notdefine@users.sourceforge.net">notdefine</a></li>
<li>&nbsp;<a href="mailto:agent725@users.sourceforge.net">agent725</a></li>
</ul>
<h2>Developed TLV Serialiser</h2>

View File

@ -67,6 +67,7 @@
<file>icons/mail_red_128.png</file>
<file>icons/newsfeed128.png</file>
<file>icons/outlook.png</file>
<file>icons/question.png</file>
<file>icons/plugins_128.png</file>
<file>icons/png/add.png</file>
<file>icons/png/attach-image.png</file>
@ -115,6 +116,7 @@
<file>icons/png/newsfeed-notify.png</file>
<file>icons/png/newsfeed.png</file>
<file>icons/png/options.png</file>
<file>icons/png/pencil-edit-button.png</file>
<file>icons/png/people-notify.png</file>
<file>icons/png/people.png</file>
<file>icons/png/person.png</file>
@ -132,6 +134,7 @@
<file>icons/png/thumbs-down.png</file>
<file>icons/png/thumbs-neutral.png</file>
<file>icons/png/thumbs-up.png</file>
<file>icons/png/typing.png</file>
<file>icons/png/video.png</file>
<file>icons/posted_128.png</file>
<file>icons/posted_red_128.png</file>
@ -277,6 +280,7 @@
<file>icons/png/comment.png</file>
<file>icons/png/chats.png</file>
<file>icons/png/chats-private.png</file>
<file>icons/png/chats-signed.png</file>
<file>icons/png/fileshare.png</file>
<file>icons/png/forum.png</file>
<file>icons/png/message.png</file>
@ -284,7 +288,6 @@
<file>icons/png/postedlinks.png</file>
<file>icons/png/people2.png</file>
<file>icons/png/bandwidth.png</file>
<file>icons/png/netgraph2.png</file>
<file>icons/png/options2.png</file>
<file>icons/png/exit2.png</file>
</qresource>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -861,3 +861,8 @@ GxsCommentDialog QComboBox#sortBox {
font: bold;
color: #0099cc;
}
PostedListWidget QTextBrowser#infoDescription {
background: transparent;
border: none;
}

View File

@ -57,7 +57,8 @@ CryptoPage::CryptoPage(QWidget * parent, Qt::WindowFlags flags)
// hide profile manager as it causes bugs when generating a new profile.
//ui.profile_Button->hide() ;
connect(ui.createNewNode_PB,SIGNAL(clicked()), this, SLOT(profilemanager()));
connect(ui.exportprofile,SIGNAL(clicked()), this, SLOT(profilemanager()));
ui.onlinesince->setText(DateTime::formatLongDateTime(Rshare::startupTime()));
}
@ -78,6 +79,10 @@ void CryptoPage::showEvent ( QShowEvent * /*event*/ )
ui.pgpid->setText(QString::fromStdString(detail.gpg_id.toStdString()));
ui.pgpfingerprint->setText(misc::fingerPrintStyleSplit(QString::fromStdString(detail.fpr.toStdString())));
std::string invite ;
rsPeers->getShortInvite(invite,rsPeers->getOwnId(),true,false);
ui.retroshareid->setText(QString::fromUtf8(invite.c_str()));
/* set retroshare version */
ui.version->setText(Rshare::retroshareVersion(true));
@ -87,6 +92,16 @@ void CryptoPage::showEvent ( QShowEvent * /*event*/ )
int friends = ids.size();
ui.friendsEdit->setText(QString::number(friends));
QString string ;
string = rsFiles->getPartialsDirectory().c_str();
QString datadir = string;
if(datadir.contains("Partials"))
{
datadir.replace("Partials","");
}
ui.labelpath->setText(datadir);
}
load() ;
}

View File

@ -6,15 +6,15 @@
<rect>
<x>0</x>
<y>0</y>
<width>1531</width>
<height>678</height>
<width>644</width>
<height>459</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -22,15 +22,180 @@
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QFrame" name="frame_1">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<widget class="QGroupBox" name="groupBox_1">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="2">
<item row="6" column="0">
<widget class="QLabel" name="label">
<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">
<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="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">
<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>Location ID:</string>
</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">
<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>Location:</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">
@ -60,64 +225,7 @@
</item>
</layout>
</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="1" column="1">
<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="2" column="0">
<widget class="QLabel" name="label_8">
<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>Location:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="2" column="1" colspan="3">
<widget class="QLabel" name="country">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
@ -136,153 +244,14 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<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>
<item row="14" column="1">
<widget class="QPushButton" name="exportprofile">
<property name="text">
<string>Location ID:</string>
<string>Export</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="peerid">
<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="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="4" column="1">
<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">
<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="5" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>PGP fingerprint:</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_6" columnstretch="0,0,0" columnminimumwidth="0,0,0">
<item row="2" 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="2" 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="3" column="0">
<item row="9" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
@ -301,68 +270,18 @@
</property>
</widget>
</item>
<item row="4" 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>
<item row="11" column="1">
<widget class="QPushButton" name="showStats_PB">
<property name="text">
<string>Online since:</string>
<string>Show statistics</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QLabel" name="version">
<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>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QLabel" name="onlinesince">
<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="1" column="0" colspan="3">
<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">
@ -394,16 +313,211 @@
</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>
</property>
</widget>
</item>
<item row="12" column="0" colspan="3">
<layout class="QGridLayout" name="gridLayout_6">
<property name="topMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="otherIcon_2">
<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="StyledLabel" name="otherLabel_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Profile</string>
</property>
</widget>
</item>
</layout>
</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="9" column="1" colspan="2">
<widget class="QLabel" name="version">
<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>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</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="6" column="1" colspan="3">
<widget class="QLabel" name="retroshareid">
<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="10" column="1" colspan="2">
<widget class="QLabel" name="onlinesince">
<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="13" column="1" colspan="2">
<widget class="QLabel" name="labelpath">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QPushButton" name="showStats_PB">
<property name="text">
<string>show statistics window</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
@ -412,7 +526,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>205</height>
<height>40</height>
</size>
</property>
</spacer>
@ -423,8 +537,8 @@
<attribute name="title">
<string>Certificate</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<widget class="QPlainTextEdit" name="certplainTextEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
@ -451,7 +565,7 @@
</property>
</widget>
</item>
<item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="_includeSignatures_CB">
@ -494,13 +608,6 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="createNewNode_PB">
<property name="text">
<string>Create new node...</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">

View File

@ -38,8 +38,8 @@ QString misc::friendlyUnit(float val)
if(val < 0) {
return tr("Unknown", "Unknown (size)");
}
const QString units[5] = {tr(" B", "bytes"), tr(" KB", "kilobytes (1024 bytes)"), tr(" MB", "megabytes (1024 kilobytes)"), tr(" GB", "gigabytes (1024 megabytes)"), tr(" TB", "terabytes (1024 gigabytes)") };
for(unsigned int i=0; i<5; ++i) {
const QString units[6] = {tr(" B", "bytes"), tr(" KB", "kilobytes (1024 bytes)"), tr(" MB", "megabytes (1024 kilobytes)"), tr(" GB", "gigabytes (1024 megabytes)"), tr(" TB", "terabytes (1024 gigabytes)"), tr(" PB", "petabytes (1024 terabytes)") };
for(unsigned int i=0; i<6; ++i) {
if (val < 1024.) {
return QString(QByteArray::number(val, 'f', 1)) + units[i];
}

View File

@ -303,9 +303,6 @@ int main(int argc, char* argv[])
<< std::endl;
return -result;
}
/* Start-up libretroshare server threads */
RsControl::instance()->StartupRetroShare();
}
#endif // def RS_SERVICE_TERMINAL_LOGIN

View File

@ -581,9 +581,6 @@ android-* {
CONFIG *= no_libresapihttpserver
CONFIG -= libresapihttpserver
CONFIG += no_rs_service_terminal_login
CONFIG += no_rs_service_webui_terminal_password
QT *= androidextras
INCLUDEPATH *= $$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/include
QMAKE_LIBDIR *= "$$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/lib/"