mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added checkbox to toggle logscale in statistics
This commit is contained in:
parent
63b88ecf68
commit
8296fa9f22
@ -25,7 +25,6 @@ public:
|
||||
|
||||
virtual void getValues(std::map<std::string,float>& values) const;
|
||||
virtual QString displayValue(float v) const;
|
||||
// virtual QString displayName(int i) const;
|
||||
virtual QString legend(int i,float v) const;
|
||||
virtual void update();
|
||||
QString unitName() const ;
|
||||
|
@ -22,6 +22,8 @@ BandwidthStatsWidget::BandwidthStatsWidget(QWidget *parent)
|
||||
|
||||
ui.unit_CB->addItem(tr("KB/s")) ;
|
||||
ui.unit_CB->addItem(tr("Count")) ;
|
||||
|
||||
ui.logScale_CB->setChecked(true) ;
|
||||
|
||||
ui.bwgraph_BW->source()->setSelector(BWGraphSource::SELECTOR_TYPE_FRIEND,BWGraphSource::GRAPH_TYPE_SUM) ;
|
||||
ui.bwgraph_BW->source()->setSelector(BWGraphSource::SELECTOR_TYPE_SERVICE,BWGraphSource::GRAPH_TYPE_SUM) ;
|
||||
@ -33,6 +35,7 @@ BandwidthStatsWidget::BandwidthStatsWidget(QWidget *parent)
|
||||
QObject::connect(ui.updn_CB ,SIGNAL(currentIndexChanged(int)),this, SLOT( updateUpDownSelection(int))) ;
|
||||
QObject::connect(ui.unit_CB ,SIGNAL(currentIndexChanged(int)),this, SLOT( updateUnitSelection(int))) ;
|
||||
QObject::connect(ui.service_CB,SIGNAL(currentIndexChanged(int)),this, SLOT(updateServiceSelection(int))) ;
|
||||
QObject::connect(ui.logScale_CB,SIGNAL(toggled(bool)),this, SLOT(toggleLogScale(bool))) ;
|
||||
|
||||
// setup one timer for auto-update
|
||||
|
||||
@ -42,6 +45,13 @@ BandwidthStatsWidget::BandwidthStatsWidget(QWidget *parent)
|
||||
mTimer->start(2000) ;
|
||||
}
|
||||
|
||||
void BandwidthStatsWidget::toggleLogScale(bool b)
|
||||
{
|
||||
if(b)
|
||||
ui.bwgraph_BW->setFlags(RSGraphWidget::RSGRAPH_FLAGS_LOG_SCALE_Y) ;
|
||||
else
|
||||
ui.bwgraph_BW->resetFlags(RSGraphWidget::RSGRAPH_FLAGS_LOG_SCALE_Y) ;
|
||||
}
|
||||
void BandwidthStatsWidget::updateComboBoxes()
|
||||
{
|
||||
if(!isVisible())
|
||||
|
@ -14,7 +14,8 @@ protected slots:
|
||||
void updateComboBoxes() ;
|
||||
void updateUpDownSelection(int n);
|
||||
void updateUnitSelection(int n);
|
||||
|
||||
void toggleLogScale(bool b);
|
||||
|
||||
private:
|
||||
Ui::BwStatsWidget ui;
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>812</width>
|
||||
<height>349</height>
|
||||
<width>1128</width>
|
||||
<height>385</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -18,14 +18,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="BWGraph" name="bwgraph_BW">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="BWGraph" name="bwgraph_BW" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="informationSelector_GB">
|
||||
@ -110,6 +103,13 @@
|
||||
<item>
|
||||
<widget class="QComboBox" name="unit_CB"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="logScale_CB">
|
||||
<property name="text">
|
||||
<string>Log scale</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
@ -131,8 +131,8 @@
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>BWGraph</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>gui/statistics/BWGraph.h</header>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">gui/statistics/BWGraph.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
|
Loading…
Reference in New Issue
Block a user