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

index eb313039da979df217cc9f0601e9a2fdbda8cb87..1dfa967fd8fa8ae8a32459599159bcbb5e35ef3e 100644 (file)
                </field>
        </widget>
 
-       <widget type="entry" name="entry48">
-               <field type="text" name="ufficio_superiore">
-                       <to-load>f</to-load>
-                       <to-save>f</to-save>
-               </field>
-       </widget>
-
-       <widget type="label" name="label169" label="label170">
-         <on-change what="update" when="after">
-                       <connection-name></connection-name>
-                       <widget-name>entry48</widget-name>
+       <widget type="decoder" name="gtkformdecoder16" label="label170">
+               <decoder>
                        <sql>
-                               SELECT nome FROM uffici WHERE id = ##label169::gint
+                               SELECT a.nome
+                               FROM uffici AS a
+                               WHERE a.id = ##key0::gint
                        </sql>
-               </on-change>
+               </decoder>
                <field type="integer" name="id_uffici">
                </field>
        </widget>
index 39df590b6e89d66b17d0390939812ed85154502f..4ce751b2e2876546e151b9d834b4f2e3d90a7de1 100644 (file)
                 <property name="width">2</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkBox" id="hbox20">
-                <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="entry48">
-                    <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="button164">
-                    <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="label169">
-                    <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">2</property>
-              </packing>
-            </child>
             <child>
               <object class="GtkNotebook" id="notebook2">
                 <property name="visible">True</property>
                 <property name="top_attach">3</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkFormDecoder" id="gtkformdecoder16">
+                <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">2</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">True</property>
index f4a98ecbed56cf2ca5e280445f9e3589c1392475..e31ca964bff04b19d95d1d44095c0a09b406639d 100644 (file)
@@ -381,11 +381,8 @@ OrganigrammaUfficio
        g_signal_connect (priv->w,
                          "delete-event", G_CALLBACK (organigramma_ufficio_on_w_ufficio_delete_event), (gpointer)a);
 
-       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "entry48"),
-                         "icon-press", G_CALLBACK (organigramma_ufficio_on_ufficio_pulisci), (gpointer)a);
-       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button164"),
-                         "clicked", G_CALLBACK (organigramma_ufficio_on_btn_ufficio_clicked), (gpointer)a);
-
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "gtkformdecoder16"),
+                         "btn-browse-clicked", G_CALLBACK (organigramma_ufficio_on_btn_ufficio_clicked), (gpointer)a);
        g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "gtkformdecoder15"),
                          "btn-browse-clicked", G_CALLBACK (organigramma_ufficio_on_btn_struttura_clicked), (gpointer)a);
 
@@ -1221,20 +1218,8 @@ organigramma_ufficio_on_ufficio_selezionato (gpointer instance, guint id, gpoint
        OrganigrammaUfficio *f = (OrganigrammaUfficio *)user_data;
        OrganigrammaUfficioPrivate *priv = ORGANIGRAMMA_UFFICIO_GET_PRIVATE (f);
 
-       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "label169"), g_strdup_printf ("%d", id));
-}
-
-static void
-organigramma_ufficio_on_ufficio_pulisci (GtkEntry *entry,
-                          GtkEntryIconPosition icon_pos,
-                          GdkEvent *event,
-                          gpointer user_data)
-{
-       OrganigrammaUfficio *f = (OrganigrammaUfficio *)user_data;
-       OrganigrammaUfficioPrivate *priv = ORGANIGRAMMA_UFFICIO_GET_PRIVATE (f);
-
-       gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (priv->commons->gtkbuilder, "label169")), "");
-       gtk_entry_set_text (GTK_ENTRY (gtk_builder_get_object (priv->commons->gtkbuilder, "entry48")), "");
+       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "gtkformdecoder16"),
+                                            g_strdup_printf ("%d", id));
 }
 
 static void