X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fgtkdlg.c;h=966164ac025e4ecf3a04bcc44802b5c907e70cfb;hb=12e019bafc75cb441e965c63e15dfceeaf71ca1e;hp=b4e06f1d7a3af42fbeba90bc2cd7cfb1aab5d2e9;hpb=ac7870a63530a4d548bb786bbca529d47a73178c;p=PuTTY.git diff --git a/unix/gtkdlg.c b/unix/gtkdlg.c index b4e06f1d..966164ac 100644 --- a/unix/gtkdlg.c +++ b/unix/gtkdlg.c @@ -2,15 +2,6 @@ * gtkdlg.c - GTK implementation of the PuTTY configuration box. */ -/* - * TODO when porting to GTK 2.0: - * - * - GtkList is deprecated and we should switch to GtkTreeView instead - * (done for GtkTree). - * - GtkLabel has a built-in mnemonic scheme, so we should at - * least consider switching to that from the current adhockery. - */ - #include #include #include @@ -2362,6 +2353,19 @@ int do_config_box(const char *title, Config *cfg, int midsession, TREESTORE_PARAMS, nselparams, -1); treeiterlevels[j] = treeiter; + + if (j > 0) { + GtkTreePath *path; + + path = gtk_tree_model_get_path(GTK_TREE_MODEL(treestore), + &treeiterlevels[j-1]); + if (j < 2) + gtk_tree_view_expand_row(GTK_TREE_VIEW(tree), path, + FALSE); + else + gtk_tree_view_collapse_row(GTK_TREE_VIEW(tree), path); + gtk_tree_path_free(path); + } #else treeitem = gtk_tree_item_new_with_label(c); if (j > 0) { @@ -2407,7 +2411,6 @@ int do_config_box(const char *title, Config *cfg, int midsession, } #if GTK_CHECK_VERSION(2,0,0) - gtk_tree_view_expand_all(GTK_TREE_VIEW(tree)); g_signal_connect(G_OBJECT(treeselection), "changed", G_CALLBACK(treeselection_changed), selparams); #else