]> saetta.ns0.it Git - solipa/territorio/commitdiff
Messi i campi id_regioni e id_province nelle tabelle province e
authorAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Wed, 25 Aug 2010 09:00:22 +0000 (11:00 +0200)
committerAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Wed, 25 Aug 2010 09:00:22 +0000 (11:00 +0200)
comuni (i cambiamenti verranno gestiti direttamente con libaudit).
Aggiunti a git i file del progetto eclipse.

.cproject [new file with mode: 0644]
.project [new file with mode: 0644]
data/territorio/form/comune.form
data/territorio/form/provincia.form
data/territorio/gui/territorio.gui
docs/territorio.sql
src/comune.c
src/provincia.c

diff --git a/.cproject b/.cproject
new file mode 100644 (file)
index 0000000..5113583
--- /dev/null
+++ b/.cproject
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+       <storageModule moduleId="org.eclipse.cdt.core.settings">
+               <cconfiguration id="cdt.managedbuild.toolchain.gnu.mingw.base.439600550">
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.mingw.base.439600550" moduleId="org.eclipse.cdt.core.settings" name="Default">
+                               <externalSettings/>
+                               <extensions>
+                                       <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                               </extensions>
+                       </storageModule>
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+                               <configuration buildProperties="" id="cdt.managedbuild.toolchain.gnu.mingw.base.439600550" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
+                                       <folderInfo id="cdt.managedbuild.toolchain.gnu.mingw.base.439600550.834483238" name="/" resourcePath="">
+                                               <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.base.1741557917" name="cdt.managedbuild.toolchain.gnu.mingw.base" superClass="cdt.managedbuild.toolchain.gnu.mingw.base">
+                                                       <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.PE" id="cdt.managedbuild.target.gnu.platform.mingw.base.1222644289" name="Debug Platform" osList="win32" superClass="cdt.managedbuild.target.gnu.platform.mingw.base"/>
+                                                       <builder buildPath="${workspace_loc:/territorio/Default}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.556545956" managedBuildOn="false" name="CDT Internal Builder.Default" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.base.1691688038" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.base"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1950648272" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.1452799006" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.base.900338487" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.base"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.2056625781" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base.1643742572" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base"/>
+                                               </toolChain>
+                                       </folderInfo>
+                               </configuration>
+                       </storageModule>
+                       <storageModule moduleId="scannerConfiguration">
+                               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+                               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="makefileGenerator">
+                                               <runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                       </storageModule>
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+               </cconfiguration>
+       </storageModule>
+       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+               <project id="territorio.null.1077983542" name="territorio"/>
+       </storageModule>
+</cproject>
diff --git a/.project b/.project
new file mode 100644 (file)
index 0000000..6b676e5
--- /dev/null
+++ b/.project
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>territorio</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+                       <triggers>clean,full,incremental,</triggers>
+                       <arguments>
+                               <dictionary>
+                                       <key>?name?</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.append_environment</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildArguments</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildCommand</key>
+                                       <value>make</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildLocation</key>
+                                       <value>${workspace_loc:/territorio/Default}</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.contents</key>
+                                       <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+                                       <value>false</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.stopOnError</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+                                       <value>true</value>
+                               </dictionary>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+                       <triggers>full,incremental,</triggers>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.cdt.core.cnature</nature>
+               <nature>org.eclipse.cdt.core.ccnature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+       </natures>
+</projectDescription>
index a6578c0e7e5ebdeb4107601433892d8c280819f1..ffd57c61a5354b5141028f7b92ec7cf2f8786ddd 100644 (file)
                <field type="text" name="cap" />
        </widget>
 
+       <widget type="entry" name="entry16">
+               <field type="text" name="provincia">
+                       <to-load>f</to-load>
+                       <to-save>f</to-save>
+               </field>
+       </widget>
+
+       <widget type="label" name="label38" label="label37">
+               <on-change what="update" when="after">
+                       <widget-name>entry16</widget-name>
+                       <sql>
+                               SELECT nome FROM province WHERE id = ##label38::gint
+                       </sql>
+               </on-change>
+               <field type="integer" name="id_province">
+                       <obligatory>t</obligatory>
+               </field>
+       </widget>
+
 </gtkform>
