mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 16:39:29 -05:00
Merge branch 'master' of https://github.com/RetroShare/RetroShare
This commit is contained in:
commit
46d4863b09
70
libresapi/src/api/ApiServerLocal.cpp
Normal file
70
libresapi/src/api/ApiServerLocal.cpp
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
#include "ApiServerLocal.h"
|
||||||
|
#include "JsonStream.h"
|
||||||
|
|
||||||
|
namespace resource_api{
|
||||||
|
|
||||||
|
ApiServerLocal::ApiServerLocal(ApiServer* server) : QThread(),
|
||||||
|
mApiServer(server), mLocalServer(this)
|
||||||
|
{
|
||||||
|
start();
|
||||||
|
mLocalServer.removeServer(serverName());
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
mLocalServer.setSocketOptions(QLocalServer::UserAccessOption);
|
||||||
|
#endif
|
||||||
|
connect(&mLocalServer, SIGNAL(newConnection()), this, SLOT(handleConnection()));
|
||||||
|
mLocalServer.listen(serverName());
|
||||||
|
}
|
||||||
|
|
||||||
|
ApiServerLocal::~ApiServerLocal()
|
||||||
|
{
|
||||||
|
mLocalServer.close();
|
||||||
|
quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApiServerLocal::handleConnection()
|
||||||
|
{
|
||||||
|
new ApiLocalConnectionHandler(mApiServer, mLocalServer.nextPendingConnection());
|
||||||
|
}
|
||||||
|
|
||||||
|
ApiLocalConnectionHandler::ApiLocalConnectionHandler(ApiServer* apiServer, QLocalSocket* sock) :
|
||||||
|
QThread(), mApiServer(apiServer), mLocalSocket(sock)
|
||||||
|
{
|
||||||
|
sock->moveToThread(this);
|
||||||
|
connect(this, SIGNAL(finished()), this, SLOT(deleteLater()));
|
||||||
|
connect(mLocalSocket, SIGNAL(disconnected()), this, SLOT(quit()));
|
||||||
|
connect(sock, SIGNAL(readyRead()), this, SLOT(handleRequest()));
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApiLocalConnectionHandler::handleRequest()
|
||||||
|
{
|
||||||
|
char path[1024];
|
||||||
|
if(mLocalSocket->readLine(path, 1023) > 0)
|
||||||
|
{
|
||||||
|
reqPath = path;
|
||||||
|
char jsonData[20480];
|
||||||
|
if(mLocalSocket->read(jsonData, 20479) > 0)
|
||||||
|
{
|
||||||
|
resource_api::JsonStream reqJson;
|
||||||
|
reqJson.setJsonString(std::string(jsonData));
|
||||||
|
resource_api::Request req(reqJson);
|
||||||
|
req.setPath(reqPath);
|
||||||
|
std::string resultString = mApiServer->handleRequest(req);
|
||||||
|
mLocalSocket->write(resultString.c_str(), resultString.length());
|
||||||
|
mLocalSocket->write("\n\0");
|
||||||
|
}
|
||||||
|
else mLocalSocket->write("\"{\"data\":null,\"debug_msg\":\"ApiLocalConnectionHandler::handleRequest() Error: timeout waiting for path.\\n\",\"returncode\":\"fail\"}\"\n\0");
|
||||||
|
}
|
||||||
|
else mLocalSocket->write("{\"data\":null,\"debug_msg\":\"ApiLocalConnectionHandler::handleRequest() Error: timeout waiting for JSON data.\\n\",\"returncode\":\"fail\"}\"\n\0");
|
||||||
|
|
||||||
|
quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
ApiLocalConnectionHandler::~ApiLocalConnectionHandler()
|
||||||
|
{
|
||||||
|
mLocalSocket->flush();
|
||||||
|
mLocalSocket->close();
|
||||||
|
mLocalSocket->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace resource_api
|
57
libresapi/src/api/ApiServerLocal.h
Normal file
57
libresapi/src/api/ApiServerLocal.h
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QLocalServer>
|
||||||
|
#include <QString>
|
||||||
|
#include <QThread>
|
||||||
|
#include <QLocalSocket>
|
||||||
|
#include <retroshare/rsinit.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "ApiServer.h"
|
||||||
|
|
||||||
|
namespace resource_api
|
||||||
|
{
|
||||||
|
class ApiServer;
|
||||||
|
|
||||||
|
class ApiServerLocal : public QThread
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
ApiServerLocal(ApiServer* server);
|
||||||
|
~ApiServerLocal();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void handleConnection();
|
||||||
|
|
||||||
|
private:
|
||||||
|
ApiServer* mApiServer;
|
||||||
|
QLocalServer mLocalServer;
|
||||||
|
|
||||||
|
const static QString& serverName()
|
||||||
|
{
|
||||||
|
const static QString sockPath(RsAccounts::AccountDirectory()
|
||||||
|
.append("/libresapi.sock").c_str());
|
||||||
|
return sockPath;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class ApiLocalConnectionHandler : public QThread
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
ApiLocalConnectionHandler(ApiServer* apiServer, QLocalSocket* sock);
|
||||||
|
~ApiLocalConnectionHandler();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void handleRequest();
|
||||||
|
|
||||||
|
private:
|
||||||
|
ApiServer* mApiServer;
|
||||||
|
QLocalSocket* mLocalSocket;
|
||||||
|
std::string reqPath;
|
||||||
|
void _die();
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace resource_api
|
@ -559,7 +559,7 @@ int ApiServerMHD::accessHandlerCallback(MHD_Connection *connection,
|
|||||||
return ((MHDHandlerBase*)(*con_cls))->handleRequest(connection, url, method, version, upload_data, upload_data_size);
|
return ((MHDHandlerBase*)(*con_cls))->handleRequest(connection, url, method, version, upload_data, upload_data_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
// these characters are not allowe in the url, raise an error if they occur
|
// these characters are not allowed in the url, raise an error if they occur
|
||||||
// reason: don't want to serve files outside the current document root
|
// reason: don't want to serve files outside the current document root
|
||||||
const char *double_dots = "..";
|
const char *double_dots = "..";
|
||||||
if(strstr(url, double_dots))
|
if(strstr(url, double_dots))
|
||||||
|
@ -193,6 +193,33 @@ public:
|
|||||||
// then each handler should pop the top element
|
// then each handler should pop the top element
|
||||||
std::stack<std::string> mPath;
|
std::stack<std::string> mPath;
|
||||||
std::string mFullPath;
|
std::string mFullPath;
|
||||||
|
bool setPath(std::string reqPath)
|
||||||
|
{
|
||||||
|
std::string str;
|
||||||
|
for(std::string::reverse_iterator sit = reqPath.rbegin(); sit != reqPath.rend(); sit++)
|
||||||
|
{
|
||||||
|
if((*sit) != '/')
|
||||||
|
{
|
||||||
|
// add to front because we are traveling in reverse order
|
||||||
|
str = *sit + str;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(str != "")
|
||||||
|
{
|
||||||
|
mPath.push(str);
|
||||||
|
str.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(str != "")
|
||||||
|
{
|
||||||
|
mPath.push(str);
|
||||||
|
}
|
||||||
|
mFullPath = reqPath;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// parameters should be used to influence the result
|
// parameters should be used to influence the result
|
||||||
// for example include or exclude some information
|
// for example include or exclude some information
|
||||||
|
@ -8,11 +8,12 @@ TARGET = resapi
|
|||||||
TARGET_PRL = libresapi
|
TARGET_PRL = libresapi
|
||||||
DESTDIR = lib
|
DESTDIR = lib
|
||||||
|
|
||||||
CONFIG += libmicrohttpd
|
|
||||||
|
|
||||||
INCLUDEPATH += ../../libretroshare/src
|
INCLUDEPATH += ../../libretroshare/src
|
||||||
|
|
||||||
unix {
|
libresapihttpserver {
|
||||||
|
CONFIG += libmicrohttpd
|
||||||
|
|
||||||
|
unix {
|
||||||
|
|
||||||
webui_files.path = "$${DATA_DIR}/webui"
|
webui_files.path = "$${DATA_DIR}/webui"
|
||||||
webui_files.files = webui/app.js webui/app.css webui/index.html
|
webui_files.files = webui/app.js webui/app.css webui/index.html
|
||||||
@ -81,9 +82,9 @@ unix {
|
|||||||
|
|
||||||
|
|
||||||
QMAKE_EXTRA_COMPILERS += create_webfiles_html create_webfiles_js create_webfiles_css
|
QMAKE_EXTRA_COMPILERS += create_webfiles_html create_webfiles_js create_webfiles_css
|
||||||
}
|
}
|
||||||
|
|
||||||
win32{
|
win32 {
|
||||||
DEFINES *= WINDOWS_SYS
|
DEFINES *= WINDOWS_SYS
|
||||||
INCLUDEPATH += . $$INC_DIR
|
INCLUDEPATH += . $$INC_DIR
|
||||||
|
|
||||||
@ -104,9 +105,8 @@ win32{
|
|||||||
|
|
||||||
# create dummy files
|
# create dummy files
|
||||||
system($$MAKE_SRC\\init.bat .)
|
system($$MAKE_SRC\\init.bat .)
|
||||||
}
|
}
|
||||||
|
|
||||||
libmicrohttpd{
|
|
||||||
linux {
|
linux {
|
||||||
CONFIG += link_pkgconfig
|
CONFIG += link_pkgconfig
|
||||||
PKGCONFIG *= libmicrohttpd
|
PKGCONFIG *= libmicrohttpd
|
||||||
@ -173,3 +173,10 @@ HEADERS += \
|
|||||||
util/ContentTypes.h \
|
util/ContentTypes.h \
|
||||||
api/ApiPluginHandler.h \
|
api/ApiPluginHandler.h \
|
||||||
api/ChannelsHandler.h
|
api/ChannelsHandler.h
|
||||||
|
|
||||||
|
libresapilocalserver {
|
||||||
|
CONFIG *= qt
|
||||||
|
QT *= network
|
||||||
|
SOURCES *= api/ApiServerLocal.cpp
|
||||||
|
HEADERS *= api/ApiServerLocal.h
|
||||||
|
}
|
||||||
|
@ -712,25 +712,25 @@ int RsDataService::storeMessage(std::map<RsNxsMsg *, RsGxsMsgMetaData *> &msg)
|
|||||||
// start a transaction
|
// start a transaction
|
||||||
mDb->beginTransaction();
|
mDb->beginTransaction();
|
||||||
|
|
||||||
for(; mit != msg.end(); ++mit){
|
for(; mit != msg.end(); ++mit)
|
||||||
|
{
|
||||||
RsNxsMsg* msgPtr = mit->first;
|
RsNxsMsg* msgPtr = mit->first;
|
||||||
RsGxsMsgMetaData* msgMetaPtr = mit->second;
|
RsGxsMsgMetaData* msgMetaPtr = mit->second;
|
||||||
|
|
||||||
#ifdef RS_DATA_SERVICE_DEBUG
|
#ifdef RS_DATA_SERVICE_DEBUG
|
||||||
std::cerr << "RsDataService::storeMessage() ";
|
std::cerr << "RsDataService::storeMessage() ";
|
||||||
std::cerr << " GroupId: " << msgMetaPtr->mGroupId.toStdString();
|
std::cerr << " GroupId: " << msgMetaPtr->mGroupId.toStdString();
|
||||||
std::cerr << " MessageId: " << msgMetaPtr->mMsgId.toStdString();
|
std::cerr << " MessageId: " << msgMetaPtr->mMsgId.toStdString();
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// skip msg item if size if greater than
|
// skip msg item if size if greater than
|
||||||
if(!validSize(msgPtr))
|
if(!validSize(msgPtr))
|
||||||
{
|
{
|
||||||
std::cerr << "RsDataService::storeMessage() ERROR invalid size";
|
std::cerr << "RsDataService::storeMessage() ERROR invalid size";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentValue cv;
|
ContentValue cv;
|
||||||
|
|
||||||
@ -773,14 +773,18 @@ int RsDataService::storeMessage(std::map<RsNxsMsg *, RsGxsMsgMetaData *> &msg)
|
|||||||
cv.put(KEY_CHILD_TS, (int32_t)msgMetaPtr->mChildTs);
|
cv.put(KEY_CHILD_TS, (int32_t)msgMetaPtr->mChildTs);
|
||||||
|
|
||||||
if (!mDb->sqlInsert(MSG_TABLE_NAME, "", cv))
|
if (!mDb->sqlInsert(MSG_TABLE_NAME, "", cv))
|
||||||
{
|
{
|
||||||
std::cerr << "RsDataService::storeMessage() sqlInsert Failed";
|
std::cerr << "RsDataService::storeMessage() sqlInsert Failed";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
std::cerr << "\t For GroupId: " << msgMetaPtr->mGroupId.toStdString();
|
std::cerr << "\t For GroupId: " << msgMetaPtr->mGroupId.toStdString();
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
std::cerr << "\t & MessageId: " << msgMetaPtr->mMsgId.toStdString();
|
std::cerr << "\t & MessageId: " << msgMetaPtr->mMsgId.toStdString();
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is needed so that mLastPost is correctly updated in the group meta when it is re-loaded.
|
||||||
|
|
||||||
|
locked_clearGrpMetaCache(msgMetaPtr->mGroupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// finish transaction
|
// finish transaction
|
||||||
|
@ -2019,6 +2019,9 @@ void RsGenExchange::publishMsgs()
|
|||||||
|
|
||||||
delete[] metaDataBuff;
|
delete[] metaDataBuff;
|
||||||
|
|
||||||
|
if(mNetService != NULL)
|
||||||
|
mNetService->stampMsgServerUpdateTS(grpId) ;
|
||||||
|
|
||||||
// add to published to allow acknowledgement
|
// add to published to allow acknowledgement
|
||||||
mMsgNotify.insert(std::make_pair(mit->first, std::make_pair(grpId, msgId)));
|
mMsgNotify.insert(std::make_pair(mit->first, std::make_pair(grpId, msgId)));
|
||||||
mDataAccess->updatePublicRequestStatus(mit->first, RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE);
|
mDataAccess->updatePublicRequestStatus(mit->first, RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE);
|
||||||
|
@ -595,6 +595,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
void setGroupReputationCutOff(uint32_t& token, const RsGxsGroupId& grpId, int CutOff);
|
void setGroupReputationCutOff(uint32_t& token, const RsGxsGroupId& grpId, int CutOff);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*
|
||||||
|
* @param token value set to be redeemed with acknowledgement
|
||||||
|
* @param grpId group id of the group to update
|
||||||
|
* @param CutOff The cut off value to set
|
||||||
|
*/
|
||||||
|
void updateGroupLastMsgTimeStamp(uint32_t& token, const RsGxsGroupId& grpId);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @return storage time of messages in months
|
* @return storage time of messages in months
|
||||||
*/
|
*/
|
||||||
|
@ -761,11 +761,11 @@ void RsGxsNetService::syncWithPeers()
|
|||||||
msg->updateTS = updateTS;
|
msg->updateTS = updateTS;
|
||||||
|
|
||||||
if(encrypt_to_this_circle_id.isNull())
|
if(encrypt_to_this_circle_id.isNull())
|
||||||
msg->grpId = grpId;
|
msg->grpId = grpId;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg->grpId = hashGrpId(grpId,mNetMgr->getOwnId()) ;
|
msg->grpId = hashGrpId(grpId,mNetMgr->getOwnId()) ;
|
||||||
msg->flag |= RsNxsSyncMsgReqItem::FLAG_USE_HASHED_GROUP_ID ;
|
msg->flag |= RsNxsSyncMsgReqItem::FLAG_USE_HASHED_GROUP_ID ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NXS_NET_DEBUG_7
|
#ifdef NXS_NET_DEBUG_7
|
||||||
@ -2096,14 +2096,19 @@ void RsGxsNetService::updateServerSyncTS()
|
|||||||
else
|
else
|
||||||
msui = mapIT->second;
|
msui = mapIT->second;
|
||||||
|
|
||||||
if(grpMeta->mLastPost > msui->msgUpdateTS )
|
// (cyril) I'm removing this, because the msgUpdateTS is updated when new messages are received by calling locked_stampMsgServerUpdateTS().
|
||||||
{
|
// mLastPost is actually updated somewhere when loading group meta data. It's not clear yet whether it is set to the latest publish time (wrong)
|
||||||
change = true;
|
// or the latest receive time (right). The former would cause problems because it would need to compare times coming from different (potentially async-ed)
|
||||||
msui->msgUpdateTS = grpMeta->mLastPost;
|
// machines.
|
||||||
|
//
|
||||||
|
// if(grpMeta->mLastPost > msui->msgUpdateTS )
|
||||||
|
// {
|
||||||
|
// change = true;
|
||||||
|
// msui->msgUpdateTS = grpMeta->mLastPost;
|
||||||
#ifdef NXS_NET_DEBUG_0
|
#ifdef NXS_NET_DEBUG_0
|
||||||
GXSNETDEBUG__G(grpId) << " updated msgUpdateTS to last post = " << time(NULL) - grpMeta->mLastPost << " secs ago for group "<< grpId << std::endl;
|
// GXSNETDEBUG__G(grpId) << " updated msgUpdateTS to last post = " << time(NULL) - grpMeta->mLastPost << " secs ago for group "<< grpId << std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
// }
|
||||||
|
|
||||||
// This is needed for group metadata updates to actually propagate: only a new grpUpdateTS will trigger the exchange of groups mPublishTs which
|
// This is needed for group metadata updates to actually propagate: only a new grpUpdateTS will trigger the exchange of groups mPublishTs which
|
||||||
// will then be compared and pssibly trigger a MetaData transmission. mRecvTS is upated when creating, receiving for the first time, or receiving
|
// will then be compared and pssibly trigger a MetaData transmission. mRecvTS is upated when creating, receiving for the first time, or receiving
|
||||||
@ -2123,6 +2128,7 @@ void RsGxsNetService::updateServerSyncTS()
|
|||||||
if(change)
|
if(change)
|
||||||
IndicateConfigChanged();
|
IndicateConfigChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RsGxsNetService::locked_checkTransacTimedOut(NxsTransaction* tr)
|
bool RsGxsNetService::locked_checkTransacTimedOut(NxsTransaction* tr)
|
||||||
{
|
{
|
||||||
return tr->mTimeOut < ((uint32_t) time(NULL));
|
return tr->mTimeOut < ((uint32_t) time(NULL));
|
||||||
@ -2595,6 +2601,8 @@ void RsGxsNetService::locked_processCompletedIncomingTrans(NxsTransaction* tr)
|
|||||||
// for the grp id
|
// for the grp id
|
||||||
locked_doMsgUpdateWork(tr->mTransaction, grpId);
|
locked_doMsgUpdateWork(tr->mTransaction, grpId);
|
||||||
|
|
||||||
|
// also update server sync TS, since we need to send the new message list to friends for comparison
|
||||||
|
locked_stampMsgServerUpdateTS(grpId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(tr->mFlag == NxsTransaction::FLAG_STATE_FAILED)
|
else if(tr->mFlag == NxsTransaction::FLAG_STATE_FAILED)
|
||||||
@ -4891,3 +4899,26 @@ bool RsGxsNetService::getGroupServerUpdateTS(const RsGxsGroupId& gid,time_t& gro
|
|||||||
|
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool RsGxsNetService::stampMsgServerUpdateTS(const RsGxsGroupId& gid)
|
||||||
|
{
|
||||||
|
RS_STACK_MUTEX(mNxsMutex) ;
|
||||||
|
|
||||||
|
return locked_stampMsgServerUpdateTS(gid) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RsGxsNetService::locked_stampMsgServerUpdateTS(const RsGxsGroupId& gid)
|
||||||
|
{
|
||||||
|
std::map<RsGxsGroupId,RsGxsServerMsgUpdateItem*>::iterator it = mServerMsgUpdateMap.find(gid) ;
|
||||||
|
|
||||||
|
if(mServerMsgUpdateMap.end() == it)
|
||||||
|
{
|
||||||
|
RsGxsServerMsgUpdateItem *item = new RsGxsServerMsgUpdateItem(mServType);
|
||||||
|
item->grpId = gid ;
|
||||||
|
item->msgUpdateTS = time(NULL) ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
it->second->msgUpdateTS = time(NULL) ;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@ -155,7 +155,8 @@ public:
|
|||||||
virtual void rejectMessage(const RsGxsMessageId& msg_id) ;
|
virtual void rejectMessage(const RsGxsMessageId& msg_id) ;
|
||||||
|
|
||||||
virtual bool getGroupServerUpdateTS(const RsGxsGroupId& gid,time_t& grp_server_update_TS,time_t& msg_server_update_TS) ;
|
virtual bool getGroupServerUpdateTS(const RsGxsGroupId& gid,time_t& grp_server_update_TS,time_t& msg_server_update_TS) ;
|
||||||
|
virtual bool stampMsgServerUpdateTS(const RsGxsGroupId& gid) ;
|
||||||
|
|
||||||
/* p3Config methods */
|
/* p3Config methods */
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -228,6 +229,13 @@ private:
|
|||||||
*/
|
*/
|
||||||
void locked_completeTransaction(NxsTransaction* trans);
|
void locked_completeTransaction(NxsTransaction* trans);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief locked_stampMsgServerUpdateTS
|
||||||
|
* updates the server msg time stamp. This function is the locked method for the one above with similar name
|
||||||
|
* \param gid group id to stamp.
|
||||||
|
* \return
|
||||||
|
*/
|
||||||
|
bool locked_stampMsgServerUpdateTS(const RsGxsGroupId& gid);
|
||||||
/*!
|
/*!
|
||||||
* This retrieves a unique transaction id that
|
* This retrieves a unique transaction id that
|
||||||
* can be used in an outgoing transaction
|
* can be used in an outgoing transaction
|
||||||
|
@ -144,6 +144,15 @@ public:
|
|||||||
* \return false if the group is not found, true otherwise
|
* \return false if the group is not found, true otherwise
|
||||||
*/
|
*/
|
||||||
virtual bool getGroupServerUpdateTS(const RsGxsGroupId& gid,time_t& grp_server_update_TS,time_t& msg_server_update_TS) =0;
|
virtual bool getGroupServerUpdateTS(const RsGxsGroupId& gid,time_t& grp_server_update_TS,time_t& msg_server_update_TS) =0;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief stampMsgServerUpdateTS
|
||||||
|
* Updates the msgServerUpdateMap structure to time(NULL), so as to trigger sending msg lists to friends.
|
||||||
|
* This is needed when e.g. posting a new message to a group.
|
||||||
|
* \param gid the group to stamp in msgServerUpdateMap
|
||||||
|
* \return
|
||||||
|
*/
|
||||||
|
virtual bool stampMsgServerUpdateTS(const RsGxsGroupId& gid) =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RSGNP_H
|
#endif // RSGNP_H
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifndef WINDOWS_SYS
|
#if !defined(WINDOWS_SYS) && !defined(__ANDROID__)
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
@ -110,13 +110,13 @@ static inline void print_stacktrace(FILE *out = stderr, unsigned int max_frames
|
|||||||
free(symbollist);
|
free(symbollist);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // WINDOWS_SYS
|
#else // !defined(WINDOWS_SYS) && !defined(__ANDROID__)
|
||||||
static inline void print_stacktrace(FILE *out = stderr, unsigned int max_frames = 63)
|
static inline void print_stacktrace(FILE *out = stderr, unsigned int max_frames = 63)
|
||||||
{
|
{
|
||||||
(void) max_frames;
|
(void) max_frames;
|
||||||
|
|
||||||
fprintf(out, "TODO: 2016/01/01 print_stacktrace not implemented yet for WINDOWS_SYS\n");
|
fprintf(out, "TODO: 2016/01/01 print_stacktrace not implemented yet for WINDOWS_SYS and ANDROID\n");
|
||||||
}
|
}
|
||||||
#endif // WINDOWS_SYS
|
#endif // !defined(WINDOWS_SYS) && !defined(__ANDROID__)
|
||||||
|
|
||||||
#endif // _STACKTRACE_H_
|
#endif // _STACKTRACE_H_
|
||||||
|
@ -29,7 +29,10 @@
|
|||||||
#include <retroshare/rsdisc.h>
|
#include <retroshare/rsdisc.h>
|
||||||
#include <retroshare/rspeers.h>
|
#include <retroshare/rspeers.h>
|
||||||
#include "settings/rsharesettings.h"
|
#include "settings/rsharesettings.h"
|
||||||
|
|
||||||
|
#ifdef ENABLE_WEBUI
|
||||||
#include <microhttpd.h>
|
#include <microhttpd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
@ -781,11 +784,13 @@ void AboutDialog::on_copy_button_clicked()
|
|||||||
RsControl::instance()->getLibraries(libraries);
|
RsControl::instance()->getLibraries(libraries);
|
||||||
verInfo+=addLibraries("libretroshare", libraries);
|
verInfo+=addLibraries("libretroshare", libraries);
|
||||||
|
|
||||||
|
#ifdef ENABLE_WEBUI
|
||||||
/* Add version numbers of RetroShare */
|
/* Add version numbers of RetroShare */
|
||||||
// Add versions here. Find a better place.
|
// Add versions here. Find a better place.
|
||||||
libraries.clear();
|
libraries.clear();
|
||||||
libraries.push_back(RsLibraryInfo("Libmicrohttpd", MHD_get_version()));
|
libraries.push_back(RsLibraryInfo("Libmicrohttpd", MHD_get_version()));
|
||||||
verInfo+=addLibraries("RetroShare", libraries);
|
verInfo+=addLibraries("RetroShare", libraries);
|
||||||
|
#endif // ENABLE_WEBUI
|
||||||
|
|
||||||
/* Add version numbers of plugins */
|
/* Add version numbers of plugins */
|
||||||
if (rsPlugins) {
|
if (rsPlugins) {
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#include <util/rsrandom.h>
|
#include <util/rsrandom.h>
|
||||||
#include <retroshare/rsinit.h>
|
#include <retroshare/rsinit.h>
|
||||||
#include <rsserver/rsaccounts.h>
|
#include <rsserver/rsaccounts.h>
|
||||||
|
#include "gui/settings/rsharesettings.h"
|
||||||
|
#include "util/misc.h"
|
||||||
#include "GenCertDialog.h"
|
#include "GenCertDialog.h"
|
||||||
#include <QAbstractEventDispatcher>
|
#include <QAbstractEventDispatcher>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
@ -402,8 +404,8 @@ void GenCertDialog::exportIdentity()
|
|||||||
{
|
{
|
||||||
QString fname = QFileDialog::getSaveFileName(this,tr("Export profile"), "",tr("RetroShare profile files (*.asc)")) ;
|
QString fname = QFileDialog::getSaveFileName(this,tr("Export profile"), "",tr("RetroShare profile files (*.asc)")) ;
|
||||||
|
|
||||||
if(fname.isNull())
|
if(fname.isNull()) return ;
|
||||||
return ;
|
if(fname.right(4).toUpper() != ".ASC") fname += ".asc";
|
||||||
|
|
||||||
QVariant data = ui.genPGPuser->itemData(ui.genPGPuser->currentIndex());
|
QVariant data = ui.genPGPuser->itemData(ui.genPGPuser->currentIndex());
|
||||||
RsPgpId gpg_id (data.toString().toStdString()) ;
|
RsPgpId gpg_id (data.toString().toStdString()) ;
|
||||||
@ -416,7 +418,9 @@ void GenCertDialog::exportIdentity()
|
|||||||
|
|
||||||
void GenCertDialog::importIdentity()
|
void GenCertDialog::importIdentity()
|
||||||
{
|
{
|
||||||
QString fname = QFileDialog::getOpenFileName(this,tr("Import profile"), "",tr("RetroShare profile files (*.asc)")) ;
|
QString fname ;
|
||||||
|
if(!misc::getOpenFileName(this,RshareSettings::LASTDIR_CERT,tr("Import profile"), tr("RetroShare profile files (*.asc);;All files (*)"),fname))
|
||||||
|
return ;
|
||||||
|
|
||||||
if(fname.isNull())
|
if(fname.isNull())
|
||||||
return ;
|
return ;
|
||||||
|
@ -24,7 +24,10 @@
|
|||||||
|
|
||||||
#include <retroshare/rsiface.h>
|
#include <retroshare/rsiface.h>
|
||||||
#include <retroshare/rsplugin.h>
|
#include <retroshare/rsplugin.h>
|
||||||
|
|
||||||
|
#ifdef ENABLE_WEBUI
|
||||||
#include <microhttpd.h>
|
#include <microhttpd.h>
|
||||||
|
#endif // ENABLE_WEBUI
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
@ -94,11 +97,13 @@ HelpDialog::HelpDialog(QWidget *parent) :
|
|||||||
RsControl::instance()->getLibraries(libraries);
|
RsControl::instance()->getLibraries(libraries);
|
||||||
addLibraries(ui->libraryLayout, "libretroshare", libraries);
|
addLibraries(ui->libraryLayout, "libretroshare", libraries);
|
||||||
|
|
||||||
|
#ifdef ENABLE_WEBUI
|
||||||
/* Add version numbers of RetroShare */
|
/* Add version numbers of RetroShare */
|
||||||
// Add versions here. Find a better place.
|
// Add versions here. Find a better place.
|
||||||
libraries.clear();
|
libraries.clear();
|
||||||
libraries.push_back(RsLibraryInfo("Libmicrohttpd", MHD_get_version()));
|
libraries.push_back(RsLibraryInfo("Libmicrohttpd", MHD_get_version()));
|
||||||
addLibraries(ui->libraryLayout, "RetroShare", libraries);
|
addLibraries(ui->libraryLayout, "RetroShare", libraries);
|
||||||
|
#endif // ENABLE_WEBUI
|
||||||
|
|
||||||
/* Add version numbers of plugins */
|
/* Add version numbers of plugins */
|
||||||
if (rsPlugins) {
|
if (rsPlugins) {
|
||||||
|
@ -225,7 +225,6 @@ IdDialog::IdDialog(QWidget *parent) :
|
|||||||
|
|
||||||
/* Add filter types */
|
/* Add filter types */
|
||||||
QMenu *idTWHMenu = new QMenu(tr("Show"), this);
|
QMenu *idTWHMenu = new QMenu(tr("Show"), this);
|
||||||
idTWHMenu->setVisible(true);
|
|
||||||
ui->idTreeWidget->addHeaderContextMenuMenu(idTWHMenu);
|
ui->idTreeWidget->addHeaderContextMenuMenu(idTWHMenu);
|
||||||
|
|
||||||
QActionGroup *idTWHActionGroup = new QActionGroup(this);
|
QActionGroup *idTWHActionGroup = new QActionGroup(this);
|
||||||
|
@ -562,7 +562,9 @@ void MainWindow::createTrayIcon()
|
|||||||
trayMenu->addSeparator();
|
trayMenu->addSeparator();
|
||||||
trayMenu->addAction(QIcon(IMAGE_MESSENGER), tr("Open Messenger"), this, SLOT(showMessengerWindow()));
|
trayMenu->addAction(QIcon(IMAGE_MESSENGER), tr("Open Messenger"), this, SLOT(showMessengerWindow()));
|
||||||
trayMenu->addAction(QIcon(IMAGE_MESSAGES), tr("Open Messages"), this, SLOT(showMess()));
|
trayMenu->addAction(QIcon(IMAGE_MESSAGES), tr("Open Messages"), this, SLOT(showMess()));
|
||||||
|
#ifdef ENABLE_WEBUI
|
||||||
trayMenu->addAction(QIcon(":/images/emblem-web.png"), tr("Show web interface"), this, SLOT(showWebinterface()));
|
trayMenu->addAction(QIcon(":/images/emblem-web.png"), tr("Show web interface"), this, SLOT(showWebinterface()));
|
||||||
|
#endif // ENABLE_WEBUI
|
||||||
trayMenu->addAction(QIcon(IMAGE_BWGRAPH), tr("Bandwidth Graph"), _bandwidthGraph, SLOT(showWindow()));
|
trayMenu->addAction(QIcon(IMAGE_BWGRAPH), tr("Bandwidth Graph"), _bandwidthGraph, SLOT(showWindow()));
|
||||||
trayMenu->addAction(QIcon(IMAGE_DHT), tr("Statistics"), this, SLOT(showStatisticsWindow()));
|
trayMenu->addAction(QIcon(IMAGE_DHT), tr("Statistics"), this, SLOT(showStatisticsWindow()));
|
||||||
|
|
||||||
@ -1061,10 +1063,12 @@ void MainWindow::showStatisticsWindow()
|
|||||||
StatisticsWindow::showYourself();
|
StatisticsWindow::showYourself();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_WEBUI
|
||||||
void MainWindow::showWebinterface()
|
void MainWindow::showWebinterface()
|
||||||
{
|
{
|
||||||
WebuiPage::showWebui();
|
WebuiPage::showWebui();
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_WEBUI
|
||||||
|
|
||||||
/** Shows Application window */
|
/** Shows Application window */
|
||||||
#ifdef UNFINISHED
|
#ifdef UNFINISHED
|
||||||
|
@ -211,7 +211,9 @@ private slots:
|
|||||||
void newRsCollection();
|
void newRsCollection();
|
||||||
void showMessengerWindow();
|
void showMessengerWindow();
|
||||||
void showStatisticsWindow();
|
void showStatisticsWindow();
|
||||||
|
#ifdef ENABLE_WEBUI
|
||||||
void showWebinterface();
|
void showWebinterface();
|
||||||
|
#endif
|
||||||
//void servicePermission();
|
//void servicePermission();
|
||||||
|
|
||||||
#ifdef UNFINISHED
|
#ifdef UNFINISHED
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
#include "PluginManagerWidget.h"
|
#include "PluginManagerWidget.h"
|
||||||
|
#include "gui/settings/rsharesettings.h"
|
||||||
|
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
@ -160,14 +161,10 @@ PluginManagerWidget::registerNewPlugin(QString pluginName)
|
|||||||
void
|
void
|
||||||
PluginManagerWidget::installPluginButtonClicked()
|
PluginManagerWidget::installPluginButtonClicked()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getOpenFileName(this,
|
QString fileName = misc::getOpenFileName(this, RshareSettings::LASTDIR_PLUGIN, tr("Open Plugin to install"), "./", tr("Plugins (*.so *.dll)"));
|
||||||
tr("Open Plugin to install"),
|
|
||||||
"./",
|
|
||||||
tr("Plugins (*.so *.dll)"));
|
|
||||||
if (!fileName.isNull())
|
if (!fileName.isNull())
|
||||||
{
|
|
||||||
emit installPluginRequested(fileName);
|
emit installPluginRequested(fileName);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -135,8 +135,15 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi
|
|||||||
RsGxsId current_id;
|
RsGxsId current_id;
|
||||||
rsMsgs->getIdentityForChatLobby(lobbyId, current_id);
|
rsMsgs->getIdentityForChatLobby(lobbyId, current_id);
|
||||||
|
|
||||||
|
uint32_t idChooserFlag = IDCHOOSER_ID_REQUIRED;
|
||||||
|
ChatLobbyInfo lobbyInfo ;
|
||||||
|
if(rsMsgs->getChatLobbyInfo(lobbyId,lobbyInfo)) {
|
||||||
|
if (lobbyInfo.lobby_flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED) {
|
||||||
|
idChooserFlag |= IDCHOOSER_NON_ANONYMOUS;
|
||||||
|
}
|
||||||
|
}
|
||||||
ownIdChooser = new GxsIdChooser() ;
|
ownIdChooser = new GxsIdChooser() ;
|
||||||
ownIdChooser->loadIds(IDCHOOSER_ID_REQUIRED,current_id) ;
|
ownIdChooser->loadIds(idChooserFlag, current_id) ;
|
||||||
|
|
||||||
QWidgetAction *checkableAction = new QWidgetAction(this);
|
QWidgetAction *checkableAction = new QWidgetAction(this);
|
||||||
checkableAction->setDefaultWidget(ownIdChooser);
|
checkableAction->setDefaultWidget(ownIdChooser);
|
||||||
@ -281,8 +288,6 @@ void ChatLobbyDialog::init()
|
|||||||
|
|
||||||
QString title;
|
QString title;
|
||||||
|
|
||||||
std::list<ChatLobbyInfo>::const_iterator lobbyIt;
|
|
||||||
|
|
||||||
if(rsMsgs->getChatLobbyInfo(lobbyId,linfo))
|
if(rsMsgs->getChatLobbyInfo(lobbyId,linfo))
|
||||||
{
|
{
|
||||||
title = QString::fromUtf8(linfo.lobby_name.c_str());
|
title = QString::fromUtf8(linfo.lobby_name.c_str());
|
||||||
|
@ -187,8 +187,9 @@ void FriendList::addToolButton(QToolButton *toolButton)
|
|||||||
|
|
||||||
/* Initialize button */
|
/* Initialize button */
|
||||||
toolButton->setAutoRaise(true);
|
toolButton->setAutoRaise(true);
|
||||||
toolButton->setIconSize(ui->displayButton->iconSize());
|
float S = QFontMetricsF(ui->filterLineEdit->font()).height() ;
|
||||||
toolButton->setFocusPolicy(ui->displayButton->focusPolicy());
|
toolButton->setIconSize(QSize(S*1.5,S*1.5));
|
||||||
|
toolButton->setFocusPolicy(Qt::NoFocus);
|
||||||
|
|
||||||
ui->titleBarFrame->layout()->addWidget(toolButton);
|
ui->titleBarFrame->layout()->addWidget(toolButton);
|
||||||
}
|
}
|
||||||
@ -1176,9 +1177,9 @@ void FriendList::insertPeers()
|
|||||||
gpgItem->setData(COLUMN_NAME, ROLE_FILTER, gpgName);
|
gpgItem->setData(COLUMN_NAME, ROLE_FILTER, gpgName);
|
||||||
|
|
||||||
gpgItem->setData(COLUMN_LAST_CONTACT, Qt::DisplayRole, showInfoAtGpgItem ? QVariant(bestLastContact) : "");
|
gpgItem->setData(COLUMN_LAST_CONTACT, Qt::DisplayRole, showInfoAtGpgItem ? QVariant(bestLastContact) : "");
|
||||||
gpgItem->setData(COLUMN_LAST_CONTACT, ROLE_SORT_NAME, showInfoAtGpgItem ? QVariant(bestLastContact) : "");
|
gpgItem->setData(COLUMN_LAST_CONTACT, ROLE_SORT_NAME, QVariant(bestLastContact));
|
||||||
gpgItem->setText(COLUMN_IP, showInfoAtGpgItem ? bestIP : "");
|
gpgItem->setText(COLUMN_IP, showInfoAtGpgItem ? bestIP : "");
|
||||||
gpgItem->setData(COLUMN_IP, ROLE_SORT_NAME, showInfoAtGpgItem ? bestIP : "");
|
gpgItem->setData(COLUMN_IP, ROLE_SORT_NAME, bestIP);
|
||||||
|
|
||||||
/* Sort data */
|
/* Sort data */
|
||||||
gpgItem->setData(COLUMN_NAME, ROLE_SORT_NAME, gpgName);
|
gpgItem->setData(COLUMN_NAME, ROLE_SORT_NAME, gpgName);
|
||||||
@ -2283,16 +2284,16 @@ void FriendList::addPeerToExpand(const std::string &gpgId)
|
|||||||
|
|
||||||
void FriendList::createDisplayMenu()
|
void FriendList::createDisplayMenu()
|
||||||
{
|
{
|
||||||
QMenu *displayMenu = new QMenu(this);
|
QMenu *displayMenu = new QMenu(tr("Show"), this);
|
||||||
connect(displayMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
|
connect(displayMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
|
||||||
|
|
||||||
displayMenu->addAction(ui->actionHideOfflineFriends);
|
displayMenu->addAction(ui->actionHideOfflineFriends);
|
||||||
displayMenu->addAction(ui->actionShowState);
|
displayMenu->addAction(ui->actionShowState);
|
||||||
displayMenu->addAction(ui->actionShowGroups);
|
displayMenu->addAction(ui->actionShowGroups);
|
||||||
displayMenu->addAction(ui->actionExportFriendlist);
|
|
||||||
displayMenu->addAction(ui->actionImportFriendlist);
|
|
||||||
|
|
||||||
ui->displayButton->setMenu(displayMenu);
|
ui->peerTreeWidget->addHeaderContextMenuMenu(displayMenu);
|
||||||
|
ui->peerTreeWidget->addHeaderContextMenuAction(ui->actionExportFriendlist);
|
||||||
|
ui->peerTreeWidget->addHeaderContextMenuAction(ui->actionImportFriendlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FriendList::updateMenu()
|
void FriendList::updateMenu()
|
||||||
|
@ -53,38 +53,6 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="LineEditClear" name="filterLineEdit"/>
|
<widget class="LineEditClear" name="filterLineEdit"/>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="displayButton">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>30</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::NoFocus</enum>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Display</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../images.qrc">
|
|
||||||
<normaloff>:/images/looknfeel.png</normaloff>:/images/looknfeel.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>24</width>
|
|
||||||
<height>24</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="popupMode">
|
|
||||||
<enum>QToolButton::InstantPopup</enum>
|
|
||||||
</property>
|
|
||||||
<property name="autoRaise">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -188,8 +156,6 @@
|
|||||||
<header>gui/common/RSTreeWidget.h</header>
|
<header>gui/common/RSTreeWidget.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources/>
|
||||||
<include location="../images.qrc"/>
|
|
||||||
</resources>
|
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -160,6 +160,7 @@ RsCollectionDialog::RsCollectionDialog(const QString& collectionFileName
|
|||||||
connect(ui._addRecur_PB, SIGNAL(clicked()), this, SLOT(addRecursive()));
|
connect(ui._addRecur_PB, SIGNAL(clicked()), this, SLOT(addRecursive()));
|
||||||
connect(ui._remove_PB, SIGNAL(clicked()), this, SLOT(remove()));
|
connect(ui._remove_PB, SIGNAL(clicked()), this, SLOT(remove()));
|
||||||
connect(ui._makeDir_PB, SIGNAL(clicked()), this, SLOT(makeDir()));
|
connect(ui._makeDir_PB, SIGNAL(clicked()), this, SLOT(makeDir()));
|
||||||
|
connect(ui._removeDuplicate_CB, SIGNAL(clicked(bool)), this, SLOT(updateRemoveDuplicate(bool)));
|
||||||
connect(ui._cancel_PB, SIGNAL(clicked()), this, SLOT(cancel()));
|
connect(ui._cancel_PB, SIGNAL(clicked()), this, SLOT(cancel()));
|
||||||
connect(ui._save_PB, SIGNAL(clicked()), this, SLOT(save()));
|
connect(ui._save_PB, SIGNAL(clicked()), this, SLOT(save()));
|
||||||
connect(ui._download_PB, SIGNAL(clicked()), this, SLOT(download()));
|
connect(ui._download_PB, SIGNAL(clicked()), this, SLOT(download()));
|
||||||
@ -190,6 +191,7 @@ RsCollectionDialog::RsCollectionDialog(const QString& collectionFileName
|
|||||||
// 5 Activate button follow creationMode
|
// 5 Activate button follow creationMode
|
||||||
ui._changeFile->setVisible(_creationMode && !_readOnly);
|
ui._changeFile->setVisible(_creationMode && !_readOnly);
|
||||||
ui._makeDir_PB->setVisible(_creationMode && !_readOnly);
|
ui._makeDir_PB->setVisible(_creationMode && !_readOnly);
|
||||||
|
ui._removeDuplicate_CB->setVisible(_creationMode && !_readOnly);
|
||||||
ui._save_PB->setVisible(_creationMode && !_readOnly);
|
ui._save_PB->setVisible(_creationMode && !_readOnly);
|
||||||
ui._treeViewFrame->setVisible(_creationMode && !_readOnly);
|
ui._treeViewFrame->setVisible(_creationMode && !_readOnly);
|
||||||
ui._download_PB->setVisible(!_creationMode && !_readOnly);
|
ui._download_PB->setVisible(!_creationMode && !_readOnly);
|
||||||
@ -408,7 +410,10 @@ bool RsCollectionDialog::addChild(QTreeWidgetItem* parent, const std::vector<Col
|
|||||||
if (colFileInfo.type == DIR_TYPE_DIR){
|
if (colFileInfo.type == DIR_TYPE_DIR){
|
||||||
founds = ui._fileEntriesTW->findItems(colFileInfo.path + "/" +colFileInfo.name, Qt::MatchExactly | Qt::MatchRecursive, COLUMN_FILEPATH);
|
founds = ui._fileEntriesTW->findItems(colFileInfo.path + "/" +colFileInfo.name, Qt::MatchExactly | Qt::MatchRecursive, COLUMN_FILEPATH);
|
||||||
} else {
|
} else {
|
||||||
founds = ui._fileEntriesTW->findItems(colFileInfo.hash, Qt::MatchExactly | Qt::MatchRecursive, COLUMN_HASH);
|
founds = ui._fileEntriesTW->findItems(colFileInfo.path + "/" +colFileInfo.name, Qt::MatchExactly | Qt::MatchRecursive, COLUMN_FILEPATH);
|
||||||
|
if (ui._removeDuplicate_CB->isChecked()) {
|
||||||
|
founds << ui._fileEntriesTW->findItems(colFileInfo.hash, Qt::MatchExactly | Qt::MatchRecursive, COLUMN_HASH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (founds.empty()) {
|
if (founds.empty()) {
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem;
|
QTreeWidgetItem *item = new QTreeWidgetItem;
|
||||||
@ -493,7 +498,8 @@ bool RsCollectionDialog::addChild(QTreeWidgetItem* parent, const std::vector<Col
|
|||||||
|
|
||||||
if (colFileInfo.type == DIR_TYPE_DIR) {
|
if (colFileInfo.type == DIR_TYPE_DIR) {
|
||||||
wrong_chars |= addChild(founds.at(0), colFileInfo.children);
|
wrong_chars |= addChild(founds.at(0), colFileInfo.children);
|
||||||
} }
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return wrong_chars;
|
return wrong_chars;
|
||||||
}
|
}
|
||||||
@ -827,9 +833,29 @@ void RsCollectionDialog::remove()
|
|||||||
//msgBox->setInformativeText(); If text too long, no scroll, so I add an text edit
|
//msgBox->setInformativeText(); If text too long, no scroll, so I add an text edit
|
||||||
QGridLayout* layout = qobject_cast<QGridLayout*>(msgBox->layout());
|
QGridLayout* layout = qobject_cast<QGridLayout*>(msgBox->layout());
|
||||||
if (layout) {
|
if (layout) {
|
||||||
QTextEdit* edit = new QTextEdit(tr("Do you want to remove them and all their children, too? <br>") + listDir);
|
int newRow = 1;
|
||||||
|
for (int row = layout->count()-1; row >= 0; --row) {
|
||||||
|
for (int col = layout->columnCount()-1; col >= 0; --col) {
|
||||||
|
QLayoutItem *item = layout->itemAtPosition(row, col);
|
||||||
|
if (item) {
|
||||||
|
int index = layout->indexOf(item->widget());
|
||||||
|
int r=0, c=0, rSpan=0, cSpan=0;
|
||||||
|
layout->getItemPosition(index, &r, &c, &rSpan, &cSpan);
|
||||||
|
if (r>0) {
|
||||||
|
layout->removeItem(item);
|
||||||
|
layout->addItem(item, r+3, c, rSpan, cSpan);
|
||||||
|
} else if (rSpan>1) {
|
||||||
|
newRow = rSpan + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
QLabel *label = new QLabel(tr("Do you want to remove them and all their children, too?"));
|
||||||
|
layout->addWidget(label,newRow, 0, 1, layout->columnCount(), Qt::AlignHCenter );
|
||||||
|
QTextEdit *edit = new QTextEdit(listDir);
|
||||||
edit->setReadOnly(true);
|
edit->setReadOnly(true);
|
||||||
layout->addWidget(edit,0 ,1);
|
edit->setWordWrapMode(QTextOption::NoWrap);
|
||||||
|
layout->addWidget(edit,newRow+1, 0, 1, layout->columnCount(), Qt::AlignHCenter );
|
||||||
}
|
}
|
||||||
|
|
||||||
msgBox->setStandardButtons(QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
|
msgBox->setStandardButtons(QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
|
||||||
@ -1063,6 +1089,79 @@ void RsCollectionDialog::itemChanged(QTreeWidgetItem *item, int col)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief RsCollectionDialog::updateRemoveDuplicate Remove all duplicate file when checked.
|
||||||
|
* @param checked
|
||||||
|
*/
|
||||||
|
void RsCollectionDialog::updateRemoveDuplicate(bool checked)
|
||||||
|
{
|
||||||
|
if (checked) {
|
||||||
|
QTreeWidgetItemIterator it(ui._fileEntriesTW);
|
||||||
|
QTreeWidgetItem *item;
|
||||||
|
while ((item = *it) != NULL) {
|
||||||
|
++it;
|
||||||
|
if (item->data(COLUMN_HASH, ROLE_TYPE).toUInt() != DIR_TYPE_DIR) {
|
||||||
|
QList<QTreeWidgetItem*> founds;
|
||||||
|
founds << ui._fileEntriesTW->findItems(item->text(COLUMN_HASH), Qt::MatchExactly | Qt::MatchRecursive, COLUMN_HASH);
|
||||||
|
if (founds.count() > 1) {
|
||||||
|
QMessageBox* msgBox = new QMessageBox(QMessageBox::Information, "", "");
|
||||||
|
msgBox->setText("Warning, duplicate file found.");
|
||||||
|
//msgBox->setInformativeText(); If text too long, no scroll, so I add an text edit
|
||||||
|
msgBox->setStandardButtons(QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
|
||||||
|
msgBox->setDefaultButton(QMessageBox::Yes);
|
||||||
|
|
||||||
|
QGridLayout* layout = qobject_cast<QGridLayout*>(msgBox->layout());
|
||||||
|
if (layout) {
|
||||||
|
int newRow = 1;
|
||||||
|
for (int row = layout->count()-1; row >= 0; --row) {
|
||||||
|
for (int col = layout->columnCount()-1; col >= 0; --col) {
|
||||||
|
QLayoutItem *item = layout->itemAtPosition(row, col);
|
||||||
|
if (item) {
|
||||||
|
int index = layout->indexOf(item->widget());
|
||||||
|
int r=0, c=0, rSpan=0, cSpan=0;
|
||||||
|
layout->getItemPosition(index, &r, &c, &rSpan, &cSpan);
|
||||||
|
if (r>0) {
|
||||||
|
layout->removeItem(item);
|
||||||
|
layout->addItem(item, r+3, c, rSpan, cSpan);
|
||||||
|
} else if (rSpan>1) {
|
||||||
|
newRow = rSpan + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
QLabel *label = new QLabel(tr("Do you want to remove this file from the list?"));
|
||||||
|
layout->addWidget(label,newRow, 0, 1, layout->columnCount(), Qt::AlignHCenter );
|
||||||
|
QTextEdit *edit = new QTextEdit(item->text(COLUMN_FILEPATH));
|
||||||
|
edit->setReadOnly(true);
|
||||||
|
edit->setWordWrapMode(QTextOption::NoWrap);
|
||||||
|
layout->addWidget(edit,newRow+1, 0, 1, layout->columnCount(), Qt::AlignHCenter );
|
||||||
|
}
|
||||||
|
|
||||||
|
int ret = msgBox->exec();
|
||||||
|
switch (ret) {
|
||||||
|
case QMessageBox::Yes:
|
||||||
|
item->parent()->removeChild(item);
|
||||||
|
break;
|
||||||
|
case QMessageBox::No:
|
||||||
|
break;
|
||||||
|
case QMessageBox::Cancel: {
|
||||||
|
delete msgBox;
|
||||||
|
ui._removeDuplicate_CB->setChecked(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// should never be reached
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
delete msgBox;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief RsCollectionDialog::cancel: Cancel RScollection editing or donwloading
|
* @brief RsCollectionDialog::cancel: Cancel RScollection editing or donwloading
|
||||||
*/
|
*/
|
||||||
|
@ -56,6 +56,7 @@ private slots:
|
|||||||
void makeDir() ;
|
void makeDir() ;
|
||||||
void fileHashingFinished(QList<HashedFile> hashedFiles) ;
|
void fileHashingFinished(QList<HashedFile> hashedFiles) ;
|
||||||
void itemChanged(QTreeWidgetItem* item,int col) ;
|
void itemChanged(QTreeWidgetItem* item,int col) ;
|
||||||
|
void updateRemoveDuplicate(bool checked);
|
||||||
void cancel() ;
|
void cancel() ;
|
||||||
void download() ;
|
void download() ;
|
||||||
void save() ;
|
void save() ;
|
||||||
|
@ -21,7 +21,16 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
@ -59,7 +68,16 @@
|
|||||||
<enum>QFrame::Plain</enum>
|
<enum>QFrame::Plain</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout">
|
<layout class="QVBoxLayout">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -83,7 +101,16 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -197,7 +224,16 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -207,7 +243,16 @@
|
|||||||
</property>
|
</property>
|
||||||
<widget class="QFrame" name="_treeViewFrame">
|
<widget class="QFrame" name="_treeViewFrame">
|
||||||
<layout class="QHBoxLayout">
|
<layout class="QHBoxLayout">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -359,6 +404,13 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout">
|
<layout class="QHBoxLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="_removeDuplicate_CB">
|
||||||
|
<property name="text">
|
||||||
|
<string>Remove Duplicate</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -405,12 +457,6 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
<zorder></zorder>
|
|
||||||
<zorder></zorder>
|
|
||||||
<zorder>_mainSplitter</zorder>
|
|
||||||
<zorder>_listSplitter</zorder>
|
|
||||||
<zorder></zorder>
|
|
||||||
<zorder>_mainSplitter</zorder>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
#include <QUrlQuery>
|
#include <QUrlQuery>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "gui/settings/rsharesettings.h"
|
||||||
|
#include "util/misc.h"
|
||||||
#include "ConnectFriendWizard.h"
|
#include "ConnectFriendWizard.h"
|
||||||
#include "ui_ConnectFriendWizard.h"
|
#include "ui_ConnectFriendWizard.h"
|
||||||
#include "gui/common/PeerDefs.h"
|
#include "gui/common/PeerDefs.h"
|
||||||
@ -1040,7 +1042,9 @@ void ConnectFriendWizard::saveCert()
|
|||||||
|
|
||||||
void ConnectFriendWizard::loadFriendCert()
|
void ConnectFriendWizard::loadFriendCert()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Certificate"), "", tr("RetroShare Certificate (*.rsc );;All Files (*)"));
|
QString fileName ;
|
||||||
|
if(!misc::getOpenFileName(this, RshareSettings::LASTDIR_CERT, tr("Select Certificate"), tr("RetroShare Certificate (*.rsc );;All Files (*)"),fileName))
|
||||||
|
return ;
|
||||||
|
|
||||||
if (!fileName.isNull()) {
|
if (!fileName.isNull()) {
|
||||||
ui->friendFileNameEdit->setText(fileName);
|
ui->friendFileNameEdit->setText(fileName);
|
||||||
|
@ -24,7 +24,9 @@
|
|||||||
#include <retroshare/rsinit.h>
|
#include <retroshare/rsinit.h>
|
||||||
#include <retroshare/rspeers.h>
|
#include <retroshare/rspeers.h>
|
||||||
#include "ProfileManager.h"
|
#include "ProfileManager.h"
|
||||||
|
#include "util/misc.h"
|
||||||
#include "gui/GenCertDialog.h"
|
#include "gui/GenCertDialog.h"
|
||||||
|
#include "gui/settings/rsharesettings.h"
|
||||||
#include "gui/common/RSTreeWidgetItem.h"
|
#include "gui/common/RSTreeWidgetItem.h"
|
||||||
|
|
||||||
#include <QAbstractEventDispatcher>
|
#include <QAbstractEventDispatcher>
|
||||||
@ -135,9 +137,7 @@ void ProfileManager::exportIdentity()
|
|||||||
if (fname.isNull())
|
if (fname.isNull())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (QFileInfo(fname).suffix().isEmpty()) {
|
if (fname.right(4).toUpper() != ".ASC") fname += ".asc";
|
||||||
fname += ".asc";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (RsAccounts::ExportIdentity(fname.toUtf8().constData(), gpgId))
|
if (RsAccounts::ExportIdentity(fname.toUtf8().constData(), gpgId))
|
||||||
QMessageBox::information(this, tr("Identity saved"), tr("Your identity was successfully saved\nIt is encrypted\n\nYou can now copy it to another computer\nand use the import button to load it"));
|
QMessageBox::information(this, tr("Identity saved"), tr("Your identity was successfully saved\nIt is encrypted\n\nYou can now copy it to another computer\nand use the import button to load it"));
|
||||||
@ -147,7 +147,10 @@ void ProfileManager::exportIdentity()
|
|||||||
|
|
||||||
void ProfileManager::importIdentity()
|
void ProfileManager::importIdentity()
|
||||||
{
|
{
|
||||||
QString fname = QFileDialog::getOpenFileName(this,tr("Import Identity"), "",tr("RetroShare Identity files (*.asc)")) ;
|
QString fname ;
|
||||||
|
|
||||||
|
if(!misc::getOpenFileName(this,RshareSettings::LASTDIR_CERT,tr("Import Identity"), tr("RetroShare Identity files (*.asc)"),fname))
|
||||||
|
return ;
|
||||||
|
|
||||||
if(fname.isNull())
|
if(fname.isNull())
|
||||||
return ;
|
return ;
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "api/ApiServer.h"
|
#include "api/ApiServer.h"
|
||||||
#include "api/ApiServerMHD.h"
|
#include "api/ApiServerMHD.h"
|
||||||
|
#include "api/ApiServerLocal.h"
|
||||||
#include "api/RsControlModule.h"
|
#include "api/RsControlModule.h"
|
||||||
#include "api/GetPluginInterfaces.h"
|
#include "api/GetPluginInterfaces.h"
|
||||||
|
|
||||||
@ -14,6 +15,10 @@
|
|||||||
|
|
||||||
resource_api::ApiServer* WebuiPage::apiServer = 0;
|
resource_api::ApiServer* WebuiPage::apiServer = 0;
|
||||||
resource_api::ApiServerMHD* WebuiPage::apiServerMHD = 0;
|
resource_api::ApiServerMHD* WebuiPage::apiServerMHD = 0;
|
||||||
|
// TODO: LIBRESAPI_LOCAL_SERVER Put indipendent option for libresapilocalserver in appropriate place
|
||||||
|
#ifdef LIBRESAPI_LOCAL_SERVER
|
||||||
|
resource_api::ApiServerLocal* WebuiPage::apiServerLocal = 0;
|
||||||
|
#endif
|
||||||
resource_api::RsControlModule* WebuiPage::controlModule = 0;
|
resource_api::RsControlModule* WebuiPage::controlModule = 0;
|
||||||
|
|
||||||
WebuiPage::WebuiPage(QWidget */*parent*/, Qt::WindowFlags /*flags*/)
|
WebuiPage::WebuiPage(QWidget */*parent*/, Qt::WindowFlags /*flags*/)
|
||||||
@ -92,6 +97,11 @@ QString WebuiPage::helpText() const
|
|||||||
"",
|
"",
|
||||||
Settings->getWebinterfaceAllowAllIps());
|
Settings->getWebinterfaceAllowAllIps());
|
||||||
apiServerMHD->start();
|
apiServerMHD->start();
|
||||||
|
|
||||||
|
// TODO: LIBRESAPI_LOCAL_SERVER Move in appropriate place
|
||||||
|
#ifdef LIBRESAPI_LOCAL_SERVER
|
||||||
|
apiServerLocal = new resource_api::ApiServerLocal(apiServer);
|
||||||
|
#endif
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,6 +112,11 @@ QString WebuiPage::helpText() const
|
|||||||
apiServerMHD->stop();
|
apiServerMHD->stop();
|
||||||
delete apiServerMHD;
|
delete apiServerMHD;
|
||||||
apiServerMHD = 0;
|
apiServerMHD = 0;
|
||||||
|
// TODO: LIBRESAPI_LOCAL_SERVER Move in appropriate place
|
||||||
|
#ifdef LIBRESAPI_LOCAL_SERVER
|
||||||
|
delete apiServerLocal;
|
||||||
|
apiServerLocal = 0;
|
||||||
|
#endif
|
||||||
delete apiServer;
|
delete apiServer;
|
||||||
apiServer = 0;
|
apiServer = 0;
|
||||||
delete controlModule;
|
delete controlModule;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
namespace resource_api{
|
namespace resource_api{
|
||||||
class ApiServer;
|
class ApiServer;
|
||||||
class ApiServerMHD;
|
class ApiServerMHD;
|
||||||
|
class ApiServerLocal;
|
||||||
class RsControlModule;
|
class RsControlModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,5 +49,8 @@ private:
|
|||||||
|
|
||||||
static resource_api::ApiServer* apiServer;
|
static resource_api::ApiServer* apiServer;
|
||||||
static resource_api::ApiServerMHD* apiServerMHD;
|
static resource_api::ApiServerMHD* apiServerMHD;
|
||||||
|
#ifdef LIBRESAPI_LOCAL_SERVER
|
||||||
|
static resource_api::ApiServerLocal* apiServerLocal;
|
||||||
|
#endif
|
||||||
static resource_api::RsControlModule* controlModule;
|
static resource_api::RsControlModule* controlModule;
|
||||||
};
|
};
|
||||||
|
@ -152,8 +152,9 @@ RSettingsWin::initStackedWidget()
|
|||||||
addPage(new AppearancePage());
|
addPage(new AppearancePage());
|
||||||
addPage(new SoundPage() );
|
addPage(new SoundPage() );
|
||||||
addPage(new ServicePermissionsPage() );
|
addPage(new ServicePermissionsPage() );
|
||||||
|
#ifdef ENABLE_WEBUI
|
||||||
addPage(new WebuiPage() );
|
addPage(new WebuiPage() );
|
||||||
|
#endif // ENABLE_WEBUI
|
||||||
// add widgets from plugins
|
// add widgets from plugins
|
||||||
|
|
||||||
for(int i=0;i<rsPlugins->nbPlugins();++i)
|
for(int i=0;i<rsPlugins->nbPlugins();++i)
|
||||||
|
@ -75,8 +75,9 @@ public:
|
|||||||
LASTDIR_IMAGES,
|
LASTDIR_IMAGES,
|
||||||
LASTDIR_MESSAGES,
|
LASTDIR_MESSAGES,
|
||||||
LASTDIR_BLOGS,
|
LASTDIR_BLOGS,
|
||||||
LASTDIR_SOUNDS
|
LASTDIR_SOUNDS,
|
||||||
};
|
LASTDIR_PLUGIN
|
||||||
|
};
|
||||||
|
|
||||||
enum enumToasterPosition
|
enum enumToasterPosition
|
||||||
{
|
{
|
||||||
|
@ -397,13 +397,17 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
|
|||||||
|
|
||||||
notify->enable() ; // enable notification system after GUI creation, to avoid data races in Qt.
|
notify->enable() ; // enable notification system after GUI creation, to avoid data races in Qt.
|
||||||
|
|
||||||
|
#ifdef ENABLE_WEBUI
|
||||||
WebuiPage::checkStartWebui();
|
WebuiPage::checkStartWebui();
|
||||||
|
#endif // ENABLE_WEBUI
|
||||||
|
|
||||||
/* dive into the endless loop */
|
/* dive into the endless loop */
|
||||||
int ti = rshare.exec();
|
int ti = rshare.exec();
|
||||||
delete w ;
|
delete w ;
|
||||||
|
|
||||||
|
#ifdef ENABLE_WEBUI
|
||||||
WebuiPage::checkShutdownWebui();
|
WebuiPage::checkShutdownWebui();
|
||||||
|
#endif // ENABLE_WEBUI
|
||||||
|
|
||||||
/* cleanup */
|
/* cleanup */
|
||||||
ChatDialog::cleanupChat();
|
ChatDialog::cleanupChat();
|
||||||
|
@ -551,8 +551,7 @@ HEADERS += rshare.h \
|
|||||||
gui/connect/ConnectProgressDialog.h \
|
gui/connect/ConnectProgressDialog.h \
|
||||||
gui/groups/CreateGroup.h \
|
gui/groups/CreateGroup.h \
|
||||||
gui/GetStartedDialog.h \
|
gui/GetStartedDialog.h \
|
||||||
gui/settings/WebuiPage.h \
|
gui/statistics/BWGraph.h \
|
||||||
gui/statistics/BWGraph.h \
|
|
||||||
util/RsSyntaxHighlighter.h \
|
util/RsSyntaxHighlighter.h \
|
||||||
util/imageutil.h
|
util/imageutil.h
|
||||||
|
|
||||||
@ -671,7 +670,7 @@ FORMS += gui/StartDialog.ui \
|
|||||||
gui/statistics/BwCtrlWindow.ui \
|
gui/statistics/BwCtrlWindow.ui \
|
||||||
gui/statistics/RttStatistics.ui \
|
gui/statistics/RttStatistics.ui \
|
||||||
gui/GetStartedDialog.ui \
|
gui/GetStartedDialog.ui \
|
||||||
gui/settings/WebuiPage.ui
|
|
||||||
|
|
||||||
# gui/ForumsDialog.ui \
|
# gui/ForumsDialog.ui \
|
||||||
# gui/forums/CreateForum.ui \
|
# gui/forums/CreateForum.ui \
|
||||||
@ -854,7 +853,6 @@ SOURCES += main.cpp \
|
|||||||
gui/settings/ServicePermissionsPage.cpp \
|
gui/settings/ServicePermissionsPage.cpp \
|
||||||
gui/settings/AddFileAssociationDialog.cpp \
|
gui/settings/AddFileAssociationDialog.cpp \
|
||||||
gui/settings/GroupFrameSettingsWidget.cpp \
|
gui/settings/GroupFrameSettingsWidget.cpp \
|
||||||
gui/settings/WebuiPage.cpp \
|
|
||||||
gui/statusbar/peerstatus.cpp \
|
gui/statusbar/peerstatus.cpp \
|
||||||
gui/statusbar/natstatus.cpp \
|
gui/statusbar/natstatus.cpp \
|
||||||
gui/statusbar/dhtstatus.cpp \
|
gui/statusbar/dhtstatus.cpp \
|
||||||
@ -1390,3 +1388,9 @@ gxsgui {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
libresapihttpserver {
|
||||||
|
HEADERS *= gui/settings/WebuiPage.h
|
||||||
|
SOURCES *= gui/settings/WebuiPage.cpp
|
||||||
|
FORMS *= gui/settings/WebuiPage.ui
|
||||||
|
}
|
||||||
|
@ -352,7 +352,7 @@ bool misc::getSaveFileName(QWidget *parent, RshareSettings::enumLastDir type
|
|||||||
{
|
{
|
||||||
QString lastDir = Settings->getLastDir(type);
|
QString lastDir = Settings->getLastDir(type);
|
||||||
|
|
||||||
file = QFileDialog::getSaveFileName(parent, caption, lastDir, filter, selectedFilter, options);
|
file = QFileDialog::getSaveFileName(parent, caption, lastDir, filter, selectedFilter, QFileDialog::DontUseNativeDialog | options);
|
||||||
|
|
||||||
if (file.isEmpty())
|
if (file.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
@ -1,367 +1,365 @@
|
|||||||
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
|
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
|
||||||
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
TARGET = RetroShare06-nogui
|
TARGET = RetroShare06-nogui
|
||||||
CONFIG += bitdht
|
CONFIG += bitdht
|
||||||
#CONFIG += introserver
|
#CONFIG += introserver
|
||||||
#CONFIG += sshserver
|
#CONFIG += sshserver
|
||||||
# webinterface, requires libmicrohttpd
|
CONFIG -= qt xml gui
|
||||||
CONFIG += webui
|
CONFIG += link_prl
|
||||||
CONFIG -= qt xml gui
|
|
||||||
CONFIG += link_prl
|
#CONFIG += debug
|
||||||
|
debug {
|
||||||
#CONFIG += debug
|
QMAKE_CFLAGS -= -O2
|
||||||
debug {
|
QMAKE_CFLAGS += -O0
|
||||||
QMAKE_CFLAGS -= -O2
|
QMAKE_CFLAGS += -g
|
||||||
QMAKE_CFLAGS += -O0
|
|
||||||
QMAKE_CFLAGS += -g
|
QMAKE_CXXFLAGS -= -O2
|
||||||
|
QMAKE_CXXFLAGS += -O0
|
||||||
QMAKE_CXXFLAGS -= -O2
|
QMAKE_CXXFLAGS += -g
|
||||||
QMAKE_CXXFLAGS += -O0
|
}
|
||||||
QMAKE_CXXFLAGS += -g
|
|
||||||
}
|
################################# Linux ##########################################
|
||||||
|
linux-* {
|
||||||
################################# Linux ##########################################
|
#CONFIG += version_detail_bash_script
|
||||||
linux-* {
|
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
|
||||||
#CONFIG += version_detail_bash_script
|
|
||||||
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
|
LIBS *= -rdynamic
|
||||||
|
}
|
||||||
LIBS *= -rdynamic
|
|
||||||
}
|
unix {
|
||||||
|
target.path = "$${BIN_DIR}"
|
||||||
unix {
|
INSTALLS += target
|
||||||
target.path = "$${BIN_DIR}"
|
}
|
||||||
INSTALLS += target
|
|
||||||
}
|
linux-g++ {
|
||||||
|
OBJECTS_DIR = temp/linux-g++/obj
|
||||||
linux-g++ {
|
}
|
||||||
OBJECTS_DIR = temp/linux-g++/obj
|
|
||||||
}
|
linux-g++-64 {
|
||||||
|
OBJECTS_DIR = temp/linux-g++-64/obj
|
||||||
linux-g++-64 {
|
}
|
||||||
OBJECTS_DIR = temp/linux-g++-64/obj
|
|
||||||
}
|
#################### Cross compilation for windows under Linux ###################
|
||||||
|
|
||||||
#################### Cross compilation for windows under Linux ###################
|
win32-x-g++ {
|
||||||
|
OBJECTS_DIR = temp/win32-x-g++/obj
|
||||||
win32-x-g++ {
|
|
||||||
OBJECTS_DIR = temp/win32-x-g++/obj
|
LIBS += ../../../../lib/win32-x-g++/libssl.a
|
||||||
|
LIBS += ../../../../lib/win32-x-g++/libcrypto.a
|
||||||
LIBS += ../../../../lib/win32-x-g++/libssl.a
|
LIBS += ../../../../lib/win32-x-g++/libminiupnpc.a
|
||||||
LIBS += ../../../../lib/win32-x-g++/libcrypto.a
|
LIBS += ../../../../lib/win32-x-g++/libz.a
|
||||||
LIBS += ../../../../lib/win32-x-g++/libminiupnpc.a
|
LIBS += -L${HOME}/.wine/drive_c/pthreads/lib -lpthreadGCE2
|
||||||
LIBS += ../../../../lib/win32-x-g++/libz.a
|
LIBS += -lws2_32 -luuid -lole32 -liphlpapi -lcrypt32 -gdi32
|
||||||
LIBS += -L${HOME}/.wine/drive_c/pthreads/lib -lpthreadGCE2
|
LIBS += -lole32 -lwinmm
|
||||||
LIBS += -lws2_32 -luuid -lole32 -liphlpapi -lcrypt32 -gdi32
|
|
||||||
LIBS += -lole32 -lwinmm
|
RC_FILE = gui/images/retroshare_win.rc
|
||||||
|
|
||||||
RC_FILE = gui/images/retroshare_win.rc
|
DEFINES *= WIN32
|
||||||
|
}
|
||||||
DEFINES *= WIN32
|
|
||||||
}
|
#################################### Windows #####################################
|
||||||
|
|
||||||
#################################### Windows #####################################
|
win32 {
|
||||||
|
CONFIG += console
|
||||||
win32 {
|
OBJECTS_DIR = temp/obj
|
||||||
CONFIG += console
|
RCC_DIR = temp/qrc
|
||||||
OBJECTS_DIR = temp/obj
|
UI_DIR = temp/ui
|
||||||
RCC_DIR = temp/qrc
|
MOC_DIR = temp/moc
|
||||||
UI_DIR = temp/ui
|
|
||||||
MOC_DIR = temp/moc
|
# solve linker warnings because of the order of the libraries
|
||||||
|
QMAKE_LFLAGS += -Wl,--start-group
|
||||||
# solve linker warnings because of the order of the libraries
|
|
||||||
QMAKE_LFLAGS += -Wl,--start-group
|
CONFIG(debug, debug|release) {
|
||||||
|
} else {
|
||||||
CONFIG(debug, debug|release) {
|
# Tell linker to use ASLR protection
|
||||||
} else {
|
QMAKE_LFLAGS += -Wl,-dynamicbase
|
||||||
# Tell linker to use ASLR protection
|
# Tell linker to use DEP protection
|
||||||
QMAKE_LFLAGS += -Wl,-dynamicbase
|
QMAKE_LFLAGS += -Wl,-nxcompat
|
||||||
# Tell linker to use DEP protection
|
}
|
||||||
QMAKE_LFLAGS += -Wl,-nxcompat
|
|
||||||
}
|
for(lib, LIB_DIR):LIBS += -L"$$lib"
|
||||||
|
LIBS += -lssl -lcrypto -lpthread -lminiupnpc -lz
|
||||||
for(lib, LIB_DIR):LIBS += -L"$$lib"
|
LIBS += -lcrypto -lws2_32 -lgdi32
|
||||||
LIBS += -lssl -lcrypto -lpthread -lminiupnpc -lz
|
LIBS += -luuid -lole32 -liphlpapi -lcrypt32
|
||||||
LIBS += -lcrypto -lws2_32 -lgdi32
|
LIBS += -lole32 -lwinmm
|
||||||
LIBS += -luuid -lole32 -liphlpapi -lcrypt32
|
|
||||||
LIBS += -lole32 -lwinmm
|
PROTOCPATH=$$BIN_DIR
|
||||||
|
|
||||||
PROTOCPATH=$$BIN_DIR
|
RC_FILE = resources/retroshare_win.rc
|
||||||
|
|
||||||
RC_FILE = resources/retroshare_win.rc
|
DEFINES *= WINDOWS_SYS _USE_32BIT_TIME_T
|
||||||
|
|
||||||
DEFINES *= WINDOWS_SYS _USE_32BIT_TIME_T
|
DEPENDPATH += . $$INC_DIR
|
||||||
|
INCLUDEPATH += . $$INC_DIR
|
||||||
DEPENDPATH += . $$INC_DIR
|
}
|
||||||
INCLUDEPATH += . $$INC_DIR
|
|
||||||
}
|
##################################### MacOS ######################################
|
||||||
|
|
||||||
##################################### MacOS ######################################
|
macx {
|
||||||
|
# ENABLE THIS OPTION FOR Univeral Binary BUILD.
|
||||||
macx {
|
# CONFIG += ppc x86
|
||||||
# ENABLE THIS OPTION FOR Univeral Binary BUILD.
|
|
||||||
# CONFIG += ppc x86
|
LIBS += -Wl,-search_paths_first
|
||||||
|
LIBS += -lssl -lcrypto -lz
|
||||||
LIBS += -Wl,-search_paths_first
|
for(lib, LIB_DIR):exists($$lib/libminiupnpc.a){ LIBS += $$lib/libminiupnpc.a}
|
||||||
LIBS += -lssl -lcrypto -lz
|
LIBS += -framework CoreFoundation
|
||||||
for(lib, LIB_DIR):exists($$lib/libminiupnpc.a){ LIBS += $$lib/libminiupnpc.a}
|
LIBS += -framework Security
|
||||||
LIBS += -framework CoreFoundation
|
for(lib, LIB_DIR):LIBS += -L"$$lib"
|
||||||
LIBS += -framework Security
|
for(bin, BIN_DIR):LIBS += -L"$$bin"
|
||||||
for(lib, LIB_DIR):LIBS += -L"$$lib"
|
|
||||||
for(bin, BIN_DIR):LIBS += -L"$$bin"
|
DEPENDPATH += . $$INC_DIR
|
||||||
|
INCLUDEPATH += . $$INC_DIR
|
||||||
DEPENDPATH += . $$INC_DIR
|
|
||||||
INCLUDEPATH += . $$INC_DIR
|
sshserver {
|
||||||
|
LIBS += -L../../../lib
|
||||||
sshserver {
|
#LIBS += -L../../../lib/libssh-0.6.0
|
||||||
LIBS += -L../../../lib
|
}
|
||||||
#LIBS += -L../../../lib/libssh-0.6.0
|
|
||||||
}
|
QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dstat64=stat -Dstatvfs64=statvfs -Dfopen64=fopen
|
||||||
|
|
||||||
QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dstat64=stat -Dstatvfs64=statvfs -Dfopen64=fopen
|
}
|
||||||
|
|
||||||
}
|
##################################### FreeBSD ######################################
|
||||||
|
|
||||||
##################################### FreeBSD ######################################
|
freebsd-* {
|
||||||
|
INCLUDEPATH *= /usr/local/include/gpgme
|
||||||
freebsd-* {
|
LIBS *= -lssl
|
||||||
INCLUDEPATH *= /usr/local/include/gpgme
|
LIBS *= -lgpgme
|
||||||
LIBS *= -lssl
|
LIBS *= -lupnp
|
||||||
LIBS *= -lgpgme
|
LIBS *= -lgnome-keyring
|
||||||
LIBS *= -lupnp
|
}
|
||||||
LIBS *= -lgnome-keyring
|
|
||||||
}
|
##################################### OpenBSD ######################################
|
||||||
|
|
||||||
##################################### OpenBSD ######################################
|
openbsd-* {
|
||||||
|
INCLUDEPATH *= /usr/local/include
|
||||||
openbsd-* {
|
QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dstat64=stat -Dstatvfs64=statvfs -Dfopen64=fopen
|
||||||
INCLUDEPATH *= /usr/local/include
|
LIBS *= -lssl -lcrypto
|
||||||
QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dstat64=stat -Dstatvfs64=statvfs -Dfopen64=fopen
|
LIBS *= -lgpgme
|
||||||
LIBS *= -lssl -lcrypto
|
LIBS *= -lupnp
|
||||||
LIBS *= -lgpgme
|
LIBS *= -lgnome-keyring
|
||||||
LIBS *= -lupnp
|
LIBS *= -rdynamic
|
||||||
LIBS *= -lgnome-keyring
|
}
|
||||||
LIBS *= -rdynamic
|
|
||||||
}
|
##################################### Haiku ######################################
|
||||||
|
|
||||||
##################################### Haiku ######################################
|
haiku-* {
|
||||||
|
QMAKE_CXXFLAGS *= -D_BSD_SOURCE
|
||||||
haiku-* {
|
|
||||||
QMAKE_CXXFLAGS *= -D_BSD_SOURCE
|
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||||
|
PRE_TARGETDEPS *= ../../openpgpsdk/src/lib/libops.a
|
||||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
|
||||||
PRE_TARGETDEPS *= ../../openpgpsdk/src/lib/libops.a
|
LIBS *= ../../libretroshare/src/lib/libretroshare.a
|
||||||
|
LIBS *= ../../openpgpsdk/src/lib/libops.a -lbz2 -lbsd
|
||||||
LIBS *= ../../libretroshare/src/lib/libretroshare.a
|
LIBS *= -lssl -lcrypto -lnetwork
|
||||||
LIBS *= ../../openpgpsdk/src/lib/libops.a -lbz2 -lbsd
|
LIBS *= -lgpgme
|
||||||
LIBS *= -lssl -lcrypto -lnetwork
|
LIBS *= -lupnp
|
||||||
LIBS *= -lgpgme
|
LIBS *= -lz
|
||||||
LIBS *= -lupnp
|
LIBS *= -lixml
|
||||||
LIBS *= -lz
|
|
||||||
LIBS *= -lixml
|
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||||
|
LIBS += -lsqlite3
|
||||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
|
||||||
LIBS += -lsqlite3
|
}
|
||||||
|
|
||||||
}
|
############################## Common stuff ######################################
|
||||||
|
|
||||||
############################## Common stuff ######################################
|
DEPENDPATH += . ../../libretroshare/src
|
||||||
|
INCLUDEPATH += . ../../libretroshare/src
|
||||||
DEPENDPATH += . ../../libretroshare/src
|
|
||||||
INCLUDEPATH += . ../../libretroshare/src
|
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||||
|
LIBS *= ../../libretroshare/src/lib/libretroshare.a
|
||||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
|
||||||
LIBS *= ../../libretroshare/src/lib/libretroshare.a
|
# Input
|
||||||
|
HEADERS += notifytxt.h
|
||||||
# Input
|
SOURCES += notifytxt.cc \
|
||||||
HEADERS += notifytxt.h
|
retroshare.cc
|
||||||
SOURCES += notifytxt.cc \
|
|
||||||
retroshare.cc
|
introserver {
|
||||||
|
HEADERS += introserver.h
|
||||||
introserver {
|
SOURCES += introserver.cc
|
||||||
HEADERS += introserver.h
|
DEFINES *= RS_INTRO_SERVER
|
||||||
SOURCES += introserver.cc
|
}
|
||||||
DEFINES *= RS_INTRO_SERVER
|
|
||||||
}
|
libresapihttpserver {
|
||||||
|
DEFINES *= ENABLE_WEBUI
|
||||||
webui {
|
PRE_TARGETDEPS *= ../../libresapi/src/lib/libresapi.a
|
||||||
DEFINES *= ENABLE_WEBUI
|
LIBS += ../../libresapi/src/lib/libresapi.a
|
||||||
PRE_TARGETDEPS *= ../../libresapi/src/lib/libresapi.a
|
DEPENDPATH += ../../libresapi/src
|
||||||
LIBS += ../../libresapi/src/lib/libresapi.a
|
INCLUDEPATH += ../../libresapi/src
|
||||||
DEPENDPATH += ../../libresapi/src
|
HEADERS += \
|
||||||
INCLUDEPATH += ../../libresapi/src
|
TerminalApiClient.h
|
||||||
HEADERS += \
|
SOURCES += \
|
||||||
TerminalApiClient.h
|
TerminalApiClient.cpp
|
||||||
SOURCES += \
|
}
|
||||||
TerminalApiClient.cpp
|
|
||||||
}
|
sshserver {
|
||||||
|
|
||||||
sshserver {
|
# This Requires libssh-0.5.* to compile.
|
||||||
|
# Please use this path below.
|
||||||
# This Requires libssh-0.5.* to compile.
|
# (You can modify it locally if required - but dont commit it!)
|
||||||
# Please use this path below.
|
|
||||||
# (You can modify it locally if required - but dont commit it!)
|
#LIBSSH_DIR = ../../../lib/libssh-0.5.2
|
||||||
|
LIBSSH_DIR = ../../../libssh-0.6.0rc1
|
||||||
#LIBSSH_DIR = ../../../lib/libssh-0.5.2
|
|
||||||
LIBSSH_DIR = ../../../libssh-0.6.0rc1
|
#
|
||||||
|
# Use the following commend to generate a Server RSA Key.
|
||||||
#
|
# Key should be in current directory - when run/
|
||||||
# Use the following commend to generate a Server RSA Key.
|
# ssh-keygen -t rsa -f rs_ssh_host_rsa_key
|
||||||
# Key should be in current directory - when run/
|
#
|
||||||
# ssh-keygen -t rsa -f rs_ssh_host_rsa_key
|
# You can connect from a standard ssh, eg: ssh -p 7022 127.0.0.1
|
||||||
#
|
#
|
||||||
# You can connect from a standard ssh, eg: ssh -p 7022 127.0.0.1
|
# The Menu system is available from the command-line (-T) and SSH (-S)
|
||||||
#
|
# if it get covered by debug gunk, just press <return> to refresh.
|
||||||
# The Menu system is available from the command-line (-T) and SSH (-S)
|
#
|
||||||
# if it get covered by debug gunk, just press <return> to refresh.
|
# ./retroshare-nogui -h provides some more instructions.
|
||||||
#
|
#
|
||||||
# ./retroshare-nogui -h provides some more instructions.
|
|
||||||
#
|
win32 {
|
||||||
|
DEFINES *= LIBSSH_STATIC
|
||||||
win32 {
|
}
|
||||||
DEFINES *= LIBSSH_STATIC
|
|
||||||
}
|
DEPENDPATH += $$LIBSSH_DIR/include/
|
||||||
|
INCLUDEPATH += $$LIBSSH_DIR/include/
|
||||||
DEPENDPATH += $$LIBSSH_DIR/include/
|
|
||||||
INCLUDEPATH += $$LIBSSH_DIR/include/
|
win32 {
|
||||||
|
LIBS += -lssh
|
||||||
win32 {
|
LIBS += -lssh_threads
|
||||||
LIBS += -lssh
|
} else {
|
||||||
LIBS += -lssh_threads
|
SSH_OK = $$system(pkg-config --atleast-version 0.5.4 libssh && echo yes)
|
||||||
} else {
|
isEmpty(SSH_OK) {
|
||||||
SSH_OK = $$system(pkg-config --atleast-version 0.5.4 libssh && echo yes)
|
exists($$LIBSSH_DIR/build/src/libssh.a):exists($$LIBSSH_DIR/build/src/threads/libssh_threads.a) {
|
||||||
isEmpty(SSH_OK) {
|
LIBS += $$LIBSSH_DIR/build/src/libssh.a
|
||||||
exists($$LIBSSH_DIR/build/src/libssh.a):exists($$LIBSSH_DIR/build/src/threads/libssh_threads.a) {
|
LIBS += $$LIBSSH_DIR/build/src/threads/libssh_threads.a
|
||||||
LIBS += $$LIBSSH_DIR/build/src/libssh.a
|
}
|
||||||
LIBS += $$LIBSSH_DIR/build/src/threads/libssh_threads.a
|
else {
|
||||||
}
|
! exists($$LIBSSH_DIR/build/src/libssh.a):message($$LIBSSH_DIR/build/src/libssh.a does not exist)
|
||||||
else {
|
! exists($$LIBSSH_DIR/build/src/threads/libssh_threads.a):message($$LIBSSH_DIR/build/src/threads/libssh_threads.a does not exist)
|
||||||
! exists($$LIBSSH_DIR/build/src/libssh.a):message($$LIBSSH_DIR/build/src/libssh.a does not exist)
|
message(You need to download and compile libssh)
|
||||||
! exists($$LIBSSH_DIR/build/src/threads/libssh_threads.a):message($$LIBSSH_DIR/build/src/threads/libssh_threads.a does not exist)
|
message(See http://sourceforge.net/p/retroshare/code/6163/tree/trunk/)
|
||||||
message(You need to download and compile libssh)
|
}
|
||||||
message(See http://sourceforge.net/p/retroshare/code/6163/tree/trunk/)
|
} else {
|
||||||
}
|
LIBS += -lssh
|
||||||
} else {
|
LIBS += -lssh_threads
|
||||||
LIBS += -lssh
|
}
|
||||||
LIBS += -lssh_threads
|
}
|
||||||
}
|
|
||||||
}
|
HEADERS += ssh/rssshd.h
|
||||||
|
SOURCES += ssh/rssshd.cc
|
||||||
HEADERS += ssh/rssshd.h
|
|
||||||
SOURCES += ssh/rssshd.cc
|
# For the Menu System
|
||||||
|
HEADERS += menu/menu.h \
|
||||||
# For the Menu System
|
menu/menus.h \
|
||||||
HEADERS += menu/menu.h \
|
menu/stdiocomms.h \
|
||||||
menu/menus.h \
|
|
||||||
menu/stdiocomms.h \
|
SOURCES += menu/menu.cc \
|
||||||
|
menu/menus.cc \
|
||||||
SOURCES += menu/menu.cc \
|
menu/stdiocomms.cc \
|
||||||
menu/menus.cc \
|
|
||||||
menu/stdiocomms.cc \
|
# For the RPC System
|
||||||
|
HEADERS += rpc/rpc.h \
|
||||||
# For the RPC System
|
rpc/rpcserver.h \
|
||||||
HEADERS += rpc/rpc.h \
|
rpc/rpcsetup.h \
|
||||||
rpc/rpcserver.h \
|
rpc/rpcecho.h \
|
||||||
rpc/rpcsetup.h \
|
rpcsystem.h \
|
||||||
rpc/rpcecho.h \
|
|
||||||
rpcsystem.h \
|
SOURCES += rpc/rpc.cc \
|
||||||
|
rpc/rpcserver.cc \
|
||||||
SOURCES += rpc/rpc.cc \
|
rpc/rpcsetup.cc \
|
||||||
rpc/rpcserver.cc \
|
rpc/rpcecho.cc \
|
||||||
rpc/rpcsetup.cc \
|
|
||||||
rpc/rpcecho.cc \
|
# Actual protocol files to go here...
|
||||||
|
#HEADERS += rpc/proto/rpcecho.h \
|
||||||
# Actual protocol files to go here...
|
|
||||||
#HEADERS += rpc/proto/rpcecho.h \
|
#SOURCES += rpc/proto/rpcecho.cc \
|
||||||
|
|
||||||
#SOURCES += rpc/proto/rpcecho.cc \
|
DEFINES *= RS_SSH_SERVER
|
||||||
|
|
||||||
DEFINES *= RS_SSH_SERVER
|
# Include Protobuf classes.
|
||||||
|
CONFIG += protorpc
|
||||||
# Include Protobuf classes.
|
}
|
||||||
CONFIG += protorpc
|
|
||||||
}
|
protorpc {
|
||||||
|
# Proto Services
|
||||||
protorpc {
|
PROTOS = core.proto peers.proto system.proto chat.proto search.proto files.proto stream.proto
|
||||||
# Proto Services
|
DESTPATH = $$PWD/rpc/proto/gencc
|
||||||
PROTOS = core.proto peers.proto system.proto chat.proto search.proto files.proto stream.proto
|
PROTOPATH = $$PWD/../../rsctrl/src/definition
|
||||||
DESTPATH = $$PWD/rpc/proto/gencc
|
CMD = echo Building protobuf files
|
||||||
PROTOPATH = $$PWD/../../rsctrl/src/definition
|
for(pf, PROTOS):CMD += && $${PROTOCPATH}protoc --cpp_out=$${DESTPATH} --proto_path=$${PROTOPATH} $${PROTOPATH}/$${pf}
|
||||||
CMD = echo Building protobuf files
|
protobuf_gen.commands = $${CMD}
|
||||||
for(pf, PROTOS):CMD += && $${PROTOCPATH}protoc --cpp_out=$${DESTPATH} --proto_path=$${PROTOPATH} $${PROTOPATH}/$${pf}
|
QMAKE_EXTRA_TARGETS += protobuf_gen
|
||||||
protobuf_gen.commands = $${CMD}
|
PRE_TARGETDEPS += protobuf_gen
|
||||||
QMAKE_EXTRA_TARGETS += protobuf_gen
|
|
||||||
PRE_TARGETDEPS += protobuf_gen
|
HEADERS += rpc/proto/rpcprotopeers.h \
|
||||||
|
rpc/proto/rpcprotosystem.h \
|
||||||
HEADERS += rpc/proto/rpcprotopeers.h \
|
rpc/proto/rpcprotochat.h \
|
||||||
rpc/proto/rpcprotosystem.h \
|
rpc/proto/rpcprotosearch.h \
|
||||||
rpc/proto/rpcprotochat.h \
|
rpc/proto/rpcprotofiles.h \
|
||||||
rpc/proto/rpcprotosearch.h \
|
rpc/proto/rpcprotostream.h \
|
||||||
rpc/proto/rpcprotofiles.h \
|
rpc/proto/rpcprotoutils.h \
|
||||||
rpc/proto/rpcprotostream.h \
|
|
||||||
rpc/proto/rpcprotoutils.h \
|
SOURCES += rpc/proto/rpcprotopeers.cc \
|
||||||
|
rpc/proto/rpcprotosystem.cc \
|
||||||
SOURCES += rpc/proto/rpcprotopeers.cc \
|
rpc/proto/rpcprotochat.cc \
|
||||||
rpc/proto/rpcprotosystem.cc \
|
rpc/proto/rpcprotosearch.cc \
|
||||||
rpc/proto/rpcprotochat.cc \
|
rpc/proto/rpcprotofiles.cc \
|
||||||
rpc/proto/rpcprotosearch.cc \
|
rpc/proto/rpcprotostream.cc \
|
||||||
rpc/proto/rpcprotofiles.cc \
|
rpc/proto/rpcprotoutils.cc \
|
||||||
rpc/proto/rpcprotostream.cc \
|
|
||||||
rpc/proto/rpcprotoutils.cc \
|
# Offical Generated Code (protobuf 2.4.1)
|
||||||
|
HEADERS += rpc/proto/gencc/core.pb.h \
|
||||||
# Offical Generated Code (protobuf 2.4.1)
|
rpc/proto/gencc/peers.pb.h \
|
||||||
HEADERS += rpc/proto/gencc/core.pb.h \
|
rpc/proto/gencc/system.pb.h \
|
||||||
rpc/proto/gencc/peers.pb.h \
|
rpc/proto/gencc/chat.pb.h \
|
||||||
rpc/proto/gencc/system.pb.h \
|
rpc/proto/gencc/search.pb.h \
|
||||||
rpc/proto/gencc/chat.pb.h \
|
rpc/proto/gencc/files.pb.h \
|
||||||
rpc/proto/gencc/search.pb.h \
|
rpc/proto/gencc/stream.pb.h \
|
||||||
rpc/proto/gencc/files.pb.h \
|
|
||||||
rpc/proto/gencc/stream.pb.h \
|
SOURCES += rpc/proto/gencc/core.pb.cc \
|
||||||
|
rpc/proto/gencc/peers.pb.cc \
|
||||||
SOURCES += rpc/proto/gencc/core.pb.cc \
|
rpc/proto/gencc/system.pb.cc \
|
||||||
rpc/proto/gencc/peers.pb.cc \
|
rpc/proto/gencc/chat.pb.cc \
|
||||||
rpc/proto/gencc/system.pb.cc \
|
rpc/proto/gencc/search.pb.cc \
|
||||||
rpc/proto/gencc/chat.pb.cc \
|
rpc/proto/gencc/files.pb.cc \
|
||||||
rpc/proto/gencc/search.pb.cc \
|
rpc/proto/gencc/stream.pb.cc \
|
||||||
rpc/proto/gencc/files.pb.cc \
|
|
||||||
rpc/proto/gencc/stream.pb.cc \
|
# Generated ProtoBuf Code the RPC System
|
||||||
|
# If you are developing, or have a different version of protobuf
|
||||||
# Generated ProtoBuf Code the RPC System
|
# you can use these ones (run make inside rsctrl/src/ to generate)
|
||||||
# If you are developing, or have a different version of protobuf
|
#HEADERS += ../../rsctrl/src/gencc/core.pb.h \
|
||||||
# you can use these ones (run make inside rsctrl/src/ to generate)
|
# ../../rsctrl/src/gencc/peers.pb.h \
|
||||||
#HEADERS += ../../rsctrl/src/gencc/core.pb.h \
|
# ../../rsctrl/src/gencc/system.pb.h \
|
||||||
# ../../rsctrl/src/gencc/peers.pb.h \
|
# ../../rsctrl/src/gencc/chat.pb.h \
|
||||||
# ../../rsctrl/src/gencc/system.pb.h \
|
# ../../rsctrl/src/gencc/search.pb.h \
|
||||||
# ../../rsctrl/src/gencc/chat.pb.h \
|
# ../../rsctrl/src/gencc/files.pb.h \
|
||||||
# ../../rsctrl/src/gencc/search.pb.h \
|
# ../../rsctrl/src/gencc/stream.pb.h \
|
||||||
# ../../rsctrl/src/gencc/files.pb.h \
|
|
||||||
# ../../rsctrl/src/gencc/stream.pb.h \
|
#SOURCES += ../../rsctrl/src/gencc/core.pb.cc \
|
||||||
|
# ../../rsctrl/src/gencc/peers.pb.cc \
|
||||||
#SOURCES += ../../rsctrl/src/gencc/core.pb.cc \
|
# ../../rsctrl/src/gencc/system.pb.cc \
|
||||||
# ../../rsctrl/src/gencc/peers.pb.cc \
|
# ../../rsctrl/src/gencc/chat.pb.cc \
|
||||||
# ../../rsctrl/src/gencc/system.pb.cc \
|
# ../../rsctrl/src/gencc/search.pb.cc \
|
||||||
# ../../rsctrl/src/gencc/chat.pb.cc \
|
# ../../rsctrl/src/gencc/files.pb.cc \
|
||||||
# ../../rsctrl/src/gencc/search.pb.cc \
|
# ../../rsctrl/src/gencc/stream.pb.cc \
|
||||||
# ../../rsctrl/src/gencc/files.pb.cc \
|
|
||||||
# ../../rsctrl/src/gencc/stream.pb.cc \
|
DEPENDPATH *= rpc/proto/gencc
|
||||||
|
INCLUDEPATH *= rpc/proto/gencc
|
||||||
DEPENDPATH *= rpc/proto/gencc
|
|
||||||
INCLUDEPATH *= rpc/proto/gencc
|
!win32 {
|
||||||
|
# unrecognized option
|
||||||
!win32 {
|
QMAKE_CFLAGS += -pthread
|
||||||
# unrecognized option
|
QMAKE_CXXFLAGS += -pthread
|
||||||
QMAKE_CFLAGS += -pthread
|
}
|
||||||
QMAKE_CXXFLAGS += -pthread
|
LIBS += -lprotobuf -lpthread
|
||||||
}
|
|
||||||
LIBS += -lprotobuf -lpthread
|
win32 {
|
||||||
|
DEPENDPATH += $$LIBS_DIR/include/protobuf
|
||||||
win32 {
|
INCLUDEPATH += $$LIBS_DIR/include/protobuf
|
||||||
DEPENDPATH += $$LIBS_DIR/include/protobuf
|
}
|
||||||
INCLUDEPATH += $$LIBS_DIR/include/protobuf
|
|
||||||
}
|
macx {
|
||||||
|
PROTOPATH = ../../../protobuf-2.4.1
|
||||||
macx {
|
INCLUDEPATH += $${PROTOPATH}/src
|
||||||
PROTOPATH = ../../../protobuf-2.4.1
|
}
|
||||||
INCLUDEPATH += $${PROTOPATH}/src
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
# To {dis,en}able libresapi via local socket (unix domain socket or windows named pipes)
|
||||||
|
# {,un}comment the following line
|
||||||
|
#CONFIG *= libresapilocalserver
|
||||||
|
|
||||||
|
# To {dis,en}able libresapi via HTTP (libmicrohttpd) {,un}comment the following line
|
||||||
|
CONFIG *= libresapihttpserver
|
||||||
|
|
||||||
# Gxs is always enabled now.
|
# Gxs is always enabled now.
|
||||||
DEFINES *= RS_ENABLE_GXS
|
DEFINES *= RS_ENABLE_GXS
|
||||||
|
|
||||||
@ -10,6 +17,25 @@ unix {
|
|||||||
isEmpty(PLUGIN_DIR) { PLUGIN_DIR = "$${LIB_DIR}/retroshare/extensions6" }
|
isEmpty(PLUGIN_DIR) { PLUGIN_DIR = "$${LIB_DIR}/retroshare/extensions6" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
android-g++ {
|
||||||
|
DEFINES *= NO_SQLCIPHER
|
||||||
|
DEFINES *= "fopen64=fopen"
|
||||||
|
DEFINES *= "fseeko64=fseeko"
|
||||||
|
DEFINES *= "ftello64=ftello"
|
||||||
|
INCLUDEPATH *= $$NDK_TOOLCHAIN_PATH/sysroot/usr/include/
|
||||||
|
LIBS *= -L$$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/
|
||||||
|
LIBS *= -lssl -lcrypto -lsqlite3 -lupnp -lixml
|
||||||
|
ANDROID_EXTRA_LIBS *= $$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/libcrypto.so
|
||||||
|
ANDROID_EXTRA_LIBS *= $$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/libssl.so
|
||||||
|
ANDROID_EXTRA_LIBS *= $$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/libbz2.so
|
||||||
|
ANDROID_EXTRA_LIBS *= $$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/libsqlite3.so
|
||||||
|
ANDROID_EXTRA_LIBS *= $$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/libupnp.so
|
||||||
|
ANDROID_EXTRA_LIBS *= $$NDK_TOOLCHAIN_PATH/sysroot/usr/lib/libixml.so
|
||||||
|
message(NDK_TOOLCHAIN_PATH: $$NDK_TOOLCHAIN_PATH)
|
||||||
|
message(LIBS: $$LIBS)
|
||||||
|
message(ANDROID_EXTRA_LIBS: $$ANDROID_EXTRA_LIBS)
|
||||||
|
}
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
message(***retroshare.pri:Win32)
|
message(***retroshare.pri:Win32)
|
||||||
exists($$PWD/../libs) {
|
exists($$PWD/../libs) {
|
||||||
@ -62,3 +88,6 @@ unfinished {
|
|||||||
}
|
}
|
||||||
|
|
||||||
wikipoos:DEFINES *= RS_USE_WIKI
|
wikipoos:DEFINES *= RS_USE_WIKI
|
||||||
|
|
||||||
|
libresapilocalserver:DEFINES *= LIBRESAPI_LOCAL_SERVER
|
||||||
|
libresapihttpserver::DEFINES *= ENABLE_WEBUI
|
||||||
|
Loading…
Reference in New Issue
Block a user