~ubuntu-branches/ubuntu/maverick/lordsawar/maverick

« back to all changes in this revision

Viewing changes to src/gui/preferences-dialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2010-04-10 09:29:33 UTC
  • mfrom: (1.1.9 upstream) (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100410092933-23uq4dxig30kmtcw
Tags: 0.1.8-1
* New upstream release.
* Add misc:Depends for -data package.
* Bump Standards Version to 3.8.4. (No changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    decorate(dialog);
49
49
    window_closed.connect(sigc::mem_fun(dialog, &Gtk::Dialog::hide));
50
50
 
51
 
    xml->get_widget("show_turn_popup_checkbutton", show_turn_popup_checkbutton);
 
51
    xml->get_widget("commentator_checkbutton", commentator_checkbutton);
 
52
    xml->get_widget("speed_scale", speed_scale);
52
53
    xml->get_widget("play_music_checkbutton", play_music_checkbutton);
53
54
    xml->get_widget("music_volume_scale", music_volume_scale);
54
55
    xml->get_widget("music_volume_hbox", music_volume_hbox);
84
85
          }
85
86
        else
86
87
          type->set_active(1);
87
 
        if (p->isDead() || Playerlist::getActiveplayer() == p)
 
88
        if (p->isDead() || (Playerlist::getActiveplayer() == p && 
 
89
                            p->getType() != Player::HUMAN))
88
90
          {
89
91
            type->set_sensitive(false);
90
92
            observe->set_sensitive(false);
104
106
        players_vbox->pack_start(*manage(player_hbox));
105
107
      }
106
108
    players_vbox->show_all_children();
107
 
    show_turn_popup_checkbutton->signal_toggled().connect(
108
 
        sigc::mem_fun(this, &PreferencesDialog::on_show_turn_popup_toggled));
 
109
    commentator_checkbutton->signal_toggled().connect(
 
110
        sigc::mem_fun(this, &PreferencesDialog::on_show_commentator_toggled));
 
111
    speed_scale->set_value(Configuration::s_displaySpeedDelay);
 
112
    speed_scale->signal_value_changed().connect(
 
113
        sigc::mem_fun(this, &PreferencesDialog::on_speed_changed));
109
114
    play_music_checkbutton->signal_toggled().connect(
110
115
        sigc::mem_fun(this, &PreferencesDialog::on_play_music_toggled));
111
116
    music_volume_scale->signal_value_changed().connect(
112
117
        sigc::mem_fun(this, &PreferencesDialog::on_music_volume_changed));
113
118
 
114
 
    show_turn_popup_checkbutton->set_active(Configuration::s_showNextPlayer);
 
119
    commentator_checkbutton->set_active(Configuration::s_displayCommentator);
115
120
    play_music_checkbutton->set_active(Configuration::s_musicenable);
116
121
    music_volume_hbox->set_sensitive(Configuration::s_musicenable);
117
122
    music_volume_scale->set_value(Configuration::s_musicvolume * 100.0 / 128);
222
227
    dialog->hide();
223
228
}
224
229
 
225
 
void PreferencesDialog::on_show_turn_popup_toggled()
 
230
void PreferencesDialog::on_show_commentator_toggled()
226
231
{
227
 
    Configuration::s_showNextPlayer = show_turn_popup_checkbutton->get_active();
 
232
    Configuration::s_displayCommentator = commentator_checkbutton->get_active();
228
233
}
229
234
 
230
235
void PreferencesDialog::on_play_music_toggled()
245
250
    music_volume_hbox->set_sensitive(Configuration::s_musicenable);
246
251
}
247
252
 
 
253
void PreferencesDialog::on_speed_changed()
 
254
{
 
255
  Configuration::s_displaySpeedDelay = int(speed_scale->get_value());
 
256
}
 
257
 
248
258
void PreferencesDialog::on_music_volume_changed()
249
259
{
250
260
    int volume = int(music_volume_scale->get_value() / 100 * 128);