00001 /**************************************************************** 00002 * Vidalia is distributed under the following license: 00003 * 00004 * Copyright (C) 2006, Matt Edman, Justin Hipple 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 ****************************************************************/ 00021 00022 /** 00023 * \file streamitem.cpp 00024 * \version $Id: streamitem.cpp 1767 2007-06-03 03:34:14Z edmanm $ 00025 * \brief Item representing a stream through Tor and its status 00026 */ 00027 00028 #include "streamitem.h" 00029 #include "circuitlistwidget.h" 00030 00031 00032 /** Constructor */ 00033 StreamItem::StreamItem(Stream stream) 00034 { 00035 /* Save the stream's id */ 00036 _id = stream.id(); 00037 00038 /* Update the status and target */ 00039 update(stream); 00040 } 00041 00042 /** Updates the status of this stream item. */ 00043 void 00044 StreamItem::update(Stream stream) 00045 { 00046 setText(CircuitListWidget::ConnectionColumn, stream.target()); 00047 setToolTip(CircuitListWidget::ConnectionColumn, stream.target()); 00048 setText(CircuitListWidget::StatusColumn, stream.statusString()); 00049 setToolTip(CircuitListWidget::StatusColumn, stream.statusString()); 00050 } 00051