mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-05 07:35:12 -04:00
generated for statusRates own class to clean more MainWindow
clean up some namings git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1157 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e3a5372597
commit
69914204db
13 changed files with 184 additions and 45 deletions
|
@ -27,7 +27,6 @@
|
|||
#include <QIcon>
|
||||
#include <QPixmap>
|
||||
|
||||
|
||||
#include "NetworkView.h"
|
||||
#include "LinksDialog.h"
|
||||
#include "PhotoDialog.h"
|
||||
|
@ -39,7 +38,6 @@
|
|||
#include "ChannelFeed.h"
|
||||
#include "ShareManager.h"
|
||||
|
||||
|
||||
#include <rshare.h>
|
||||
#include "MainWindow.h"
|
||||
#include "MessengerWindow.h"
|
||||
|
@ -55,6 +53,7 @@
|
|||
#include "statusbar/peerstatus.h"
|
||||
#include "statusbar/dhtstatus.h"
|
||||
#include "statusbar/natstatus.h"
|
||||
#include "statusbar/ratesstatus.h"
|
||||
|
||||
#include "Preferences/PreferencesWindow.h"
|
||||
#include "Settings/gsettingswin.h"
|
||||
|
@ -279,7 +278,8 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
|||
statusBar()->addPermanentWidget(widget);
|
||||
_hashing_info_label->hide() ;
|
||||
|
||||
statusBar()->addPermanentWidget(statusRates = new QLabel(tr("<strong>Down:</strong> 0.00 (kB/s) | <strong>Up:</strong> 0.00 (kB/s) ")));
|
||||
ratesstatus = new RatesStatus();
|
||||
statusBar()->addPermanentWidget(ratesstatus);
|
||||
/******* Status Bar end ******/
|
||||
|
||||
/* Create the actions that will go in the tray menu */
|
||||
|
@ -337,20 +337,12 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
|||
|
||||
void MainWindow::updateStatus()
|
||||
{
|
||||
/* set users/friends/network */
|
||||
float downKb = 0;
|
||||
float upKb = 0;
|
||||
rsicontrol -> ConfigGetDataRates(downKb, upKb);
|
||||
|
||||
std::ostringstream out;
|
||||
out << "<strong>Down:</strong> " << std::setprecision(2) << std::fixed << downKb << " (kB/s) | <strong>Up:</strong> " << std::setprecision(2) << std::fixed << upKb << " (kB/s) ";
|
||||
|
||||
/* set uploads/download rates */
|
||||
if (statusRates)
|
||||
statusRates -> setText(QString::fromStdString(out.str()));
|
||||
|
||||
if (ratesstatus)
|
||||
ratesstatus->getRatesStatus();
|
||||
|
||||
if (peerstatus)
|
||||
peerstatus->setPeerStatus();
|
||||
peerstatus->getPeerStatus();
|
||||
|
||||
if (dhtstatus)
|
||||
dhtstatus->getDHTStatus();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue