Merge pull request #36 from RetroShare/master

update to master
This commit is contained in:
defnax 2019-11-27 21:32:01 +01:00 committed by GitHub
commit 220ccd8bf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 42 additions and 21 deletions

View File

@ -29,6 +29,12 @@ rs_jsonapi:isEmpty(JSONAPI_GENERATOR_EXE) {
libretroshare.depends += jsonapi-generator libretroshare.depends += jsonapi-generator
} }
rs_webui {
!rs_jsonapi {
error("rs_webui requires rs_jsonapi")
}
}
SUBDIRS += libbitdht SUBDIRS += libbitdht
libbitdht.file = libbitdht/src/libbitdht.pro libbitdht.file = libbitdht/src/libbitdht.pro
libretroshare.depends += openpgpsdk libbitdht libretroshare.depends += openpgpsdk libbitdht

View File

@ -61,7 +61,6 @@
#include "gxstunnel/p3gxstunnel.h" #include "gxstunnel/p3gxstunnel.h"
#include "retroshare/rsgxsdistsync.h" #include "retroshare/rsgxsdistsync.h"
#include "file_sharing/p3filelists.h" #include "file_sharing/p3filelists.h"
#include "jsonapi/jsonapi.h"
#define ENABLE_GROUTER #define ENABLE_GROUTER
@ -97,6 +96,10 @@ RsDht *rsDht = NULL ;
#ifdef RS_JSONAPI #ifdef RS_JSONAPI
# include "jsonapi/jsonapi.h" # include "jsonapi/jsonapi.h"
#ifdef RS_WEBUI
#include "jsonapi/jsonapi.h"
#endif
#endif #endif
#ifdef RS_BROADCAST_DISCOVERY #ifdef RS_BROADCAST_DISCOVERY

View File

@ -23,7 +23,9 @@
#include "HelpDialog.h" #include "HelpDialog.h"
#include "rshare.h" #include "rshare.h"
#ifdef RS_JSONAPI
#include "restbed" #include "restbed"
#endif
#include <retroshare/rsiface.h> #include <retroshare/rsiface.h>
#include <retroshare/rsplugin.h> #include <retroshare/rsplugin.h>
@ -970,13 +972,13 @@ void AboutWidget::on_copy_button_clicked()
RsControl::instance()->getLibraries(libraries); RsControl::instance()->getLibraries(libraries);
verInfo+=addLibraries("libretroshare", libraries); verInfo+=addLibraries("libretroshare", libraries);
// #ifdef RS_WEBUI #ifdef RS_JSONAPI
// /* 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("RestBed", restbed::get_version())); libraries.push_back(RsLibraryInfo("RestBed", restbed::get_version()));
// verInfo+=addLibraries("RetroShare", libraries); verInfo+=addLibraries("RetroShare", libraries);
// #endif #endif
/* Add version numbers of plugins */ /* Add version numbers of plugins */
if (rsPlugins) { if (rsPlugins) {

View File

@ -606,8 +606,10 @@ void MainWindow::createTrayIcon()
trayMenu->addAction(QIcon(IMAGE_MESSENGER), tr("Open Messenger"), this, SLOT(showMessengerWindow())); trayMenu->addAction(QIcon(IMAGE_MESSENGER), tr("Open Messenger"), this, SLOT(showMessengerWindow()));
#endif #endif
trayMenu->addAction(QIcon(IMAGE_MESSAGES), tr("Open Messages"), this, SLOT(showMess())); trayMenu->addAction(QIcon(IMAGE_MESSAGES), tr("Open Messages"), this, SLOT(showMess()));
#ifdef RS_JSONAPI
#ifdef RS_WEBUI #ifdef RS_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
#endif #endif
trayMenu->addAction(QIcon(IMAGE_BWGRAPH), tr("Bandwidth Graph"), this, SLOT(showBandwidthGraph())); trayMenu->addAction(QIcon(IMAGE_BWGRAPH), tr("Bandwidth Graph"), this, SLOT(showBandwidthGraph()));
trayMenu->addAction(QIcon(IMAGE_STATS), tr("Statistics"), this, SLOT(showStatisticsWindow())); trayMenu->addAction(QIcon(IMAGE_STATS), tr("Statistics"), this, SLOT(showStatisticsWindow()));
@ -1117,12 +1119,14 @@ void MainWindow::showStatisticsWindow()
StatisticsWindow::showYourself(); StatisticsWindow::showYourself();
} }
#ifdef RS_JSONAPI
#ifdef RS_WEBUI #ifdef RS_WEBUI
void MainWindow::showWebinterface() void MainWindow::showWebinterface()
{ {
WebuiPage::showWebui(); WebuiPage::showWebui();
} }
#endif // ENABLE_WEBUI #endif // ENABLE_WEBUI
#endif
/** Shows Application window */ /** Shows Application window */
#ifdef UNFINISHED #ifdef UNFINISHED