index fd38096d27ed336b77016cfb112b6c8305bdb41e..6d64aff0705f7c9980255317514232c78d8a64f9 100644 (file)
                <field type="text" name="sigla" />
        </widget>
 
+       <widget type="entry" name="entry15">
+               <field type="text" name="regione">
+                       <to-load>f</to-load>
+                       <to-save>f</to-save>
+               </field>
+       </widget>
+
+       <widget type="label" name="label36" label="label35">
+               <on-change what="update" when="after">
+                       <widget-name>entry15</widget-name>
+                       <sql>
+                               SELECT nome FROM regioni WHERE id = ##label36::gint
+                       </sql>
+               </on-change>
+               <field type="integer" name="id_regioni">
+                       <obligatory>t</obligatory>
+               </field>
+       </widget>
+
 </gtkform>
index c77353f196a224e075b44a32543542ee844c4f98..4aa5fd63df1b9c0b536f6ddf8758ec1bcac4bfcf 100644 (file)
       </object>
     </child>
   </object>
+  <object class="GtkListStore" id="lstore_stati">
+    <columns>
+      <!-- column-name id -->
+      <column type="guint"/>
+      <!-- column-name nome -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="lstore_regioni">
+    <columns>
+      <!-- column-name id -->
+      <column type="guint"/>
+      <!-- column-name nome -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="lstore_province">
+    <columns>
+      <!-- column-name id -->
+      <column type="guint"/>
+      <!-- column-name nome -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="lstore_comuni">
+    <columns>
+      <!-- column-name id -->
+      <column type="guint"/>
+      <!-- column-name nome -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="lstore_tipi_aggregazione_territoriale">
+    <columns>
+      <!-- column-name id -->
+      <column type="gchararray"/>
+      <!-- column-name nome -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="lstore_aggregazioni_territoriali">
+    <columns>
+      <!-- column-name id -->
+      <column type="gchararray"/>
+      <!-- column-name nome -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
   <object class="GtkWindow" id="w_stati">
     <property name="title" translatable="yes">Stati - Territorio</property>
     <property name="modal">True</property>
       </object>
     </child>
   </object>
-  <object class="GtkListStore" id="lstore_stati">
-    <columns>
-      <!-- column-name id -->
-      <column type="guint"/>
-      <!-- column-name nome -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
-  <object class="GtkListStore" id="lstore_regioni">
-    <columns>
-      <!-- column-name id -->
-      <column type="guint"/>
-      <!-- column-name nome -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
-  <object class="GtkListStore" id="lstore_province">
-    <columns>
-      <!-- column-name id -->
-      <column type="guint"/>
-      <!-- column-name nome -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
-  <object class="GtkListStore" id="lstore_comuni">
-    <columns>
-      <!-- column-name id -->
-      <column type="guint"/>
-      <!-- column-name nome -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
-  <object class="GtkListStore" id="lstore_tipi_aggregazione_territoriale">
-    <columns>
-      <!-- column-name id -->
-      <column type="gchararray"/>
-      <!-- column-name nome -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
-  <object class="GtkListStore" id="lstore_aggregazioni_territoriali">
-    <columns>
-      <!-- column-name id -->
-      <column type="gchararray"/>
-      <!-- column-name nome -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
   <object class="GtkWindow" id="w_stato">
     <property name="title" translatable="yes">Stato - Territorio</property>
     <property name="modal">True</property>
         <child>
           <object class="GtkTable" id="table3">
             <property name="visible">True</property>
-            <property name="n_rows">4</property>
+            <property name="n_rows">5</property>
             <property name="n_columns">2</property>
             <property name="column_spacing">5</property>
             <property name="row_spacing">5</property>
                 <property name="y_options">GTK_FILL</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkLabel" id="label35">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Regione</property>
