X-Git-Url: http://git.maemo.org/git/?p=lordsawar;a=blobdiff_plain;f=src%2Fgui%2Fsurrender-refused-dialog.cpp;fp=src%2Fgui%2Fsurrender-refused-dialog.cpp;h=6350aa43e64738be9dba0390a74860ec96ccddcc;hp=0000000000000000000000000000000000000000;hb=9eda00ff73353c55ecef6f82131166d5d4a85e29;hpb=3d34d4aa85a929f912464f71158396a388274f27;ds=sidebyside diff --git a/src/gui/surrender-refused-dialog.cpp b/src/gui/surrender-refused-dialog.cpp new file mode 100644 index 0000000..6350aa4 --- /dev/null +++ b/src/gui/surrender-refused-dialog.cpp @@ -0,0 +1,71 @@ +// Copyright (C) 2008, 2009 Ben Asselstine +// +// 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 3 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA +// 02110-1301, USA. + +#include + +#include +#include + +#include "surrender-refused-dialog.h" + +#include "glade-helpers.h" +#include "image-helpers.h" +#include "input-helpers.h" +#include "ucompose.hpp" +#include "defs.h" +#include "File.h" + +SurrenderRefusedDialog::SurrenderRefusedDialog() +{ + Glib::RefPtr xml + = Gtk::Builder::create_from_file(get_glade_path() + + "/surrender-refused-dialog.ui"); + + xml->get_widget("dialog", dialog); + decorate(dialog); + window_closed.connect(sigc::mem_fun(dialog, &Gtk::Dialog::hide)); + + Gtk::Label *label; + xml->get_widget("label", label); + xml->get_widget("image", image); + + label->set_text(_("Off with their heads! I want it ALL!")); + image->property_file() + = File::getMiscFile("various/parley_refused.png"); +} + +SurrenderRefusedDialog::~SurrenderRefusedDialog() +{ + delete dialog; +} + +void SurrenderRefusedDialog::set_parent_window(Gtk::Window &parent) +{ + dialog->set_transient_for(parent); + //dialog->set_position(Gtk::WIN_POS_CENTER_ON_PARENT); +} + +void SurrenderRefusedDialog::hide() +{ + dialog->hide(); +} + +void SurrenderRefusedDialog::run() +{ + dialog->run(); + return; +}