View File

@ -230,8 +230,10 @@ private slots:
void showMessengerWindow(); void showMessengerWindow();
#endif #endif
void showStatisticsWindow(); void showStatisticsWindow();
#ifdef RS_JSONAPI
#ifdef RS_WEBUI #ifdef RS_WEBUI
void showWebinterface(); void showWebinterface();
#endif
#endif #endif
//void servicePermission(); //void servicePermission();

View File

@ -30,8 +30,9 @@
#include "rsharesettings.h" #include "rsharesettings.h"
#include "gui/MainWindow.h" #include "gui/MainWindow.h"
// for this one, we'd rather use a file in retroshare/*h list. #ifdef RS_JSONAPI
#include <jsonapi/jsonapi.h> #include <retroshare/rsjsonapi.h>
#endif
#include <retroshare/rsnotify.h> #include <retroshare/rsnotify.h>
#include <retroshare/rspeers.h> #include <retroshare/rspeers.h>

View File

@ -574,11 +574,11 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
#ifdef RS_JSONAPI #ifdef RS_JSONAPI
JsonApiPage::checkStartJsonApi(); JsonApiPage::checkStartJsonApi();
#endif // RS_JSONAPI
#ifdef RS_WEBUI #ifdef RS_WEBUI
WebuiPage::checkStartWebui(); // normally we should rather save the UI flags internally to p3webui WebuiPage::checkStartWebui(); // normally we should rather save the UI flags internally to p3webui
#endif #endif
#endif // RS_JSONAPI
// This is done using a timer, because the passphrase request from notify is asynchrouneous and therefore clearing the // This is done using a timer, because the passphrase request from notify is asynchrouneous and therefore clearing the
// passphrase here makes it request for a passphrase when creating the default chat identity. // passphrase here makes it request for a passphrase when creating the default chat identity.

View File

