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
Branches
Tags
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.");
if(w==NULL) for(i=0;i<26;i++) {
fprintf(stderr,"Cannot get the flag set 1 widget\n"); str[9]='A'+i;
else { w=glade_xml_get_widget(xml, str);
ltoaf(user.flags1, str); if(w==NULL)
truncsp(str); fprintf(stderr,"Cannot get the %s widget\n",str);
gtk_entry_set_text(GTK_ENTRY(w),str); else {
b = (user.flags1 & (1L << i)) != 0;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),b);
}
} }
w=glade_xml_get_widget(xml, "eFlagSet2");
if(w==NULL) strcpy(str,"tFlagSet2.");
fprintf(stderr,"Cannot get the flag set 2 widget\n"); for(i=0;i<26;i++) {
else { str[9]='A'+i;
ltoaf(user.flags2, str); w=glade_xml_get_widget(xml, str);
truncsp(str); if(w==NULL)
gtk_entry_set_text(GTK_ENTRY(w),str); fprintf(stderr,"Cannot get the %s widget\n",str);
else {
b = (user.flags2 & (1L << i)) != 0;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),b);
}
} }
w=glade_xml_get_widget(xml, "eFlagSet3");
if(w==NULL) strcpy(str,"tFlagSet3.");
fprintf(stderr,"Cannot get the flag set 3 widget\n"); for(i=0;i<26;i++) {
else { str[9]='A'+i;
ltoaf(user.flags3, str); w=glade_xml_get_widget(xml, str);
truncsp(str); if(w==NULL)
gtk_entry_set_text(GTK_ENTRY(w),str); fprintf(stderr,"Cannot get the %s widget\n",str);
else {
b = (user.flags3 & (1L << i)) != 0;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),b);
}
} }
w=glade_xml_get_widget(xml, "eFlagSet4");
if(w==NULL) strcpy(str,"tFlagSet4.");
fprintf(stderr,"Cannot get the flag set 4 widget\n"); for(i=0;i<26;i++) {
else { str[9]='A'+i;
ltoaf(user.flags4, str); w=glade_xml_get_widget(xml, str);
truncsp(str); if(w==NULL)
gtk_entry_set_text(GTK_ENTRY(w),str); fprintf(stderr,"Cannot get the %s widget\n",str);
else {
b = (user.flags4 & (1L << i)) != 0;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),b);
}
} }
/* Exemptions */ /* Exemptions */
w=glade_xml_get_widget(xml, "eExemptions"); strcpy(str,"tExemptions.");
if(w==NULL) for(i=0;i<26;i++) {
fprintf(stderr,"Cannot get the exemptions widget\n"); str[11]='A'+i;
else { w=glade_xml_get_widget(xml, str);
ltoaf(user.exempt, str); if(w==NULL)
truncsp(str); fprintf(stderr,"Cannot get the %s widget\n",str);
gtk_entry_set_text(GTK_ENTRY(w),str); else {
b = (user.exempt & (1L << i)) != 0;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),b);
}
} }
/* Restrictions */ /* Restrictions */
w=glade_xml_get_widget(xml, "eRestrictions"); strcpy(str,"tRestrictions.");
if(w==NULL) for(i=0;i<26;i++) {
fprintf(stderr,"Cannot get the restrictions widget\n"); str[13]='A'+i;
else { w=glade_xml_get_widget(xml, str);
ltoaf(user.rest, str); if(w==NULL)
truncsp(str); fprintf(stderr,"Cannot get the %s widget\n",str);
gtk_entry_set_text(GTK_ENTRY(w),str); else {
b = (user.rest & (1L << i)) != 0;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),b);
}
} }
/* 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