]> saetta.ns0.it Git - solipa/organigramma/commitdiff
Messo il GtkFormDecoder in persona ufficio (refs #646).
authorAndrea Zagli <azagli@libero.it>
Thu, 8 Dec 2016 10:14:00 +0000 (11:14 +0100)
committerAndrea Zagli <azagli@libero.it>
Thu, 8 Dec 2016 10:14:00 +0000 (11:14 +0100)
data/organigramma/form/persona_ufficio.form
data/organigramma/gui/organigramma.gui
src/personaufficio.c

index 2352e02e87c5a3d46fa13ff84268baa1e28080d2..b158e137f3fa0b775c4b442c9509b277259acc18 100644 (file)
                </field>
        </widget>
 
-       <widget type="entry" name="entry21">
-               <field type="text" name="ufficio">
-                       <to-load>f</to-load>
-                       <to-save>f</to-save>
-               </field>
-       </widget>
-
-       <widget type="label" name="label89" label="label88">
-               <on-change what="update" when="after">
-                       <connection-name></connection-name>
-                       <widget-name>entry21</widget-name>
+       <widget type="decoder" name="gtkformdecoder13" label="label88">
+               <decoder>
                        <sql>
-                               SELECT nome FROM uffici WHERE id = ##label89::gint
+                               SELECT nome FROM uffici WHERE id = ##key0::gint
                        </sql>
-               </on-change>
+               </decoder>
                <field type="integer" name="id_uffici">
                        <obligatory>t</obligatory>
                </field>
index 415d77772576ceb9a911d9920b0aad457ee88025..090c4db4aee3e125d5ecabd49594e5ea46ea55b7 100644 (file)
                 <property name="top_attach">0</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkBox" id="hbox16">
-                <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="entry21">
-                    <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="primary_icon_activatable">False</property>
-                    <property name="secondary_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="button82">
-                    <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="label89">
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">lbl_id_uffici</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">0</property>
-              </packing>
-            </child>
             <child>
               <object class="GtkLabel" id="label91">
                 <property name="can_focus">False</property>
                 <property name="top_attach">7</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkFormDecoder" id="gtkformdecoder13">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">True</property>
index 104391c8539331c86875b58d8802844948e53e45..2ca76165e6d2524aee84047d1990d670c1030aa4 100644 (file)
@@ -40,9 +40,9 @@ static void organigramma_persona_ufficio_salva (OrganigrammaPersonaUfficio *orga
 
 static gboolean organigramma_persona_ufficio_conferma_chiusura (OrganigrammaPersonaUfficio *organigramma_persona_ufficio);
 
-static void organigramma_persona_ufficio_on_ruolo_selezionato (gpointer instance, guint id, gpointer user_data);
 static void organigramma_persona_ufficio_on_ufficio_selezionato (gpointer instance,
                                           guint id, gpointer user_data);
+static void organigramma_persona_ufficio_on_ruolo_selezionato (gpointer instance, guint id, gpointer user_data);
 
 static void organigramma_persona_ufficio_set_property (GObject *object,
                                      guint property_id,
@@ -171,8 +171,8 @@ OrganigrammaPersonaUfficio
        g_signal_connect (priv->w,
                          "delete-event", G_CALLBACK (organigramma_persona_ufficio_on_w_organigramma_persona_ufficio_delete_event), (gpointer)a);
 
-       g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button82")),
-                         "clicked", G_CALLBACK (organigramma_persona_ufficio_on_btn_ufficio_clicked), (gpointer)a);
+       g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "gtkformdecoder13")),
+                         "btn-browse-clicked", G_CALLBACK (organigramma_persona_ufficio_on_btn_ufficio_clicked), (gpointer)a);
 
        g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "gtkformdecoder1"),
                          "btn-browse-clicked", G_CALLBACK (organigramma_persona_ufficio_on_btn_ruolo_clicked), (gpointer)a);
@@ -292,16 +292,6 @@ organigramma_persona_ufficio_salva (OrganigrammaPersonaUfficio *organigramma_per
                }
 }
 
-static void
-organigramma_persona_ufficio_on_ufficio_selezionato (gpointer instance, guint id, gpointer user_data)
-{
-       OrganigrammaPersonaUfficio *ia = (OrganigrammaPersonaUfficio *)user_data;
-
-       OrganigrammaPersonaUfficioPrivate *priv = ORGANIGRAMMA_PERSONA_UFFICIO_GET_PRIVATE (ia);
-
-       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "label89"), g_strdup_printf ("%d", id));
-}
-
 static void
 organigramma_persona_ufficio_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
 {
@@ -362,6 +352,17 @@ organigramma_persona_ufficio_on_w_organigramma_persona_ufficio_delete_event (Gtk
        return !organigramma_persona_ufficio_conferma_chiusura ((OrganigrammaPersonaUfficio *)user_data);
 }
 
+static void
+organigramma_persona_ufficio_on_ufficio_selezionato (gpointer instance, guint id, gpointer user_data)
+{
+       OrganigrammaPersonaUfficio *ia = (OrganigrammaPersonaUfficio *)user_data;
+
+       OrganigrammaPersonaUfficioPrivate *priv = ORGANIGRAMMA_PERSONA_UFFICIO_GET_PRIVATE (ia);
+
+       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "gtkformdecoder13"),
+                                            g_strdup_printf ("%d", id));
+}
+
 static void
 organigramma_persona_ufficio_on_ruolo_selezionato (gpointer instance, guint id, gpointer user_data)
 {