mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 06:02:41 -04:00
WebUI is now optional but enabled by default at compile time
This commit is contained in:
parent
b4a10749f4
commit
fe7de83529
11 changed files with 426 additions and 380 deletions
|
@ -8,10 +8,11 @@ TARGET = resapi
|
||||||
TARGET_PRL = libresapi
|
TARGET_PRL = libresapi
|
||||||
DESTDIR = lib
|
DESTDIR = lib
|
||||||
|
|
||||||
CONFIG += libmicrohttpd
|
|
||||||
|
|
||||||
INCLUDEPATH += ../../libretroshare/src
|
INCLUDEPATH += ../../libretroshare/src
|
||||||
|
|
||||||
|
libresapihttpserver {
|
||||||
|
CONFIG += libmicrohttpd
|
||||||
|
|
||||||
unix {
|
unix {
|
||||||
|
|
||||||
webui_files.path = "$${DATA_DIR}/webui"
|
webui_files.path = "$${DATA_DIR}/webui"
|
||||||
|
@ -106,7 +107,6 @@ win32{
|
||||||
system($$MAKE_SRC\\init.bat .)
|
system($$MAKE_SRC\\init.bat .)
|
||||||
}
|
}
|
||||||
|
|
||||||
libmicrohttpd{
|
|
||||||
linux {
|
linux {
|
||||||
CONFIG += link_pkgconfig
|
CONFIG += link_pkgconfig
|
||||||
PKGCONFIG *= libmicrohttpd
|
PKGCONFIG *= libmicrohttpd
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
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 Move in appropriate place
|
// TODO: LIBRESAPI_LOCAL_SERVER Put indipendent option for libresapilocalserver in appropriate place
|
||||||
#ifdef LIBRESAPI_LOCAL_SERVER
|
#ifdef LIBRESAPI_LOCAL_SERVER
|
||||||
resource_api::ApiServerLocal* WebuiPage::apiServerLocal = 0;
|
resource_api::ApiServerLocal* WebuiPage::apiServerLocal = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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,7 +551,6 @@ 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
|
||||||
|
}
|
||||||
|
|
|
@ -5,8 +5,6 @@ TARGET = RetroShare06-nogui
|
||||||
CONFIG += bitdht
|
CONFIG += bitdht
|
||||||
#CONFIG += introserver
|
#CONFIG += introserver
|
||||||
#CONFIG += sshserver
|
#CONFIG += sshserver
|
||||||
# webinterface, requires libmicrohttpd
|
|
||||||
CONFIG += webui
|
|
||||||
CONFIG -= qt xml gui
|
CONFIG -= qt xml gui
|
||||||
CONFIG += link_prl
|
CONFIG += link_prl
|
||||||
|
|
||||||
|
@ -184,7 +182,7 @@ introserver {
|
||||||
DEFINES *= RS_INTRO_SERVER
|
DEFINES *= RS_INTRO_SERVER
|
||||||
}
|
}
|
||||||
|
|
||||||
webui {
|
libresapihttpserver {
|
||||||
DEFINES *= ENABLE_WEBUI
|
DEFINES *= ENABLE_WEBUI
|
||||||
PRE_TARGETDEPS *= ../../libresapi/src/lib/libresapi.a
|
PRE_TARGETDEPS *= ../../libresapi/src/lib/libresapi.a
|
||||||
LIBS += ../../libresapi/src/lib/libresapi.a
|
LIBS += ../../libresapi/src/lib/libresapi.a
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
# {,un}comment the following line
|
# {,un}comment the following line
|
||||||
#CONFIG *= libresapilocalserver
|
#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
|
||||||
|
|
||||||
|
@ -14,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) {
|
||||||
|
@ -68,3 +90,4 @@ unfinished {
|
||||||
wikipoos:DEFINES *= RS_USE_WIKI
|
wikipoos:DEFINES *= RS_USE_WIKI
|
||||||
|
|
||||||
libresapilocalserver:DEFINES *= LIBRESAPI_LOCAL_SERVER
|
libresapilocalserver:DEFINES *= LIBRESAPI_LOCAL_SERVER
|
||||||
|
libresapihttpserver::DEFINES *= ENABLE_WEBUI
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue