X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fgoto-case-dialog.c;h=832e1f2dbdfff5376f432deed5a1d03202bfeee9;hb=ac5fc2c85d86f1a14cdea0a215666ab39b44a1dc;hp=32e93dbd4ca37afe07f9bd14ebcf01953199ec27;hpb=82d3fc0e14c1465eb2d1de00796317d062151fe0;p=pspp
diff --git a/src/ui/gui/goto-case-dialog.c b/src/ui/gui/goto-case-dialog.c
index 32e93dbd4c..832e1f2dbd 100644
--- a/src/ui/gui/goto-case-dialog.c
+++ b/src/ui/gui/goto-case-dialog.c
@@ -15,44 +15,38 @@
along with this program. If not, see . */
+#include
#include "goto-case-dialog.h"
#include "helper.h"
#include "psppire-dialog.h"
-#include "data-editor.h"
+#include "psppire-data-window.h"
#include "psppire-data-store.h"
-#include
static void
-refresh (const struct data_editor *de, GladeXML *xml)
+refresh (const PsppireDataWindow *de, GtkBuilder *xml)
{
- GtkSheet *data_sheet =
- GTK_SHEET (get_widget_assert (de->xml, "data_sheet"));
+ PsppireDataStore *ds = NULL;
+ casenumber case_count ;
- PsppireDataStore *ds =
- PSPPIRE_DATA_STORE (gtk_sheet_get_model (data_sheet));
+ GtkWidget *case_num_entry = get_widget_assert (xml, "goto-case-case-num-entry");
- GtkWidget *case_num_entry =
- get_widget_assert (xml, "goto-case-case-num-entry");
+ g_object_get (de->data_editor, "data-store", &ds, NULL);
- casenumber case_count =
- psppire_data_store_get_case_count (ds);
+ case_count = psppire_data_store_get_case_count (ds);
- gtk_spin_button_set_range (GTK_SPIN_BUTTON (case_num_entry),
- 1, case_count);
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (case_num_entry), 1, case_count);
}
void
-goto_case_dialog (GObject *o, gpointer data)
+goto_case_dialog (PsppireDataWindow *de)
{
gint response;
- GladeXML *xml = XML_NEW ("psppire.glade");
- struct data_editor *de = data;
+ GtkBuilder *xml = builder_new ("goto-case.ui");
GtkWidget *dialog = get_widget_assert (xml, "goto-case-dialog");
-
- gtk_window_set_transient_for (GTK_WINDOW (dialog), de->parent.window);
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de));
refresh (de, xml);
@@ -60,24 +54,13 @@ goto_case_dialog (GObject *o, gpointer data)
if ( response == PSPPIRE_RESPONSE_GOTO )
{
- gint row, column;
- GtkSheet *data_sheet =
- GTK_SHEET (get_widget_assert (de->xml, "data_sheet"));
-
-
+ glong case_num;
GtkWidget *case_num_entry =
get_widget_assert (xml, "goto-case-case-num-entry");
- gtk_sheet_get_active_cell (data_sheet, &row, &column);
-
- row =
- gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (case_num_entry))
+ case_num = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (case_num_entry))
- FIRST_CASE_NUMBER ;
- gtk_sheet_moveto (data_sheet,
- row, column,
- 0.5, 0.5);
-
- gtk_sheet_set_active_cell (data_sheet, row, column);
+ g_object_set (de->data_editor, "current-case", case_num, NULL);
}
}