Logo Search packages:      
Sourcecode: teg version File versions  Download package

static void apply_cb ( GtkWidget *  widget,
gint  pagenum,
gpointer  data 
) [static]

dialogs

messages

status

Definition at line 126 of file preferences.c.

References conf_cb_showattackturn, conf_cb_showerr, conf_cb_stscolor, and theme_activated.

Referenced by preferences_activate().

{
      if (pagenum != -1)
            return;
 
      /** dialogs **/


      if (GTK_TOGGLE_BUTTON(conf_cb_showattackturn)->active)
            gui_private.dialog_show |= (1 << DIALOG_ATTACK_TURN);
      else
            gui_private.dialog_show &= ~(1 << DIALOG_ATTACK_TURN);

      if (GTK_TOGGLE_BUTTON(conf_cb_showplacearmies)->active)
            gui_private.dialog_show |= (1 << DIALOG_PLACE_ARMIES);
      else
            gui_private.dialog_show &= ~(1 << DIALOG_PLACE_ARMIES);
      
      if (GTK_TOGGLE_BUTTON(conf_cb_showregrouparmies)->active)
            gui_private.dialog_show |= (1 << DIALOG_REGROUP_ARMIES);
      else
            gui_private.dialog_show &= ~(1 << DIALOG_REGROUP_ARMIES);
      

      /** messages **/
      if (GTK_TOGGLE_BUTTON( conf_cb_showerr )->active)
            g_game.msg_show |= M_ERR;
      else
            g_game.msg_show &= ~M_ERR;


      if (GTK_TOGGLE_BUTTON( conf_cb_showimp )->active)
            g_game.msg_show |= M_IMP;
      else
            g_game.msg_show &= ~M_IMP;


      if (GTK_TOGGLE_BUTTON( conf_cb_showmsg )->active)
            g_game.msg_show |= M_MSG;
      else
            g_game.msg_show &= ~M_MSG;


      if (GTK_TOGGLE_BUTTON( conf_cb_showmsgcolor )->active)
            gui_private.msg_show_colors = 1;
      else
            gui_private.msg_show_colors = 0;


      if (GTK_TOGGLE_BUTTON( conf_cb_showinf )->active)
            g_game.msg_show |= M_INF;
      else
            g_game.msg_show &= ~M_INF;

      /** status **/
      if (GTK_TOGGLE_BUTTON( conf_cb_stscolor)->active)
            gui_private.status_show |= (1 << STATUS_COLUMN_COLOR);
      else
            gui_private.status_show &= ~(1 << STATUS_COLUMN_COLOR);

      if (GTK_TOGGLE_BUTTON( conf_cb_stsnumber)->active)
            gui_private.status_show |= (1 << STATUS_COLUMN_NUMBER);
      else
            gui_private.status_show &= ~(1 << STATUS_COLUMN_NUMBER);

      if (GTK_TOGGLE_BUTTON( conf_cb_stsname)->active)
            gui_private.status_show |= (1 << STATUS_COLUMN_NAME);
      else
            gui_private.status_show &= ~(1 << STATUS_COLUMN_NAME);

      if (GTK_TOGGLE_BUTTON( conf_cb_stsscore)->active)
            gui_private.status_show |= (1 << STATUS_COLUMN_SCORE);
      else
            gui_private.status_show &= ~(1 << STATUS_COLUMN_SCORE);

      if (GTK_TOGGLE_BUTTON( conf_cb_stsaddress )->active)
            gui_private.status_show |= (1 << STATUS_COLUMN_ADDR);
      else
            gui_private.status_show &= ~(1 << STATUS_COLUMN_ADDR);

      if (GTK_TOGGLE_BUTTON( conf_cb_stshuman)->active)
            gui_private.status_show |= (1 << STATUS_COLUMN_HUMAN);
      else
            gui_private.status_show &= ~(1 << STATUS_COLUMN_HUMAN);

      if (GTK_TOGGLE_BUTTON( conf_cb_stscountries)->active)
            gui_private.status_show |= (1 << STATUS_COLUMN_COUNTRIES);
      else
            gui_private.status_show &= ~(1 << STATUS_COLUMN_COUNTRIES);

      if (GTK_TOGGLE_BUTTON( conf_cb_stsarmies)->active)
            gui_private.status_show |= (1 << STATUS_COLUMN_ARMIES);
      else
            gui_private.status_show &= ~(1 << STATUS_COLUMN_ARMIES);

      if (GTK_TOGGLE_BUTTON( conf_cb_stscards)->active)
            gui_private.status_show |= (1 << STATUS_COLUMN_CARDS);
      else
            gui_private.status_show &= ~(1 << STATUS_COLUMN_CARDS);

      if (GTK_TOGGLE_BUTTON( conf_cb_stsstatus)->active)
            gui_private.status_show |= (1 << STATUS_COLUMN_STATUS);
      else
            gui_private.status_show &= ~(1 << STATUS_COLUMN_STATUS);

      if (GTK_TOGGLE_BUTTON( conf_cb_stswho)->active)
            gui_private.status_show |= (1 << STATUS_COLUMN_WHO);
      else
            gui_private.status_show &= ~(1 << STATUS_COLUMN_WHO);

      status_update_visibility_of_columns();


      /* robot */
      g_game.robot_in_server = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(conf_cb_robotserver) );

      
      /* save new configurations */
      gconf_client_set_int( g_conf_client, "/apps/teg/msgshow",g_game.msg_show, NULL);
      gconf_client_set_bool( g_conf_client, "/apps/teg/msgshow_with_color",gui_private.msg_show_colors, NULL);
      gconf_client_set_int( g_conf_client, "/apps/teg/status_show",gui_private.status_show, NULL);
      gconf_client_set_int( g_conf_client, "/apps/teg/dialog_show",gui_private.dialog_show, NULL);
      gconf_client_set_bool( g_conf_client, "/apps/teg/robot_in_server",g_game.robot_in_server, NULL);

      if( theme_activated ){
            gconf_client_set_string( g_conf_client, "/apps/teg/theme",theme_activated, NULL);
            if( strcmp(theme_activated,g_game.theme) )
                  gnome_ok_dialog_parented(_("You have to restart TEG to use the new theme."),GTK_WINDOW(main_window));
      }
}


Generated by  Doxygen 1.6.0   Back to index