~ubuntu-branches/ubuntu/raring/lordsawar/raring

« back to all changes in this revision

Viewing changes to src/editor/tileset-info-dialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Barry deFreese, Gonéri Le Bouder
  • Date: 2008-06-17 11:15:26 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080617111526-yjyvu9df50zmpdo0
Tags: 0.0.9-1
[ Barry deFreese ]
* New upstream release.
  + Fixes gcc-4.3 builds so drop ftbfs_gcc-4.3_fix.diff.
  + Add new build-dependency for libgnet-dev.
* Add simple man page for new lordsawar-tile-editor.
* Add desktop file for lordsawar-tile-editor.
* Remove French translation on install.

[ Gonéri Le Bouder ]
* bump Debian Policy to 3.8.0. No change needed.
* fix wording in the 0.0.8-3 entry of the Debian changelog

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//  Copyright (C) 2008 Ben Asselstine
 
2
//
 
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.
 
7
//
 
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.
 
12
//
 
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 
 
16
//  02110-1301, USA.
 
17
 
 
18
#include <config.h>
 
19
 
 
20
#include <libglademm/xml.h>
 
21
#include <sigc++/functors/mem_fun.h>
 
22
 
 
23
#include "tileset-info-dialog.h"
 
24
 
 
25
#include "glade-helpers.h"
 
26
#include "../ucompose.hpp"
 
27
#include "../defs.h"
 
28
#include "../signpost.h"
 
29
 
 
30
 
 
31
TileSetInfoDialog::TileSetInfoDialog(Tileset *tileset)
 
32
{
 
33
    Glib::RefPtr<Gnome::Glade::Xml> xml
 
34
        = Gnome::Glade::Xml::create(get_glade_path()
 
35
                                    + "/tileset-info-dialog.glade");
 
36
 
 
37
    Gtk::Dialog *d = 0;
 
38
    xml->get_widget("dialog", d);
 
39
    dialog.reset(d);
 
40
 
 
41
    xml->get_widget("name_entry", name_entry);
 
42
    name_entry->set_text(tileset->getName());
 
43
    
 
44
    xml->get_widget("description_textview", description_textview);
 
45
    description_textview->get_buffer()->set_text(tileset->getInfo());
 
46
    d_tileset = tileset;
 
47
}
 
48
 
 
49
void TileSetInfoDialog::set_parent_window(Gtk::Window &parent)
 
50
{
 
51
    dialog->set_transient_for(parent);
 
52
    //dialog->set_position(Gtk::WIN_POS_CENTER_ON_PARENT);
 
53
}
 
54
 
 
55
bool TileSetInfoDialog::run()
 
56
{
 
57
    dialog->show_all();
 
58
    int response = dialog->run();
 
59
 
 
60
    if (response == 0)          // accepted
 
61
    {
 
62
        d_tileset->setName(name_entry->get_text());
 
63
        d_tileset->setInfo(description_textview->get_buffer()->get_text());
 
64
        return true;
 
65
    }
 
66
    return false;
 
67
}
 
68