|
Lines 162-168
Link Here
|
| 162 |
GtkWidget *check; |
162 |
GtkWidget *check; |
| 163 |
GtkWidget *radio[9]; |
163 |
GtkWidget *radio[9]; |
| 164 |
gchar **curstrarr; |
164 |
gchar **curstrarr; |
| 165 |
const gchar *selected_filetype; |
165 |
gchar *selected_filetype; |
| 166 |
} Thighlightpatterndialog; |
166 |
} Thighlightpatterndialog; |
| 167 |
|
167 |
|
| 168 |
typedef struct { |
168 |
typedef struct { |
|
Lines 910-921
Link Here
|
| 910 |
} |
910 |
} |
| 911 |
|
911 |
|
| 912 |
static void highlightpattern_fill_from_selected_filetype(Tprefdialog *pd) { |
912 |
static void highlightpattern_fill_from_selected_filetype(Tprefdialog *pd) { |
| 913 |
DEBUG_MSG("highlightpattern_popmenu_activate, applied changes, about to clear liststore\n"); |
913 |
DEBUG_MSG("highlightpattern_fill_from_selected_filetype, applied changes, about to clear liststore\n"); |
| 914 |
gtk_list_store_clear(GTK_LIST_STORE(pd->hpd.lstore)); |
914 |
gtk_list_store_clear(GTK_LIST_STORE(pd->hpd.lstore)); |
| 915 |
if (pd->hpd.selected_filetype) { |
915 |
if (pd->hpd.selected_filetype) { |
| 916 |
GList *tmplist; |
916 |
GList *tmplist; |
| 917 |
tmplist = g_list_first(pd->lists[highlight_patterns]); |
917 |
tmplist = g_list_first(pd->lists[highlight_patterns]); |
| 918 |
DEBUG_MSG("highlightpattern_popmenu_activate, about to fill for filetype %s (tmplist=%p)\n",pd->hpd.selected_filetype,tmplist); |
918 |
DEBUG_MSG("highlightpattern_fill_from_selected_filetype, about to fill for filetype %s (tmplist=%p)\n",pd->hpd.selected_filetype,tmplist); |
| 919 |
/* fill list model here */ |
919 |
/* fill list model here */ |
| 920 |
while (tmplist) { |
920 |
while (tmplist) { |
| 921 |
gchar **strarr =(gchar **)tmplist->data; |
921 |
gchar **strarr =(gchar **)tmplist->data; |
|
Lines 923-929
Link Here
|
| 923 |
DEBUG_MSG("found entry with filetype %s\n",strarr[0]); |
923 |
DEBUG_MSG("found entry with filetype %s\n",strarr[0]); |
| 924 |
if (strcmp(strarr[0], pd->hpd.selected_filetype)==0) { |
924 |
if (strcmp(strarr[0], pd->hpd.selected_filetype)==0) { |
| 925 |
GtkTreeIter iter; |
925 |
GtkTreeIter iter; |
| 926 |
DEBUG_MSG("highlightpattern_popmenu_activate, appending pattern %s with filetype %s\n",strarr[1],strarr[0]); |
926 |
DEBUG_MSG("highlightpattern_fill_from_selected_filetype, appending pattern %s with filetype %s\n",strarr[1],strarr[0]); |
| 927 |
gtk_list_store_append(GTK_LIST_STORE(pd->hpd.lstore), &iter); |
927 |
gtk_list_store_append(GTK_LIST_STORE(pd->hpd.lstore), &iter); |
| 928 |
gtk_list_store_set(GTK_LIST_STORE(pd->hpd.lstore), &iter, 0, strarr[1], -1); |
928 |
gtk_list_store_set(GTK_LIST_STORE(pd->hpd.lstore), &iter, 0, strarr[1], -1); |
| 929 |
} |
929 |
} |
|
Lines 949-955
Link Here
|
| 949 |
highlightpattern_apply_changes(pd); |
949 |
highlightpattern_apply_changes(pd); |
| 950 |
pd->hpd.curstrarr = NULL; |
950 |
pd->hpd.curstrarr = NULL; |
| 951 |
if (menuitem) { |
951 |
if (menuitem) { |
| 952 |
pd->hpd.selected_filetype = gtk_label_get_text(GTK_LABEL(GTK_BIN(menuitem)->child)); |
952 |
if (pd->hpd.selected_filetype) |
|
|
953 |
g_free (pd->hpd.selected_filetype); |
| 954 |
pd->hpd.selected_filetype = g_strdup (gtk_label_get_text(GTK_LABEL(GTK_BIN(menuitem)->child))); |
| 953 |
} |
955 |
} |
| 954 |
highlightpattern_fill_from_selected_filetype(pd); |
956 |
highlightpattern_fill_from_selected_filetype(pd); |
| 955 |
} |
957 |
} |
|
Lines 1209-1214
Link Here
|
| 1209 |
|
1211 |
|
| 1210 |
select = gtk_tree_view_get_selection(GTK_TREE_VIEW(pd->hpd.lview)); |
1212 |
select = gtk_tree_view_get_selection(GTK_TREE_VIEW(pd->hpd.lview)); |
| 1211 |
g_signal_connect(G_OBJECT(select), "changed",G_CALLBACK(highlightpattern_selection_changed_cb),pd); |
1213 |
g_signal_connect(G_OBJECT(select), "changed",G_CALLBACK(highlightpattern_selection_changed_cb),pd); |
|
|
1214 |
gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE); |
| 1212 |
} |
1215 |
} |
| 1213 |
|
1216 |
|
| 1214 |
vbox3 = gtk_vbox_new(FALSE, 2); |
1217 |
vbox3 = gtk_vbox_new(FALSE, 2); |
|
Lines 1807-1812
Link Here
|
| 1807 |
pd->lists[browsers] = NULL; |
1810 |
pd->lists[browsers] = NULL; |
| 1808 |
pd->lists[external_commands] = NULL; |
1811 |
pd->lists[external_commands] = NULL; |
| 1809 |
|
1812 |
|
|
|
1813 |
if (pd->hpd.selected_filetype) |
| 1814 |
g_free (pd->hpd.selected_filetype); |
| 1815 |
|
| 1810 |
/* select = gtk_tree_view_get_selection(GTK_TREE_VIEW(pd->ftd.lview)); |
1816 |
/* select = gtk_tree_view_get_selection(GTK_TREE_VIEW(pd->ftd.lview)); |
| 1811 |
g_signal_handlers_destroy(G_OBJECT(select));*/ |
1817 |
g_signal_handlers_destroy(G_OBJECT(select));*/ |
| 1812 |
DEBUG_MSG("preferences_destroy_lcb, destroying handlers for lstore %p\n",pd->ftd.lstore); |
1818 |
DEBUG_MSG("preferences_destroy_lcb, destroying handlers for lstore %p\n",pd->ftd.lstore); |