]> saetta.ns0.it Git - solipa/organigramma/commitdiff
Tolta la combobox tipo recapito in persona nodo recapito (refs #645 #646).
authorAndrea Zagli <azagli@libero.it>
Thu, 8 Dec 2016 09:17:30 +0000 (10:17 +0100)
committerAndrea Zagli <azagli@libero.it>
Thu, 8 Dec 2016 09:17:30 +0000 (10:17 +0100)
data/organigramma/form/persona_nodo_recapito.form
data/organigramma/gui/organigramma.gui
src/personanodorecapito.c

index 146e86cd392f0593b655dcd6f1fd6880a1885271..3418851b461c3179140daa11d249a92c0babc50d 100644 (file)
                </field>
        </widget>
 
-       <widget type="combobox" name="combobox7" label="label121">
-               <column-field>0</column-field>
-               <sql with-empty-entry="t">
-                       SELECT id, nome FROM tipi_recapito WHERE status &lt;&gt; 'E' ORDER BY nome
-               </sql>
+       <widget type="decoder" name="gtkformdecoder9" label="label121">
+               <decoder>
+                       <sql>
+                               SELECT a.nome
+                               FROM tipi_recapito AS a
+                               WHERE a.id = ##key0::gint
+                       </sql>
+               </decoder>
                <field type="integer" name="id_tipi_recapito">
                        <obligatory>t</obligatory>
                </field>
index 034c04f074548f8dbaa79d8fac5c69677858cafd..e599634eb5eaa3226713421ffe6faae8068a352c 100644 (file)
@@ -50,6 +50,9 @@
         </child>
       </object>
     </child>
+    <child>
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkListStore" id="lstore_mesi">
     <columns>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkListStore" id="lstore_persona_incarichi">
     <columns>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkListStore" id="lstore_struttura_allegati">
     <columns>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkListStore" id="lstore_ufficio_allegati">
     <columns>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkListStore" id="lstore_vie">
     <columns>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkTreeStore" id="tstore_uffici">
     <columns>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_main">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_nodo">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_persona_incarico">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_persona_nodo">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_persona_nodo_recapito">
     <property name="can_focus">False</property>
                 <property name="top_attach">1</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkComboBox" id="combobox7">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="hexpand">True</property>
-                <child>
-                  <object class="GtkCellRendererText" id="cellrenderertext31"/>
-                  <attributes>
-                    <attribute name="text">1</attribute>
-                  </attributes>
-                </child>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">0</property>
-              </packing>
-            </child>
             <child>
               <object class="GtkCheckButton" id="checkbutton11">
                 <property name="visible">True</property>
                 <property name="top_attach">0</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkFormDecoder" id="gtkformdecoder9">
+                <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>
             <child>
               <placeholder/>
             </child>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_persona_recapito">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_persona_ufficio">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_persona_ufficio_recapito">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_persone">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_posizione_economica">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_posizioni_economiche">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_profili_professionali">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_profilo_professionale">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_ruoli">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_ruolo">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_struttura_allegato">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_struttura_collegamento">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_struttura_indirizzo">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_strutture">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_tipi_nodo">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_tipi_prestazione">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_tipi_rapporto_lavoro">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_tipi_recapito">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_tipo_nodo">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_tipo_prestazione">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_tipo_rapporto_lavoro">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_tipo_recapito">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_titoli">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_titolo">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_ufficio_allegato">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_ufficio_collegamento">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_ufficio_nodo">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_ufficio_recapito">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkWindow" id="w_ufficio_stanza">
     <property name="can_focus">False</property>
         </child>
       </object>
     </child>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
   </object>
 </interface>
index bf67e19ca44d0afe5a98d90fa9d97d231be1600a..06cca71ddccb034b6cf36e9c2d7795a2e2c7e26a 100644 (file)
 
 #include <libzakautho/autoz.h>
 #include <libgtkform/form.h>
+#include <libgtkformui/gtkformdecoder.h>
 #include <libsolipa/utils.h>
 
 #include "personanodorecapito.h"
+#include "tipirecapito.h"
 
 static void organigramma_persona_nodo_recapito_class_init (OrganigrammaPersonaNodoRecapitoClass *klass);
 static void organigramma_persona_nodo_recapito_init (OrganigrammaPersonaNodoRecapito *organigramma_persona_nodo_recapito);
@@ -35,6 +37,8 @@ static void organigramma_persona_nodo_recapito_init (OrganigrammaPersonaNodoReca
 static void organigramma_persona_nodo_recapito_carica (OrganigrammaPersonaNodoRecapito *organigramma_persona_nodo_recapito);
 static void organigramma_persona_nodo_recapito_salva (OrganigrammaPersonaNodoRecapito *organigramma_persona_nodo_recapito, gboolean chiudi);
 
+static void organigramma_persona_nodo_recapito_on_tipo_recapito_selezionato (gpointer instance, guint id, gpointer user_data);
+
 static gboolean organigramma_persona_nodo_recapito_conferma_chiusura (OrganigrammaPersonaNodoRecapito *organigramma_persona_nodo_recapito);
 
 static void organigramma_persona_nodo_recapito_set_property (GObject *object,
@@ -50,6 +54,9 @@ static gboolean organigramma_persona_nodo_recapito_on_w_organigramma_persona_nod
                                GdkEvent *event,
                                gpointer user_data);
 
+static void organigramma_persona_nodo_recapito_on_btn_tipo_recapito_clicked (GtkButton *button,
+                      gpointer user_data);
+
 static void organigramma_persona_nodo_recapito_on_btn_annulla_clicked (GtkButton *button,
                                     gpointer user_data);
 static void organigramma_persona_nodo_recapito_on_btn_salva_clicked (GtkButton *button,
@@ -162,6 +169,9 @@ OrganigrammaPersonaNodoRecapito
        g_signal_connect (priv->w,
                          "delete-event", G_CALLBACK (organigramma_persona_nodo_recapito_on_w_organigramma_persona_nodo_recapito_delete_event), (gpointer *)a);
 
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "gtkformdecoder9"),
+                         "btn-browse-clicked", G_CALLBACK (organigramma_persona_nodo_recapito_on_btn_tipo_recapito_clicked), (gpointer)a);
+
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button93")),
                          "clicked", G_CALLBACK (organigramma_persona_nodo_recapito_on_btn_annulla_clicked), (gpointer *)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button94")),
@@ -330,6 +340,16 @@ organigramma_persona_nodo_recapito_conferma_chiusura (OrganigrammaPersonaNodoRec
 }
 
 /* CALLBACK */
+static void
+organigramma_persona_nodo_recapito_on_tipo_recapito_selezionato (gpointer instance, guint id, gpointer user_data)
+{
+       OrganigrammaPersonaNodoRecapito *f = (OrganigrammaPersonaNodoRecapito *)user_data;
+       OrganigrammaPersonaNodoRecapitoPrivate *priv = ORGANIGRAMMA_PERSONA_NODO_RECAPITO_GET_PRIVATE (f);
+
+       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "gtkformdecoder9"),
+                                            g_strdup_printf ("%d", id));
+}
+
 static gboolean
 organigramma_persona_nodo_recapito_on_w_organigramma_persona_nodo_recapito_delete_event (GtkWidget *widget,
                                GdkEvent *event,
@@ -338,6 +358,25 @@ organigramma_persona_nodo_recapito_on_w_organigramma_persona_nodo_recapito_delet
        return !organigramma_persona_nodo_recapito_conferma_chiusura ((OrganigrammaPersonaNodoRecapito *)user_data);
 }
 
+static void
+organigramma_persona_nodo_recapito_on_btn_tipo_recapito_clicked (GtkButton *button,
+                      gpointer user_data)
+{
+       GtkWidget *w;
+
+       OrganigrammaPersonaNodoRecapito *rf = (OrganigrammaPersonaNodoRecapito *)user_data;
+       OrganigrammaPersonaNodoRecapitoPrivate *priv = ORGANIGRAMMA_PERSONA_NODO_RECAPITO_GET_PRIVATE (rf);
+
+       OrganigrammaTipiRecapito *c = organigramma_tipi_recapito_new (priv->commons, TRUE);
+
+       g_signal_connect (G_OBJECT (c), "selezionato",
+                         G_CALLBACK (organigramma_persona_nodo_recapito_on_tipo_recapito_selezionato), user_data);
+
+       w = organigramma_tipi_recapito_get_widget (c);
+       gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
+       gtk_widget_show (w);
+}
+
 static void
 organigramma_persona_nodo_recapito_on_btn_annulla_clicked (GtkButton *button,
                         gpointer user_data)