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:
electron128 2015-04-28 14:55:13 +00:00
parent bb2f131464
commit 7ba6b24122
4 changed files with 22 additions and 0 deletions

View File

@ -108,6 +108,7 @@
#include "gui/common/RsCollectionFile.h"
#include "settings/rsettingswin.h"
#include "settings/rsharesettings.h"
#include "settings/WebuiPage.h"
#include "common/StatusDefs.h"
#include "gui/notifyqt.h"
@ -605,6 +606,7 @@ void MainWindow::createTrayIcon()
trayMenu->addSeparator();
//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(":/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_DHT), tr("Statistics"), this, SLOT(showStatisticsWindow()));
@ -1093,7 +1095,11 @@ void MainWindow::showMessengerWindow()
void MainWindow::showStatisticsWindow()
{
StatisticsWindow::showYourself();
}
void MainWindow::showWebinterface()
{
WebuiPage::showWebui();
}
/** Shows Application window */

View File

@ -207,6 +207,7 @@ private slots:
void newRsCollection();
void showMessengerWindow();
void showStatisticsWindow();
void showWebinterface();
//void servicePermission();
#ifdef UNFINISHED

View File

@ -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)
{
if(checked)

View File

@ -35,6 +35,9 @@ public:
// it stops the webinterface if its running
static void checkShutdownWebui();
// show webinterface in default browser (if enabled)
static void showWebui();
public slots:
void onEnableCBClicked(bool checked);
void onApplyClicked();