1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-15 18:18:05 -05:00

Rename a structure field to avoid clashing with one of the old GTK1

ones. (I'm going to merge the GTK1 list code back in under ifdefs,
and I want none of the disputed structure fields to have the same
names, so that I'll reliably be told by the compiler if I keep the
wrong piece of code outside the ifdef.)

[originally from svn r7965]
This commit is contained in:
Simon Tatham 2008-04-04 10:16:24 +00:00
parent a128ee8588
commit 54e26eb7ef

View File

@ -41,10 +41,10 @@ struct uctrl {
int privdata_needs_free; int privdata_needs_free;
GtkWidget **buttons; int nbuttons; /* for radio buttons */ GtkWidget **buttons; int nbuttons; /* for radio buttons */
GtkWidget *entry; /* for editbox, filesel, fontsel */ GtkWidget *entry; /* for editbox, filesel, fontsel */
GtkWidget *combo; /* for combo box (either editable or not) */
GtkWidget *list; /* for list box (list, droplist, combo box) */
GtkListStore *listmodel; /* for all types of list box */
GtkWidget *button; /* for filesel, fontsel */ GtkWidget *button; /* for filesel, fontsel */
GtkWidget *combo; /* for combo box (either editable or not) */
GtkWidget *treeview; /* for list box (list, droplist, combo box) */
GtkListStore *listmodel; /* for all types of list box */
GtkWidget *text; /* for text */ GtkWidget *text; /* for text */
GtkWidget *label; /* for dlg_label_change */ GtkWidget *label; /* for dlg_label_change */
GtkAdjustment *adj; /* for the scrollbar in a list box */ GtkAdjustment *adj; /* for the scrollbar in a list box */
@ -465,8 +465,8 @@ int dlg_listbox_index(union control *ctrl, void *dlg)
gint *indices; gint *indices;
int ret; int ret;
assert(uc->list != NULL); assert(uc->treeview != NULL);
treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(uc->list)); treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(uc->treeview));
if (gtk_tree_selection_count_selected_rows(treesel) != 1) if (gtk_tree_selection_count_selected_rows(treesel) != 1)
return -1; return -1;
@ -517,8 +517,8 @@ int dlg_listbox_issel(union control *ctrl, void *dlg, int index)
GtkTreePath *path; GtkTreePath *path;
int ret; int ret;
assert(uc->list != NULL); assert(uc->treeview != NULL);
treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(uc->list)); treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(uc->treeview));
path = gtk_tree_path_new_from_indices(index, -1); path = gtk_tree_path_new_from_indices(index, -1);
ret = gtk_tree_selection_path_is_selected(treesel, path); ret = gtk_tree_selection_path_is_selected(treesel, path);
@ -546,12 +546,12 @@ void dlg_listbox_select(union control *ctrl, void *dlg, int index)
GtkTreeSelection *treesel; GtkTreeSelection *treesel;
GtkTreePath *path; GtkTreePath *path;
assert(uc->list != NULL); assert(uc->treeview != NULL);
treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(uc->list)); treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(uc->treeview));
path = gtk_tree_path_new_from_indices(index, -1); path = gtk_tree_path_new_from_indices(index, -1);
gtk_tree_selection_select_path(treesel, path); gtk_tree_selection_select_path(treesel, path);
gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(uc->list), gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(uc->treeview),
path, NULL, FALSE, 0.0, 0.0); path, NULL, FALSE, 0.0, 0.0);
gtk_tree_path_free(path); gtk_tree_path_free(path);
} }
@ -710,8 +710,8 @@ void dlg_set_focus(union control *ctrl, void *dlg)
* There might be a combo box (drop-down list) here, or a * There might be a combo box (drop-down list) here, or a
* proper list box. * proper list box.
*/ */
if (uc->list) { if (uc->treeview) {
gtk_widget_grab_focus(uc->list); gtk_widget_grab_focus(uc->treeview);
} else if (uc->combo) { } else if (uc->combo) {
gtk_widget_grab_focus(uc->combo); gtk_widget_grab_focus(uc->combo);
} }
@ -1225,7 +1225,7 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
uc->privdata = NULL; uc->privdata = NULL;
uc->privdata_needs_free = FALSE; uc->privdata_needs_free = FALSE;
uc->buttons = NULL; uc->buttons = NULL;
uc->entry = uc->combo = uc->list = NULL; uc->entry = uc->combo = uc->treeview = NULL;
uc->listmodel = NULL; uc->listmodel = NULL;
uc->button = uc->text = NULL; uc->button = uc->text = NULL;
uc->label = NULL; uc->label = NULL;
@ -1516,7 +1516,7 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
gtk_tree_selection_set_mode gtk_tree_selection_set_mode
(sel, ctrl->listbox.multisel ? GTK_SELECTION_MULTIPLE : (sel, ctrl->listbox.multisel ? GTK_SELECTION_MULTIPLE :
GTK_SELECTION_SINGLE); GTK_SELECTION_SINGLE);
uc->list = w; uc->treeview = w;
gtk_signal_connect(GTK_OBJECT(w), "row-activated", gtk_signal_connect(GTK_OBJECT(w), "row-activated",
GTK_SIGNAL_FUNC(listbox_doubleclick), dp); GTK_SIGNAL_FUNC(listbox_doubleclick), dp);
g_signal_connect(G_OBJECT(sel), "changed", g_signal_connect(G_OBJECT(sel), "changed",
@ -2783,9 +2783,9 @@ gint eventlog_selection_clear(GtkWidget *widget, GdkEventSelection *seldata,
* Deselect everything in the list box. * Deselect everything in the list box.
*/ */
uc = dlg_find_byctrl(&es->dp, es->listctrl); uc = dlg_find_byctrl(&es->dp, es->listctrl);
assert(uc->list); assert(uc->treeview);
gtk_tree_selection_unselect_all gtk_tree_selection_unselect_all
(gtk_tree_view_get_selection(GTK_TREE_VIEW(uc->list))); (gtk_tree_view_get_selection(GTK_TREE_VIEW(uc->treeview)));
sfree(es->seldata); sfree(es->seldata);
es->sellen = 0; es->sellen = 0;