[Frugalware-darcs] setup-current: select: new function: fw_cat_checklist() & selpkg()

VMiklos vmiklos at frugalware.org
Thu Mar 16 18:01:00 CET 2006


[select: new function: fw_cat_checklist() & selpkg()
VMiklos <vmiklos at frugalware.org>**20051115001459
 fw_cat_checklist() is currently just a copy of fw_checklist()
 selpkg() is just a fake function for now
] {
hunk ./src/plugins/select.c 176
+GList* fw_cat_checklist(const char *title, const char *cprompt, int height,
+	int width, int menu_height, int item_no, char **items, int flag)
+{
+	int ret;
+	char my_buffer[MAX_LEN + 1] = "";
+	char *ptr, *ptrn;
+	GList *list=NULL;
+
+	while(1)
+	{
+		dialog_vars.input_result = my_buffer;
+		ret = dialog_checklist(title, cprompt, height, width,
+			menu_height, item_no, items, flag);
+		if (ret != DLG_EXIT_CANCEL)
+			break;
+		if(exit_confirm())
+			exit_perform();
+	}
+
+	if(strlen(dialog_vars.input_result)==0)
+		// no item selected
+		return(list);
+
+	ptr=strstr(dialog_vars.input_result, "\"")+1;
+	while(strstr(ptr, "\" \""))
+	{
+		ptrn=strstr(ptr, "\" \"");
+		if(ptrn)
+		{
+			*ptrn='\0';
+			ptrn += 3;
+		}
+		list = g_list_append(list, ptr);
+		ptr=ptrn;
+	}
+	ptrn=ptr+strlen(ptr)-1;
+	*ptrn='\0';
+	list = g_list_append(list, strdup(ptr));
+	return(list);
+}
+
+GList *selpkg(char *category)
+{
+	// XXX
+	dialog_msgbox("TODO", category, 0, 0, 1);
+	return(NULL);
+}
+
hunk ./src/plugins/select.c 285
-	ret = fw_checklist(_("Selecting categories"),
+	ret = fw_cat_checklist(_("Selecting categories"),
}


More information about the Frugalware-darcs mailing list