mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-02 05:02:33 -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
|
@ -29,7 +29,10 @@
|
|||
#include <retroshare/rsdisc.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
#include "settings/rsharesettings.h"
|
||||
|
||||
#ifdef ENABLE_WEBUI
|
||||
#include <microhttpd.h>
|
||||
#endif
|
||||
|
||||
#include <QClipboard>
|
||||
#include <QSysInfo>
|
||||
|
@ -781,11 +784,13 @@ void AboutDialog::on_copy_button_clicked()
|
|||
RsControl::instance()->getLibraries(libraries);
|
||||
verInfo+=addLibraries("libretroshare", libraries);
|
||||
|
||||
#ifdef ENABLE_WEBUI
|
||||
/* Add version numbers of RetroShare */
|
||||
// Add versions here. Find a better place.
|
||||
libraries.clear();
|
||||
libraries.push_back(RsLibraryInfo("Libmicrohttpd", MHD_get_version()));
|
||||
verInfo+=addLibraries("RetroShare", libraries);
|
||||
#endif // ENABLE_WEBUI
|
||||
|
||||
/* Add version numbers of plugins */
|
||||
if (rsPlugins) {
|
||||
|
|
|
@ -24,7 +24,10 @@
|
|||
|
||||
#include <retroshare/rsiface.h>
|
||||
#include <retroshare/rsplugin.h>
|
||||
|
||||
#ifdef ENABLE_WEBUI
|
||||
#include <microhttpd.h>
|
||||
#endif // ENABLE_WEBUI
|
||||
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
|
@ -94,11 +97,13 @@ HelpDialog::HelpDialog(QWidget *parent) :
|
|||
RsControl::instance()->getLibraries(libraries);
|
||||
addLibraries(ui->libraryLayout, "libretroshare", libraries);
|
||||
|
||||
#ifdef ENABLE_WEBUI
|
||||
/* Add version numbers of RetroShare */
|
||||
// Add versions here. Find a better place.
|
||||
libraries.clear();
|
||||
libraries.push_back(RsLibraryInfo("Libmicrohttpd", MHD_get_version()));
|
||||
addLibraries(ui->libraryLayout, "RetroShare", libraries);
|
||||
#endif // ENABLE_WEBUI
|
||||
|
||||
/* Add version numbers of plugins */
|
||||
if (rsPlugins) {
|
||||
|
|
|
@ -562,7 +562,9 @@ void MainWindow::createTrayIcon()
|
|||
trayMenu->addSeparator();
|
||||
trayMenu->addAction(QIcon(IMAGE_MESSENGER), tr("Open Messenger"), this, SLOT(showMessengerWindow()));
|
||||
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()));
|
||||
#endif // ENABLE_WEBUI
|
||||
trayMenu->addAction(QIcon(IMAGE_BWGRAPH), tr("Bandwidth Graph"), _bandwidthGraph, SLOT(showWindow()));
|
||||
trayMenu->addAction(QIcon(IMAGE_DHT), tr("Statistics"), this, SLOT(showStatisticsWindow()));
|
||||
|
||||
|
@ -1061,10 +1063,12 @@ void MainWindow::showStatisticsWindow()
|
|||
StatisticsWindow::showYourself();
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WEBUI
|
||||
void MainWindow::showWebinterface()
|
||||
{
|
||||
WebuiPage::showWebui();
|
||||
}
|
||||
#endif // ENABLE_WEBUI
|
||||
|
||||
/** Shows Application window */
|
||||
#ifdef UNFINISHED
|
||||
|
|
|
@ -211,7 +211,9 @@ private slots:
|
|||
void newRsCollection();
|
||||
void showMessengerWindow();
|
||||
void showStatisticsWindow();
|
||||
#ifdef ENABLE_WEBUI
|
||||
void showWebinterface();
|
||||
#endif
|
||||
//void servicePermission();
|
||||
|
||||
#ifdef UNFINISHED
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
resource_api::ApiServer* WebuiPage::apiServer = 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
|
||||
resource_api::ApiServerLocal* WebuiPage::apiServerLocal = 0;
|
||||
#endif
|
||||
|
|
|
@ -152,8 +152,9 @@ RSettingsWin::initStackedWidget()
|
|||
addPage(new AppearancePage());
|
||||
addPage(new SoundPage() );
|
||||
addPage(new ServicePermissionsPage() );
|
||||
#ifdef ENABLE_WEBUI
|
||||
addPage(new WebuiPage() );
|
||||
|
||||
#endif // ENABLE_WEBUI
|
||||
// add widgets from plugins
|
||||
|
||||
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.
|
||||
|
||||
#ifdef ENABLE_WEBUI
|
||||
WebuiPage::checkStartWebui();
|
||||
#endif // ENABLE_WEBUI
|
||||
|
||||
/* dive into the endless loop */
|
||||
int ti = rshare.exec();
|
||||
delete w ;
|
||||
|
||||
#ifdef ENABLE_WEBUI
|
||||
WebuiPage::checkShutdownWebui();
|
||||
#endif // ENABLE_WEBUI
|
||||
|
||||
/* cleanup */
|
||||
ChatDialog::cleanupChat();
|
||||
|
|
|
@ -551,8 +551,7 @@ HEADERS += rshare.h \
|
|||
gui/connect/ConnectProgressDialog.h \
|
||||
gui/groups/CreateGroup.h \
|
||||
gui/GetStartedDialog.h \
|
||||
gui/settings/WebuiPage.h \
|
||||
gui/statistics/BWGraph.h \
|
||||
gui/statistics/BWGraph.h \
|
||||
util/RsSyntaxHighlighter.h \
|
||||
util/imageutil.h
|
||||
|
||||
|
@ -671,7 +670,7 @@ FORMS += gui/StartDialog.ui \
|
|||
gui/statistics/BwCtrlWindow.ui \
|
||||
gui/statistics/RttStatistics.ui \
|
||||
gui/GetStartedDialog.ui \
|
||||
gui/settings/WebuiPage.ui
|
||||
|
||||
|
||||
# gui/ForumsDialog.ui \
|
||||
# gui/forums/CreateForum.ui \
|
||||
|
@ -854,7 +853,6 @@ SOURCES += main.cpp \
|
|||
gui/settings/ServicePermissionsPage.cpp \
|
||||
gui/settings/AddFileAssociationDialog.cpp \
|
||||
gui/settings/GroupFrameSettingsWidget.cpp \
|
||||
gui/settings/WebuiPage.cpp \
|
||||
gui/statusbar/peerstatus.cpp \
|
||||
gui/statusbar/natstatus.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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue