mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-12 19:12:28 -04:00
* Fixed Defnax's Status Bar.
* Fixed 'Offline' bug in MessengerWindow. * Added isOnline function to rspeers interface. * Cleaned up some stuff. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@610 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1389c617e9
commit
0d6471433c
6 changed files with 17 additions and 40 deletions
|
@ -96,7 +96,7 @@
|
|||
****/
|
||||
|
||||
#define RS_RELEASE_VERSION 1
|
||||
|
||||
|
||||
/** Constructor */
|
||||
MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
: QMainWindow(parent, flags)
|
||||
|
@ -214,7 +214,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
|||
connect(transfersDialog, SIGNAL(playFiles( QStringList )), this, SLOT(playFiles( QStringList )));
|
||||
|
||||
#ifdef RS_RELEASE_VERSION
|
||||
addAction(new QAction(QIcon(IMAGE_BLOCK), tr("Unfinished"), ui.toolBar), SLOT(showApplWindow()));
|
||||
//addAction(new QAction(QIcon(IMAGE_BLOCK), tr("Unfinished"), ui.toolBar), SLOT(showApplWindow()));
|
||||
|
||||
|
||||
#else
|
||||
|
@ -258,9 +258,9 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
|||
ui.toolBarservice->addSeparator();
|
||||
|
||||
#endif
|
||||
//peerstatus = new PeerStatus();
|
||||
//statusBar()->addWidget(peerstatus);
|
||||
statusBar()->addWidget(statusPeers = new QLabel(tr("Online: 0 |Friends: 0|Network: 0")));
|
||||
peerstatus = new PeerStatus();
|
||||
statusBar()->addWidget(peerstatus);
|
||||
//statusBar()->addWidget(statusPeers = new QLabel(tr("Online: 0 |Friends: 0|Network: 0")));
|
||||
statusBar()->addPermanentWidget(statusRates = new QLabel(tr("Down: 0.0 | Up: 0.0 ")));
|
||||
//statusBar()->addPermanentWidget(statusPeers = new QLabel(tr("Online: 0 |Friends: 0|Network: 0")));
|
||||
|
||||
|
@ -328,36 +328,15 @@ void MainWindow::updateStatus()
|
|||
std::ostringstream out;
|
||||
out << "Down: " << std::setprecision(2) << std::fixed << downKb << " (kB/s) | Up: " << std::setprecision(2) << std::fixed << upKb << " (kB/s) ";
|
||||
|
||||
std::list<std::string> ids;
|
||||
rsPeers->getOnlineList(ids);
|
||||
int online = ids.size();
|
||||
|
||||
ids.clear();
|
||||
rsPeers->getFriendList(ids);
|
||||
int friends = ids.size();
|
||||
|
||||
ids.clear();
|
||||
rsPeers->getOthersList(ids);
|
||||
int others = 1 + ids.size();
|
||||
|
||||
std::ostringstream out2;
|
||||
out2 << "Online: " << online << "| Friends: " << friends << "| Network: " << others << " ";
|
||||
|
||||
/* set uploads/download rates */
|
||||
|
||||
if (statusRates)
|
||||
statusRates -> setText(QString::fromStdString(out.str()));
|
||||
|
||||
if (statusPeers)
|
||||
statusPeers -> setText(QString::fromStdString(out2.str()));
|
||||
if (peerstatus)
|
||||
peerstatus->setPeerStatus();
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::peerstat()
|
||||
{
|
||||
peerstatus->setPeerStatus();
|
||||
}
|
||||
|
||||
|
||||
/** Creates a new action associated with a config page. */
|
||||
QAction* MainWindow::createPageAction(QIcon img, QString text, QActionGroup *group)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue