mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-12 16:09:37 -05:00
added for Network View Settings QFrame to can Hide/Show the settings
added a Log Tab in Network git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@398 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
247e583a35
commit
4c40d7beff
@ -23,7 +23,8 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
#include "rshare.h"
|
#include "rshare.h"
|
||||||
#include "common/vmessagebox.h"
|
#include "common/vmessagebox.h"
|
||||||
|
#include "util/rsversion.h"
|
||||||
#include "NetworkDialog.h"
|
#include "NetworkDialog.h"
|
||||||
#include "NetworkView.h"
|
#include "NetworkView.h"
|
||||||
#include "connect/ConnectDialog.h"
|
#include "connect/ConnectDialog.h"
|
||||||
@ -32,7 +33,7 @@
|
|||||||
#include "rsiface/rspeers.h"
|
#include "rsiface/rspeers.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#include <QTime>
|
||||||
#include <QContextMenuEvent>
|
#include <QContextMenuEvent>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
@ -63,6 +64,8 @@ NetworkDialog::NetworkDialog(QWidget *parent)
|
|||||||
/* create a single connect dialog */
|
/* create a single connect dialog */
|
||||||
connectdialog = new ConnectDialog();
|
connectdialog = new ConnectDialog();
|
||||||
|
|
||||||
|
connect(ui.infoLog, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayInfoLogMenu(const QPoint&)));
|
||||||
|
|
||||||
/* hide the Tree +/- */
|
/* hide the Tree +/- */
|
||||||
ui.connecttreeWidget -> setRootIsDecorated( false );
|
ui.connecttreeWidget -> setRootIsDecorated( false );
|
||||||
|
|
||||||
@ -98,6 +101,11 @@ NetworkDialog::NetworkDialog(QWidget *parent)
|
|||||||
layout->setSpacing( 0 );
|
layout->setSpacing( 0 );
|
||||||
layout->setMargin( 0 );
|
layout->setMargin( 0 );
|
||||||
|
|
||||||
|
// Set Log infos
|
||||||
|
setLogInfo(tr("RetroShare %1 started.", "e.g: RetroShare v0.x started.").arg(retroshareVersion()));
|
||||||
|
|
||||||
|
setLogInfo(tr("Welcome to RetroShare."), QString::fromUtf8("blue"));
|
||||||
|
|
||||||
|
|
||||||
/* Hide platform specific features */
|
/* Hide platform specific features */
|
||||||
#ifdef Q_WS_WIN
|
#ifdef Q_WS_WIN
|
||||||
@ -442,3 +450,26 @@ void NetworkDialog::authneighbour()
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update Log Info information
|
||||||
|
void NetworkDialog::setLogInfo(QString info, QColor color) {
|
||||||
|
static unsigned int nbLines = 0;
|
||||||
|
++nbLines;
|
||||||
|
// Check log size, clear it if too big
|
||||||
|
if(nbLines > 200) {
|
||||||
|
ui.infoLog->clear();
|
||||||
|
nbLines = 1;
|
||||||
|
}
|
||||||
|
ui.infoLog->append(QString::fromUtf8("<font color='grey'>")+ QTime::currentTime().toString(QString::fromUtf8("hh:mm:ss")) + QString::fromUtf8("</font> - <font color='") + color.name() +QString::fromUtf8("'><i>") + info + QString::fromUtf8("</i></font>"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void NetworkDialog::on_actionClearLog_triggered() {
|
||||||
|
ui.infoLog->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void NetworkDialog::displayInfoLogMenu(const QPoint& pos) {
|
||||||
|
// Log Menu
|
||||||
|
QMenu myLogMenu(this);
|
||||||
|
myLogMenu.addAction(ui.actionClearLog);
|
||||||
|
// XXX: Why mapToGlobal() is not enough?
|
||||||
|
myLogMenu.exec(mapToGlobal(pos)+QPoint(20,450));
|
||||||
|
}
|
@ -48,6 +48,8 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
std::string loadneighbour();
|
std::string loadneighbour();
|
||||||
/* void loadneighbour(); */
|
/* void loadneighbour(); */
|
||||||
|
void setLogInfo(QString info, QColor color=QApplication::palette().color(QPalette::WindowText));
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
@ -62,6 +64,9 @@ private slots:
|
|||||||
|
|
||||||
void authneighbour();
|
void authneighbour();
|
||||||
void addneighbour();
|
void addneighbour();
|
||||||
|
|
||||||
|
void on_actionClearLog_triggered();
|
||||||
|
void displayInfoLogMenu(const QPoint& pos);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>619</width>
|
<width>582</width>
|
||||||
<height>443</height>
|
<height>444</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
@ -50,9 +50,6 @@
|
|||||||
<property name="bottomMargin" >
|
<property name="bottomMargin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="horizontalSpacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<property name="verticalSpacing" >
|
<property name="verticalSpacing" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
@ -208,6 +205,63 @@ p, li { white-space: pre-wrap; }
|
|||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="0" >
|
||||||
|
<widget class="QTabWidget" name="tabBottom" >
|
||||||
|
<property name="maximumSize" >
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>142</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="tabPosition" >
|
||||||
|
<enum>QTabWidget::North</enum>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="log_tab" >
|
||||||
|
<attribute name="title" >
|
||||||
|
<string>Log</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" >
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QTextBrowser" name="infoLog" >
|
||||||
|
<property name="sizePolicy" >
|
||||||
|
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize" >
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>142</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="contextMenuPolicy" >
|
||||||
|
<enum>Qt::CustomContextMenu</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="networkviewTab" >
|
<widget class="QWidget" name="networkviewTab" >
|
||||||
@ -218,6 +272,11 @@ p, li { white-space: pre-wrap; }
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
<action name="actionClearLog" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Clear</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
@ -41,7 +41,11 @@ NetworkView::NetworkView(QWidget *parent)
|
|||||||
|
|
||||||
/* add button */
|
/* add button */
|
||||||
connect( ui.refreshButton, SIGNAL( clicked( void ) ), this, SLOT( insertPeers( void ) ) );
|
connect( ui.refreshButton, SIGNAL( clicked( void ) ), this, SLOT( insertPeers( void ) ) );
|
||||||
// connect( mScene, SIGNAL( changed ( const QList<QRectF> & ) ), this, SLOT ( changedScene( void ) ) );
|
//connect( mScene, SIGNAL( changed ( const QList<QRectF> & ) ), this, SLOT ( changedScene( void ) ) );
|
||||||
|
|
||||||
|
/* Hide Settings frame */
|
||||||
|
shownwSettingsFrame(false);
|
||||||
|
connect( ui.nviewsettingsButton, SIGNAL(toggled(bool)), this, SLOT(shownwSettingsFrame(bool)));
|
||||||
|
|
||||||
|
|
||||||
/* hide the Tree +/- */
|
/* hide the Tree +/- */
|
||||||
@ -233,4 +237,19 @@ void NetworkView::changedScene()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Toggles the Settings pane on and off, changes toggle button text
|
||||||
|
*/
|
||||||
|
void NetworkView::shownwSettingsFrame(bool show)
|
||||||
|
{
|
||||||
|
if (show) {
|
||||||
|
ui.viewsettingsframe->setVisible(true);
|
||||||
|
ui.nviewsettingsButton->setChecked(true);
|
||||||
|
ui.nviewsettingsButton->setToolTip(tr("Hide Settings"));
|
||||||
|
} else {
|
||||||
|
ui.viewsettingsframe->setVisible(false);
|
||||||
|
ui.nviewsettingsButton->setChecked(false);
|
||||||
|
ui.nviewsettingsButton->setToolTip(tr("Show Settings"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,9 @@ void changedFoFCheckBox( );
|
|||||||
void changedDrawSignatures( );
|
void changedDrawSignatures( );
|
||||||
void changedDrawFriends( );
|
void changedDrawFriends( );
|
||||||
|
|
||||||
|
/** Called when Settings button is toggled */
|
||||||
|
void shownwSettingsFrame(bool show);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void clearPeerItems();
|
void clearPeerItems();
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>603</width>
|
<width>493</width>
|
||||||
<height>418</height>
|
<height>373</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
@ -25,62 +25,25 @@
|
|||||||
<property name="bottomMargin" >
|
<property name="bottomMargin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="horizontalSpacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
<property name="verticalSpacing" >
|
<property name="verticalSpacing" >
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<layout class="QGridLayout" >
|
<widget class="GraphWidget" name="graphicsView" >
|
||||||
<item row="0" column="0" >
|
<property name="styleSheet" >
|
||||||
<widget class="QLabel" name="networkviewiconlabel" >
|
<string>background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
||||||
<property name="minimumSize" >
|
stop:0 lightgray, stop:1 darkgray);
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
</string>
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="pixmap" >
|
|
||||||
<pixmap resource="images.qrc" >:/images/network16.png</pixmap>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" >
|
|
||||||
<widget class="QLabel" name="label_2" >
|
|
||||||
<property name="font" >
|
|
||||||
<font>
|
|
||||||
<weight>50</weight>
|
|
||||||
<bold>false</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
|
||||||
p, li { white-space: pre-wrap; }
|
|
||||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><span style=" font-size:9pt; font-weight:600;">Network View</span></p></body></html></string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
</widget>
|
||||||
<size>
|
|
||||||
<width>311</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" colspan="2" >
|
<item row="1" column="0" >
|
||||||
<widget class="GraphWidget" name="graphicsView" />
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" colspan="2" >
|
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" >
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QPushButton" name="refreshButton" >
|
<widget class="QPushButton" name="refreshButton" >
|
||||||
@ -96,39 +59,103 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" >
|
||||||
<size>
|
<size>
|
||||||
<width>31</width>
|
<width>391</width>
|
||||||
<height>20</height>
|
<height>23</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2" >
|
<item row="0" column="2" >
|
||||||
<layout class="QGridLayout" >
|
<widget class="QPushButton" name="nviewsettingsButton" >
|
||||||
<item row="0" column="0" >
|
<property name="text" >
|
||||||
<widget class="QCheckBox" name="fofCheckBox" >
|
<string>Settings</string>
|
||||||
<property name="text" >
|
</property>
|
||||||
<string>Show Friends of Friends</string>
|
<property name="checkable" >
|
||||||
</property>
|
<bool>true</bool>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
</widget>
|
||||||
<item row="0" column="1" >
|
|
||||||
<widget class="QCheckBox" name="checkBox" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Connect Signature</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2" >
|
|
||||||
<widget class="QCheckBox" name="checkBox_2" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Draw Friend Connections</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="0" >
|
||||||
|
<widget class="QFrame" name="viewsettingsframe" >
|
||||||
|
<property name="frameShape" >
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow" >
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" >
|
||||||
|
<property name="leftMargin" >
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin" >
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0" >
|
||||||
|
<layout class="QGridLayout" >
|
||||||
|
<item row="0" column="0" >
|
||||||
|
<widget class="QCheckBox" name="fofCheckBox" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Show Friends of Friends</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" >
|
||||||
|
<widget class="QCheckBox" name="checkBox" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Connect Signature</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1" >
|
||||||
|
<layout class="QGridLayout" >
|
||||||
|
<item row="0" column="0" >
|
||||||
|
<widget class="QCheckBox" name="checkBox_2" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Draw Friend Connections</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" >
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>141</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2" >
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>161</width>
|
||||||
|
<height>41</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
Loading…
Reference in New Issue
Block a user