Skip to content
Snippets Groups Projects
Commit cc7261b1 authored by deuce's avatar deuce
Browse files

Replace simple easy flag/exempt/restriction input boxes with a zillion

separate buttons.
parent 31923ac9
No related branches found
No related tags found
No related merge requests found
...@@ -242,57 +242,78 @@ void load_user(GtkWidget *wiggy, gpointer data) ...@@ -242,57 +242,78 @@ void load_user(GtkWidget *wiggy, gpointer data)
} }
/* Flag Sets */ /* Flag Sets */
w=glade_xml_get_widget(xml, "eFlagSet1"); strcpy(str,"tFlagSet1.");
for(i=0;i<26;i++) {
str[9]='A'+i;
w=glade_xml_get_widget(xml, str);
if(w==NULL) if(w==NULL)
fprintf(stderr,"Cannot get the flag set 1 widget\n"); fprintf(stderr,"Cannot get the %s widget\n",str);
else { else {
ltoaf(user.flags1, str); b = (user.flags1 & (1L << i)) != 0;
truncsp(str); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),b);
gtk_entry_set_text(GTK_ENTRY(w),str); }
} }
w=glade_xml_get_widget(xml, "eFlagSet2");
strcpy(str,"tFlagSet2.");
for(i=0;i<26;i++) {
str[9]='A'+i;
w=glade_xml_get_widget(xml, str);
if(w==NULL) if(w==NULL)
fprintf(stderr,"Cannot get the flag set 2 widget\n"); fprintf(stderr,"Cannot get the %s widget\n",str);
else { else {
ltoaf(user.flags2, str); b = (user.flags2 & (1L << i)) != 0;
truncsp(str); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),b);
gtk_entry_set_text(GTK_ENTRY(w),str);
} }
w=glade_xml_get_widget(xml, "eFlagSet3"); }
strcpy(str,"tFlagSet3.");
for(i=0;i<26;i++) {
str[9]='A'+i;
w=glade_xml_get_widget(xml, str);
if(w==NULL) if(w==NULL)
fprintf(stderr,"Cannot get the flag set 3 widget\n"); fprintf(stderr,"Cannot get the %s widget\n",str);
else { else {
ltoaf(user.flags3, str); b = (user.flags3 & (1L << i)) != 0;
truncsp(str); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),b);
gtk_entry_set_text(GTK_ENTRY(w),str); }
} }
w=glade_xml_get_widget(xml, "eFlagSet4");
strcpy(str,"tFlagSet4.");
for(i=0;i<26;i++) {
str[9]='A'+i;
w=glade_xml_get_widget(xml, str);
if(w==NULL) if(w==NULL)
fprintf(stderr,"Cannot get the flag set 4 widget\n"); fprintf(stderr,"Cannot get the %s widget\n",str);
else { else {
ltoaf(user.flags4, str); b = (user.flags4 & (1L << i)) != 0;
truncsp(str); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),b);
gtk_entry_set_text(GTK_ENTRY(w),str); }
} }
/* Exemptions */ /* Exemptions */
w=glade_xml_get_widget(xml, "eExemptions"); strcpy(str,"tExemptions.");
for(i=0;i<26;i++) {
str[11]='A'+i;
w=glade_xml_get_widget(xml, str);
if(w==NULL) if(w==NULL)
fprintf(stderr,"Cannot get the exemptions widget\n"); fprintf(stderr,"Cannot get the %s widget\n",str);
else { else {
ltoaf(user.exempt, str); b = (user.exempt & (1L << i)) != 0;
truncsp(str); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),b);
gtk_entry_set_text(GTK_ENTRY(w),str); }
} }
/* Restrictions */ /* Restrictions */
w=glade_xml_get_widget(xml, "eRestrictions"); strcpy(str,"tRestrictions.");
for(i=0;i<26;i++) {
str[13]='A'+i;
w=glade_xml_get_widget(xml, str);
if(w==NULL) if(w==NULL)
fprintf(stderr,"Cannot get the restrictions widget\n"); fprintf(stderr,"Cannot get the %s widget\n",str);
else { else {
ltoaf(user.rest, str); b = (user.rest & (1L << i)) != 0;
truncsp(str); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),b);
gtk_entry_set_text(GTK_ENTRY(w),str); }
} }
/* Credits */ /* Credits */
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment