Salome HOME
PR : merge branch V1_2c dans branche principale pour V1_3_0_b1
[modules/kernel.git] / src / SALOMEGUI / QAD_ObjectBrowser.cxx
index 9d992471aa17fe2ca39a4d3be01764fe0572a41e..7bea424c0ac0b22bdf375c349ea9ed29abcb7ee5 100644 (file)
@@ -688,8 +688,8 @@ void QAD_ObjectBrowser::Update( SALOMEDS::SObject_ptr SO,
              QString msg;
              QAD_ResourceMgr* resMgr = QAD_Desktop::createResourceManager();
              if ( resMgr ) {
-               if(resMgr->loadResources( QString(aFatherName->Value()) + "GUI", msg )) {
-                 QPixmap icon ( resMgr->loadPixmap( QString(aFatherName->Value()) + "GUI",
+               if(resMgr->loadResources( QAD_Application::getDesktop()->getComponentName(QString(aFatherName->Value())), msg )) {
+                 QPixmap icon ( resMgr->loadPixmap( QAD_Application::getDesktop()->getComponentName(QString(aFatherName->Value())),
                                                     tr(aPixmap->GetPixMap()) /*tr( "ICON_OBJBROWSER_" + theComponent )*/ ));
                  Item->setPixmap( 0, icon );
                }
@@ -712,6 +712,9 @@ void QAD_ObjectBrowser::Update( SALOMEDS::SObject_ptr SO,
 */
 void QAD_ObjectBrowser::Update()
 {
+  int x = myListView->contentsX();
+  int y = myListView->contentsY();
+
   myListView->clear();
   myListViewMap.clear();
 
@@ -823,8 +826,8 @@ void QAD_ObjectBrowser::Update()
          if ( resMgr ) {
            MESSAGE ( " Component " << aName->Value() )
              MESSAGE ( " Icon " << aPixmap->GetPixMap() )
-           if(resMgr->loadResources( QString(aName->Value()) + "GUI", msg )) {
-             QPixmap icon ( resMgr->loadPixmap( QString(aName->Value()) + "GUI",
+           if(resMgr->loadResources( QAD_Application::getDesktop()->getComponentName(QString(aName->Value())), msg )) {
+             QPixmap icon ( resMgr->loadPixmap( QAD_Application::getDesktop()->getComponentName(QString(aName->Value())),
                                                 tr(aPixmap->GetPixMap()) /*tr( "ICON_OBJBROWSER_" + theComponent )*/ ));
              Item->setPixmap( 0, icon );
            }
@@ -844,6 +847,8 @@ void QAD_ObjectBrowser::Update()
   }
   /* Updating UseCase Browser ============================================= */
   UpdateUseCaseBrowser();
+
+  myListView->setContentsPos(x,y);
 }
 
 /*!
@@ -1049,8 +1054,8 @@ void QAD_ObjectBrowser::UpdateUCItem( SALOMEDS::SObject_var UCObject, QAD_Object
            QAD_ResourceMgr* resMgr = QAD_Desktop::getResourceManager();
            if ( resMgr ) {
              QString msg;
-             if( resMgr->loadResources( QString( aFatherName->Value() ) + "GUI", msg ) ) {
-               QPixmap icon ( resMgr->loadPixmap( QString( aFatherName->Value() ) + "GUI",
+             if( resMgr->loadResources( QAD_Application::getDesktop()->getComponentName(QString( aFatherName->Value() )), msg ) ) {
+               QPixmap icon ( resMgr->loadPixmap( QAD_Application::getDesktop()->getComponentName(QString( aFatherName->Value() )),
                                                   tr( aPixmap->GetPixMap() ) /*tr( "ICON_OBJBROWSER_" + theComponent )*/ ) );
                UCSubItem->setPixmap( 0, icon );
              }