mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 06:54:15 +00:00
Merge pull request #925 from hypnosis-i2p/openssl
Qt GUI now shows buttons under Status and their corresponding info panes
This commit is contained in:
commit
95af716a96
2
.gitignore
vendored
2
.gitignore
vendored
@ -262,3 +262,5 @@ qt/i2pd_qt/*.ui.autosave
|
|||||||
qt/i2pd_qt/*.ui.bk*
|
qt/i2pd_qt/*.ui.bk*
|
||||||
qt/i2pd_qt/*.ui_*
|
qt/i2pd_qt/*.ui_*
|
||||||
|
|
||||||
|
#unknown android stuff
|
||||||
|
android/libs/
|
||||||
|
@ -185,7 +185,7 @@ namespace http {
|
|||||||
s << "<b>ERROR:</b> " << string << "<br>\r\n";
|
s << "<b>ERROR:</b> " << string << "<br>\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowStatus (std::stringstream& s)
|
void ShowStatus (std::stringstream& s, bool includeHiddenContent)
|
||||||
{
|
{
|
||||||
s << "<b>Uptime:</b> ";
|
s << "<b>Uptime:</b> ";
|
||||||
ShowUptime(s, i2p::context.GetUptime ());
|
ShowUptime(s, i2p::context.GetUptime ());
|
||||||
@ -233,33 +233,35 @@ namespace http {
|
|||||||
s << " (" << (double) i2p::transport::transports.GetTransitBandwidth () / 1024 << " KiB/s)<br>\r\n";
|
s << " (" << (double) i2p::transport::transports.GetTransitBandwidth () / 1024 << " KiB/s)<br>\r\n";
|
||||||
s << "<b>Data path:</b> " << i2p::fs::GetDataDir() << "<br>\r\n";
|
s << "<b>Data path:</b> " << i2p::fs::GetDataDir() << "<br>\r\n";
|
||||||
s << "<div class='slide'\r\n><label for='slide1'>Hidden content. Press on text to see.</label>\r\n<input type='checkbox' id='slide1'/>\r\n<p class='content'>\r\n";
|
s << "<div class='slide'\r\n><label for='slide1'>Hidden content. Press on text to see.</label>\r\n<input type='checkbox' id='slide1'/>\r\n<p class='content'>\r\n";
|
||||||
s << "<b>Router Ident:</b> " << i2p::context.GetRouterInfo().GetIdentHashBase64() << "<br>\r\n";
|
if(includeHiddenContent) {
|
||||||
s << "<b>Router Family:</b> " << i2p::context.GetRouterInfo().GetProperty("family") << "<br>\r\n";
|
s << "<b>Router Ident:</b> " << i2p::context.GetRouterInfo().GetIdentHashBase64() << "<br>\r\n";
|
||||||
s << "<b>Router Caps:</b> " << i2p::context.GetRouterInfo().GetProperty("caps") << "<br>\r\n";
|
s << "<b>Router Family:</b> " << i2p::context.GetRouterInfo().GetProperty("family") << "<br>\r\n";
|
||||||
s << "<b>Our external address:</b>" << "<br>\r\n" ;
|
s << "<b>Router Caps:</b> " << i2p::context.GetRouterInfo().GetProperty("caps") << "<br>\r\n";
|
||||||
for (const auto& address : i2p::context.GetRouterInfo().GetAddresses())
|
s << "<b>Our external address:</b>" << "<br>\r\n" ;
|
||||||
{
|
for (const auto& address : i2p::context.GetRouterInfo().GetAddresses())
|
||||||
switch (address->transportStyle)
|
{
|
||||||
{
|
switch (address->transportStyle)
|
||||||
case i2p::data::RouterInfo::eTransportNTCP:
|
{
|
||||||
if (address->host.is_v6 ())
|
case i2p::data::RouterInfo::eTransportNTCP:
|
||||||
s << "NTCP6 ";
|
if (address->host.is_v6 ())
|
||||||
else
|
s << "NTCP6 ";
|
||||||
s << "NTCP ";
|
else
|
||||||
break;
|
s << "NTCP ";
|
||||||
case i2p::data::RouterInfo::eTransportSSU:
|
break;
|
||||||
if (address->host.is_v6 ())
|
case i2p::data::RouterInfo::eTransportSSU:
|
||||||
s << "SSU6 ";
|
if (address->host.is_v6 ())
|
||||||
else
|
s << "SSU6 ";
|
||||||
s << "SSU ";
|
else
|
||||||
break;
|
s << "SSU ";
|
||||||
default:
|
break;
|
||||||
s << "Unknown ";
|
default:
|
||||||
}
|
s << "Unknown ";
|
||||||
s << address->host.to_string() << ":" << address->port << "<br>\r\n";
|
}
|
||||||
}
|
s << address->host.to_string() << ":" << address->port << "<br>\r\n";
|
||||||
s << "</p>\r\n</div>\r\n";
|
}
|
||||||
s << "<b>Routers:</b> " << i2p::data::netdb.GetNumRouters () << " ";
|
}
|
||||||
|
s << "</p>\r\n</div>\r\n";
|
||||||
|
s << "<b>Routers:</b> " << i2p::data::netdb.GetNumRouters () << " ";
|
||||||
s << "<b>Floodfills:</b> " << i2p::data::netdb.GetNumFloodfills () << " ";
|
s << "<b>Floodfills:</b> " << i2p::data::netdb.GetNumFloodfills () << " ";
|
||||||
s << "<b>LeaseSets:</b> " << i2p::data::netdb.GetNumLeaseSets () << "<br>\r\n";
|
s << "<b>LeaseSets:</b> " << i2p::data::netdb.GetNumLeaseSets () << "<br>\r\n";
|
||||||
|
|
||||||
@ -271,7 +273,7 @@ namespace http {
|
|||||||
s << "<b>Transit Tunnels:</b> " << std::to_string(transitTunnelCount) << "<br>\r\n";
|
s << "<b>Transit Tunnels:</b> " << std::to_string(transitTunnelCount) << "<br>\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowLocalDestinations (std::stringstream& s)
|
void ShowLocalDestinations (std::stringstream& s)
|
||||||
{
|
{
|
||||||
s << "<b>Local Destinations:</b><br>\r\n<br>\r\n";
|
s << "<b>Local Destinations:</b><br>\r\n<br>\r\n";
|
||||||
for (auto& it: i2p::client::context.GetDestinations ())
|
for (auto& it: i2p::client::context.GetDestinations ())
|
||||||
@ -339,7 +341,7 @@ namespace http {
|
|||||||
s << "<br>" << std::endl;
|
s << "<br>" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowLocalDestination (std::stringstream& s, const std::string& b32)
|
void ShowLocalDestination (std::stringstream& s, const std::string& b32)
|
||||||
{
|
{
|
||||||
s << "<b>Local Destination:</b><br>\r\n<br>\r\n";
|
s << "<b>Local Destination:</b><br>\r\n<br>\r\n";
|
||||||
i2p::data::IdentHash ident;
|
i2p::data::IdentHash ident;
|
||||||
@ -397,7 +399,7 @@ namespace http {
|
|||||||
ShowError(s, "I2CP is not enabled");
|
ShowError(s, "I2CP is not enabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowLeasesSets(std::stringstream& s)
|
void ShowLeasesSets(std::stringstream& s)
|
||||||
{
|
{
|
||||||
s << "<div id='leasesets'><b>LeaseSets (click on to show info):</b></div><br>\r\n";
|
s << "<div id='leasesets'><b>LeaseSets (click on to show info):</b></div><br>\r\n";
|
||||||
int counter = 1;
|
int counter = 1;
|
||||||
@ -430,7 +432,7 @@ namespace http {
|
|||||||
// end for each lease set
|
// end for each lease set
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowTunnels (std::stringstream& s)
|
void ShowTunnels (std::stringstream& s)
|
||||||
{
|
{
|
||||||
s << "<b>Queue size:</b> " << i2p::tunnel::tunnels.GetQueueSize () << "<br>\r\n";
|
s << "<b>Queue size:</b> " << i2p::tunnel::tunnels.GetQueueSize () << "<br>\r\n";
|
||||||
|
|
||||||
@ -452,7 +454,7 @@ namespace http {
|
|||||||
s << "<br>\r\n";
|
s << "<br>\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowCommands (std::stringstream& s, uint32_t token)
|
static void ShowCommands (std::stringstream& s, uint32_t token)
|
||||||
{
|
{
|
||||||
/* commands */
|
/* commands */
|
||||||
s << "<b>Router Commands</b><br>\r\n";
|
s << "<b>Router Commands</b><br>\r\n";
|
||||||
@ -474,7 +476,7 @@ namespace http {
|
|||||||
s << " <a href=\"/?cmd=" << HTTP_COMMAND_SHUTDOWN_NOW << "&token=" << token << "\">Force shutdown</a><br>\r\n";
|
s << " <a href=\"/?cmd=" << HTTP_COMMAND_SHUTDOWN_NOW << "&token=" << token << "\">Force shutdown</a><br>\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowTransitTunnels (std::stringstream& s)
|
void ShowTransitTunnels (std::stringstream& s)
|
||||||
{
|
{
|
||||||
s << "<b>Transit tunnels:</b><br>\r\n<br>\r\n";
|
s << "<b>Transit tunnels:</b><br>\r\n<br>\r\n";
|
||||||
for (const auto& it: i2p::tunnel::tunnels.GetTransitTunnels ())
|
for (const auto& it: i2p::tunnel::tunnels.GetTransitTunnels ())
|
||||||
@ -489,7 +491,7 @@ namespace http {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowTransports (std::stringstream& s)
|
void ShowTransports (std::stringstream& s)
|
||||||
{
|
{
|
||||||
s << "<b>Transports:</b><br>\r\n<br>\r\n";
|
s << "<b>Transports:</b><br>\r\n<br>\r\n";
|
||||||
auto ntcpServer = i2p::transport::transports.GetNTCPServer ();
|
auto ntcpServer = i2p::transport::transports.GetNTCPServer ();
|
||||||
@ -575,7 +577,7 @@ namespace http {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowSAMSessions (std::stringstream& s)
|
void ShowSAMSessions (std::stringstream& s)
|
||||||
{
|
{
|
||||||
auto sam = i2p::client::context.GetSAMBridge ();
|
auto sam = i2p::client::context.GetSAMBridge ();
|
||||||
if (!sam) {
|
if (!sam) {
|
||||||
@ -622,7 +624,7 @@ namespace http {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowI2PTunnels (std::stringstream& s)
|
void ShowI2PTunnels (std::stringstream& s)
|
||||||
{
|
{
|
||||||
s << "<b>Client Tunnels:</b><br>\r\n<br>\r\n";
|
s << "<b>Client Tunnels:</b><br>\r\n<br>\r\n";
|
||||||
for (auto& it: i2p::client::context.GetClientTunnels ())
|
for (auto& it: i2p::client::context.GetClientTunnels ())
|
||||||
@ -797,7 +799,7 @@ namespace http {
|
|||||||
} else if (req.uri.find("cmd=") != std::string::npos) {
|
} else if (req.uri.find("cmd=") != std::string::npos) {
|
||||||
HandleCommand (req, res, s);
|
HandleCommand (req, res, s);
|
||||||
} else {
|
} else {
|
||||||
ShowStatus (s);
|
ShowStatus (s, true);
|
||||||
res.add_header("Refresh", "10");
|
res.add_header("Refresh", "10");
|
||||||
}
|
}
|
||||||
ShowPageTail (s);
|
ShowPageTail (s);
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
|
#include <sstream>
|
||||||
#include "HTTP.h"
|
#include "HTTP.h"
|
||||||
|
|
||||||
namespace i2p
|
namespace i2p
|
||||||
@ -75,6 +76,17 @@ namespace http
|
|||||||
boost::asio::io_service::work m_Work;
|
boost::asio::io_service::work m_Work;
|
||||||
boost::asio::ip::tcp::acceptor m_Acceptor;
|
boost::asio::ip::tcp::acceptor m_Acceptor;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//all the below functions are also used by Qt GUI, see mainwindow.cpp -> getStatusPageHtml
|
||||||
|
void ShowStatus (std::stringstream& s, bool includeHiddenContent);
|
||||||
|
void ShowLocalDestinations (std::stringstream& s);
|
||||||
|
void ShowLeasesSets(std::stringstream& s);
|
||||||
|
void ShowTunnels (std::stringstream& s);
|
||||||
|
void ShowTransitTunnels (std::stringstream& s);
|
||||||
|
void ShowTransports (std::stringstream& s);
|
||||||
|
void ShowSAMSessions (std::stringstream& s);
|
||||||
|
void ShowI2PTunnels (std::stringstream& s);
|
||||||
|
void ShowLocalDestination (std::stringstream& s, const std::string& b32);
|
||||||
} // http
|
} // http
|
||||||
} // i2p
|
} // i2p
|
||||||
|
|
||||||
|
@ -87,7 +87,9 @@ SOURCES += DaemonQT.cpp mainwindow.cpp \
|
|||||||
../../daemon/i2pd.cpp \
|
../../daemon/i2pd.cpp \
|
||||||
../../daemon/I2PControl.cpp \
|
../../daemon/I2PControl.cpp \
|
||||||
../../daemon/UnixDaemon.cpp \
|
../../daemon/UnixDaemon.cpp \
|
||||||
../../daemon/UPnP.cpp
|
../../daemon/UPnP.cpp \
|
||||||
|
textbrowsertweaked1.cpp \
|
||||||
|
pagewithbackbutton.cpp
|
||||||
|
|
||||||
#qt creator does not handle this well
|
#qt creator does not handle this well
|
||||||
#SOURCES += $$files(../../libi2pd/*.cpp)
|
#SOURCES += $$files(../../libi2pd/*.cpp)
|
||||||
@ -166,7 +168,9 @@ HEADERS += DaemonQT.h mainwindow.h \
|
|||||||
../../daemon/Daemon.h \
|
../../daemon/Daemon.h \
|
||||||
../../daemon/HTTPServer.h \
|
../../daemon/HTTPServer.h \
|
||||||
../../daemon/I2PControl.h \
|
../../daemon/I2PControl.h \
|
||||||
../../daemon/UPnP.h
|
../../daemon/UPnP.h \
|
||||||
|
textbrowsertweaked1.h \
|
||||||
|
pagewithbackbutton.h
|
||||||
|
|
||||||
INCLUDEPATH += ../../libi2pd
|
INCLUDEPATH += ../../libi2pd
|
||||||
INCLUDEPATH += ../../libi2pd_client
|
INCLUDEPATH += ../../libi2pd_client
|
||||||
@ -174,7 +178,9 @@ INCLUDEPATH += ../../daemon
|
|||||||
INCLUDEPATH += .
|
INCLUDEPATH += .
|
||||||
|
|
||||||
FORMS += mainwindow.ui \
|
FORMS += mainwindow.ui \
|
||||||
tunnelform.ui
|
tunnelform.ui \
|
||||||
|
statusbuttons.ui \
|
||||||
|
routercommandswidget.ui
|
||||||
|
|
||||||
LIBS += -lz
|
LIBS += -lz
|
||||||
|
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
|
#include <fstream>
|
||||||
|
#include <assert.h>
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
|
#include "ui_statusbuttons.h"
|
||||||
|
#include "ui_routercommandswidget.h"
|
||||||
|
#include <sstream>
|
||||||
|
#include <QScrollBar>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@ -8,15 +14,15 @@
|
|||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "FS.h"
|
#include "FS.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
|
#include "RouterContext.h"
|
||||||
|
#include "Transports.h"
|
||||||
|
|
||||||
|
#include "HTTPServer.h"
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
# include <QtDebug>
|
# include <QtDebug>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <QScrollBar>
|
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
|
|
||||||
#include "DaemonQT.h"
|
#include "DaemonQT.h"
|
||||||
#include "SignatureTypeComboboxFactory.h"
|
#include "SignatureTypeComboboxFactory.h"
|
||||||
|
|
||||||
@ -27,7 +33,12 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
,quitting(false)
|
,quitting(false)
|
||||||
#endif
|
#endif
|
||||||
|
,wasSelectingAtStatusMainPage(false)
|
||||||
|
,showHiddenInfoStatusMainPage(false)
|
||||||
,ui(new Ui::MainWindow)
|
,ui(new Ui::MainWindow)
|
||||||
|
,statusButtonsUI(new Ui::StatusButtonsForm)
|
||||||
|
,routerCommandsUI(new Ui::routerCommandsWidget)
|
||||||
|
,routerCommandsParent(new QWidget(this))
|
||||||
,i2pController(nullptr)
|
,i2pController(nullptr)
|
||||||
,configItems()
|
,configItems()
|
||||||
,datadir()
|
,datadir()
|
||||||
@ -37,12 +48,21 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
statusButtonsUI->setupUi(ui->statusButtonsPane);
|
||||||
|
routerCommandsUI->setupUi(routerCommandsParent);
|
||||||
|
routerCommandsParent->hide();
|
||||||
|
ui->verticalLayout_2->addWidget(routerCommandsParent);
|
||||||
|
//,statusHtmlUI(new Ui::StatusHtmlPaneForm)
|
||||||
|
//statusHtmlUI->setupUi(lastStatusWidgetui->statusWidget);
|
||||||
|
ui->statusButtonsPane->setFixedSize(171,300);
|
||||||
|
ui->verticalLayout->setGeometry(QRect(0,0,171,ui->verticalLayout->geometry().height()));
|
||||||
|
//ui->statusButtonsPane->adjustSize();
|
||||||
|
//ui->centralWidget->adjustSize();
|
||||||
setWindowTitle(QApplication::translate("AppTitle","I2PD"));
|
setWindowTitle(QApplication::translate("AppTitle","I2PD"));
|
||||||
|
|
||||||
//TODO handle resizes and change the below into resize() call
|
//TODO handle resizes and change the below into resize() call
|
||||||
setFixedSize(width(), 480);
|
setFixedHeight(550);
|
||||||
ui->centralWidget->setMinimumHeight(480);
|
ui->centralWidget->setFixedHeight(550);
|
||||||
ui->centralWidget->setMaximumHeight(480);
|
|
||||||
onResize();
|
onResize();
|
||||||
|
|
||||||
ui->stackedWidget->setCurrentIndex(0);
|
ui->stackedWidget->setCurrentIndex(0);
|
||||||
@ -69,7 +89,42 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
createTrayIcon();
|
createTrayIcon();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QObject::connect(ui->statusPagePushButton, SIGNAL(released()), this, SLOT(showStatusPage()));
|
textBrowser = new TextBrowserTweaked1(this);
|
||||||
|
//textBrowser->setOpenExternalLinks(false);
|
||||||
|
textBrowser->setOpenLinks(false);
|
||||||
|
/*textBrowser->setTextInteractionFlags(textBrowser->textInteractionFlags()|
|
||||||
|
Qt::LinksAccessibleByMouse|Qt::LinksAccessibleByKeyboard|
|
||||||
|
Qt::TextSelectableByMouse|Qt::TextSelectableByKeyboard);*/
|
||||||
|
ui->verticalLayout_2->addWidget(textBrowser);
|
||||||
|
childTextBrowser = new TextBrowserTweaked1(this);
|
||||||
|
//childTextBrowser->setOpenExternalLinks(false);
|
||||||
|
childTextBrowser->setOpenLinks(false);
|
||||||
|
connect(textBrowser, SIGNAL(anchorClicked(const QUrl&)), this, SLOT(anchorClickedHandler(const QUrl&)));
|
||||||
|
pageWithBackButton = new PageWithBackButton(this, childTextBrowser);
|
||||||
|
ui->verticalLayout_2->addWidget(pageWithBackButton);
|
||||||
|
pageWithBackButton->hide();
|
||||||
|
connect(pageWithBackButton, SIGNAL(backReleased()), this, SLOT(backClickedFromChild()));
|
||||||
|
scheduleStatusPageUpdates();
|
||||||
|
|
||||||
|
QObject::connect(ui->statusPagePushButton, SIGNAL(released()), this, SLOT(showStatusMainPage()));
|
||||||
|
showStatusMainPage();
|
||||||
|
QObject::connect(statusButtonsUI->mainPagePushButton, SIGNAL(released()), this, SLOT(showStatusMainPage()));
|
||||||
|
QObject::connect(statusButtonsUI->routerCommandsPushButton, SIGNAL(released()), this, SLOT(showStatus_commands_Page()));
|
||||||
|
QObject::connect(statusButtonsUI->localDestinationsPushButton, SIGNAL(released()), this, SLOT(showStatus_local_destinations_Page()));
|
||||||
|
QObject::connect(statusButtonsUI->leasesetsPushButton, SIGNAL(released()), this, SLOT(showStatus_leasesets_Page()));
|
||||||
|
QObject::connect(statusButtonsUI->tunnelsPushButton, SIGNAL(released()), this, SLOT(showStatus_tunnels_Page()));
|
||||||
|
QObject::connect(statusButtonsUI->transitTunnelsPushButton, SIGNAL(released()), this, SLOT(showStatus_transit_tunnels_Page()));
|
||||||
|
QObject::connect(statusButtonsUI->transportsPushButton, SIGNAL(released()), this, SLOT(showStatus_transports_Page()));
|
||||||
|
QObject::connect(statusButtonsUI->i2pTunnelsPushButton, SIGNAL(released()), this, SLOT(showStatus_i2p_tunnels_Page()));
|
||||||
|
QObject::connect(statusButtonsUI->samSessionsPushButton, SIGNAL(released()), this, SLOT(showStatus_sam_sessions_Page()));
|
||||||
|
|
||||||
|
QObject::connect(textBrowser, SIGNAL(mouseReleased()), this, SLOT(statusHtmlPageMouseReleased()));
|
||||||
|
QObject::connect(textBrowser, SIGNAL(selectionChanged()), this, SLOT(statusHtmlPageSelectionChanged()));
|
||||||
|
|
||||||
|
QObject::connect(routerCommandsUI->runPeerTestPushButton, SIGNAL(released()), this, SLOT(runPeerTest()));
|
||||||
|
QObject::connect(routerCommandsUI->acceptTransitTunnelsPushButton, SIGNAL(released()), this, SLOT(enableTransit()));
|
||||||
|
QObject::connect(routerCommandsUI->declineTransitTunnelsPushButton, SIGNAL(released()), this, SLOT(disableTransit()));
|
||||||
|
|
||||||
QObject::connect(ui->settingsPagePushButton, SIGNAL(released()), this, SLOT(showSettingsPage()));
|
QObject::connect(ui->settingsPagePushButton, SIGNAL(released()), this, SLOT(showSettingsPage()));
|
||||||
|
|
||||||
QObject::connect(ui->tunnelsPagePushButton, SIGNAL(released()), this, SLOT(showTunnelsPage()));
|
QObject::connect(ui->tunnelsPagePushButton, SIGNAL(released()), this, SLOT(showTunnelsPage()));
|
||||||
@ -226,11 +281,97 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
//QMetaObject::connectSlotsByName(this);
|
//QMetaObject::connectSlotsByName(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showStatusPage(){ui->stackedWidget->setCurrentIndex(0);}
|
void MainWindow::updateRouterCommandsButtons() {
|
||||||
void MainWindow::showSettingsPage(){ui->stackedWidget->setCurrentIndex(1);}
|
bool acceptsTunnels = i2p::context.AcceptsTunnels ();
|
||||||
void MainWindow::showTunnelsPage(){ui->stackedWidget->setCurrentIndex(2);}
|
routerCommandsUI->declineTransitTunnelsPushButton->setEnabled(acceptsTunnels);
|
||||||
void MainWindow::showRestartPage(){ui->stackedWidget->setCurrentIndex(3);}
|
routerCommandsUI->acceptTransitTunnelsPushButton->setEnabled(!acceptsTunnels);
|
||||||
void MainWindow::showQuitPage(){ui->stackedWidget->setCurrentIndex(4);}
|
}
|
||||||
|
|
||||||
|
void MainWindow::showStatusPage(StatusPage newStatusPage){
|
||||||
|
ui->stackedWidget->setCurrentIndex(0);
|
||||||
|
setStatusButtonsVisible(true);
|
||||||
|
statusPage=newStatusPage;
|
||||||
|
showHiddenInfoStatusMainPage=false;
|
||||||
|
if(newStatusPage!=StatusPage::commands){
|
||||||
|
textBrowser->setHtml(getStatusPageHtml(false));
|
||||||
|
textBrowser->show();
|
||||||
|
routerCommandsParent->hide();
|
||||||
|
pageWithBackButton->hide();
|
||||||
|
}else{
|
||||||
|
routerCommandsParent->show();
|
||||||
|
textBrowser->hide();
|
||||||
|
pageWithBackButton->hide();
|
||||||
|
updateRouterCommandsButtons();
|
||||||
|
}
|
||||||
|
wasSelectingAtStatusMainPage=false;
|
||||||
|
}
|
||||||
|
void MainWindow::showSettingsPage(){ui->stackedWidget->setCurrentIndex(1);setStatusButtonsVisible(false);}
|
||||||
|
void MainWindow::showTunnelsPage(){ui->stackedWidget->setCurrentIndex(2);setStatusButtonsVisible(false);}
|
||||||
|
void MainWindow::showRestartPage(){ui->stackedWidget->setCurrentIndex(3);setStatusButtonsVisible(false);}
|
||||||
|
void MainWindow::showQuitPage(){ui->stackedWidget->setCurrentIndex(4);setStatusButtonsVisible(false);}
|
||||||
|
|
||||||
|
void MainWindow::setStatusButtonsVisible(bool visible) {
|
||||||
|
ui->statusButtonsPane->setVisible(visible);
|
||||||
|
}
|
||||||
|
|
||||||
|
// see also: HTTPServer.cpp
|
||||||
|
QString MainWindow::getStatusPageHtml(bool showHiddenInfo) {
|
||||||
|
std::stringstream s;
|
||||||
|
|
||||||
|
s << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">";
|
||||||
|
|
||||||
|
switch (statusPage) {
|
||||||
|
case main_page: i2p::http::ShowStatus(s, showHiddenInfo);break;
|
||||||
|
case commands: break;
|
||||||
|
case local_destinations: i2p::http::ShowLocalDestinations(s);break;
|
||||||
|
case leasesets: i2p::http::ShowLeasesSets(s); break;
|
||||||
|
case tunnels: i2p::http::ShowTunnels(s); break;
|
||||||
|
case transit_tunnels: i2p::http::ShowTransitTunnels(s); break;
|
||||||
|
case transports: i2p::http::ShowTransports(s); break;
|
||||||
|
case i2p_tunnels: i2p::http::ShowI2PTunnels(s); break;
|
||||||
|
case sam_sessions: i2p::http::ShowSAMSessions(s); break;
|
||||||
|
default: assert(false); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string str = s.str();
|
||||||
|
return QString::fromStdString(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::showStatusMainPage() { showStatusPage(StatusPage::main_page); }
|
||||||
|
void MainWindow::showStatus_commands_Page() { showStatusPage(StatusPage::commands); }
|
||||||
|
void MainWindow::showStatus_local_destinations_Page() { showStatusPage(StatusPage::local_destinations); }
|
||||||
|
void MainWindow::showStatus_leasesets_Page() { showStatusPage(StatusPage::leasesets); }
|
||||||
|
void MainWindow::showStatus_tunnels_Page() { showStatusPage(StatusPage::tunnels); }
|
||||||
|
void MainWindow::showStatus_transit_tunnels_Page() { showStatusPage(StatusPage::transit_tunnels); }
|
||||||
|
void MainWindow::showStatus_transports_Page() { showStatusPage(StatusPage::transports); }
|
||||||
|
void MainWindow::showStatus_i2p_tunnels_Page() { showStatusPage(StatusPage::i2p_tunnels); }
|
||||||
|
void MainWindow::showStatus_sam_sessions_Page() { showStatusPage(StatusPage::sam_sessions); }
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::scheduleStatusPageUpdates() {
|
||||||
|
statusPageUpdateTimer = new QTimer(this);
|
||||||
|
connect(statusPageUpdateTimer, SIGNAL(timeout()), this, SLOT(updateStatusPage()));
|
||||||
|
statusPageUpdateTimer->start(10*1000/*millis*/);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::statusHtmlPageMouseReleased() {
|
||||||
|
if(wasSelectingAtStatusMainPage){
|
||||||
|
QString selection = textBrowser->textCursor().selectedText();
|
||||||
|
if(!selection.isEmpty()&&!selection.isNull())return;
|
||||||
|
}
|
||||||
|
showHiddenInfoStatusMainPage=!showHiddenInfoStatusMainPage;
|
||||||
|
textBrowser->setHtml(getStatusPageHtml(showHiddenInfoStatusMainPage));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::statusHtmlPageSelectionChanged() {
|
||||||
|
wasSelectingAtStatusMainPage=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::updateStatusPage() {
|
||||||
|
showHiddenInfoStatusMainPage=false;
|
||||||
|
textBrowser->setHtml(getStatusPageHtml(showHiddenInfoStatusMainPage));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
void MainWindow::resizeEvent(QResizeEvent *event)
|
void MainWindow::resizeEvent(QResizeEvent *event)
|
||||||
@ -352,6 +493,7 @@ void MainWindow::handleGracefulQuitTimerEvent() {
|
|||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
{
|
{
|
||||||
qDebug("Destroying main window");
|
qDebug("Destroying main window");
|
||||||
|
delete statusPageUpdateTimer;
|
||||||
for(QList<MainWindowItem*>::iterator it = configItems.begin(); it!= configItems.end(); ++it) {
|
for(QList<MainWindowItem*>::iterator it = configItems.begin(); it!= configItems.end(); ++it) {
|
||||||
MainWindowItem* item = *it;
|
MainWindowItem* item = *it;
|
||||||
item->deleteLater();
|
item->deleteLater();
|
||||||
@ -631,3 +773,41 @@ void MainWindow::addClientTunnelPushButtonReleased() {
|
|||||||
void MainWindow::setI2PController(i2p::qt::Controller* controller_) {
|
void MainWindow::setI2PController(i2p::qt::Controller* controller_) {
|
||||||
this->i2pController = controller_;
|
this->i2pController = controller_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::runPeerTest() {
|
||||||
|
i2p::transport::transports.PeerTest();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::enableTransit() {
|
||||||
|
i2p::context.SetAcceptsTunnels(true);
|
||||||
|
updateRouterCommandsButtons();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::disableTransit() {
|
||||||
|
i2p::context.SetAcceptsTunnels(false);
|
||||||
|
updateRouterCommandsButtons();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::anchorClickedHandler(const QUrl & link) {
|
||||||
|
QString debugStr=QString()+"anchorClicked: "+"\""+link.toString()+"\"";
|
||||||
|
qDebug()<<debugStr;
|
||||||
|
//QMessageBox::information(this, "", debugStr);
|
||||||
|
|
||||||
|
/* /?page=local_destination&b32=xx...xx */
|
||||||
|
QString str=link.toString();
|
||||||
|
#define LOCAL_DEST_B32_PREFIX "/?page=local_destination&b32="
|
||||||
|
static size_t LOCAL_DEST_B32_PREFIX_SZ=QString(LOCAL_DEST_B32_PREFIX).size();
|
||||||
|
if(str.startsWith(LOCAL_DEST_B32_PREFIX)) {
|
||||||
|
str = str.right(str.size()-LOCAL_DEST_B32_PREFIX_SZ);
|
||||||
|
qDebug () << "b32:" << str;
|
||||||
|
pageWithBackButton->show();
|
||||||
|
textBrowser->hide();
|
||||||
|
std::stringstream s;
|
||||||
|
i2p::http::ShowLocalDestination(s,str.toStdString());
|
||||||
|
childTextBrowser->setHtml(QString::fromStdString(s.str()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::backClickedFromChild() {
|
||||||
|
showStatusPage(statusPage);
|
||||||
|
}
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <QtWidgets/QPushButton>
|
#include <QtWidgets/QPushButton>
|
||||||
#include <QtWidgets/QSpacerItem>
|
#include <QtWidgets/QSpacerItem>
|
||||||
#include "QVBoxLayout"
|
#include "QVBoxLayout"
|
||||||
|
#include "QUrl"
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
# include <QSystemTrayIcon>
|
# include <QSystemTrayIcon>
|
||||||
@ -40,6 +41,7 @@
|
|||||||
#include "ServerTunnelPane.h"
|
#include "ServerTunnelPane.h"
|
||||||
#include "ClientTunnelPane.h"
|
#include "ClientTunnelPane.h"
|
||||||
#include "TunnelConfig.h"
|
#include "TunnelConfig.h"
|
||||||
|
#include "textbrowsertweaked1.h"
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "FS.h"
|
#include "FS.h"
|
||||||
@ -53,6 +55,7 @@
|
|||||||
|
|
||||||
#include "DaemonQT.h"
|
#include "DaemonQT.h"
|
||||||
#include "SignatureTypeComboboxFactory.h"
|
#include "SignatureTypeComboboxFactory.h"
|
||||||
|
#include "pagewithbackbutton.h"
|
||||||
|
|
||||||
template<typename ValueType>
|
template<typename ValueType>
|
||||||
bool isType(boost::any& a) {
|
bool isType(boost::any& a) {
|
||||||
@ -306,7 +309,9 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
class StatusButtonsForm;
|
||||||
|
class routerCommandsWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace i2p::client;
|
using namespace i2p::client;
|
||||||
@ -332,7 +337,12 @@ public:
|
|||||||
// void setVisible(bool visible);
|
// void setVisible(bool visible);
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
enum StatusPage {main_page, commands, local_destinations, leasesets, tunnels, transit_tunnels,
|
||||||
|
transports, i2p_tunnels, sam_sessions};
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void handleQuitButton();
|
void handleQuitButton();
|
||||||
void handleGracefulQuitButton();
|
void handleGracefulQuitButton();
|
||||||
void handleDoRestartButton();
|
void handleDoRestartButton();
|
||||||
@ -342,13 +352,37 @@ private slots:
|
|||||||
void iconActivated(QSystemTrayIcon::ActivationReason reason);
|
void iconActivated(QSystemTrayIcon::ActivationReason reason);
|
||||||
void toggleVisibilitySlot();
|
void toggleVisibilitySlot();
|
||||||
#endif
|
#endif
|
||||||
void showStatusPage();
|
void scheduleStatusPageUpdates();
|
||||||
|
void statusHtmlPageMouseReleased();
|
||||||
|
void statusHtmlPageSelectionChanged();
|
||||||
|
void updateStatusPage();
|
||||||
|
|
||||||
|
void showStatusMainPage();
|
||||||
|
void showStatus_commands_Page();
|
||||||
|
void runPeerTest();
|
||||||
|
void enableTransit();
|
||||||
|
void disableTransit();
|
||||||
|
|
||||||
|
void showStatus_local_destinations_Page();
|
||||||
|
void showStatus_leasesets_Page();
|
||||||
|
void showStatus_tunnels_Page();
|
||||||
|
void showStatus_transit_tunnels_Page();
|
||||||
|
void showStatus_transports_Page();
|
||||||
|
void showStatus_i2p_tunnels_Page();
|
||||||
|
void showStatus_sam_sessions_Page();
|
||||||
|
|
||||||
void showSettingsPage();
|
void showSettingsPage();
|
||||||
void showTunnelsPage();
|
void showTunnelsPage();
|
||||||
void showRestartPage();
|
void showRestartPage();
|
||||||
void showQuitPage();
|
void showQuitPage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
StatusPage statusPage;
|
||||||
|
QTimer * statusPageUpdateTimer;
|
||||||
|
bool wasSelectingAtStatusMainPage;
|
||||||
|
bool showHiddenInfoStatusMainPage;
|
||||||
|
|
||||||
|
void showStatusPage(StatusPage newStatusPage);
|
||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
void createActions();
|
void createActions();
|
||||||
void createTrayIcon();
|
void createTrayIcon();
|
||||||
@ -359,16 +393,30 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
Ui::MainWindow* ui;
|
Ui::MainWindow* ui;
|
||||||
|
Ui::StatusButtonsForm* statusButtonsUI;
|
||||||
|
Ui::routerCommandsWidget* routerCommandsUI;
|
||||||
|
|
||||||
|
TextBrowserTweaked1 * textBrowser;
|
||||||
|
QWidget * routerCommandsParent;
|
||||||
|
PageWithBackButton * pageWithBackButton;
|
||||||
|
TextBrowserTweaked1 * childTextBrowser;
|
||||||
|
|
||||||
i2p::qt::Controller* i2pController;
|
i2p::qt::Controller* i2pController;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
void updateRouterCommandsButtons();
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
#endif
|
#endif
|
||||||
void resizeEvent(QResizeEvent* event);
|
void resizeEvent(QResizeEvent* event);
|
||||||
void onResize();
|
void onResize();
|
||||||
|
|
||||||
|
void setStatusButtonsVisible(bool visible);
|
||||||
|
|
||||||
|
QString getStatusPageHtml(bool showHiddenInfo);
|
||||||
|
|
||||||
QList<MainWindowItem*> configItems;
|
QList<MainWindowItem*> configItems;
|
||||||
NonGUIOptionItem* logOption;
|
NonGUIOptionItem* logOption;
|
||||||
NonGUIOptionItem* daemonOption;
|
NonGUIOptionItem* daemonOption;
|
||||||
@ -402,6 +450,9 @@ public slots:
|
|||||||
void addServerTunnelPushButtonReleased();
|
void addServerTunnelPushButtonReleased();
|
||||||
void addClientTunnelPushButtonReleased();
|
void addClientTunnelPushButtonReleased();
|
||||||
|
|
||||||
|
void anchorClickedHandler(const QUrl & link);
|
||||||
|
void backClickedFromChild();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString datadir;
|
QString datadir;
|
||||||
QString confpath;
|
QString confpath;
|
||||||
|
@ -6,10 +6,22 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>816</width>
|
<width>908</width>
|
||||||
<height>516</height>
|
<height>550</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>908</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>908</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>MainWindow</string>
|
<string>MainWindow</string>
|
||||||
</property>
|
</property>
|
||||||
@ -22,14 +34,14 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>908</width>
|
||||||
<height>516</height>
|
<height>550</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>16777215</width>
|
<width>908</width>
|
||||||
<height>516</height>
|
<height>550</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||||
@ -37,19 +49,27 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>10</y>
|
<y>10</y>
|
||||||
<width>796</width>
|
<width>888</width>
|
||||||
<height>496</height>
|
<height>530</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="sizeConstraint">
|
<property name="sizeConstraint">
|
||||||
<enum>QLayout::SetDefaultConstraint</enum>
|
<enum>QLayout::SetMaximumSize</enum>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0,0,0">
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0,0,0,0,0">
|
||||||
<property name="sizeConstraint">
|
<property name="sizeConstraint">
|
||||||
<enum>QLayout::SetMinimumSize</enum>
|
<enum>QLayout::SetMinimumSize</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="geometry" stdset="0">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>170</width>
|
||||||
|
<height>496</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="statusPagePushButton">
|
<widget class="QPushButton" name="statusPagePushButton">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
@ -60,13 +80,29 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="statusButtonsPane" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>172</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="settingsPagePushButton">
|
<widget class="QPushButton" name="settingsPagePushButton">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Settings</string>
|
<string>General settings</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -76,7 +112,7 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Tunnels</string>
|
<string>Tunnels settings</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -100,6 +136,22 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_19">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>171</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -118,7 +170,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="stackedWidget">
|
<widget class="QStackedWidget" name="stackedWidget">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -126,31 +178,37 @@
|
|||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
<height>496</height>
|
<height>528</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>16777215</width>
|
<width>713</width>
|
||||||
<height>496</height>
|
<height>713</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>4</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="statusPage">
|
<widget class="QWidget" name="statusPage">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<widget class="QWidget" name="verticalLayoutWidget_5">
|
<widget class="QWidget" name="verticalLayoutWidget_5">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>686</width>
|
<width>713</width>
|
||||||
<height>496</height>
|
<height>531</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
<property name="sizeConstraint">
|
<property name="sizeConstraint">
|
||||||
<enum>QLayout::SetMinAndMaxSize</enum>
|
<enum>QLayout::SetMaximumSize</enum>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_4">
|
||||||
@ -165,17 +223,11 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_4">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<property name="orientation">
|
<property name="sizeConstraint">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>QLayout::SetMaximumSize</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
</layout>
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@ -192,13 +244,13 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>706</width>
|
<width>711</width>
|
||||||
<height>461</height>
|
<height>531</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
<property name="sizeConstraint">
|
<property name="sizeConstraint">
|
||||||
<enum>QLayout::SetMinAndMaxSize</enum>
|
<enum>QLayout::SetMaximumSize</enum>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="settingsTitleLabel">
|
<widget class="QLabel" name="settingsTitleLabel">
|
||||||
@ -208,7 +260,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Settings</string>
|
<string>General settings</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -231,8 +283,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>679</width>
|
<width>689</width>
|
||||||
<height>3000</height>
|
<height>496</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -247,7 +299,7 @@
|
|||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>10</y>
|
<y>10</y>
|
||||||
<width>679</width>
|
<width>679</width>
|
||||||
<height>3000</height>
|
<height>3052</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="settingsContentsGridLayout" rowstretch="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0">
|
<layout class="QGridLayout" name="settingsContentsGridLayout" rowstretch="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0">
|
||||||
@ -2993,8 +3045,8 @@ Comma separated list of base64 identities:</string>
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>706</width>
|
<width>711</width>
|
||||||
<height>461</height>
|
<height>531</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||||
@ -3009,7 +3061,7 @@ Comma separated list of base64 identities:</string>
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Tunnels</string>
|
<string>Tunnels settings</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -3076,8 +3128,8 @@ Comma separated list of base64 identities:</string>
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>686</width>
|
<width>711</width>
|
||||||
<height>496</height>
|
<height>531</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
@ -3131,8 +3183,8 @@ Comma separated list of base64 identities:</string>
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>686</width>
|
<width>711</width>
|
||||||
<height>496</height>
|
<height>531</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="quitPageVerticalLayout">
|
<layout class="QVBoxLayout" name="quitPageVerticalLayout">
|
||||||
|
24
qt/i2pd_qt/pagewithbackbutton.cpp
Normal file
24
qt/i2pd_qt/pagewithbackbutton.cpp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#include "pagewithbackbutton.h"
|
||||||
|
#include "QVBoxLayout"
|
||||||
|
#include "QHBoxLayout"
|
||||||
|
#include "QPushButton"
|
||||||
|
|
||||||
|
PageWithBackButton::PageWithBackButton(QWidget *parent, QWidget* child) : QWidget(parent)
|
||||||
|
{
|
||||||
|
QVBoxLayout * layout = new QVBoxLayout();
|
||||||
|
setLayout(layout);
|
||||||
|
QWidget * topBar = new QWidget();
|
||||||
|
QHBoxLayout * topBarLayout = new QHBoxLayout();
|
||||||
|
topBar->setLayout(topBarLayout);
|
||||||
|
layout->addWidget(topBar);
|
||||||
|
layout->addWidget(child);
|
||||||
|
|
||||||
|
QPushButton * backButton = new QPushButton(topBar);
|
||||||
|
backButton->setText("< Back");
|
||||||
|
topBarLayout->addWidget(backButton);
|
||||||
|
connect(backButton, SIGNAL(released()), this, SLOT(backReleasedSlot()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PageWithBackButton::backReleasedSlot() {
|
||||||
|
emit backReleased();
|
||||||
|
}
|
21
qt/i2pd_qt/pagewithbackbutton.h
Normal file
21
qt/i2pd_qt/pagewithbackbutton.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#ifndef PAGEWITHBACKBUTTON_H
|
||||||
|
#define PAGEWITHBACKBUTTON_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
class PageWithBackButton : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit PageWithBackButton(QWidget *parent, QWidget* child);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
void backReleased();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
void backReleasedSlot();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // PAGEWITHBACKBUTTON_H
|
127
qt/i2pd_qt/routercommandswidget.ui
Normal file
127
qt/i2pd_qt/routercommandswidget.ui
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>routerCommandsWidget</class>
|
||||||
|
<widget class="QWidget" name="routerCommandsWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>711</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="verticalLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>711</width>
|
||||||
|
<height>301</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetMaximumSize</enum>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Router Commands</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="runPeerTestPushButton">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Run peer test</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="declineTransitTunnelsPushButton">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Decline transit tunnels</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="acceptTransitTunnelsPushButton">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Accept transit tunnels</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="cancelGracefulQuitPushButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Cancel graceful quit</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
163
qt/i2pd_qt/statusbuttons.ui
Normal file
163
qt/i2pd_qt/statusbuttons.ui
Normal file
@ -0,0 +1,163 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>StatusButtonsForm</class>
|
||||||
|
<widget class="QWidget" name="StatusButtonsForm">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>171</width>
|
||||||
|
<height>295</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>171</width>
|
||||||
|
<height>295</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="verticalLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>21</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>171</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetDefaultConstraint</enum>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="mainPagePushButton">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>150</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Main page</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="routerCommandsPushButton">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>150</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Router commands</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="localDestinationsPushButton">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>150</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Local destinations</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="leasesetsPushButton">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>150</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Leasesets</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="tunnelsPushButton">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>150</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Tunnels</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="transitTunnelsPushButton">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>150</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Transit tunnels</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="transportsPushButton">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>150</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Transports</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="i2pTunnelsPushButton">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>150</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>I2P tunnels</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="samSessionsPushButton">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>150</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>SAM sessions</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
9
qt/i2pd_qt/textbrowsertweaked1.cpp
Normal file
9
qt/i2pd_qt/textbrowsertweaked1.cpp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include "textbrowsertweaked1.h"
|
||||||
|
|
||||||
|
TextBrowserTweaked1::TextBrowserTweaked1(QWidget * parent): QTextBrowser(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*void TextBrowserTweaked1::setSource(const QUrl & url) {
|
||||||
|
emit navigatedTo(url);
|
||||||
|
}*/
|
26
qt/i2pd_qt/textbrowsertweaked1.h
Normal file
26
qt/i2pd_qt/textbrowsertweaked1.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#ifndef TEXTBROWSERTWEAKED1_H
|
||||||
|
#define TEXTBROWSERTWEAKED1_H
|
||||||
|
|
||||||
|
#include <QTextBrowser>
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
|
class TextBrowserTweaked1 : public QTextBrowser
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
TextBrowserTweaked1(QWidget * parent);
|
||||||
|
//virtual void setSource(const QUrl & url);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void mouseReleased();
|
||||||
|
//void navigatedTo(const QUrl & link);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void mouseReleaseEvent(QMouseEvent *event) {
|
||||||
|
QTextBrowser::mouseReleaseEvent(event);
|
||||||
|
emit mouseReleased();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TEXTBROWSERTWEAKED1_H
|
Loading…
x
Reference in New Issue
Block a user