1
// Copyright (C) 2008 Ben Asselstine
3
// This program is free software; you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation; either version 2 of the License, or
6
// (at your option) any later version.
8
// This program is distributed in the hope that it will be useful,
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
// GNU Library General Public License for more details.
13
// You should have received a copy of the GNU General Public License
14
// along with this program; if not, write to the Free Software
15
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20
#include <libglademm/xml.h>
21
#include <sigc++/functors/mem_fun.h>
23
#include "tileset-info-dialog.h"
25
#include "glade-helpers.h"
26
#include "../ucompose.hpp"
28
#include "../signpost.h"
31
TileSetInfoDialog::TileSetInfoDialog(Tileset *tileset)
33
Glib::RefPtr<Gnome::Glade::Xml> xml
34
= Gnome::Glade::Xml::create(get_glade_path()
35
+ "/tileset-info-dialog.glade");
38
xml->get_widget("dialog", d);
41
xml->get_widget("name_entry", name_entry);
42
name_entry->set_text(tileset->getName());
44
xml->get_widget("description_textview", description_textview);
45
description_textview->get_buffer()->set_text(tileset->getInfo());
49
void TileSetInfoDialog::set_parent_window(Gtk::Window &parent)
51
dialog->set_transient_for(parent);
52
//dialog->set_position(Gtk::WIN_POS_CENTER_ON_PARENT);
55
bool TileSetInfoDialog::run()
58
int response = dialog->run();
60
if (response == 0) // accepted
62
d_tileset->setName(name_entry->get_text());
63
d_tileset->setInfo(description_textview->get_buffer()->get_text());