]> saetta.ns0.it Git - solipa/organigramma/commitdiff
Messo il GtkFormDecoder in nodo (refs #646).
authorAndrea Zagli <azagli@libero.it>
Thu, 8 Dec 2016 09:39:21 +0000 (10:39 +0100)
committerAndrea Zagli <azagli@libero.it>
Thu, 8 Dec 2016 09:39:21 +0000 (10:39 +0100)
data/organigramma/form/nodo.form
data/organigramma/gui/organigramma.gui
src/nodo.c

index 825623fa108a80a83d6da1e79b0012344ac908d7..ecec565532d5406ebf9a7aad3bb71e06bb21e758 100644 (file)
                </field>
        </widget>
 
-       <widget type="entry" name="entry2">
-               <field type="text" name="nodo_superiore">
-                       <to-load>f</to-load>
-                       <to-save>f</to-save>
-               </field>
-       </widget>
-
-       <widget type="label" name="label5" label="label4">
-               <on-change what="update" when="after">
-                       <connection-name></connection-name>
-                       <widget-name>entry2</widget-name>
+       <widget type="decoder" name="gtkformdecoder11" label="label4">
+               <decoder>
                        <sql>
-                               SELECT nome FROM nodi WHERE id = ##label5::gint
+                               SELECT a.nome
+                               FROM nodi AS a
+                               WHERE a.id = ##key0::gint
                        </sql>
-               </on-change>
+               </decoder>
                <field type="integer" name="id_nodi">
                </field>
        </widget>
index 8458403604375f65b2ecec6cb808538498ab19d2..bd8e87a28c5e583fdea21bc951672a306567e077 100644 (file)
                 <property name="top_attach">1</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkBox" id="hbox1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="hexpand">True</property>
-                <property name="spacing">5</property>
-                <child>
-                  <object class="GtkEntry" id="entry2">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="hexpand">True</property>
-                    <property name="editable">False</property>
-                    <property name="invisible_char">●</property>
-                    <property name="secondary_icon_stock">gtk-clear</property>
-                    <property name="primary_icon_activatable">False</property>
-                  </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkButton" id="button6">
-                    <property name="label" translatable="yes">...</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label5">
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">lbl_id_nodi</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">1</property>
-              </packing>
-            </child>
             <child>
               <object class="GtkLabel" id="label6">
                 <property name="visible">True</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkFormDecoder" id="gtkformdecoder11">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="show_btn_clean">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">True</property>
index 0aa53cece884657fdea29ffb8a0ad0ef9f9070b0..14cb14e935e3c345becf85beda0eca666437bb4f 100644 (file)
@@ -50,10 +50,6 @@ static void organigramma_nodo_get_property (GObject *object,
 static void organigramma_nodo_on_organigramma_nodo_selezionato (gpointer instance, guint id, gpointer user_data);
 static void organigramma_nodo_on_tipo_nodo_selezionato (gpointer instance, guint id, gpointer user_data);
 
-static void organigramma_nodo_on_organigramma_nodo_pulisci (GtkEntry *entry,
-                          GtkEntryIconPosition icon_pos,
-                          GdkEvent *event,
-                          gpointer user_data);
 static void organigramma_nodo_on_btn_organigramma_nodo_clicked (GtkButton *button,
                       gpointer user_data);
 static void organigramma_nodo_on_btn_tipo_nodo_clicked (GtkButton *button,
@@ -169,10 +165,8 @@ OrganigrammaNodo
        g_signal_connect (priv->w,
                          "delete-event", G_CALLBACK (organigramma_nodo_on_w_organigramma_nodo_delete_event), (gpointer)a);
 
-       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "entry2"),
-                         "icon-press", G_CALLBACK (organigramma_nodo_on_organigramma_nodo_pulisci), (gpointer)a);
-       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button6"),
-                         "clicked", G_CALLBACK (organigramma_nodo_on_btn_organigramma_nodo_clicked), (gpointer)a);
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "gtkformdecoder11"),
+                         "btn-browse-clicked", G_CALLBACK (organigramma_nodo_on_btn_organigramma_nodo_clicked), (gpointer)a);
        g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "gtkformdecoder6"),
                          "btn-browse-clicked", G_CALLBACK (organigramma_nodo_on_btn_tipo_nodo_clicked), (gpointer)a);
 
@@ -349,7 +343,8 @@ organigramma_nodo_on_organigramma_nodo_selezionato (gpointer instance, guint id,
        OrganigrammaNodo *f = (OrganigrammaNodo *)user_data;
        OrganigrammaNodoPrivate *priv = ORGANIGRAMMA_NODO_GET_PRIVATE (f);
 
-       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "label5"), g_strdup_printf ("%d", id));
+       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "gtkformdecoder11"),
+                                            g_strdup_printf ("%d", id));
 }
 
 static void
@@ -362,19 +357,6 @@ organigramma_nodo_on_tipo_nodo_selezionato (gpointer instance, guint id, gpointe
                                             g_strdup_printf ("%d", id));
 }
 
-static void
-organigramma_nodo_on_organigramma_nodo_pulisci (GtkEntry *entry,
-                          GtkEntryIconPosition icon_pos,
-                          GdkEvent *event,
-                          gpointer user_data)
-{
-       OrganigrammaNodo *f = (OrganigrammaNodo *)user_data;
-       OrganigrammaNodoPrivate *priv = ORGANIGRAMMA_NODO_GET_PRIVATE (f);
-
-       gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (priv->commons->gtkbuilder, "label5")), "");
-       gtk_entry_set_text (GTK_ENTRY (gtk_builder_get_object (priv->commons->gtkbuilder, "entry2")), "");
-}
-
 static void
 organigramma_nodo_on_btn_organigramma_nodo_clicked (GtkButton *button,
                       gpointer user_data)