(* Guestfs Browser. * Copyright (C) 2011 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *) open Utils let rec file_information tree path = let model = tree#model in let row = model#get_iter path in let src, pathname = tree#get_pathname row in debug "file_information %s" pathname; (* See if this node already has an Info "file_information" child * node. If so they don't recreate it. *) let info_text = "file_information" in if not (tree#has_child_info_node path info_text) then ( tree#set_child_info_node path info_text "Calculating file information ..."; Slave.file_information src pathname (when_file_information tree path pathname) ) and when_file_information tree path pathname fileinfo = let model = tree#model in let row = model#get_iter path in tree#set_visited row; (* Find the child node added above, and replace the text. *) let info_text = "file_information" in let msg = markup_escape fileinfo in tree#set_child_info_node path info_text msg