+              </object>
+              <packing>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options">GTK_FILL</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHBox" id="hbox1">
+                <property name="visible">True</property>
+                <property name="spacing">5</property>
+                <child>
+                  <object class="GtkEntry" id="entry15">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="editable">False</property>
+                    <property name="invisible_char">&#x25CF;</property>
+                  </object>
+                  <packing>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="button43">
+                    <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="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label36">
+                    <property name="label" translatable="yes">lbl_id_regioni</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+                <property name="y_options">GTK_FILL</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="position">0</property>
         <child>
           <object class="GtkTable" id="table4">
             <property name="visible">True</property>
-            <property name="n_rows">4</property>
+            <property name="n_rows">5</property>
             <property name="n_columns">2</property>
             <property name="column_spacing">5</property>
             <property name="row_spacing">5</property>
                 <property name="y_options">GTK_FILL</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkLabel" id="label37">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Provincia</property>
+              </object>
+              <packing>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options">GTK_FILL</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHBox" id="hbox2">
+                <property name="visible">True</property>
+                <property name="spacing">5</property>
+                <child>
+                  <object class="GtkEntry" id="entry16">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="editable">False</property>
+                    <property name="invisible_char">&#x25CF;</property>
+                  </object>
+                  <packing>
+                    <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="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label38">
+                    <property name="label" translatable="yes">lbl_id_province</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+                <property name="y_options">GTK_FILL</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="position">0</property>
index 411eaf91e7355d64794ff76d790a33920273298d..8eacb3d4d153c29b60511912ed9475e2bdbcb950 100644 (file)
@@ -2,7 +2,7 @@
 -- PostgreSQL database dump
 --
 
--- Started on 2010-08-24 16:56:56
+-- Started on 2010-08-25 10:29:20
 
 SET statement_timeout = 0;
 SET client_encoding = 'UTF8';
@@ -12,7 +12,7 @@ SET client_min_messages = warning;
 SET escape_string_warning = off;
 
 --
--- TOC entry 1839 (class 1262 OID 59420)
+-- TOC entry 1827 (class 1262 OID 59420)
 -- Name: territorio; Type: DATABASE; Schema: -; Owner: -
 --
 
@@ -29,7 +29,7 @@ SET client_min_messages = warning;
 SET escape_string_warning = off;
 
 --
--- TOC entry 321 (class 2612 OID 16386)
+-- TOC entry 317 (class 2612 OID 16386)
 -- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: -
 --
 
@@ -43,8 +43,8 @@ SET default_tablespace = '';
 SET default_with_oids = false;
 
 --
--- TOC entry 1514 (class 1259 OID 59503)
--- Dependencies: 1810 1811 3
+-- TOC entry 1508 (class 1259 OID 59503)
+-- Dependencies: 1802 1803 3
 -- Name: aggregazioni_territoriali; Type: TABLE; Schema: public; Owner: -; Tablespace: 
 --
 
