demo: improved consistency in widgets names
authorNicola Fontana <ntd@entidi.it>
Tue, 19 Mar 2013 21:24:50 +0000 (19 22:24 +0100)
committerNicola Fontana <ntd@entidi.it>
Tue, 19 Mar 2013 21:27:00 +0000 (19 22:27 +0100)
Always prepend "edit" followed by uppercase name on widgets bound to
model data. This will make possible to connect signals automatically.

demo/adg-demo.c
demo/adg-demo.ui.in

index f3a8fc4..a017911 100644 (file)
@@ -997,7 +997,7 @@ _adg_part_new(GtkBuilder *builder)
     g_signal_connect(part->area, "button-press-event",
                      G_CALLBACK(_adg_button_press), NULL);
 
-    toggle_object = gtk_builder_get_object(builder, "GROOVE");
+    toggle_object = gtk_builder_get_object(builder, "editGROOVE");
     _adg_part_link(part, &part->GROOVE, toggle_object);
 
     object = gtk_builder_get_object(builder, "editZGROOVE");
@@ -1024,10 +1024,10 @@ _adg_part_new(GtkBuilder *builder)
     g_signal_connect(toggle_object, "toggled",
                      G_CALLBACK(adg_gtk_toggle_button_sensitivize), object);
 
-    _adg_part_link(part, &part->TITLE, gtk_builder_get_object(builder, "txtTitle"));
-    _adg_part_link(part, &part->DRAWING, gtk_builder_get_object(builder, "txtDrawing"));
-    _adg_part_link(part, &part->AUTHOR, gtk_builder_get_object(builder, "txtAuthor"));
-    _adg_part_link(part, &part->DATE, gtk_builder_get_object(builder, "txtDate"));
+    _adg_part_link(part, &part->TITLE, gtk_builder_get_object(builder, "editTITLE"));
+    _adg_part_link(part, &part->DRAWING, gtk_builder_get_object(builder, "editDRAWING"));
+    _adg_part_link(part, &part->AUTHOR, gtk_builder_get_object(builder, "editAUTHOR"));
+    _adg_part_link(part, &part->DATE, gtk_builder_get_object(builder, "editDATE"));
 
     part->D5 = 4.5;
     part->RD34 = 1;
index e3d2851..8a21d2e 100644 (file)
@@ -774,7 +774,7 @@ Boston, MA  02110-1301, USA.</property>
                         <property name="n_columns">5</property>
                         <property name="row_spacing">6</property>
                         <child>
-                          <object class="GtkCheckButton" id="GROOVE">
+                          <object class="GtkCheckButton" id="editGROOVE">
                             <property name="label" translatable="yes">Groove machining</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
@@ -945,7 +945,7 @@ Boston, MA  02110-1301, USA.</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">_Title:</property>
                             <property name="use-underline">True</property>
-                            <property name="mnemonic-widget">txtTitle</property>
+                            <property name="mnemonic-widget">editTITLE</property>
                           </object>
                           <packing>
                             <property name="x-options">GTK_FILL</property>
@@ -953,7 +953,7 @@ Boston, MA  02110-1301, USA.</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkEntry" id="txtTitle">
+                          <object class="GtkEntry" id="editTITLE">
                             <property name="visible">True</property>
                             <property name="can-focus">True</property>
                             <property name="text" translatable="yes">SAMPLE DRAWING</property>
@@ -969,7 +969,7 @@ Boston, MA  02110-1301, USA.</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">_Drawing:</property>
                             <property name="use-underline">True</property>
-                            <property name="mnemonic-widget">txtDrawing</property>
+                            <property name="mnemonic-widget">editDRAWING</property>
                           </object>
                           <packing>
                             <property name="x-options">GTK_FILL</property>
@@ -979,7 +979,7 @@ Boston, MA  02110-1301, USA.</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkEntry" id="txtDrawing">
+                          <object class="GtkEntry" id="editDRAWING">
                             <property name="visible">True</property>
                             <property name="can-focus">True</property>
                             <property name="text" translatable="yes">EXAMPLE</property>
@@ -997,7 +997,7 @@ Boston, MA  02110-1301, USA.</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">A_uthor:</property>
                             <property name="use-underline">True</property>
-                            <property name="mnemonic-widget">txtAuthor</property>
+                            <property name="mnemonic-widget">editAUTHOR</property>
                           </object>
                           <packing>
                             <property name="x-options">GTK_FILL</property>
@@ -1007,7 +1007,7 @@ Boston, MA  02110-1301, USA.</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkEntry" id="txtAuthor">
+                          <object class="GtkEntry" id="editAUTHOR">
                             <property name="visible">True</property>
                             <property name="can-focus">True</property>
                             <property name="text" translatable="no">adg-demo</property>
@@ -1025,7 +1025,7 @@ Boston, MA  02110-1301, USA.</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">D_ate:</property>
                             <property name="use-underline">True</property>
-                            <property name="mnemonic-widget">txtDate</property>
+                            <property name="mnemonic-widget">editDATE</property>
                           </object>
                           <packing>
                             <property name="x-options">GTK_FILL</property>
@@ -1035,7 +1035,7 @@ Boston, MA  02110-1301, USA.</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkEntry" id="txtDate">
+                          <object class="GtkEntry" id="editDATE">
                             <property name="visible">True</property>
                             <property name="can-focus">True</property>
                             <property name="text" translatable="no">09/03/2011</property>