Debian Codegraph @

src/exception.cpp

raw
1 /* dvbcut
2 Copyright (c) 2007 Sven Over <[email protected]>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 /* $Id$ */
20
21 #include "exception.h"
22 #include <qstring.h>
23 #include <qmessagebox.h>
24
25 dvbcut_exception::dvbcut_exception(const std::string &__arg) : _M_msg(__arg), _M_extype()
26 {
27 }
28
29 dvbcut_exception::dvbcut_exception(const char* __arg) : _M_msg(__arg), _M_extype()
30 {
31 }
32
33 dvbcut_exception::~dvbcut_exception() throw()
34 {
35 }
36
37 const char *dvbcut_exception::what() const throw()
38 {
39 return _M_msg.c_str();
40 }
41
42 void dvbcut_exception::show() const
43 {
44 std::string extype(type());
45
46 if (extype.empty())
47 extype="DVBCUT error";
48
49 QMessageBox::critical(NULL,QString::fromStdString(extype),what(),QMessageBox::Abort,QMessageBox::NoButton);
50 }