Vidalia 0.2.10

StreamItem.cpp

Go to the documentation of this file.
00001 /*
00002 **  This file is part of Vidalia, and is subject to the license terms in the
00003 **  LICENSE file, found in the top level directory of this distribution. If you
00004 **  did not receive the LICENSE file with this file, you may obtain it from the
00005 **  Vidalia source package distributed by the Vidalia Project at
00006 **  http://www.vidalia-project.net/. No part of Vidalia, including this file,
00007 **  may be copied, modified, propagated, or distributed except according to the
00008 **  terms described in the LICENSE file.
00009 */
00010 
00011 /*
00012 ** \file StreamItem.cpp
00013 ** \version $Id: StreamItem.cpp 4360 2010-07-31 02:41:16Z edmanm $
00014 ** \brief Item representing a stream through Tor and its status
00015 */
00016 
00017 #include "StreamItem.h"
00018 #include "CircuitListWidget.h"
00019 
00020 
00021 /** Constructor */
00022 StreamItem::StreamItem(const Stream &stream)
00023 {
00024   /* Set the stream's displayed target information */
00025   setText(CircuitListWidget::ConnectionColumn, stream.target());
00026   setToolTip(CircuitListWidget::ConnectionColumn, stream.target());
00027  
00028   /* Update the status and target */
00029   update(stream);
00030 }
00031 
00032 /** Updates the status of this stream item. */
00033 void
00034 StreamItem::update(const Stream &stream)
00035 {
00036   _stream = stream;
00037   setText(CircuitListWidget::StatusColumn, stream.statusString());
00038   setToolTip(CircuitListWidget::StatusColumn, stream.statusString());
00039 }
00040