// -*-c++-*- //------------------------------------------------------------------------------ // xword (http://xword.sourceforge.net) // Copyright 2002 Patrick Crosby //------------------------------------------------------------------------------ // ErrorDialog.cpp // // $Id: ErrorDialog.cpp,v 1.2 2002/01/23 19:43:03 pcrosby Exp $ //------------------------------------------------------------------------------ // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 2 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, write to the Free Software Foundation, Inc., 59 Temple // Place, Suite 330, Boston, MA 02111-1307 USA //------------------------------------------------------------------------------ #include "ErrorDialog.h" #include #include #include "ErrorManager.h" #include "Namespace.h" NAMESPACE_OPEN //------------------------------------------------------------------------------ ErrorDialog* ErrorDialog::m_pThisInstance(NULL); //------------------------------------------------------------------------------ ErrorDialog::ErrorDialog() : XDialog() { m_pLabel = manage(new Gtk::Label()); get_vbox()->pack_start(*m_pLabel); m_pButton = manage(new Gtk::Button("OK")); get_action_area()->pack_start(*m_pButton); m_pButton->clicked.connect(SigC::slot(this, &ErrorDialog::hide_all)); set_modal(true); } //------------------------------------------------------------------------------ ErrorDialog* ErrorDialog::Instance() { if (m_pThisInstance == NULL) { m_pThisInstance = new ErrorDialog; } return m_pThisInstance; } //------------------------------------------------------------------------------ void ErrorDialog::SetText(const std::string& strText) { AssertNotNull(m_pLabel); m_pLabel->set_text(strText); } //------------------------------------------------------------------------------ NAMESPACE_CLOSE //------------------------------------------------------------------------------