1790{
1793 gint is_valid;
1794 gpointer gptr;
1795 GtkTreeIter iter;
1796 char *output_shapefile, *orig_shapefile;
1798 gchar *folder_path;
1799
1800 int ret, success =
FALSE, i = 0;
1801
1802
1804 if (!is_valid)
1805 {
1806 pgui_seterr(
_(
"ERROR: You haven't specified any tables to export"));
1808
1809 return;
1810 }
1811
1812
1813
1815 {
1816 pgui_seterr(
_(
"Unable to connect to the database - please check your connection settings"));
1818
1819
1821
1823 return;
1824 }
1825
1826
1827
1829 {
1831
1832 return;
1833 }
1834
1837
1838
1840 while (is_valid)
1841 {
1842
1845
1846 pgui_logf(
"\n==============================");
1847 pgui_logf(
"Exporting with configuration: %s, %s, %s", dumper_table_config->
table, dumper_table_config->
schema, dumper_table_config->
shp_file);
1848
1849
1852
1853
1854 gtk_widget_set_sensitive(widget,
FALSE);
1855
1856
1857 while (gtk_events_pending())
1858 gtk_main_iteration();
1859
1860
1863
1864
1865 orig_shapefile = dumper_table_config->
shp_file;
1866 output_shapefile =
malloc(strlen(folder_path) + strlen(dumper_table_config->
shp_file) + 2);
1867 strcpy(output_shapefile, folder_path);
1868 strcat(output_shapefile, G_DIR_SEPARATOR_S);
1869 strcat(output_shapefile, dumper_table_config->
shp_file);
1870
1871 dumper_table_config->
shp_file = output_shapefile;
1872
1873
1876 {
1879
1880 goto export_cleanup;
1881 }
1882
1883
1885 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(
progress), 0.0);
1887
1890 {
1892
1894 {
1896
1899
1900 goto export_cleanup;
1901 }
1902 }
1903
1904
1908
1909
1910 while (gtk_events_pending())
1911 gtk_main_iteration();
1912
1915
1917 {
1920 {
1922
1924 {
1926
1929
1930 goto export_cleanup;
1931 }
1932 }
1933
1934
1936
1937
1938 while (gtk_events_pending())
1939 gtk_main_iteration();
1940 }
1941
1942
1945 {
1947
1949 {
1951
1954 }
1955 }
1956
1957
1960
1961export_cleanup:
1962
1963
1965
1966
1967 dumper_table_config->
shp_file = orig_shapefile;
1968
1969
1971 }
1972
1973
1975 if (!success)
1977 else
1979
1980
1981 gtk_widget_set_sensitive(widget,
TRUE);
1982
1983
1984 gtk_widget_hide(widget);
1985 gtk_widget_show(widget);
1986
1987
1989
1990
1991 while (gtk_events_pending())
1992 gtk_main_iteration();
1993
1994 return;
1995}
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 static void static void static void pgui_seterr(const char *fmt,...) __attribute__((format(printf
static volatile int is_running
static void static void static void pgui_logf(const char *fmt,...) __attribute__((format(printf
static void pgui_raise_error_dialogue(void)
static void static void static void static 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
SHPCONNECTIONCONFIG * conn
char message[SHPDUMPERMSGLEN]