diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-03 12:13:54 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-03 12:13:54 -0700 |
commit | 1531a37dd0b74fcb06ca06fd2f225d4a2d228a87 (patch) | |
tree | 87edc576053e177afb4a3bcddee4876cea0ece47 /gtk-gui.c | |
parent | a32d28d5e388ab3e31eadcd329814488fa5e8b1b (diff) | |
parent | c15f798a85db53dae404a9113266a4d2bc72fbc6 (diff) | |
download | subsurface-1531a37dd0b74fcb06ca06fd2f225d4a2d228a87.tar.gz |
Merge branch 'uemis-integration' of git://github.com/dirkhh/subsurface
* 'uemis-integration' of git://github.com/dirkhh/subsurface:
Remove the ability to 'Import' .SDA files
Integrate loading of uemis SDA files into the regular xml parsing
First steps towards integrating SDA files into the default XML loading
Diffstat (limited to 'gtk-gui.c')
-rw-r--r-- | gtk-gui.c | 42 |
1 files changed, 2 insertions, 40 deletions
@@ -103,6 +103,8 @@ static void file_open(GtkWidget *w, gpointer data) filter = gtk_file_filter_new(); gtk_file_filter_add_pattern(filter, "*.xml"); gtk_file_filter_add_pattern(filter, "*.XML"); + gtk_file_filter_add_pattern(filter, "*.sda"); + gtk_file_filter_add_pattern(filter, "*.SDA"); gtk_file_filter_add_mime_type(filter, "text/xml"); gtk_file_filter_set_name(filter, "XML file"); gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter); @@ -668,46 +670,6 @@ void run_ui(void) gtk_main(); } -/* get the filenames the user selects and call the parsing function - * on them - * return 0 if the user cancelled the dialog - */ -int open_import_file_dialog(char *filterpattern, char *filtertext, - void(* parse_function)(char *)) -{ - int ret=0; - - GtkWidget *dialog; - GtkFileFilter *filter = gtk_file_filter_new (); - gtk_file_filter_add_pattern (filter, filterpattern); - gtk_file_filter_set_name(filter, filtertext); - dialog = gtk_file_chooser_dialog_new("Open File", - GTK_WINDOW(main_window), - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, - NULL); - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), TRUE); - gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter); - - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { - GSList *filenames; - char *filename; - filenames = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog)); - while(filenames != NULL) { - filename = (char *)filenames->data; - parse_function(filename); - g_free(filename); - filenames = g_slist_next(filenames); - } - g_slist_free(filenames); - ret = 1; - } - gtk_widget_destroy(dialog); - - return ret; -} - static gboolean expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data) { struct dive *dive = current_dive; |