X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fgoto-case-dialog.c;h=54d8eaf3349205b850901d2ff8ffce303dbfe74c;hb=978053dda1b3dd918e0a814cb5bd282cd2d3774c;hp=9a523943b1c5686e639d4df34b56530d4f1b55a5;hpb=4398d3a1a881c6cafaeb0cbd11f56bd51d904c51;p=pspp diff --git a/src/ui/gui/goto-case-dialog.c b/src/ui/gui/goto-case-dialog.c index 9a523943b1..54d8eaf334 100644 --- a/src/ui/gui/goto-case-dialog.c +++ b/src/ui/gui/goto-case-dialog.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007 Free Software Foundation + Copyright (C) 2007, 2011, 2012 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 @@ -17,53 +17,18 @@ #include #include "goto-case-dialog.h" -#include "helper.h" +#include "builder-wrapper.h" #include "psppire-dialog.h" #include "psppire-data-window.h" #include "psppire-data-store.h" static void -refresh (const PsppireDataWindow *de, GtkBuilder *xml) +refresh (GtkWidget *ds, GtkBuilder *xml) { - PsppireDataStore *ds = NULL; - casenumber case_count ; - - GtkWidget *case_num_entry = get_widget_assert (xml, "goto-case-case-num-entry"); - - g_object_get (de->data_editor, "data-store", &ds, NULL); - - case_count = psppire_data_store_get_case_count (ds); - - 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 (void *ds) { - gint response; - GtkBuilder *xml = builder_new ("psppire.ui"); - PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data); - - GtkWidget *dialog = get_widget_assert (xml, "goto-case-dialog"); - - - gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); - - refresh (de, xml); - - response = psppire_dialog_run (PSPPIRE_DIALOG (dialog)); - - if ( response == PSPPIRE_RESPONSE_GOTO ) - { - glong case_num; - GtkWidget *case_num_entry = - get_widget_assert (xml, "goto-case-case-num-entry"); - - case_num = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (case_num_entry)) - - FIRST_CASE_NUMBER ; - - g_object_set (de->data_editor, "current-case", case_num, NULL); - } }