From: Predrag "Pele" Balorda Date: Fri, 27 Nov 1998 02:08:19 +0000 (+0000) Subject: Updates to cache and misc. other fixes on gtk-tool X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~1013 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=09488c01581e1f38bf58f7740dfdc68ad6952521;p=openldap Updates to cache and misc. other fixes on gtk-tool --- diff --git a/contrib/gtk-tool/ChangeLog b/contrib/gtk-tool/ChangeLog index a46e0ba56f..a002fc7edd 100644 --- a/contrib/gtk-tool/ChangeLog +++ b/contrib/gtk-tool/ChangeLog @@ -1,5 +1,12 @@ ChangeLog for gtk-tool +27/11/1998 - Pele + * Added viewports, both sides now scroll automatically + * Brought back the "cache" stuff, now data gets reused if it's allready + available without redundant searches/listings. + * Editing pixmaps by hand is so much, er, fun! + * Miniscule fixes + 26/11/1998 - Pele * Added nice icons in the browser pane - looks decent now. * Fixed scrolling in the data (right) pane - now scrolls if there is diff --git a/contrib/gtk-tool/Gtk_LdapTreeItem.cc b/contrib/gtk-tool/Gtk_LdapTreeItem.cc index 26a8b8b983..3556911453 100644 --- a/contrib/gtk-tool/Gtk_LdapTreeItem.cc +++ b/contrib/gtk-tool/Gtk_LdapTreeItem.cc @@ -51,31 +51,17 @@ int Gtk_LdapTreeItem::getDetails() { Gtk_Notebook *g; Gtk_Viewport *viewport; viewport = new Gtk_Viewport(); -/* if (this->notebook != NULL) { printf("Data on %s available\n", this->rdn); - if (par->scroller2->children() != NULL) { - // if (par->scroller2->children[0] != NULL) { - printf("."); - // par->scroller2->release(par->scroller2->children()->nth_data(0)); - par->scroller2->remove_c(par->scroller2->children()->nth_data(0)); - // par->scroller2->remove_child(0); + if (par->viewport->getchild() != NULL) { + par->viewport->remove_c(par->viewport->getchild()->gtkobj()); } - // par->scroller2->add_child(this->notebook); - viewport->add(this->notebook); - printf("."); - par->scroller2->add(viewport); //this->notebook); - printf("."); - // this->notebook->reparent(*par->scroller2); + par->viewport->add(this->notebook); this->notebook->show(); - printf("."); - viewport->show(); - printf("."); - par->scroller2->show(); - printf("."); + par->viewport->show(); + // par->scroller2->show(); return 0; } -*/ error = ldap_search_s(this->ld, this->dn, LDAP_SCOPE_BASE, "objectclass=*", NULL, 0, &result_identifier); entriesCount = ldap_count_entries(ld, result_identifier); if (entriesCount == 0) return 0; @@ -99,20 +85,13 @@ int Gtk_LdapTreeItem::getDetails() { } } if (par->scroller2 != NULL) { - // cout << "Scroller2 exists" << endl; - if (par->scroller2->children() != NULL ) { - // if (par->scroller2->children[0] != NULL) { - // cout << "There are children in scroller2" << endl; - // par->scroller2->release(par->scroller2->children()->nth_data(0)); - par->scroller2->remove_c(par->scroller2->children()->nth_data(0)); - // par->scroller2->remove_child(0); + if (par->viewport->getchild() != NULL) { + par->viewport->remove_c(par->viewport->getchild()->gtkobj()); } - // par->scroller2->add_child(this->notebook); - viewport->add(this->notebook); - par->scroller2->add(viewport); //this->notebook); + par->viewport->add(this->notebook); this->notebook->show(); - viewport->show(); - par->scroller2->show(); + par->viewport->show(); + // par->scroller2->show(); cout << "Added details for " << this->rdn << endl; } return 0; diff --git a/contrib/gtk-tool/My_Window.cc b/contrib/gtk-tool/My_Window.cc index 67d4f1b124..9e07dc89a6 100644 --- a/contrib/gtk-tool/My_Window.cc +++ b/contrib/gtk-tool/My_Window.cc @@ -14,7 +14,9 @@ My_Window::My_Window(GtkWindowType t) : Gtk_Window(t) { // this->scroller2 = new My_Scroller(); this->scroller2 = new Gtk_ScrolledWindow(); + this->viewport = new Gtk_Viewport(); this->scroller2->set_policy(GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + this->scroller2->add(*this->viewport); pane->add2(*this->scroller2); this->scroller2->show(); diff --git a/contrib/gtk-tool/My_Window.h b/contrib/gtk-tool/My_Window.h index ce4a6f34f8..7cf29a0f47 100644 --- a/contrib/gtk-tool/My_Window.h +++ b/contrib/gtk-tool/My_Window.h @@ -14,6 +14,7 @@ class My_Scroller; class My_Window : public Gtk_Window { public: Gtk_ScrolledWindow *scroller, *scroller2; + Gtk_Viewport *viewport; // My_Scroller *scroller2; Gtk_Entry *urlfield; Gtk_Button *display_button; diff --git a/contrib/gtk-tool/branch_node.xpm b/contrib/gtk-tool/branch_node.xpm index 1797f85741..e1db8cf757 100644 --- a/contrib/gtk-tool/branch_node.xpm +++ b/contrib/gtk-tool/branch_node.xpm @@ -14,19 +14,19 @@ static char *magick[] = { "% c None", /* pixels */ "%%%%%%%%%%%%%%%%%%%", -"%%%%%%ooooo %%%%%%%", -"%%%%%o$$##@O %%%%%%", -"%%%%oOOOOOOOoooooo%", -"%%%%o###########@O ", -"%%%%o#@@@@@@@@@@+O ", -"%%%%o#@@@@@@@+@+@@ ", -"%%%%o#@@@@@@@@+@+O ", -"%%%%o#@@@@@+@+@+@O ", -"%%%%o#@@@@@@+@+@+O ", -"%%%%o#@@@+@+@+@++@ ", -"%%%%o#+@+@+@+@+++O ", -"%%%%oOOOOOOOOOOOOO ", -"%%%%% ", +"%%ooooo %%%%%%%%%%%", +"%o$$##@O %%%%%%%%%%", +"oOOOOOOOoooooo%%%%%", +"o###########@O %%%%", +"o#@@@@@@@@@@+O %%%%", +"o#@@@@@@@+@+@@ %%%%", +"o#@@@@@@@@+@+O %%%%", +"o#@@@@@+@+@+@O %%%%", +"o#@@@@@@+@+@+O %%%%", +"o#@@@+@+@+@++@ %%%%", +"o#+@+@+@+@+++O %%%%", +"oOOOOOOOOOOOOO %%%%", +"% %%%%", "%%%%%%%%%%%%%%%%%%%", "%%%%%%%%%%%%%%%%%%%", "%%%%%%%%%%%%%%%%%%%", diff --git a/contrib/gtk-tool/main.cc b/contrib/gtk-tool/main.cc index e83cff8b21..022fac6d81 100644 --- a/contrib/gtk-tool/main.cc +++ b/contrib/gtk-tool/main.cc @@ -11,6 +11,7 @@ int main(int argc, char **argv) { Gtk_LdapItem *treeresult; Gtk_Tree *tree, *subtree; Gtk_LdapTreeItem *treeitem; + Gtk_Viewport *viewport; LDAPMessage **thing; LDAP *ld; char *host = NULL; @@ -57,8 +58,11 @@ int main(int argc, char **argv) { treeitem->set_subtree(*subtree); } treeitem->show(); - window->scroller->add(tree); + viewport = new Gtk_Viewport(); + viewport->add(tree); + window->scroller->add(viewport); tree->show(); + viewport->show(); window->scroller->show(); treeitem->getDetails(); window->set_title("Hello"); diff --git a/contrib/gtk-tool/root_node.xpm b/contrib/gtk-tool/root_node.xpm index a5286eab93..e8d1004684 100644 --- a/contrib/gtk-tool/root_node.xpm +++ b/contrib/gtk-tool/root_node.xpm @@ -52,22 +52,22 @@ static char *magick[] = { "z c Gray100", "x c None", /* pixels */ -"xxxxxx&t&&txxxxxxxx", -"xxxxhujds9u&&xxxxxx", -"xxxhzzdadd1<1 xxxxx", -"xx7zhjdag&1e,$ xxxx", -"xx7ddkuj61e&$, xxxx", -"x7asapryt&.@>., xxx", -"x7983py&z5l.., xxx", -"x2i226&z5l54.%. xxx", -"x272;:t5l545.. xxx", -"x22;-$&h5454. . xxx", -"x---1.,&454.&.. xxx", -"x-*##$#+...&zq0xxxx", -"xxXO++. + . qfq0xxx", -"xxxXoOo+.. . qfq0xx", -"xxxxXX+=++ ..xqq0xx", -"xxxxxx.....xxxx..xx", +"xxxxx&t&&txxxxxxxxx", +"xxxhujds9u&&xxxxxxx", +"xxhzzdadd1<1 xxxxxx", +"x7zhjdag&1e,$ xxxxx", +"x7ddkuj61e&$, xxxxx", +"7asapryt&.@>., xxxx", +"7983py&z5l.., xxxx", +"2i226&z5l54.%. xxxx", +"272;:t5l545.. xxxx", +"22;-$&h5454. . xxxx", +"---1.,&454.&.. xxxx", +"-*##$#+...&zq0xxxxx", +"xXO++. + . qfq0xxxx", +"xxXoOo+.. . qfq0xxx", +"xxxXX+=++ ..xqq0xxx", +"xxxxx.....xxxx..xxx", "xxxxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxx",