1 // Copyright (C) 2007 Ole Laursen
2 // Copyright (C) 2007, 2008, 2009 Ben Asselstine
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Library General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 #ifndef LOAD_SCENARIOS_DIALOG_H
20 #define LOAD_SCENARIOS_DIALOG_H
24 #include <sigc++/trackable.h>
25 #include <sigc++/signal.h>
28 #include "decorated.h"
29 // dialog for choosing a scenario
30 class LoadScenarioDialog: public Decorated
34 ~LoadScenarioDialog();
36 void set_parent_window(Gtk::Window &parent);
41 std::string get_scenario_filename();
45 Gtk::Button *load_button;
46 Gtk::TextView *description_textview;
47 Gtk::Label *num_players_label;
48 Gtk::Label *num_cities_label;
49 Gtk::TreeView *scenarios_treeview;
50 Gtk::Button *add_scenario_button;
51 Gtk::Button *remove_scenario_button;
53 class ScenariosColumns: public Gtk::TreeModelColumnRecord {
56 { add(name); add(filename); }
58 Gtk::TreeModelColumn<Glib::ustring> name;
59 Gtk::TreeModelColumn<std::string> filename;
61 const ScenariosColumns scenarios_columns;
62 Glib::RefPtr<Gtk::ListStore> scenarios_list;
64 std::string selected_filename;
66 void on_selection_changed();
67 void add_scenario(std::string filename);
68 void on_add_scenario_clicked();
69 void on_remove_scenario_clicked();
70 int copy_file (Glib::ustring from, Glib::ustring to);