1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 05_fix_449288_hlt_pattern_dialog.dpatch by Jim Hayward,
3
## Daniel Leidert (dale) <daniel.leidert@wgdd.de>
5
## All lines beginning with `## DP:' are a description of the patch.
6
## DP: With Gtk 2.12 many people observed, that no highlighting pattern are
7
## DP: shown in the dialog. This might be because of a Gtk bug and the fact,
8
## DP: that GtkOptionMenu has been deprecated some time ago. This fix adds a
11
## DP: Many thanks to Jim Hayward for the patch.
13
## DP: <URL:http://bugs.debian.org/449288>
14
## DP: <URL:http://bugzilla.gnome.org/show_bug.cgi?id=498954>
17
diff -urNad trunk~/src/preferences.c trunk/src/preferences.c
18
--- trunk~/src/preferences.c 2006-02-13 05:16:30.000000000 +0100
19
+++ trunk/src/preferences.c 2008-01-20 14:20:33.000000000 +0100
24
- const gchar *selected_filetype;
25
+ gchar *selected_filetype;
26
} Thighlightpatterndialog;
32
static void highlightpattern_fill_from_selected_filetype(Tprefdialog *pd) {
33
- DEBUG_MSG("highlightpattern_popmenu_activate, applied changes, about to clear liststore\n");
34
+ DEBUG_MSG("highlightpattern_fill_from_selected_filetype, applied changes, about to clear liststore\n");
35
gtk_list_store_clear(GTK_LIST_STORE(pd->hpd.lstore));
36
if (pd->hpd.selected_filetype) {
38
tmplist = g_list_first(pd->lists[highlight_patterns]);
39
- DEBUG_MSG("highlightpattern_popmenu_activate, about to fill for filetype %s (tmplist=%p)\n",pd->hpd.selected_filetype,tmplist);
40
+ DEBUG_MSG("highlightpattern_fill_from_selected_filetype, about to fill for filetype %s (tmplist=%p)\n",pd->hpd.selected_filetype,tmplist);
41
/* fill list model here */
43
gchar **strarr =(gchar **)tmplist->data;
45
DEBUG_MSG("found entry with filetype %s\n",strarr[0]);
46
if (strcmp(strarr[0], pd->hpd.selected_filetype)==0) {
48
- DEBUG_MSG("highlightpattern_popmenu_activate, appending pattern %s with filetype %s\n",strarr[1],strarr[0]);
49
+ DEBUG_MSG("highlightpattern_fill_from_selected_filetype, appending pattern %s with filetype %s\n",strarr[1],strarr[0]);
50
gtk_list_store_append(GTK_LIST_STORE(pd->hpd.lstore), &iter);
51
gtk_list_store_set(GTK_LIST_STORE(pd->hpd.lstore), &iter, 0, strarr[1], -1);
54
highlightpattern_apply_changes(pd);
55
pd->hpd.curstrarr = NULL;
57
- pd->hpd.selected_filetype = gtk_label_get_text(GTK_LABEL(GTK_BIN(menuitem)->child));
58
+ if (pd->hpd.selected_filetype)
59
+ g_free (pd->hpd.selected_filetype);
60
+ pd->hpd.selected_filetype = g_strdup (gtk_label_get_text(GTK_LABEL(GTK_BIN(menuitem)->child)));
62
highlightpattern_fill_from_selected_filetype(pd);
66
select = gtk_tree_view_get_selection(GTK_TREE_VIEW(pd->hpd.lview));
67
g_signal_connect(G_OBJECT(select), "changed",G_CALLBACK(highlightpattern_selection_changed_cb),pd);
68
+ gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);
71
vbox3 = gtk_vbox_new(FALSE, 2);
73
pd->lists[browsers] = NULL;
74
pd->lists[external_commands] = NULL;
76
+ if (pd->hpd.selected_filetype)
77
+ g_free (pd->hpd.selected_filetype);
79
/* select = gtk_tree_view_get_selection(GTK_TREE_VIEW(pd->ftd.lview));
80
g_signal_handlers_destroy(G_OBJECT(select));*/
81
DEBUG_MSG("preferences_destroy_lcb, destroying handlers for lstore %p\n",pd->ftd.lstore);