From 2a44c23dcad676f1633e0d53ee0da8a110586f45 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 6 May 2009 13:46:10 +0000 Subject: [PATCH] (trunk qt) hide the network icon when the transmission session is being run inside the client. patch by stdisease --- qt/mainwin.cc | 2 ++ qt/session.h | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/qt/mainwin.cc b/qt/mainwin.cc index 4500e1cec..1589ce433 100644 --- a/qt/mainwin.cc +++ b/qt/mainwin.cc @@ -667,6 +667,8 @@ TrMainWindow :: refreshStatusBar( ) foreach( QWidget * w, myUpStatusWidgets ) w->setVisible( !up.isZero( ) ); foreach( QWidget * w, myDownStatusWidgets ) w->setVisible( !down.isZero( ) ); + myNetworkLabel->setVisible( !mySession.isServer( ) ); + const QString mode( myPrefs.getString( Prefs::STATUSBAR_STATS ) ); QString str; diff --git a/qt/session.h b/qt/session.h index 7f63d7cd7..fb619428a 100644 --- a/qt/session.h +++ b/qt/session.h @@ -62,10 +62,13 @@ class Session: public QObject void portTest( ); public: - bool isRemote( ) const { return !isLocal( ); } - bool isLocal( ) const; + + /** returns true if the transmission session is being run inside this client */ bool isServer( ) const; + /** returns true if isServer() is true or if the remote address is the localhost */ + bool isLocal( ) const; + private: void updateStats( struct tr_benc * args ); void updateInfo( struct tr_benc * args );