// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include <qstring.h>
#include "SUIT_Application.h"
#include "SUIT_Session.h"
-#include "SalomeApp_SelectionMgr.h"
+#include "LightApp_SelectionMgr.h"
#include "SalomeApp_Application.h"
#include "SalomeApp_Module.h"
#include "SalomeApp_Study.h"
return theModule->application()->desktop();
}
- SalomeApp_SelectionMgr*
+ LightApp_SelectionMgr*
GetSelectionMgr(const SalomeApp_Module* theModule)
{
return theModule->getApp()->selectionMgr();
}
+ SUIT_ResourceMgr*
+ GetResourceMgr( const SalomeApp_Module* )
+ {
+ return SUIT_Session::session()->resourceMgr();
+ }
_PTR(Study)
GetCStudy(const SalomeApp_Study* theStudy)
}
CORBA::Object_var
- DataOwnerToObject(const SalomeApp_DataOwnerPtr& theOwner)
+ DataOwnerToObject(const LightApp_DataOwnerPtr& theOwner)
{
CORBA::Object_var anObj;
if(theOwner){
{
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
(SUIT_Session::session()->activeApplication());
- if (app && app->activeViewManager())
- return app->activeViewManager()->getActiveView();
+ if (app && app->desktop() )
+ return app->desktop()->activeWindow();
else
return NULL;
}
if (aComment)
aComment->SetValue(theValue);
}
+
+ void setFileName (_PTR(SObject) theSObject, const char* theValue)
+ {
+ _PTR(Study) aStudy = GetActiveStudyDocument();
+ if (aStudy->GetProperties()->IsLocked())
+ return;
+ _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
+ _PTR(GenericAttribute) anAttr =
+ aBuilder->FindOrCreateAttribute(theSObject, "AttributeExternalFileDef");
+ _PTR(AttributeExternalFileDef) aFileName = anAttr;
+ if (aFileName)
+ aFileName->SetValue(theValue);
+ }
+
+ void setFileType (_PTR(SObject) theSObject, const char* theValue)
+ {
+ _PTR(Study) aStudy = GetActiveStudyDocument();
+ if (aStudy->GetProperties()->IsLocked())
+ return;
+ _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
+ _PTR(GenericAttribute) anAttr =
+ aBuilder->FindOrCreateAttribute(theSObject, "AttributeFileType");
+ _PTR(AttributeFileType) aFileType = anAttr;
+ if (aFileType)
+ aFileType->SetValue(theValue);
+ }
CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject,
_PTR(Study) theStudy)
return app->orb()->string_to_object(theIOR);
}
- int GetNameOfSelectedIObjects(SalomeApp_SelectionMgr* theMgr, QString& theName)
+ int GetNameOfSelectedIObjects(LightApp_SelectionMgr* theMgr, QString& theName)
{
if (!theMgr)
return 0;