added back dhtstatus label to StatusBar

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3702 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-10-27 12:49:46 +00:00
parent ddf97c8ed2
commit 5809e25a60
6 changed files with 36 additions and 26 deletions

View File

@ -290,6 +290,7 @@ HEADERS += rshare.h \
gui/help/browser/helptextbrowser.h \
gui/statusbar/peerstatus.h \
gui/statusbar/natstatus.h \
gui/statusbar/dhtstatus.h \
gui/statusbar/ratesstatus.h \
gui/statusbar/hashingstatus.h \
gui/advsearch/advancedsearchdialog.h \
@ -506,6 +507,7 @@ SOURCES += main.cpp \
gui/settings/AddFileAssociationDialog.cpp \
gui/statusbar/peerstatus.cpp \
gui/statusbar/natstatus.cpp \
gui/statusbar/dhtstatus.cpp \
gui/statusbar/ratesstatus.cpp \
gui/statusbar/hashingstatus.cpp \
gui/toaster/ChatToaster.cpp \

View File

@ -62,6 +62,7 @@
#include "statusbar/peerstatus.h"
#include "statusbar/natstatus.h"
#include "statusbar/ratesstatus.h"
#include "statusbar/dhtstatus.h"
#include "statusbar/hashingstatus.h"
#include <retroshare/rsstatus.h>
@ -266,6 +267,9 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
natstatus = new NATStatus();
statusBar()->addWidget(natstatus);
dhtstatus = new DHTStatus();
statusBar()->addWidget(dhtstatus);
hashingstatus = new HashingStatus();
statusBar()->addPermanentWidget(hashingstatus);
@ -306,6 +310,7 @@ MainWindow::~MainWindow()
delete _messengerwindowAct;
delete peerstatus;
delete natstatus;
delete dhtstatus;
delete ratesstatus;
MessengerWindow::releaseInstance();
#ifdef UNFINISHED
@ -502,6 +507,9 @@ void MainWindow::updateStatus()
if (natstatus)
natstatus->getNATStatus();
if (dhtstatus)
dhtstatus->getDHTStatus();
if (nOnlineCount == 0)
{

View File

@ -34,6 +34,7 @@ class Idle;
class PeerStatus;
class NATStatus;
class RatesStatus;
class DHTStatus;
class HashingStatus;
class ForumsDialog;
class PeersDialog;
@ -234,6 +235,7 @@ private:
PeerStatus *peerstatus;
NATStatus *natstatus;
DHTStatus *dhtstatus;
RatesStatus *ratesstatus;
HashingStatus *hashingstatus;
QComboBox *statusComboBox;

View File

@ -24,6 +24,7 @@
<file>images/connect_established.png</file>
<file>images/connect_creating.png</file>
<file>images/connect_no.png</file>
<file>images/dht16.png</file>
<file>images/edit-clear-history.png</file>
<file>images/edit_16.png</file>
<file>images/feedback_arrow.png</file>

View File

@ -20,17 +20,13 @@
****************************************************************/
#include "dhtstatus.h"
#include <QtGui>
#include <QString>
#include <QLayout>
#include <QLabel>
#include <QIcon>
#include <QPainter>
#include <QPixmap>
#include "rsiface/rsiface.h"
#include "rsiface/rspeers.h"
#include "retroshare/rsiface.h"
#include "retroshare/rspeers.h"
#include <sstream>
#include <iomanip>
@ -46,20 +42,25 @@ DHTStatus::DHTStatus(QWidget *parent)
//statusDHT->setMinimumSize( statusPeers->frameSize().width() + 0, 0 );
hbox->addWidget(statusDHT);
iconLabel = new QLabel( this );
iconLabel->setPixmap(QPixmap::QPixmap(":/images/grayled.png"));
// iconLabel doesn't change over time, so we didn't need a minimum size
hbox->addWidget(iconLabel);
dhtstatusLabel = new QLabel( this );
dhtstatusLabel->setPixmap(QPixmap(":/images/grayled.png"));
hbox->addWidget(dhtstatusLabel);
spaceLabel = new QLabel( " | ", this );
hbox->addWidget(spaceLabel);
dhtnetworkLabel = new QLabel( this );
dhtnetworkLabel->setPixmap(QPixmap(":/images/dht16.png"));
hbox->addWidget(dhtnetworkLabel);
dhtnetworksizeLabel = new QLabel( "0 (0) ",this );
hbox->addWidget(dhtnetworksizeLabel);
setLayout( hbox );
}
DHTStatus::~DHTStatus()
{
}
void DHTStatus::getDHTStatus()
@ -73,13 +74,13 @@ void DHTStatus::getDHTStatus()
if (config.netDhtOk)
{
iconLabel->setPixmap(QPixmap::QPixmap(":/images/greenled.png"));
iconLabel->setToolTip(tr("DHT OK"));
dhtstatusLabel->setPixmap(QPixmap(":/images/greenled.png"));
dhtstatusLabel->setToolTip(tr("DHT On"));
}
else
{
iconLabel->setPixmap(QPixmap::QPixmap(":/images/redled.png"));
iconLabel->setToolTip(tr("DHT DOWN"));
dhtstatusLabel->setPixmap(QPixmap(":/images/redled.png"));
dhtstatusLabel->setToolTip(tr("DHT Off"));
}
rsiface->unlockData(); /* UnLock Interface */

View File

@ -20,25 +20,21 @@
****************************************************************/
#ifndef DHTSTATUS_H
#define DHTSTATUS_H
#include "gui/MainWindow.h"
#include <QWidget>
class QLabel;
class DHTStatus : public QWidget
{
Q_OBJECT
Q_OBJECT
public:
DHTStatus(QWidget *parent = 0);
~DHTStatus();
void getDHTStatus( );
void getDHTStatus( );
private:
class QLabel *iconLabel, *statusDHT;
QLabel *dhtstatusLabel, *statusDHT, *dhtnetworkLabel, *dhtnetworksizeLabel, *spaceLabel;
};