/* Called from c1_ShowResult */

#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include "gddcalc.h"
#include "manydays.h"

bool c2_LocaleOK(c2_widgets *w) {
	
	const gchar *t;

	t = gtk_entry_get_text(GTK_ENTRY(w->entry_lat));
	if (atoi(t) < 42.0 || atoi(t) > 46.0) {return false;}

	t = gtk_entry_get_text(GTK_ENTRY(w->entry_lon));
	if (atoi(t) > -122.5 || atoi(t) < -124.0) {return false;}

	t = gtk_entry_get_text(GTK_ENTRY(w->entry_elev));
	if (atoi(t) < 100 || atoi(t) > 600) {return false;}

	t = gtk_entry_get_text(GTK_ENTRY(w->entry_aspect));
	if (atoi(t) < 0.0 || atoi(t) > 360.0) {return false;}

	t = gtk_entry_get_text(GTK_ENTRY(w->entry_tilt));
	if (atoi(t) < -10.0 || atoi(t) > 30.0) {return false;}

	return true;
}
