#include "history_list.h"
+#include <langinfo.h>
/*
*-----------------------------------------------------------------------------
GtkWidget *arrow;
ds = g_new0(DateSelection, 1);
+ gchar *date_format;
+ gint i;
ds->box = gtk_hbox_new(FALSE, 2);
g_signal_connect(G_OBJECT(ds->box), "destroy",
G_CALLBACK(date_selection_destroy_cb), ds);
- /* FIXME: use option menu with text format of month instead of a spin button */
- ds->spin_m = pref_spin_new(ds->box, NULL, NULL, 1, 12, 1, 0, 1, NULL, NULL);
- ds->spin_d = pref_spin_new(ds->box, NULL, NULL, 1, 31, 1, 0, 1, NULL, NULL);
- ds->spin_y = pref_spin_new(ds->box, NULL, NULL, 1900, 9999, 1, 0, 1900, NULL, NULL);
+ date_format = nl_langinfo(D_FMT);
+
+ if (strlen(date_format) == 8)
+ {
+ for (i=1; i<8; i=i+3)
+ {
+ switch (date_format[i])
+ {
+ case 'd':
+ ds->spin_d = pref_spin_new(ds->box, NULL, NULL, 1, 31, 1, 0, 1, NULL, NULL);
+ break;
+ case 'm':
+ ds->spin_m = pref_spin_new(ds->box, NULL, NULL, 1, 12, 1, 0, 1, NULL, NULL);
+ break;
+ case 'y': case 'Y':
+ ds->spin_y = pref_spin_new(ds->box, NULL, NULL, 1900, 9999, 1, 0, 1900, NULL, NULL);
+ break;
+ default:
+ DEBUG_0("Date locale %s is unknown", date_format);
+ break;
+ }
+ }
+ }
+ else
+ {
+ ds->spin_m = pref_spin_new(ds->box, NULL, NULL, 1, 12, 1, 0, 1, NULL, NULL);
+ ds->spin_d = pref_spin_new(ds->box, NULL, NULL, 1, 31, 1, 0, 1, NULL, NULL);
+ ds->spin_y = pref_spin_new(ds->box, NULL, NULL, 1900, 9999, 1, 0, 1900, NULL, NULL);
+ }
+
spin_increase(ds->spin_y, 5);
ds->button = gtk_toggle_button_new();
return handle_size;
}
-static gboolean sizer_motion_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
+static gboolean sizer_motion_cb(GtkWidget *widget, GdkEventMotion *event, gpointer data)
{
SizerData *sd = data;
gint x, y;
if (!sd->in_drag) return FALSE;
- x = sd->press_x - bevent->x_root;
- y = sd->press_y - bevent->y_root;
+ x = sd->press_x - event->x_root;
+ y = sd->press_y - event->y_root;
w = sd->press_width;
h = sd->press_height;