mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-21 23:40:26 -04:00
Set to show only the Sum for Download or Upload on BW Window
This commit is contained in:
parent
d1c87f215d
commit
659de2830a
3 changed files with 88 additions and 49 deletions
|
@ -35,11 +35,13 @@
|
||||||
#define SETTING_ALWAYS_ON_TOP "AlwaysOnTop"
|
#define SETTING_ALWAYS_ON_TOP "AlwaysOnTop"
|
||||||
#define SETTING_STYLE "GraphStyle"
|
#define SETTING_STYLE "GraphStyle"
|
||||||
#define SETTING_GRAPHCOLOR "GraphColor"
|
#define SETTING_GRAPHCOLOR "GraphColor"
|
||||||
|
#define SETTING_DIRECTION "Direction"
|
||||||
#define DEFAULT_FILTER (BWGRAPH_LINE_SEND|BWGRAPH_LINE_RECV)
|
#define DEFAULT_FILTER (BWGRAPH_LINE_SEND|BWGRAPH_LINE_RECV)
|
||||||
#define DEFAULT_ALWAYS_ON_TOP false
|
#define DEFAULT_ALWAYS_ON_TOP false
|
||||||
#define DEFAULT_OPACITY 100
|
#define DEFAULT_OPACITY 100
|
||||||
#define DEFAULT_STYLE LineGraph
|
#define DEFAULT_STYLE LineGraph
|
||||||
#define DEFAULT_GRAPHCOLOR DefaultColor
|
#define DEFAULT_GRAPHCOLOR DefaultColor
|
||||||
|
#define DEFAULT_DIRECTION DefaultDirection
|
||||||
|
|
||||||
#define ADD_TO_FILTER(f,v,b) (f = ((b) ? ((f) | (v)) : ((f) & ~(v))))
|
#define ADD_TO_FILTER(f,v,b) (f = ((b) ? ((f) | (v)) : ((f) & ~(v))))
|
||||||
|
|
||||||
|
@ -148,6 +150,23 @@ BandwidthGraph::loadSettings()
|
||||||
else
|
else
|
||||||
ui.frmGraph->setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
|
ui.frmGraph->setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
|
||||||
|
|
||||||
|
/* Download & Upload */
|
||||||
|
int defaultdirection = getSetting(SETTING_DIRECTION, DEFAULT_DIRECTION).toInt();
|
||||||
|
|
||||||
|
if (defaultdirection < 0 || defaultdirection >= ui.cmbDownUp->count()) {
|
||||||
|
defaultdirection = DEFAULT_DIRECTION;
|
||||||
|
}
|
||||||
|
ui.cmbDownUp->setCurrentIndex(graphColor);
|
||||||
|
|
||||||
|
if(defaultdirection==0)
|
||||||
|
ui.frmGraph->setDirection(BWGraphSource::DIRECTION_UP) ;
|
||||||
|
else
|
||||||
|
ui.frmGraph->setDirection(BWGraphSource::DIRECTION_DOWN) ;
|
||||||
|
|
||||||
|
/* Default Settings for the Graph */
|
||||||
|
ui.frmGraph->setSelector(BWGraphSource::SELECTOR_TYPE_FRIEND,BWGraphSource::GRAPH_TYPE_SUM) ;
|
||||||
|
ui.frmGraph->resetFlags(RSGraphWidget::RSGRAPH_FLAGS_LOG_SCALE_Y) ;
|
||||||
|
|
||||||
/* Set graph frame settings */
|
/* Set graph frame settings */
|
||||||
ui.frmGraph->setShowEntry(0,ui.chkReceiveRate->isChecked()) ;
|
ui.frmGraph->setShowEntry(0,ui.chkReceiveRate->isChecked()) ;
|
||||||
ui.frmGraph->setShowEntry(1,ui.chkSendRate->isChecked()) ;
|
ui.frmGraph->setShowEntry(1,ui.chkSendRate->isChecked()) ;
|
||||||
|
@ -205,6 +224,11 @@ void BandwidthGraph::saveChanges()
|
||||||
else
|
else
|
||||||
ui.frmGraph->setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
|
ui.frmGraph->setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
|
||||||
|
|
||||||
|
if(ui.cmbDownUp->currentIndex()==0)
|
||||||
|
ui.frmGraph->setDirection(BWGraphSource::DIRECTION_UP) ;
|
||||||
|
else
|
||||||
|
ui.frmGraph->setDirection(BWGraphSource::DIRECTION_DOWN) ;
|
||||||
|
|
||||||
/* A change in window flags causes the window to disappear, so make sure
|
/* A change in window flags causes the window to disappear, so make sure
|
||||||
* it's still visible. */
|
* it's still visible. */
|
||||||
showNormal();
|
showNormal();
|
||||||
|
|
|
@ -41,6 +41,7 @@ class BandwidthGraph : public RWindow
|
||||||
public:
|
public:
|
||||||
enum { AreaGraph=0,LineGraph=1 } ;
|
enum { AreaGraph=0,LineGraph=1 } ;
|
||||||
enum { DefaultColor=0,DarkColor=1 } ;
|
enum { DefaultColor=0,DarkColor=1 } ;
|
||||||
|
enum { DefaultDirection=0,Download=1 } ;
|
||||||
|
|
||||||
/** Default constructor */
|
/** Default constructor */
|
||||||
BandwidthGraph(QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
BandwidthGraph(QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
||||||
|
|
|
@ -78,13 +78,13 @@
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>400</width>
|
<width>450</width>
|
||||||
<height>82</height>
|
<height>82</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>400</width>
|
<width>450</width>
|
||||||
<height>82</height>
|
<height>82</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
@ -190,7 +190,53 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1" rowspan="2">
|
<item row="0" column="4" rowspan="2">
|
||||||
|
<layout class="QVBoxLayout" name="_7">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>1</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="QPushButton" name="btnSaveSettings">
|
||||||
|
<property name="text">
|
||||||
|
<string>Save</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnCancelSettings">
|
||||||
|
<property name="text">
|
||||||
|
<string>Cancel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>21</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1" rowspan="2" colspan="2">
|
||||||
<layout class="QVBoxLayout" name="_3">
|
<layout class="QVBoxLayout" name="_3">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
|
@ -280,6 +326,20 @@
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="cmbDownUp">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Upload</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Download</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -451,52 +511,6 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="4" rowspan="2">
|
|
||||||
<layout class="QVBoxLayout" name="_7">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>1</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="QPushButton" name="btnSaveSettings">
|
|
||||||
<property name="text">
|
|
||||||
<string>Save</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="btnCancelSettings">
|
|
||||||
<property name="text">
|
|
||||||
<string>Cancel</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="3">
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>21</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue