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 00004 ** you did not receive the LICENSE file with this file, you may obtain it 00005 ** from the 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 00008 ** the terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file TorSignal.cpp 00013 ** \version $Id: TorSignal.cpp 3735 2009-04-28 20:28:01Z edmanm $ 00014 ** \brief Sends a signal to Tor's control interface 00015 */ 00016 00017 #include "TorSignal.h" 00018 00019 00020 /** Returns a string representation of a signal that Tor understands. */ 00021 QString 00022 TorSignal::toString(Signal signal) 00023 { 00024 QString sigtype; 00025 switch (signal) { 00026 case Reload: sigtype = "RELOAD"; break; 00027 case Shutdown: sigtype = "SHUTDOWN"; break; 00028 case Dump: sigtype = "DUMP"; break; 00029 case Debug: sigtype = "DEBUG"; break; 00030 case Halt: sigtype = "HALT"; break; 00031 case NewNym: sigtype = "NEWNYM"; break; 00032 default: return "UNKNOWN"; 00033 } 00034 return sigtype; 00035 } 00036