Update detailpanel.cpp

make it more generic