mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Make sure there are no invisible selected dives after import / download
Prior to this commit, gtk often decided to collapse the trip with the selected dive after the user imported or downloaded additional dives. Since Subsurface tracks dives as being selected even after gtk collapses a trip (which clears all selection state as far as gtk is concerned) this could lead to the strange situation that the user could click on a new dive to select it without unselecting the already selected dive - and suddenly edit or delete did things that were entirely unwanted. With this change we explicitly save and then restore the tree state around import and download operations. This ensures that the same dive(s) stay selected and trips stay expanded and therefore avoids the issues described here. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a8d413551e
commit
d872a5c8aa
3 changed files with 8 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue