mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-12 07:59:29 -05:00
added web interface to tray menu
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8181 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
bb2f131464
commit
7ba6b24122
@ -108,6 +108,7 @@
|
|||||||
#include "gui/common/RsCollectionFile.h"
|
#include "gui/common/RsCollectionFile.h"
|
||||||
#include "settings/rsettingswin.h"
|
#include "settings/rsettingswin.h"
|
||||||
#include "settings/rsharesettings.h"
|
#include "settings/rsharesettings.h"
|
||||||
|
#include "settings/WebuiPage.h"
|
||||||
#include "common/StatusDefs.h"
|
#include "common/StatusDefs.h"
|
||||||
#include "gui/notifyqt.h"
|
#include "gui/notifyqt.h"
|
||||||
|
|
||||||
@ -605,6 +606,7 @@ void MainWindow::createTrayIcon()
|
|||||||
trayMenu->addSeparator();
|
trayMenu->addSeparator();
|
||||||
//trayMenu->addAction(QIcon(IMAGE_RSM16), tr("Open Messenger"), this, SLOT(showMessengerWindow()));
|
//trayMenu->addAction(QIcon(IMAGE_RSM16), 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()));
|
||||||
|
trayMenu->addAction(QIcon(":/images/emblem-web.png"), tr("Show web interface"), this, SLOT(showWebinterface()));
|
||||||
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()));
|
||||||
|
|
||||||
@ -1093,7 +1095,11 @@ void MainWindow::showMessengerWindow()
|
|||||||
void MainWindow::showStatisticsWindow()
|
void MainWindow::showStatisticsWindow()
|
||||||
{
|
{
|
||||||
StatisticsWindow::showYourself();
|
StatisticsWindow::showYourself();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::showWebinterface()
|
||||||
|
{
|
||||||
|
WebuiPage::showWebui();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Shows Application window */
|
/** Shows Application window */
|
||||||
|
@ -207,6 +207,7 @@ private slots:
|
|||||||
void newRsCollection();
|
void newRsCollection();
|
||||||
void showMessengerWindow();
|
void showMessengerWindow();
|
||||||
void showStatisticsWindow();
|
void showStatisticsWindow();
|
||||||
|
void showWebinterface();
|
||||||
//void servicePermission();
|
//void servicePermission();
|
||||||
|
|
||||||
#ifdef UNFINISHED
|
#ifdef UNFINISHED
|
||||||
|
@ -109,6 +109,18 @@ QString WebuiPage::helpText() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*static*/ void WebuiPage::showWebui()
|
||||||
|
{
|
||||||
|
if(Settings->getWebinterfaceEnabled())
|
||||||
|
{
|
||||||
|
QDesktopServices::openUrl(QUrl(QString("http://localhost:")+QString::number(Settings->getWebinterfacePort())));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QMessageBox::warning(0, tr("Webinterface not enabled"), "The webinterface is not enabled. Enable it in Settings -> Webinterface.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void WebuiPage::onEnableCBClicked(bool checked)
|
void WebuiPage::onEnableCBClicked(bool checked)
|
||||||
{
|
{
|
||||||
if(checked)
|
if(checked)
|
||||||
|
@ -35,6 +35,9 @@ public:
|
|||||||
// it stops the webinterface if its running
|
// it stops the webinterface if its running
|
||||||
static void checkShutdownWebui();
|
static void checkShutdownWebui();
|
||||||
|
|
||||||
|
// show webinterface in default browser (if enabled)
|
||||||
|
static void showWebui();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void onEnableCBClicked(bool checked);
|
void onEnableCBClicked(bool checked);
|
||||||
void onApplyClicked();
|
void onApplyClicked();
|
||||||
|
Loading…
Reference in New Issue
Block a user