+
+void GEOMGUI_CreationInfoWdg::setInfo( GEOM::CreationInformationSeq& info )
+{
+ clear();
+
+ QPixmap icon;
+ QString operationName;
+
+ try
+ {
+ if ( &info )
+ {
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ for ( int j = 0, nb = info.length(); j < nb; ++j )
+ {
+ QString name = info[j].operationName.in();
+ if ( !name.isEmpty() )
+ {
+ // get plugin_name if any
+ QString plugin_name;
+ for ( size_t i = 0; i < info[j].params.length(); ++i )
+ {
+ QString value = info[j].params[i].name.in();
+ if ( value == PLUGIN_NAME )
+ plugin_name = info[j].params[i].value.in();
+ }
+ // get icon
+ QString prefix = plugin_name.isEmpty() ? "GEOM" : plugin_name;
+ icon = resMgr->loadPixmap( prefix, tr( ("ICO_"+name).toLatin1().constData() ), false );
+
+ // translate operation name
+ operationName = tr( ("MEN_"+name).toLatin1().constData() );
+ if ( operationName.startsWith( "MEN_" ))
+ operationName = name; // no translation
+
+ QTreeWidgetItem* operation = addOperation( icon, operationName );
+
+ // add parameters
+ for ( size_t i = 0; i < info[j].params.length(); ++i )
+ addParam( operation,
+ info[j].params[i].name.in(),
+ info[j].params[i].value.in() );
+ }
+ }
+ }
+ else
+ {
+ addOperation( icon, operationName );
+ }
+ }
+ catch (...)
+ {
+ }
+}