tServer questions now use stock GTK+ "yes" and "no" buttons. - vaccinewars - be… | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit fc52feea6ab65b0b6b32a7acd0034f5116f1694d | |
parent 8ab707530d26358b7c47db6d79bf9d22fcb95170 | |
Author: Ben Webb <[email protected]> | |
Date: Mon, 25 Mar 2002 16:56:30 +0000 | |
Server questions now use stock GTK+ "yes" and "no" buttons. | |
Diffstat: | |
M src/gui_client/gtk_client.c | 34 ++++++++++++++++++++---------… | |
1 file changed, 22 insertions(+), 12 deletions(-) | |
--- | |
diff --git a/src/gui_client/gtk_client.c b/src/gui_client/gtk_client.c | |
t@@ -1846,19 +1846,29 @@ void QuestionDialog(char *Data, Player *From) | |
hbbox = my_hbbox_new(); | |
for (i = 0; i < strlen(Responses); i++) { | |
- for (j = 0, trword = NULL; j < numWords && !trword; j++) { | |
- underline = strchr(Words[j], '_'); | |
- if (underline && toupper(underline[1]) == Responses[i]) { | |
- trword = _(Words[j]); | |
+ switch (Responses[i]) { | |
+ case 'Y': | |
+ button = gtk_button_new_from_stock(GTK_STOCK_YES); | |
+ break; | |
+ case 'N': | |
+ button = gtk_button_new_from_stock(GTK_STOCK_NO); | |
+ break; | |
+ default: | |
+ for (j = 0, trword = NULL; j < numWords && !trword; j++) { | |
+ underline = strchr(Words[j], '_'); | |
+ if (underline && toupper(underline[1]) == Responses[i]) { | |
+ trword = _(Words[j]); | |
+ } | |
} | |
- } | |
- button = gtk_button_new_with_label(""); | |
- if (trword) { | |
- SetAccelerator(button, trword, button, "clicked", accel_group, FALSE); | |
- } else { | |
- trword = g_strdup_printf("_%c", Responses[i]); | |
- SetAccelerator(button, trword, button, "clicked", accel_group, FALSE); | |
- g_free(trword); | |
+ button = gtk_button_new_with_label(""); | |
+ if (trword) { | |
+ SetAccelerator(button, trword, button, "clicked", accel_group, FALSE); | |
+ } else { | |
+ trword = g_strdup_printf("_%c", Responses[i]); | |
+ SetAccelerator(button, trword, button, "clicked", accel_group, FALSE); | |
+ g_free(trword); | |
+ } | |
+ break; | |
} | |
gtk_object_set_data(GTK_OBJECT(button), "dialog", (gpointer)dialog); | |
gtk_signal_connect(GTK_OBJECT(button), "clicked", |