Commit 04d98875 authored by Mike Kremer's avatar Mike Kremer

Added getObjectId(QString) to core scripting functions.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6629 383ad7c9-94d9-4d36-a494-682f7c89f535
parent aea267da
......@@ -182,6 +182,14 @@ bool getObject( const int _identifier , BaseObjectData*& _object ) {
return ( _object != 0 );
}
int getObjectId( const QString _name ) {
if(_name.isEmpty()) return -1;
BaseObject* object = objectRoot_->childExists( _name );
return object->id();
}
// ===============================================================================
// ===============================================================================
......
......@@ -133,6 +133,11 @@ bool getObject( const int _identifier , BaseObject*& _object );
DLLEXPORT
bool getObject( const int _identifier , BaseObjectData*& _object );
/** This functions returns the object's id with the given name.
*/
DLLEXPORT
int getObjectId( const QString _name );
/** \brief Check if an object with this identifier exists.
*
* Searches through the Data containers and checks if the object with the given identifier exists
......
......@@ -508,6 +508,9 @@ private:
/// Load status from file
void loadSettings(QString _filename);
/// Get object id from filename
int getObjectId(QString _filename);
/** @} */
//===========================================================================
......
......@@ -105,6 +105,13 @@ void Core::createWidget(QString _objectName, QString _uiFilename) {
//-----------------------------------------------------------------------------
int Core::getObjectId( const QString _name ) {
return PluginFunctions::getObjectId(_name);
}
//-----------------------------------------------------------------------------
void Core::setViewMode(QString _viewMode){
if ( OpenFlipper::Options::gui() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment