1769{
1772 gint is_valid;
1773 gpointer gptr;
1774 GtkTreeIter iter;
1775 char *output_shapefile, *orig_shapefile;
1777 gchar *folder_path;
1778
1779 int ret, success =
FALSE, i = 0;
1780
1781
1783 if (!is_valid)
1784 {
1785 pgui_seterr(
_(
"ERROR: You haven't specified any tables to export"));
1787
1788 return;
1789 }
1790
1791
1792
1794 {
1795 pgui_seterr(
_(
"Unable to connect to the database - please check your connection settings"));
1797
1798
1800
1802 return;
1803 }
1804
1805
1806
1808 {
1810
1811 return;
1812 }
1813
1816
1817
1819 while (is_valid)
1820 {
1821
1824
1825 pgui_logf(
"\n==============================");
1826 pgui_logf(
"Exporting with configuration: %s, %s, %s", dumper_table_config->
table, dumper_table_config->
schema, dumper_table_config->
shp_file);
1827
1828
1831
1832
1833 gtk_widget_set_sensitive(widget,
FALSE);
1834
1835
1836 while (gtk_events_pending())
1837 gtk_main_iteration();
1838
1839
1842
1843
1844 orig_shapefile = dumper_table_config->
shp_file;
1845 output_shapefile =
malloc(strlen(folder_path) + strlen(dumper_table_config->
shp_file) + 2);
1846 strcpy(output_shapefile, folder_path);
1847 strcat(output_shapefile, G_DIR_SEPARATOR_S);
1848 strcat(output_shapefile, dumper_table_config->
shp_file);
1849
1850 dumper_table_config->
shp_file = output_shapefile;
1851
1852
1855 {
1858
1859 goto export_cleanup;
1860 }
1861
1862
1864 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(
progress), 0.0);
1866
1869 {
1871
1873 {
1875
1878
1879 goto export_cleanup;
1880 }
1881 }
1882
1883
1887
1888
1889 while (gtk_events_pending())
1890 gtk_main_iteration();
1891
1894
1896 {
1899 {
1901
1903 {
1905
1908
1909 goto export_cleanup;
1910 }
1911 }
1912
1913
1915
1916
1917 while (gtk_events_pending())
1918 gtk_main_iteration();
1919 }
1920
1921
1924 {
1926
1928 {
1930
1933 }
1934 }
1935
1936
1939
1940export_cleanup:
1941
1942
1944
1945
1946 dumper_table_config->
shp_file = orig_shapefile;
1947
1948
1950 }
1951
1952
1954 if (!success)
1956 else
1958
1959
1960 gtk_widget_set_sensitive(widget,
TRUE);
1961
1962
1963 gtk_widget_hide(widget);
1964 gtk_widget_show(widget);
1965
1966
1968
1969
1970 while (gtk_events_pending())
1971 gtk_main_iteration();
1972
1973 return;
1974}
int ShpDumperGetRecordCount(SHPDUMPERSTATE *state)
void ShpDumperDestroy(SHPDUMPERSTATE *state)
int ShpDumperConnectDatabase(SHPDUMPERSTATE *state)
char * shapetypename(int num)
int ShpLoaderGenerateShapeRow(SHPDUMPERSTATE *state)
SHPDUMPERSTATE * ShpDumperCreate(SHPDUMPERCONFIG *config)
int ShpDumperCloseTable(SHPDUMPERSTATE *state)
int ShpDumperOpenTable(SHPDUMPERSTATE *state)
static GtkWidget * label_progress
static GtkWidget * progress
static void pgui_seterr(const char *fmt,...)
static volatile int is_running
static void pgui_raise_error_dialogue(void)
static void update_conn_ui_from_conn_config(void)
static GtkWidget * dialog_progress
static int connection_test(void)
GtkListStore * export_table_list_store
#define GUIMSG_LINE_MAXLEN
static GtkWidget * dialog_folderchooser
static SHPCONNECTIONCONFIG * conn
static GtkWidget * window_conn
static void pgui_logf(const char *fmt,...)
SHPCONNECTIONCONFIG * conn
char message[SHPDUMPERMSGLEN]