~ubuntu-branches/ubuntu/trusty/lordsawar/trusty

« back to all changes in this revision

Viewing changes to src/editor/rewardlist-dialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Barry deFreese
  • Date: 2009-10-21 08:02:12 UTC
  • mfrom: (1.1.8 upstream) (5.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20091021080212-wpmd6xdaxrgnn63y
Tags: 0.1.6-1
[ Barry deFreese ]
* New upstream release.
  + Drop libsdl-image1.2 from build-deps, no longer needed.
* Add README.source for quilt patch system.
* Clean up debian/copyright some.
* Bump Standards Version to 3.8.3. (No changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//  Copyright (C) 2008, Ben Asselstine
 
1
//  Copyright (C) 2008, 2009 Ben Asselstine
2
2
//
3
3
//  This program is free software; you can redistribute it and/or modify
4
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
 
5
//  the Free Software Foundation; either version 3 of the License, or
6
6
//  (at your option) any later version.
7
7
//
8
8
//  This program is distributed in the hope that it will be useful,
25
25
#include <sigc++/functors/mem_fun.h>
26
26
#include <sigc++/functors/ptr_fun.h>
27
27
 
28
 
#include <gtkmm/widget.h>
29
 
#include <gtkmm/eventbox.h>
30
 
#include <gtkmm/image.h>
31
 
#include <gtkmm/box.h>
32
 
#include <gtkmm/dialog.h>
33
 
 
 
28
#include <gtkmm.h>
34
29
#include "rewardlist-dialog.h"
35
30
 
36
31
#include "gui/input-helpers.h"
44
39
#include "playerlist.h"
45
40
 
46
41
#include "glade-helpers.h"
47
 
#include "reward-dialog.h"
 
42
#include "reward-editor-dialog.h"
48
43
 
49
44
 
50
45
RewardlistDialog::RewardlistDialog()
51
46
{
52
 
    Glib::RefPtr<Gnome::Glade::Xml> xml
53
 
        = Gnome::Glade::Xml::create(get_glade_path() + 
54
 
                                    "/reward-list-dialog.glade");
 
47
    Glib::RefPtr<Gtk::Builder> xml
 
48
        = Gtk::Builder::create_from_file(get_glade_path() + 
 
49
                                    "/reward-list-dialog.ui");
55
50
 
56
 
    Gtk::Dialog *d = 0;
57
 
    xml->get_widget("dialog", d);
58
 
    dialog.reset(d);
 
51
    xml->get_widget("dialog", dialog);
59
52
 
60
53
    xml->get_widget("rewards_treeview", rewards_treeview);
61
54
    xml->get_widget("add_button", add_button);
78
71
    for (;iter != rewardlist->end(); iter++)
79
72
      addReward(*iter);
80
73
      
81
 
    Uint32 max = rewardlist->size();
 
74
    guint32 max = rewardlist->size();
82
75
    if (max)
83
76
      {
84
77
        Gtk::TreeModel::Row row;
110
103
 
111
104
RewardlistDialog::~RewardlistDialog()
112
105
{
 
106
  delete dialog;
113
107
}
114
108
 
115
109
void RewardlistDialog::addReward(Reward *reward)
127
121
void RewardlistDialog::on_add_clicked()
128
122
{
129
123
  Player *neutral = Playerlist::getInstance()->getNeutral();
130
 
  RewardDialog d(neutral, true, NULL);
 
124
  RewardEditorDialog d(neutral, true, NULL);
131
125
  d.run();
132
126
  if (d.get_reward())
133
127
    {
167
161
      Gtk::TreeModel::Row row = *iterrow;
168
162
      Reward *reward = row[rewards_columns.reward];
169
163
      Player *neutral = Playerlist::getInstance()->getNeutral();
170
 
      RewardDialog d(neutral, true, reward);
 
164
      RewardEditorDialog d(neutral, true, reward);
171
165
      d.run();
172
166
      if (d.get_reward())
173
167
        {