@@ -57,24 +57,8 @@ CREATE TABLE aggregazioni_territoriali (
 
 
 --
--- TOC entry 1512 (class 1259 OID 59490)
--- Dependencies: 1807 3
--- Name: comune_province; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE comune_province (
-    id integer NOT NULL,
-    id_comuni integer,
-    id_province integer,
-    da_data date,
-    a_data date,
-    status character varying(1) DEFAULT ''::character varying
-);
-
-
---
--- TOC entry 1511 (class 1259 OID 59481)
--- Dependencies: 1803 1804 1805 1806 3
+-- TOC entry 1506 (class 1259 OID 59481)
+-- Dependencies: 1796 1797 1798 1799 3
 -- Name: comuni; Type: TABLE; Schema: public; Owner: -; Tablespace: 
 --
 
@@ -83,13 +67,14 @@ CREATE TABLE comuni (
     nome character varying(255) DEFAULT ''::character varying,
     cod_istat character varying(5) DEFAULT ''::character varying,
     cap character varying(5) DEFAULT ''::character varying,
-    status character varying(1) DEFAULT ''::character varying
+    status character varying(1) DEFAULT ''::character varying,
+    id_province integer
 );
 
 
 --
--- TOC entry 1516 (class 1259 OID 59532)
--- Dependencies: 1815 1816 1817 1818 3
+-- TOC entry 1510 (class 1259 OID 59532)
+-- Dependencies: 1807 1808 1809 1810 3
 -- Name: province; Type: TABLE; Schema: public; Owner: -; Tablespace: 
 --
 
@@ -98,29 +83,14 @@ CREATE TABLE province (
     nome character varying(255) DEFAULT ''::character varying,
     cod_istat character varying(5) DEFAULT ''::character varying,
     sigla character varying(5) DEFAULT ''::character varying,
-    status character varying(1) DEFAULT ''::character varying
+    status character varying(1) DEFAULT ''::character varying,
+    id_regioni integer
 );
 
 
 --
--- TOC entry 1510 (class 1259 OID 59475)
--- Dependencies: 1802 3
--- Name: provincia_regioni; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE provincia_regioni (
-    id integer NOT NULL,
-    id_province integer,
-    id_regioni integer,
-    da_data date,
-    a_data date,
-    status character varying(1) DEFAULT ''::character varying
-);
-
-
---
--- TOC entry 1509 (class 1259 OID 59459)
--- Dependencies: 1799 1800 1801 3
+-- TOC entry 1505 (class 1259 OID 59459)
+-- Dependencies: 1793 1794 1795 3
 -- Name: regioni; Type: TABLE; Schema: public; Owner: -; Tablespace: 
 --
 
@@ -133,8 +103,8 @@ CREATE TABLE regioni (
 
 
 --
--- TOC entry 1508 (class 1259 OID 59446)
--- Dependencies: 1794 1795 1796 1797 1798 3
+-- TOC entry 1504 (class 1259 OID 59446)
+-- Dependencies: 1788 1789 1790 1791 1792 3
 -- Name: stati; Type: TABLE; Schema: public; Owner: -; Tablespace: 
 --
 
@@ -150,8 +120,8 @@ CREATE TABLE stati (
 
 
 --
--- TOC entry 1513 (class 1259 OID 59496)
--- Dependencies: 1808 1809 3
+-- TOC entry 1507 (class 1259 OID 59496)
+-- Dependencies: 1800 1801 3
 -- Name: tipi_aggregazione_territoriale; Type: TABLE; Schema: public; Owner: -; Tablespace: 
 --
 
@@ -163,8 +133,8 @@ CREATE TABLE tipi_aggregazione_territoriale (
 
 
 --
--- TOC entry 1515 (class 1259 OID 59524)
--- Dependencies: 1812 1813 1814 3
+-- TOC entry 1509 (class 1259 OID 59524)
+-- Dependencies: 1804 1805 1806 3
 -- Name: vie; Type: TABLE; Schema: public; Owner: -; Tablespace: 
 --
 
@@ -178,8 +148,8 @@ CREATE TABLE vie (
 
 
 --
--- TOC entry 1832 (class 2606 OID 59509)
--- Dependencies: 1514 1514
+-- TOC entry 1820 (class 2606 OID 59509)
+-- Dependencies: 1508 1508
 -- Name: aggregazioni_territoriali_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
 --
 
@@ -188,18 +158,8 @@ ALTER TABLE ONLY aggregazioni_territoriali
 
 
 --
--- TOC entry 1828 (class 2606 OID 59495)
--- Dependencies: 1512 1512
--- Name: comune_province_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
---
-
-ALTER TABLE ONLY comune_province
-    ADD CONSTRAINT comune_province_pkey PRIMARY KEY (id);
-
-
---
--- TOC entry 1826 (class 2606 OID 59489)
--- Dependencies: 1511 1511
+-- TOC entry 1816 (class 2606 OID 59489)
+-- Dependencies: 1506 1506
 -- Name: comuni_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
 --
 
@@ -208,8 +168,8 @@ ALTER TABLE ONLY comuni
 
 
 --
--- TOC entry 1836 (class 2606 OID 59540)
--- Dependencies: 1516 1516
+-- TOC entry 1824 (class 2606 OID 59540)
+-- Dependencies: 1510 1510
 -- Name: province_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
 --
 
@@ -218,18 +178,8 @@ ALTER TABLE ONLY province
 
 
 --
--- TOC entry 1824 (class 2606 OID 59480)
--- Dependencies: 1510 1510
--- Name: provincia_regioni_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
---
-
-ALTER TABLE ONLY provincia_regioni
-    ADD CONSTRAINT provincia_regioni_pkey PRIMARY KEY (id);
-
-
---
--- TOC entry 1822 (class 2606 OID 59466)
--- Dependencies: 1509 1509
+-- TOC entry 1814 (class 2606 OID 59466)
+-- Dependencies: 1505 1505
 -- Name: regioni_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
 --
 
@@ -238,8 +188,8 @@ ALTER TABLE ONLY regioni
 
 
 --
--- TOC entry 1820 (class 2606 OID 59458)
--- Dependencies: 1508 1508
+-- TOC entry 1812 (class 2606 OID 59458)
+-- Dependencies: 1504 1504
 -- Name: stati_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
 --
 
@@ -248,8 +198,8 @@ ALTER TABLE ONLY stati
 
 
 --
--- TOC entry 1830 (class 2606 OID 59502)
--- Dependencies: 1513 1513
+-- TOC entry 1818 (class 2606 OID 59502)
+-- Dependencies: 1507 1507
 -- Name: tipi_aggregazioni_territoriali_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
 --
 
@@ -258,8 +208,8 @@ ALTER TABLE ONLY tipi_aggregazione_territoriale
 
 
 --
--- TOC entry 1834 (class 2606 OID 59531)
--- Dependencies: 1515 1515
+-- TOC entry 1822 (class 2606 OID 59531)
+-- Dependencies: 1509 1509
 -- Name: vie_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
 --
 
@@ -268,7 +218,7 @@ ALTER TABLE ONLY vie
 
 
 --
--- TOC entry 1841 (class 0 OID 0)
+-- TOC entry 1829 (class 0 OID 0)
 -- Dependencies: 3
 -- Name: public; Type: ACL; Schema: -; Owner: -
 --
@@ -279,7 +229,7 @@ GRANT ALL ON SCHEMA public TO postgres;
 GRANT ALL ON SCHEMA public TO PUBLIC;
 
 
--- Completed on 2010-08-24 16:56:56
+-- Completed on 2010-08-25 10:29:20
 
 --
 -- PostgreSQL database dump complete
index ea2a248fa1b126571fd06a37ca9e5c09ce418e13..b82f9033af3b0c59ebb8f63b64fc80590e660519 100644 (file)
@@ -20,6 +20,7 @@
 #include <libgtkform/form.h>
 
 #include "comune.h"
+#include "province.h"
 
 static void comune_class_init (ComuneClass *klass);
 static void comune_init (Comune *comune);
@@ -38,10 +39,15 @@ static void comune_get_property (GObject *object,
                                      GValue *value,
                                      GParamSpec *pspec);
 
+static void comune_on_provincia_selezionato (gpointer instance, guint id, gpointer user_data);
+
 static gboolean comune_on_w_comune_delete_event (GtkWidget *widget,
                                GdkEvent *event,
                                gpointer user_data);
 
+static void comune_on_btn_provincia_clicked (GtkButton *button,
+                      gpointer user_data);
+
 static void comune_on_btn_annulla_clicked (GtkButton *button,
                                     gpointer user_data);
 static void comune_on_btn_salva_clicked (GtkButton *button,
@@ -143,6 +149,9 @@ Comune
        g_signal_connect (priv->w,
                          "delete-event", G_CALLBACK (comune_on_w_comune_delete_event), (gpointer *)a);
 
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button44"),
+                         "clicked", G_CALLBACK (comune_on_btn_provincia_clicked), (gpointer *)a);
+
        g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button27"),
                          "clicked", G_CALLBACK (comune_on_btn_annulla_clicked), (gpointer *)a);
        g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button28"),
@@ -311,6 +320,15 @@ comune_conferma_chiusura (Comune *comune)
 }
 
 /* CALLBACK */
+static void
+comune_on_provincia_selezionato (gpointer instance, guint id, gpointer user_data)
+{
+       Comune *f = (Comune *)user_data;
+       ComunePrivate *priv = COMUNE_GET_PRIVATE (f);
+
+       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "label38"), g_strdup_printf ("%d", id));
+}
+
 static gboolean
 comune_on_w_comune_delete_event (GtkWidget *widget,
                                GdkEvent *event,
@@ -319,6 +337,26 @@ comune_on_w_comune_delete_event (GtkWidget *widget,
        return !comune_conferma_chiusura ((Comune *)user_data);
 }
 
+static void
+comune_on_btn_provincia_clicked (GtkButton *button,
+                      gpointer user_data)
+{
+       GtkWidget *w;
+
+       Comune *rf = (Comune *)user_data;
+
+       ComunePrivate *priv = COMUNE_GET_PRIVATE (rf);
+
+       Province *c = province_new (priv->commons, TRUE);
+
+       g_signal_connect (G_OBJECT (c), "selezionato",
+                         G_CALLBACK (comune_on_provincia_selezionato), user_data);
+
+       w = province_get_widget (c);
+       gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
+       gtk_widget_show (w);
+}
+
 static void
 comune_on_btn_annulla_clicked (GtkButton *button,
                         gpointer user_data)
index fb7fcc166cfc3cf650f677ea777d522501b3b000..9ac5edbfec5f64bab7a5b409a189203f08842e3d 100644 (file)
@@ -20,6 +20,7 @@
 #include <libgtkform/form.h>
 
 #include "provincia.h"
+#include "regioni.h"
 
 static void provincia_class_init (ProvinciaClass *klass);
 static void provincia_init (Provincia *provincia);
@@ -38,10 +39,15 @@ static void provincia_get_property (GObject *object,
                                      GValue *value,
                                      GParamSpec *pspec);
 
+static void provincia_on_regione_selezionato (gpointer instance, guint id, gpointer user_data);
+
 static gboolean provincia_on_w_provincia_delete_event (GtkWidget *widget,
                                GdkEvent *event,
                                gpointer user_data);
 
+static void provincia_on_btn_regione_clicked (GtkButton *button,
+                      gpointer user_data);
+
 static void provincia_on_btn_annulla_clicked (GtkButton *button,
                                     gpointer user_data);
 static void provincia_on_btn_salva_clicked (GtkButton *button,
@@ -143,6 +149,9 @@ Provincia
        g_signal_connect (priv->w,
                          "delete-event", G_CALLBACK (provincia_on_w_provincia_delete_event), (gpointer *)a);
 
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button43"),
+                         "clicked", G_CALLBACK (provincia_on_btn_regione_clicked), (gpointer *)a);
+
        g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button20"),
                          "clicked", G_CALLBACK (provincia_on_btn_annulla_clicked), (gpointer *)a);
        g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button21"),
@@ -311,6 +320,15 @@ provincia_conferma_chiusura (Provincia *provincia)
 }
 
 /* CALLBACK */
