mirror of https://github.com/PurpleI2P/i2pd.git
Browse Source
Qt GUI now shows buttons under Status and their corresponding info panespull/932/head
orignal
7 years ago
committed by
GitHub
13 changed files with 775 additions and 100 deletions
@ -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(); |
||||||
|
} |
@ -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
|
@ -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> |
@ -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> |
@ -0,0 +1,9 @@ |
|||||||
|
#include "textbrowsertweaked1.h" |
||||||
|
|
||||||
|
TextBrowserTweaked1::TextBrowserTweaked1(QWidget * parent): QTextBrowser(parent) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
/*void TextBrowserTweaked1::setSource(const QUrl & url) {
|
||||||
|
emit navigatedTo(url); |
||||||
|
}*/ |
@ -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…
Reference in new issue