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 torsignal.cpp 00024 * \version $Id: torsignal.cpp 1563 2006-12-26 06:06:04Z edmanm $ 00025 * \brief Sends a signal to Tor's control interface 00026 */ 00027 00028 #include "torsignal.h" 00029 00030 /** Returns a string representation of a signal that Tor understands. */ 00031 QString 00032 TorSignal::toString(Signal signal) 00033 { 00034 QString sigtype; 00035 switch (signal) { 00036 case Reload: sigtype = "RELOAD"; break; 00037 case Shutdown: sigtype = "SHUTDOWN"; break; 00038 case Dump: sigtype = "DUMP"; break; 00039 case Debug: sigtype = "DEBUG"; break; 00040 case Halt: sigtype = "HALT"; break; 00041 case NewNym: sigtype = "NEWNYM"; break; 00042 default: return "UNKNOWN"; 00043 } 00044 return sigtype; 00045 } 00046