72 int lux,
int no_lux_scroll,
73 int sci,
int no_sci_scroll)
76 int tax_lock, lux_lock, sci_lock;
79 tax_lock = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
rates_tax_toggle));
80 lux_lock = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
rates_lux_toggle));
81 sci_lock = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
rates_sci_toggle));
90 tax =
MIN(tax, maxrate);
91 lux =
MIN(lux, maxrate);
92 sci =
MIN(sci, maxrate);
94 if (tax + sci + lux != 100) {
97 lux =
MIN(
MAX(100 - tax - sci, 0), maxrate);
100 sci =
MIN(
MAX(100 - tax - lux, 0), maxrate);
104 tax =
MIN(
MAX(100 - lux - sci, 0), maxrate);
107 sci =
MIN(
MAX(100 - lux - tax, 0), maxrate);
111 lux =
MIN(
MAX(100 - tax - sci, 0), maxrate);
114 tax =
MIN(
MAX(100 - lux - sci, 0), maxrate);
118 if (tax + sci + lux != 100) {
136 if (strcmp(buf, gtk_label_get_text(GTK_LABEL(
rates_tax_label))) != 0) {
139 if (!no_tax_scroll) {
150 if (strcmp(buf, gtk_label_get_text(GTK_LABEL(
rates_lux_label))) != 0) {
153 if (!no_lux_scroll) {
164 if (strcmp(buf, gtk_label_get_text(GTK_LABEL(
rates_sci_label))) != 0) {
167 if (!no_sci_scroll) {
301 GtkWidget *
shell, *content;
302 GtkWidget *label, *scale;
305 shell = gtk_dialog_new_with_buttons(
_(
"Change policies"),
314 shell = gtk_dialog_new_with_buttons(
_(
"Policies"),
323 content = gtk_dialog_get_content_area(GTK_DIALOG(
shell));
326 label = gtk_label_new(
_(
"Changes will not take effect until next turn."));
327 gtk_box_insert_child_after(GTK_BOX(content), label, NULL);
338 scale = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,
348 gtk_box_insert_child_after(GTK_BOX(content), label, NULL);
349 gtk_box_insert_child_after(GTK_BOX(content), scale, NULL);
357 g_signal_connect(
shell,
"destroy",
360 g_signal_connect(
shell,
"response",
363 gtk_widget_show(content);
389 GtkWidget *
shell, *content;
390 GtkWidget *frame, *hbox;
397 shell = gtk_dialog_new_with_buttons(
_(
"Select tax, luxury and science rates"),
406 gtk_dialog_set_default_response(GTK_DIALOG(
shell), GTK_RESPONSE_OK);
407 content = gtk_dialog_get_content_area(GTK_DIALOG(
shell));
412 frame = gtk_frame_new(
_(
"Tax") );
413 gtk_box_insert_child_after(GTK_BOX(content), frame, NULL);
415 hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
416 gtk_frame_set_child(GTK_FRAME(frame), hbox);
419 gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0, 10, 1);
421 for (i = 0; i <= 10; i++) {
436 frame = gtk_frame_new(
_(
"Luxury") );
437 gtk_box_insert_child_after(GTK_BOX(content), frame, NULL);
439 hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
440 gtk_frame_set_child(GTK_FRAME(frame), hbox);
443 gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0, 10, 1);
445 for (i = 0; i <= 10; i++) {
460 frame = gtk_frame_new(
_(
"Science") );
461 gtk_box_insert_child_after(GTK_BOX(content), frame, NULL);
463 hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
464 gtk_frame_set_child(GTK_FRAME(frame), hbox);
467 gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0, 10, 1);
469 for (i = 0; i <= 10; i++) {
484 g_signal_connect(
shell,
"response",
486 g_signal_connect(
shell,
"destroy",
489 gtk_widget_show(
shell);
bool can_client_issue_orders(void)