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
21
#include <libglademm/xml.h>
23
#include "glade-helpers.h"
24
#include "generation-progress-window.h"
25
#include "../MapGenerator.h"
27
GenerationProgressWindow::GenerationProgressWindow()
29
Glib::RefPtr<Gnome::Glade::Xml> xml
30
= Gnome::Glade::Xml::create(get_glade_path() +
31
"/generation-progress-window.glade");
34
xml->get_widget("window", w);
37
xml->get_widget("statusbar", statusbar);
38
xml->get_widget("progressbar", progressbar);
40
//w->signal_delete_event().connect
41
//(sigc::mem_fun(*this, &GenerationProgressWindow::on_delete_event));
45
void GenerationProgressWindow::setGenerator(MapGenerator *generator)
47
generator->progress.connect
48
(sigc::mem_fun (this, &GenerationProgressWindow::update_progress));
50
GenerationProgressWindow::~GenerationProgressWindow()
54
void GenerationProgressWindow::show_all()
56
window->set_position(Gtk::WIN_POS_CENTER_ON_PARENT);
62
void GenerationProgressWindow::update_progress(double fraction,
65
progressbar->set_fraction(fraction);
66
statusbar->push(status, 0);
69
//bool GenerationProgressWindow::on_delete_event(GdkEventAny *e)