X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-var-sheet-header.c;h=c40b0aa381692099bbd8bb32adcdd7a9bc0489ed;hb=7c3ed885759bae94d80064c24135083e597873e1;hp=8930826aaac939bfe8c233fce78d00dac4f07581;hpb=978053dda1b3dd918e0a814cb5bd282cd2d3774c;p=pspp diff --git a/src/ui/gui/psppire-var-sheet-header.c b/src/ui/gui/psppire-var-sheet-header.c index 8930826aaa..c40b0aa381 100644 --- a/src/ui/gui/psppire-var-sheet-header.c +++ b/src/ui/gui/psppire-var-sheet-header.c @@ -1,6 +1,5 @@ -/* - A candidate replacement for Pspp's sheet - Copyright (C) 2016 John Darrington +/* PSPPIRE - a graphical user interface for PSPP. + Copyright (C) 2016 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,9 +20,15 @@ #include "psppire-var-sheet-header.h" -#include "efficient-sheet/jmd-axis-model.h" -#include "efficient-sheet/jmd-datum.h" +#include +#define _(msgid) gettext (msgid) +#define N_(msgid) msgid + +enum {CHANGED, + n_SIGNALS}; + +static guint signals [n_SIGNALS]; static guint gni (GListModel *list) @@ -34,56 +39,59 @@ gni (GListModel *list) static GType git (GListModel *list) { - return JMD_TYPE_DATUM; + return GTK_TYPE_BUTTON; } + static gpointer gi (GListModel *list, guint position) { - JmdDatum *gd = JMD_DATUM (g_object_new (JMD_TYPE_DATUM, NULL)); + GtkWidget *button = gtk_button_new (); + const gchar *text = NULL; switch (position) { case 0: - gd->text = g_strdup ("Name"); + text = N_("Name"); break; case 1: - gd->text = g_strdup ("Type"); + text = N_("Type"); break; case 2: - gd->text = g_strdup ("Width"); + text = N_("Width"); break; case 3: - gd->text = g_strdup ("Decimal"); + text = N_("Decimal"); break; case 4: - gd->text = g_strdup ("Label"); + text = N_("Label"); break; case 5: - gd->text = g_strdup ("Value Labels"); + text = N_("Value Labels"); break; case 6: - gd->text = g_strdup ("Missing Values"); + text = N_("Missing Values"); break; case 7: - gd->text = g_strdup ("Columns"); + text = N_("Columns"); break; case 8: - gd->text = g_strdup ("Align"); + text = N_("Align"); break; case 9: - gd->text = g_strdup ("Measure"); + text = N_("Measure"); break; case 10: - gd->text = g_strdup ("Role"); + text = N_("Role"); break; default: - // g_assert_not_reached (); - g_print ("Bug: Request for item %d\n", position); break; } - return gd; + if (text) + gtk_button_set_label (GTK_BUTTON (button), gettext (text)); + + return button; } @@ -110,5 +118,17 @@ psppire_var_sheet_header_init (PsppireVarSheetHeader *d) static void psppire_var_sheet_header_class_init (PsppireVarSheetHeaderClass *dc) { + GObjectClass *object_class = G_OBJECT_CLASS (dc); + + /* This signal is never emitted. It is just to satisfy the interface. */ + signals [CHANGED] = + g_signal_new ("changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + 0, + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); }