summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--divelist.c4
-rw-r--r--divelist.h2
-rw-r--r--gtk-gui.c4
3 files changed, 8 insertions, 2 deletions
diff --git a/divelist.c b/divelist.c
index 59db7c208..37efed67a 100644
--- a/divelist.c
+++ b/divelist.c
@@ -1948,7 +1948,7 @@ void add_single_dive(int idx, struct dive *dive)
}
/* remember expanded state */
-static void remember_tree_state()
+void remember_tree_state()
{
GtkTreeIter iter;
if (!gtk_tree_model_get_iter_first(TREEMODEL(dive_list), &iter))
@@ -1992,7 +1992,7 @@ static gboolean restore_node_state(GtkTreeModel *model, GtkTreePath *path, GtkTr
}
/* restore expanded and selected state */
-static void restore_tree_state()
+void restore_tree_state()
{
gtk_tree_model_foreach(MODEL(dive_list), restore_node_state, NULL);
}
diff --git a/divelist.h b/divelist.h
index 45c1a18f8..0a635c2ed 100644
--- a/divelist.h
+++ b/divelist.h
@@ -11,4 +11,6 @@ extern void update_cylinder_related_info(struct dive *);
extern void mark_divelist_changed(int);
extern int unsaved_changes(void);
extern void remove_autogen_trips(void);
+extern void remember_tree_state(void);
+extern void restore_tree_state(void);
#endif
diff --git a/gtk-gui.c b/gtk-gui.c
index 96dbfa320..292a3c77d 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -1633,6 +1633,7 @@ void import_files(GtkWidget *w, gpointer data)
struct stat sb;
GSList *filenames = NULL;
+ remember_tree_state();
fs_dialog = gtk_file_chooser_dialog_new(_("Choose XML Files To Import Into Current Data File"),
GTK_WINDOW(main_window),
GTK_FILE_CHOOSER_ACTION_OPEN,
@@ -1671,6 +1672,7 @@ void import_files(GtkWidget *w, gpointer data)
free(current_def_dir);
gtk_widget_destroy(fs_dialog);
+ restore_tree_state();
}
static GError *setup_uemis_import(device_data_t *data)
@@ -1738,6 +1740,7 @@ void download_dialog(GtkWidget *w, gpointer data)
.devname = NULL,
};
+ remember_tree_state();
dialog = gtk_dialog_new_with_buttons(_("Download From Dive Computer"),
GTK_WINDOW(main_window),
GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -1834,6 +1837,7 @@ repeat:
break;
}
gtk_widget_destroy(dialog);
+ restore_tree_state();
}
void update_progressbar(progressbar_t *progress, double value)