From: erg Date: Fri, 27 Aug 2010 18:30:26 +0000 (+0000) Subject: Clean up menubar menus, removing redundant connection to Node List widget, X-Git-Tag: LAST_LIBGRAPH~32^2~1217 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf4829dfe6ce89e0f2b9747a68ce8864d8f8da20;p=graphviz Clean up menubar menus, removing redundant connection to Node List widget, and set up toggle between Show and Hide console; allow attribute widget to set all objects --- diff --git a/cmd/smyrna/gui/frmobjectui.c b/cmd/smyrna/gui/frmobjectui.c index 59e094caa..8975c70b5 100644 --- a/cmd/smyrna/gui/frmobjectui.c +++ b/cmd/smyrna/gui/frmobjectui.c @@ -416,6 +416,7 @@ void filter_attributes(char *prefix, topview * t) gtk_widget_set_sensitive(glade_xml_get_widget(xml, "txtDefValue"), 1); gtk_widget_show(glade_xml_get_widget(xml, "attrAddBtn")); gtk_widget_hide(glade_xml_get_widget(xml, "attrApplyBtn")); + gtk_widget_hide(glade_xml_get_widget(xml, "attrApplyAllBtn")); gtk_widget_hide(glade_xml_get_widget(xml, "attrSearchBtn")); gtk_toggle_button_set_active((GtkToggleButton *) glade_xml_get_widget(xml, "attrProg"), 0); @@ -426,6 +427,7 @@ void filter_attributes(char *prefix, topview * t) if (strlen(prefix) == 0) { gtk_widget_hide(glade_xml_get_widget(xml, "attrAddBtn")); gtk_widget_hide(glade_xml_get_widget(xml, "attrApplyBtn")); + gtk_widget_hide(glade_xml_get_widget(xml, "attrApplyAllBtn")); gtk_widget_hide(glade_xml_get_widget(xml, "attrSearchBtn")); gtk_widget_hide(glade_xml_get_widget(xml, "attrAddBtn")); gtk_widget_hide(glade_xml_get_widget(xml, "txtValue")); @@ -459,6 +461,7 @@ void filter_attributes(char *prefix, topview * t) (xml, "txtDefValue"), 0); gtk_widget_hide(glade_xml_get_widget(xml, "attrAddBtn")); gtk_widget_show(glade_xml_get_widget(xml, "attrApplyBtn")); + gtk_widget_show(glade_xml_get_widget(xml, "attrApplyAllBtn")); gtk_widget_show(glade_xml_get_widget(xml, "attrSearchBtn")); gtk_toggle_button_set_active((GtkToggleButton *) glade_xml_get_widget(xml, @@ -501,7 +504,7 @@ static void set_refresh_filters(ViewInfo * v, int type, char *name) } -_BB void on_attrApplyBtn_clicked(GtkWidget * widget, gpointer user_data) +static void doApply (GtkWidget * widget, int doAll) { char *attr_name; char *value; @@ -545,7 +548,7 @@ _BB void on_attrApplyBtn_clicked(GtkWidget * widget, gpointer user_data) /*nodes */ else if (objKind == AGNODE) { for (v = agfstnode(g); v; v = agnxtnode(g, v)) { - if (ND_selected(v)) + if (doAll || ND_selected(v)) agxset(v, sym, value); } } @@ -553,7 +556,7 @@ _BB void on_attrApplyBtn_clicked(GtkWidget * widget, gpointer user_data) else if (objKind == AGEDGE) { for (v = agfstnode(g); v; v = agnxtnode(g, v)) { for (e = agfstout(g, v); e; e = agnxtout(g, e)) { - if (ED_selected(e)) + if (doAll || ED_selected(e)) agxset(e, sym, value); } } @@ -564,6 +567,16 @@ _BB void on_attrApplyBtn_clicked(GtkWidget * widget, gpointer user_data) set_refresh_filters(view, objKind, attr_name); } +_BB void on_attrApplyBtn_clicked(GtkWidget * widget, gpointer user_data) +{ + doApply (widget, 0); +} + +_BB void on_attrApplyAllBtn_clicked(GtkWidget * widget, gpointer user_data) +{ + doApply (widget, 1); +} + _BB void on_attrRB0_clicked(GtkWidget * widget, gpointer user_data) { filter_attributes((char *) diff --git a/cmd/smyrna/gui/menucallbacks.c b/cmd/smyrna/gui/menucallbacks.c index 86cd28e32..4d3d31618 100755 --- a/cmd/smyrna/gui/menucallbacks.c +++ b/cmd/smyrna/gui/menucallbacks.c @@ -160,6 +160,7 @@ void mShowToolBoxSlot(GtkWidget * widget, gpointer user_data) } +#if 0 void mShowHostSelectionSlot(GtkWidget * widget, gpointer user_data) { @@ -170,20 +171,35 @@ void mShowHostSelectionSlot(GtkWidget * widget, gpointer user_data) "frmHostSelection"), 1); } - +#endif void mShowConsoleSlot(GtkWidget * widget, gpointer user_data) { - gtk_widget_show(glade_xml_get_widget(xml, "vbox13")); + static int state = 0; // off by default + static GtkMenuItem* menui; + if (menui == NULL) + menui = (GtkMenuItem*)glade_xml_get_widget(xml, "show_console1"); + + if (state) { + gtk_widget_hide(glade_xml_get_widget(xml, "vbox13")); + gtk_menu_item_set_label (menui, "Show Console"); + state = 0; + } + else { + gtk_widget_show(glade_xml_get_widget(xml, "vbox13")); + gtk_menu_item_set_label (menui, "Hide Console"); + state = 1; + } } +#if 0 void mHideConsoleSlot(GtkWidget * widget, gpointer user_data) { gtk_widget_hide(glade_xml_get_widget(xml, "vbox13")); } - +#endif //Graph void mNodeListSlot(GtkWidget * widget, gpointer user_data) diff --git a/share/gui/smyrna.glade b/share/gui/smyrna.glade index 77a2dfeb8..d3717470f 100755 --- a/share/gui/smyrna.glade +++ b/share/gui/smyrna.glade @@ -122,15 +122,6 @@ - - - - True - Node List - True - - - @@ -154,19 +145,10 @@ - - - True - Hide Console - True - - - - True - View Selected Nodes + Selected Nodes True @@ -819,7 +801,7 @@ 400 400 0 0 658 0 592.2 658 - 0 0 425 0 382.5 425 + 0 0 421 0 378.9 421 @@ -1603,7 +1585,7 @@ When head or tail is within viewport 400 400 0 0 658 0 592.2 658 - 0 0 425 0 382.5 425 + 0 0 421 0 378.9 421 @@ -2061,7 +2043,7 @@ GLUT_BITMAP_HELVETICA_18 400 400 0 0 658 0 592.2 658 - 0 0 425 0 382.5 425 + 0 0 421 0 378.9 421 @@ -2394,7 +2376,7 @@ Custom 400 400 0 0 658 0 592.2 658 - 0 0 425 0 382.5 425 + 0 0 421 0 378.9 421 @@ -2786,7 +2768,7 @@ Custom 400 400 0 0 658 0 592.2 658 - 0 0 425 0 382.5 425 + 0 0 421 0 378.9 421 @@ -3793,7 +3775,7 @@ Custom 562 68 True - 3 + 4 6 False 0 @@ -4066,6 +4048,26 @@ Custom True + + 4 + 5 + 3 + 4 + fill + + + + + + + True + True + Apply All + True + GTK_RELIEF_NORMAL + True + + 4 5