projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
FLIP: Convert tests to use Autotest.
[pspp]
/
src
/
ui
/
gui
/
dict-display.c
diff --git
a/src/ui/gui/dict-display.c
b/src/ui/gui/dict-display.c
index 2123c3c5cfe7b300b6c2bcaca241f5ae95d5636d..ada7fb40fcbd5ab45ad55edca1c5508c5a4c8c07 100644
(file)
--- a/
src/ui/gui/dict-display.c
+++ b/
src/ui/gui/dict-display.c
@@
-23,6
+23,8
@@
#include "dict-display.h"
#include "psppire-dict.h"
#include "dict-display.h"
#include "psppire-dict.h"
+#include "psppire-var-view.h"
+#include <libpspp/i18n.h>
#include "helper.h"
#include <data/variable.h>
#include <data/format.h>
#include "helper.h"
#include <data/variable.h>
#include <data/format.h>
@@
-53,7
+55,6
@@
get_base_model (GtkTreeModel *top_model, GtkTreeIter *top_iter,
}
}
-
void
insert_source_row_into_entry (GtkTreeIter iter,
GtkWidget *dest,
void
insert_source_row_into_entry (GtkTreeIter iter,
GtkWidget *dest,
@@
-66,7
+67,6
@@
insert_source_row_into_entry (GtkTreeIter iter,
gint *idx;
struct variable *var;
GtkTreeIter dict_iter;
gint *idx;
struct variable *var;
GtkTreeIter dict_iter;
- gchar *name;
g_return_if_fail (GTK_IS_ENTRY(dest));
g_return_if_fail (GTK_IS_ENTRY(dest));
@@
-80,13
+80,10
@@
insert_source_row_into_entry (GtkTreeIter iter,
gtk_tree_path_free (path);
gtk_tree_path_free (path);
- name = pspp_locale_to_utf8 (var_get_name (var), -1, NULL);
- gtk_entry_set_text (GTK_ENTRY (dest), name);
- g_free (name);
+ gtk_entry_set_text (GTK_ENTRY (dest), var_get_name (var));
}
}
-
void
insert_source_row_into_tree_view (GtkTreeIter iter,
GtkWidget *dest,
void
insert_source_row_into_tree_view (GtkTreeIter iter,
GtkWidget *dest,
@@
-98,37
+95,45
@@
insert_source_row_into_tree_view (GtkTreeIter iter,
GtkTreeIter dest_iter;
GtkTreeIter dict_iter;
gint *row ;
GtkTreeIter dest_iter;
GtkTreeIter dict_iter;
gint *row ;
- GtkTreeModel *destmodel = gtk_tree_view_get_model (
GTK_TREE_VIEW (dest));
+ GtkTreeModel *destmodel = gtk_tree_view_get_model (GTK_TREE_VIEW (dest));
+ const struct variable *var;
GtkTreeModel *dict;
GtkTreeModel *dict;
-
get_base_model (model, &iter, &dict, &dict_iter);
path = gtk_tree_model_get_path (dict, &dict_iter);
row = gtk_tree_path_get_indices (path);
get_base_model (model, &iter, &dict, &dict_iter);
path = gtk_tree_model_get_path (dict, &dict_iter);
row = gtk_tree_path_get_indices (path);
+ var = psppire_dict_get_variable (PSPPIRE_DICT (dict), *row);
+
gtk_list_store_append (GTK_LIST_STORE (destmodel), &dest_iter);
gtk_list_store_append (GTK_LIST_STORE (destmodel), &dest_iter);
- gtk_list_store_set (GTK_LIST_STORE (destmodel), &dest_iter, 0, *row, -1);
+
+ gtk_list_store_set (GTK_LIST_STORE (destmodel), &dest_iter, 0, var, -1);
gtk_tree_path_free (path);
}
gtk_tree_path_free (path);
}
+
gboolean
is_currently_in_entry (GtkTreeModel *model, GtkTreeIter *iter,
PsppireSelector *selector)
{
gboolean result;
gboolean
is_currently_in_entry (GtkTreeModel *model, GtkTreeIter *iter,
PsppireSelector *selector)
{
gboolean result;
- gchar *name;
GtkTreeIter dict_iter;
GtkTreeModel *dict;
struct variable *var;
gint dict_index;
gint *indeces;
GtkTreePath *path;
GtkTreeIter dict_iter;
GtkTreeModel *dict;
struct variable *var;
gint dict_index;
gint *indeces;
GtkTreePath *path;
- const gchar *text = gtk_entry_get_text (GTK_ENTRY (selector->dest));
+ GtkWidget *entry = NULL;
+ const gchar *text = NULL;
+
+ g_object_get (selector, "dest-widget", &entry, NULL);
+
+ text = gtk_entry_get_text (GTK_ENTRY (entry));
get_base_model (model, iter, &dict, &dict_iter);
get_base_model (model, iter, &dict, &dict_iter);
@@
-142,12
+147,8
@@
is_currently_in_entry (GtkTreeModel *model, GtkTreeIter *iter,
gtk_tree_path_free (path);
gtk_tree_path_free (path);
- name = pspp_locale_to_utf8 (var_get_name (var), -1, NULL);
- result = ( 0 == strcmp (text, name));
- g_free (name);
+ result = ( 0 == strcmp (text, var_get_name (var) ));
return result;
}
return result;
}
-
-