@ -31,10 +31,12 @@ INCLUDEPATH *= $${PWD} retroshare-gui
!include("../../libretroshare/src/use_libretroshare.pri"):error("Including") !include("../../libretroshare/src/use_libretroshare.pri"):error("Including")
rs_webui { rs_webui {
rs_jsonapi {
HEADERS *= gui/settings/WebuiPage.h HEADERS *= gui/settings/WebuiPage.h
SOURCES *= gui/settings/WebuiPage.cpp SOURCES *= gui/settings/WebuiPage.cpp
FORMS *= gui/settings/WebuiPage.ui FORMS *= gui/settings/WebuiPage.ui
} }
}
rs_jsonapi { rs_jsonapi {
HEADERS *= gui/settings/JsonApiPage.h HEADERS *= gui/settings/JsonApiPage.h

View File

@ -23,11 +23,11 @@
#ifdef RS_JSONAPI #ifdef RS_JSONAPI
#include "retroshare/rsjsonapi.h" #include "retroshare/rsjsonapi.h"
#endif
#ifdef RS_WEBUI #ifdef RS_WEBUI
#include "retroshare/rswebui.h" #include "retroshare/rswebui.h"
#endif #endif
#endif
static CrashStackTrace gCrashStackTrace; static CrashStackTrace gCrashStackTrace;
@ -124,10 +124,11 @@ int main(int argc, char* argv[])
std::string prefUserString; std::string prefUserString;
RsConfigOptions conf; RsConfigOptions conf;
std::string webui_base_directory = RsWebUi::DEFAULT_BASE_DIRECTORY;
#ifdef RS_JSONAPI #ifdef RS_JSONAPI
conf.jsonApiPort = RsJsonApi::DEFAULT_PORT; // enable JSonAPI by default conf.jsonApiPort = RsJsonApi::DEFAULT_PORT; // enable JSonAPI by default
#ifdef RS_WEBUI
std::string webui_base_directory = RsWebUi::DEFAULT_BASE_DIRECTORY;
#endif
#endif #endif
argstream as(argc,argv); argstream as(argc,argv);
@ -164,7 +165,7 @@ int main(int argc, char* argv[])
"127.0.0.1.", false ); "127.0.0.1.", false );
#endif // def RS_JSONAPI #endif // def RS_JSONAPI
#if (defined(RS_JSONAPI) || defined(RS_WEBUI)) && defined(RS_SERVICE_TERMINAL_WEBUI_PASSWORD) #if (defined(RS_JSONAPI) && defined(RS_WEBUI)) && defined(RS_SERVICE_TERMINAL_WEBUI_PASSWORD)
bool askWebUiPassword = false; bool askWebUiPassword = false;
as >> parameter( 'B', "webui-directory", webui_base_directory, "Place where to find the html/js files for the webui.",false ); as >> parameter( 'B', "webui-directory", webui_base_directory, "Place where to find the html/js files for the webui.",false );
as >> option( 'W', "webui-password", askWebUiPassword, "Ask WebUI password on the console." ); as >> option( 'W', "webui-password", askWebUiPassword, "Ask WebUI password on the console." );
@ -185,7 +186,7 @@ int main(int argc, char* argv[])
as >> help( 'h', "help", "Display this Help" ); as >> help( 'h', "help", "Display this Help" );
as.defaultErrorHandling(true, true); as.defaultErrorHandling(true, true);
#if (defined(RS_JSONAPI) || defined(RS_WEBUI)) && defined(RS_SERVICE_TERMINAL_WEBUI_PASSWORD) #if (defined(RS_JSONAPI) && defined(RS_WEBUI)) && defined(RS_SERVICE_TERMINAL_WEBUI_PASSWORD)
std::string webui_pass1 = "Y"; std::string webui_pass1 = "Y";
if(askWebUiPassword) if(askWebUiPassword)
{ {
@ -308,7 +309,7 @@ int main(int argc, char* argv[])
} }
#endif // def RS_SERVICE_TERMINAL_LOGIN #endif // def RS_SERVICE_TERMINAL_LOGIN
#if (defined(RS_JSONAPI) || defined(RS_WEBUI)) && defined(RS_SERVICE_TERMINAL_WEBUI_PASSWORD) #if (defined(RS_JSONAPI) && defined(RS_WEBUI)) && defined(RS_SERVICE_TERMINAL_WEBUI_PASSWORD)
if(rsJsonAPI && !webui_pass1.empty()) if(rsJsonAPI && !webui_pass1.empty())
{ {
rsWebUI->setHtmlFilesDirectory(webui_base_directory); rsWebUI->setHtmlFilesDirectory(webui_base_directory);

View File

@ -180,10 +180,10 @@ rs_use_native_dialogs:CONFIG -= no_rs_use_native_dialogs
CONFIG *= rs_broadcast_discovery CONFIG *= rs_broadcast_discovery
no_rs_broadcast_discovery:CONFIG -= rs_broadcast_discovery no_rs_broadcast_discovery:CONFIG -= rs_broadcast_discovery
# To disable webui append the following assignation to qmake # To enable webui append the following assignation to qmake
# command line "CONFIG+=rs_no_webui" # command line "CONFIG+=rs_webui"
CONFIG *= rs_webui CONFIG *= rs_no_webui
rs_no_webui:CONFIG -= rs_webui rs_webui:CONFIG -= rs_no_webui
# To enable webui append the following assignation to qmake # To enable webui append the following assignation to qmake
# command line "CONFIG+=rs_service_webui_terminal_password" # command line "CONFIG+=rs_service_webui_terminal_password"