]> granicus.if.org Git - graphviz/commitdiff
Clean up menubar menus, removing redundant connection to Node List widget,
authorerg <devnull@localhost>
Fri, 27 Aug 2010 18:30:26 +0000 (18:30 +0000)
committererg <devnull@localhost>
Fri, 27 Aug 2010 18:30:26 +0000 (18:30 +0000)
and set up toggle between Show and Hide console;
allow attribute widget to set all objects

cmd/smyrna/gui/frmobjectui.c
cmd/smyrna/gui/menucallbacks.c
share/gui/smyrna.glade

index 59e094caa07ff7ed39c2f327f62689ba9d86942c..8975c70b581915219eca855c397ec434f1210739 100644 (file)
@@ -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 *)
index 86cd28e32bba0bf913c141264b0f8310c0d08618..4d3d31618e71e781177a31fbad1ba3ca6429e1a5 100755 (executable)
@@ -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)
index 77a2dfeb89c583943b4b3c8e6aa6527458bba36a..d3717470fc77a0a7350b2832d9fc8d08fd3e6e30 100755 (executable)
                          <signal name="activate" handler="mAttributesSlot" last_modification_time="Fri, 06 Nov 2009 17:03:12 GMT"/>
                        </widget>
                      </child>
-
-                     <child>
-                       <widget class="GtkMenuItem" id="node_list1">
-                         <property name="visible">True</property>
-                         <property name="label" translatable="yes">Node List</property>
-                         <property name="use_underline">True</property>
-                         <signal name="activate" handler="mNodeListSlot" last_modification_time="Fri, 06 Nov 2009 17:02:05 GMT"/>
-                       </widget>
-                     </child>
                    </widget>
                  </child>
                </widget>
                        </widget>
                      </child>
 
-                     <child>
-                       <widget class="GtkMenuItem" id="hide_console1">
-                         <property name="visible">True</property>
-                         <property name="label" translatable="yes">Hide Console</property>
-                         <property name="use_underline">True</property>
-                         <signal name="activate" handler="mHideConsoleSlot" last_modification_time="Wed, 22 Jul 2009 16:17:32 GMT"/>
-                       </widget>
-                     </child>
-
                      <child>
                        <widget class="GtkMenuItem" id="view_selected_nodes1">
                          <property name="visible">True</property>
-                         <property name="label" translatable="yes">View Selected Nodes</property>
+                         <property name="label" translatable="yes">Selected Nodes</property>
                          <property name="use_underline">True</property>
                          <signal name="activate" handler="mNodeListSlot" last_modification_time="Tue, 09 Mar 2010 18:05:05 GMT"/>
                        </widget>
              <property name="width">400</property>
              <property name="height">400</property>
              <property name="hadjustment">0 0 658 0 592.2 658</property>
-             <property name="vadjustment">0 0 425 0 382.5 425</property>
+             <property name="vadjustment">0 0 421 0 378.9 421</property>
 
              <child>
                <widget class="GtkTable" id="table4">
@@ -1603,7 +1585,7 @@ When head or tail is within viewport
              <property name="width">400</property>
              <property name="height">400</property>
              <property name="hadjustment">0 0 658 0 592.2 658</property>
-             <property name="vadjustment">0 0 425 0 382.5 425</property>
+             <property name="vadjustment">0 0 421 0 378.9 421</property>
 
              <child>
                <widget class="GtkTable" id="table16">
@@ -2061,7 +2043,7 @@ GLUT_BITMAP_HELVETICA_18
              <property name="width">400</property>
              <property name="height">400</property>
              <property name="hadjustment">0 0 658 0 592.2 658</property>
-             <property name="vadjustment">0 0 425 0 382.5 425</property>
+             <property name="vadjustment">0 0 421 0 378.9 421</property>
 
              <child>
                <widget class="GtkTable" id="table5">
@@ -2394,7 +2376,7 @@ Custom</property>
              <property name="width">400</property>
              <property name="height">400</property>
              <property name="hadjustment">0 0 658 0 592.2 658</property>
-             <property name="vadjustment">0 0 425 0 382.5 425</property>
+             <property name="vadjustment">0 0 421 0 378.9 421</property>
 
              <child>
                <widget class="GtkTable" id="table6">
@@ -2786,7 +2768,7 @@ Custom</property>
              <property name="width">400</property>
              <property name="height">400</property>
              <property name="hadjustment">0 0 658 0 592.2 658</property>
-             <property name="vadjustment">0 0 425 0 382.5 425</property>
+             <property name="vadjustment">0 0 421 0 378.9 421</property>
 
              <child>
                <widget class="GtkVBox" id="vbox6">
@@ -3793,7 +3775,7 @@ Custom</property>
                      <property name="width_request">562</property>
                      <property name="height_request">68</property>
                      <property name="visible">True</property>
-                     <property name="n_rows">3</property>
+                     <property name="n_rows">4</property>
                      <property name="n_columns">6</property>
                      <property name="homogeneous">False</property>
                      <property name="row_spacing">0</property>
@@ -4066,6 +4048,26 @@ Custom</property>
                          <property name="focus_on_click">True</property>
                          <signal name="clicked" handler="on_attrSearchBtn_clicked" last_modification_time="Wed, 11 Nov 2009 16:07:55 GMT"/>
                        </widget>
+                       <packing>
+                         <property name="left_attach">4</property>
+                         <property name="right_attach">5</property>
+                         <property name="top_attach">3</property>
+                         <property name="bottom_attach">4</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkButton" id="attrApplyAllBtn">
+                         <property name="visible">True</property>
+                         <property name="can_focus">True</property>
+                         <property name="label" translatable="yes">Apply All</property>
+                         <property name="use_underline">True</property>
+                         <property name="relief">GTK_RELIEF_NORMAL</property>
+                         <property name="focus_on_click">True</property>
+                         <signal name="clicked" handler="on_attrApplyBtn_clicked" last_modification_time="Mon, 09 Nov 2009 23:05:37 GMT"/>
+                       </widget>
                        <packing>
                          <property name="left_attach">4</property>
                          <property name="right_attach">5</property>