]> saetta.ns0.it Git - solipa/organigramma/commitdiff
Messo il GtkFormDecoder in ufficio nodo (refs #646).
authorAndrea Zagli <azagli@libero.it>
Thu, 8 Dec 2016 11:03:05 +0000 (12:03 +0100)
committerAndrea Zagli <azagli@libero.it>
Thu, 8 Dec 2016 11:03:05 +0000 (12:03 +0100)
data/organigramma/form/ufficio_nodo.form
data/organigramma/gui/organigramma.gui
src/ufficionodo.c

index b53e28ec2d3466ee2589035fa770bda289b93496..44975541e9dd2f032f8457a739355650a72db0d7 100644 (file)
                </field>
        </widget>
 
-       <widget type="entry" name="entry11">
-               <field type="text" name="nodo">
-                       <to-load>f</to-load>
-                       <to-save>f</to-save>
-               </field>
-       </widget>
-
-       <widget type="label" name="label37" label="label36">
-               <on-change what="update" when="after">
-                       <connection-name></connection-name>
-                       <widget-name>entry11</widget-name>
+       <widget type="decoder" name="gtkformdecoder14" label="label36">
+               <decoder>
                        <sql>
-                               SELECT nome FROM nodi WHERE id = ##label37::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 090c4db4aee3e125d5ecabd49594e5ea46ea55b7..410efe884d6907dd5e89e6e8623a43bb28a602d5 100644 (file)
                 <property name="top_attach">1</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkBox" id="hbox5">
-                <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="entry11">
-                    <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="button44">
-                    <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="label37">
-                    <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">0</property>
-              </packing>
-            </child>
             <child>
               <object class="GtkLabel" id="label22">
                 <property name="can_focus">False</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkFormDecoder" id="gtkformdecoder14">
+                <property name="visible">True</property>
+                <property name="can_focus">False</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 fd0e5c3fbeed9aa722069c2b7a300a89a353cf29..3e718631a526fcb6a33f368a22f2c42f5278ad7a 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <libzakautho/autoz.h>
 #include <libgtkform/form.h>
+#include <libgtkformui/gtkformdecoder.h>
 #include <libsolipa/utils.h>
 
 #include "ufficionodo.h"
@@ -36,7 +37,6 @@ static void organigramma_ufficio_nodo_init (OrganigrammaUfficioNodo *organigramm
 static void organigramma_ufficio_nodo_carica (OrganigrammaUfficioNodo *organigramma_ufficio_nodo);
 static void organigramma_ufficio_nodo_salva (OrganigrammaUfficioNodo *organigramma_ufficio_nodo, gboolean chiudi);
 
-
 static gboolean organigramma_ufficio_nodo_conferma_chiusura (OrganigrammaUfficioNodo *organigramma_ufficio_nodo);
 
 static void organigramma_ufficio_nodo_set_property (GObject *object,
@@ -67,8 +67,7 @@ static void organigramma_ufficio_nodo_on_btn_salvaechiudi_clicked (GtkButton *bu
 enum
 {
        LBL_ID,
-       LBL_ID_UFFICI,
-       LBL_ID_NODI
+       LBL_ID_UFFICI
 };
 
 typedef struct _OrganigrammaUfficioNodoPrivate OrganigrammaUfficioNodoPrivate;
@@ -159,14 +158,13 @@ OrganigrammaUfficioNodo
        priv->objects = gtk_form_get_objects_by_name (priv->form,
                                                      "label38",
                                                      "label22",
-                                                     "label37",
                                                      NULL);
 
        g_signal_connect (priv->w,
                          "delete-event", G_CALLBACK (organigramma_ufficio_nodo_on_w_organigramma_ufficio_nodo_delete_event), (gpointer)a);
 
-       g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button44")),
-                         "clicked", G_CALLBACK (organigramma_ufficio_nodo_on_btn_nodo_clicked), (gpointer)a);
+       g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "gtkformdecoder14")),
+                         "btn-browse-clicked", G_CALLBACK (organigramma_ufficio_nodo_on_btn_nodo_clicked), (gpointer)a);
 
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button45")),
                          "clicked", G_CALLBACK (organigramma_ufficio_nodo_on_btn_annulla_clicked), (gpointer)a);
@@ -287,7 +285,8 @@ organigramma_ufficio_nodo_on_nodo_selezionato (gpointer instance, guint id, gpoi
        OrganigrammaUfficioNodo *ia = (OrganigrammaUfficioNodo *)user_data;
        OrganigrammaUfficioNodoPrivate *priv = ORGANIGRAMMA_UFFICIO_NODO_GET_PRIVATE (ia);
 
-       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "label37"), g_strdup_printf ("%d", id));
+       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "gtkformdecoder14"),
+                                            g_strdup_printf ("%d", id));
 }
 
 static void