Browse Source

* widget.c (listbox_new): Remove "action" argument. Listboxes
without callbacks default to closing the dialog. Adjust all
users. This fixes double click on completion listbox.
* widget.h: Use uppercase names for the return values of the
listbox callback.

Pavel Roskin 21 years ago
parent
commit
f8e00e7b6a
10 changed files with 21 additions and 15 deletions
  1. 1 1
      edit/editcmd.c
  2. 6 0
      src/ChangeLog
  3. 1 1
      src/achown.c
  4. 1 1
      src/boxes.c
  5. 2 2
      src/chown.c
  6. 1 1
      src/complete.c
  7. 1 1
      src/find.c
  8. 6 6
      src/hotlist.c
  9. 1 1
      src/listmode.c
  10. 1 1
      src/panelize.c

+ 1 - 1
edit/editcmd.c

@@ -2759,7 +2759,7 @@ edit_completion_dialog (WEdit *edit, int max_len, int word_len,
 
     /* create the listbox */
     compl_list =
-	listbox_new (1, 1, compl_dlg_w - 2, compl_dlg_h - 2, 0, NULL);
+	listbox_new (1, 1, compl_dlg_w - 2, compl_dlg_h - 2, NULL);
 
     /* add the dialog */
     add_widget (compl_dlg, compl_list);

+ 6 - 0
src/ChangeLog

@@ -1,5 +1,11 @@
 2003-09-01  Pavel Roskin  <proski@gnu.org>
 
+	* widget.c (listbox_new): Remove "action" argument.  Listboxes
+	without callbacks default to closing the dialog.  Adjust all
+	users.  This fixes double click on completion listbox.
+	* widget.h: Use uppercase names for the return values of the
+	listbox callback.
+
 	* hotlist.c (update_path_name): Avoid using global variable.
 	(l_call): Likewise.
 

+ 1 - 1
src/achown.c

@@ -260,7 +260,7 @@ do_enter_key (Dlg_head * h, int f_pos)
 			"[Advanced Chown]", title, DLG_COMPACT);
 
 	/* get new listboxes */
-	chl_list = listbox_new (1, 1, 15, 11, 0, NULL);
+	chl_list = listbox_new (1, 1, 15, 11, NULL);
 
 	listbox_add_item (chl_list, 0, 0, "<Unknown>", NULL);
 

+ 1 - 1
src/boxes.c

@@ -976,7 +976,7 @@ jobs_cmd (void)
 			   "[Background jobs]", _("Background Jobs"),
 			   DLG_CENTER);
 
-    bg_list = listbox_new (2, 3, JOBS_X-7, JOBS_Y-9, listbox_nothing, 0);
+    bg_list = listbox_new (2, 3, JOBS_X-7, JOBS_Y-9, 0);
     add_widget (jobs_dlg, bg_list);
 
 	i = n_buttons;

+ 2 - 2
src/chown.c

@@ -171,8 +171,8 @@ init_chown (void)
     }
 
     /* get new listboxes */
-    l_user = listbox_new (UY + 1, UX + 1, 19, 10, 0, NULL);
-    l_group = listbox_new (GY + 1, GX + 1, 19, 10, 0, NULL);
+    l_user = listbox_new (UY + 1, UX + 1, 19, 10, NULL);
+    l_group = listbox_new (GY + 1, GX + 1, 19, 10, NULL);
 
     /* add fields for unknown names (numbers) */
     listbox_add_item (l_user, 0, 0, _("<Unknown user>"), NULL);

+ 1 - 1
src/complete.c

@@ -980,7 +980,7 @@ complete_engine (WInput *in, int what_to_do)
     	    query_dlg = create_dlg (y, x, query_height, query_width,
 				    dialog_colors, query_callback,
 				    "[Completion]", NULL, DLG_COMPACT);
-    	    query_list = listbox_new (1, 1, w - 2, h - 2, 0, NULL);
+    	    query_list = listbox_new (1, 1, w - 2, h - 2, NULL);
     	    add_widget (query_dlg, query_list);
     	    for (p = in->completions + 1; *p; p++)
     	    	listbox_add_item (query_list, 0, 0, *p, NULL);

+ 1 - 1
src/find.c

@@ -830,7 +830,7 @@ setup_gui (void)
     add_widget (find_dlg, status_label);
 
     find_list =
-	listbox_new (2, 2, FIND2_X - 4, FIND2_Y - 9, listbox_finish, 0);
+	listbox_new (2, 2, FIND2_X - 4, FIND2_Y - 9, 0);
     add_widget (find_dlg, find_list);
 }
 

+ 6 - 6
src/hotlist.c

@@ -486,22 +486,22 @@ static int l_call (WListbox *list)
 	    if (hlp->type == HL_TYPE_ENTRY) {
 		dlg->ret_value = B_ENTER;
 		dlg_stop (dlg);
-		return listbox_finish;
+		return LISTBOX_DONE;
 	    } else {
 		hotlist_button_callback (B_ENTER);
 		hotlist_callback (dlg, '\n', DLG_POST_KEY);
-		return listbox_nothing;
+		return LISTBOX_CONT;
 	    }
 	} else {
 	    dlg->ret_value = B_ENTER;
 	    dlg_stop (dlg);
-	    return listbox_finish;
+	    return LISTBOX_DONE;
 	}
     }
 
     hotlist_button_callback (B_UP_GROUP);
     hotlist_callback (dlg, 'u', DLG_POST_KEY);
-    return listbox_nothing;
+    return LISTBOX_CONT;
 }
 
 /*
@@ -642,7 +642,7 @@ init_hotlist (int list_type)
     /* get new listbox */
     l_hotlist =
 	listbox_new (UY + 1, UX + 1, COLS - 2 * UX - 8, LINES - 14,
-		     listbox_nothing, l_call);
+		     l_call);
 
     /* Fill the hotlist with the active VFS or the hotlist */
 #ifdef USE_VFS
@@ -690,7 +690,7 @@ init_movelist (int list_type, struct hotlist *item)
     /* get new listbox */
     l_movelist =
 	listbox_new (UY + 1, UX + 1, movelist_dlg->cols - 2 * UX - 2,
-		     movelist_dlg->lines - 8, listbox_nothing, l_call);
+		     movelist_dlg->lines - 8, l_call);
 
     fill_listbox ();
 

+ 1 - 1
src/listmode.c

@@ -192,7 +192,7 @@ init_listmode (char *oldlistformat)
     radio_justify->sel = 1;
 
     /* get new listbox */
-    l_listmode = listbox_new (UY + 5, UX + 1, 16, 9, 0, NULL);
+    l_listmode = listbox_new (UY + 5, UX + 1, 16, 9, NULL);
 
     if (strncmp (oldlistformat, "full ", 5) == 0) {
 	format_width = 1;

+ 1 - 1
src/panelize.c

@@ -170,7 +170,7 @@ init_panelize (void)
 
     /* get new listbox */
     l_panelize =
-	listbox_new (UY + 1, UX + 1, panelize_dlg->cols - 12, 10, 0, NULL);
+	listbox_new (UY + 1, UX + 1, panelize_dlg->cols - 12, 10, NULL);
 
     while (current) {
 	listbox_add_item (l_panelize, 0, 0, current->label, current);

Some files were not shown because too many files changed in this diff