+static void
+provincia_on_regione_selezionato (gpointer instance, guint id, gpointer user_data)
+{
+       Provincia *f = (Provincia *)user_data;
+       ProvinciaPrivate *priv = PROVINCIA_GET_PRIVATE (f);
+
+       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "label36"), g_strdup_printf ("%d", id));
+}
+
 static gboolean
 provincia_on_w_provincia_delete_event (GtkWidget *widget,
                                GdkEvent *event,
@@ -319,6 +337,26 @@ provincia_on_w_provincia_delete_event (GtkWidget *widget,
        return !provincia_conferma_chiusura ((Provincia *)user_data);
 }
 
+static void
+provincia_on_btn_regione_clicked (GtkButton *button,
+                      gpointer user_data)
+{
+       GtkWidget *w;
+
+       Provincia *rf = (Provincia *)user_data;
+
+       ProvinciaPrivate *priv = PROVINCIA_GET_PRIVATE (rf);
+
+       Regioni *c = regioni_new (priv->commons, TRUE);
+
+       g_signal_connect (G_OBJECT (c), "selezionato",
+                         G_CALLBACK (provincia_on_regione_selezionato), user_data);
+
+       w = regioni_get_widget (c);
+       gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
+       gtk_widget_show (w);
+}
+
 static void
 provincia_on_btn_annulla_clicked (GtkButton *button,
                         gpointer user_data)