chiark / gitweb /
make rtp socket/log dependent on hostname for nfs-mounted home
[disorder] / disobedience / choose.c
index b7f77c481a824df2e0b2e35ea02121b81ca1f86c..8aa11e2117cd0fe478dc7cb8a8070b16c9402655 100644 (file)
@@ -1288,6 +1288,15 @@ static const struct tabtype tabtype_choose = {
 
 /* Public entry points ----------------------------------------------------- */
 
+/** @brief Called to entirely reset the choose screen */
+static void choose_reset(void) {
+  if(root)
+    undisplay_tree(root);
+  root = newnode(0/*parent*/, "<root>", "All files", "",
+                 CN_EXPANDABLE, fill_root_node);
+  expand_node(root, 0);                 /* will call redisplay_tree */
+}
+
 /** @brief Create a track choice widget */
 GtkWidget *choose_widget(void) {
   int n;
@@ -1354,9 +1363,8 @@ GtkWidget *choose_widget(void) {
    * namespace */
   NW(layout);
   chooselayout = gtk_layout_new(0, 0);
-  root = newnode(0/*parent*/, "<root>", "All files", "",
-                 CN_EXPANDABLE, fill_root_node);
-  expand_node(root, 0);                 /* will call redisplay_tree */
+  choose_reset();
+  register_reset(choose_reset);
   /* Create the popup menus */
   NW(menu);
   track_menu = gtk_menu_new();