Commit f869561c authored by Jan Möbius's avatar Jan Möbius

Scripting function to add viewmodes



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6330 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 55920b04
......@@ -1182,11 +1182,22 @@ void Core::setDescriptions(){
QString("Toolbox Entry name,Widget").split(","),
QString("Name of the new widget in the toolbox,Pointer to the new widget").split(","));
emit setSlotDescription("addViewMode(QString,QString)", "Add a new viewmode",
QString("Name,Toolbox List").split(","),
QString("Name of the new Viewmode, ; seperated list of toolboxes visible in this viewmode").split(","));
}
void Core::addViewMode(QString _modeName, QString _toolboxList) {
QStringList list = _toolboxList.split(";");
coreWidget_->slotAddViewMode(_modeName,list);
}
void Core::addToolbox(QString _name ,QWidget* _widget) {
int id = -1;
// Find the plugin which added this Toolbox
for ( uint i = 0 ; i < plugins.size(); ++i ) {
if ( plugins[i].plugin == sender() ) {
id = i;
......@@ -1194,6 +1205,7 @@ void Core::addToolbox(QString _name ,QWidget* _widget) {
}
}
// Find the scripting plugin because we assign this toolBox to it as we did not find the original sender
if ( id == -1 ) {
for ( uint i = 0 ; i < plugins.size(); ++i ) {
if ( plugins[i].name == "Scripting" ) {
......
......@@ -375,6 +375,19 @@ public slots:
/// write the current versions of all plugins to ini file
void writeVersionNumbers(QString _filename);
//===========================================================================
/** @name Scripting functions for controlling view modes
* @{ */
//===========================================================================
public slots:
/** \brief Scripting function to add a nev viewMode
@param _modeName Name of the new View Mode
@param _toolboxList ; seperated list of toolboxes in the view mode
*/
void addViewMode(QString _modeName, QString _toolboxList);
/** @} */
//===========================================================================
......
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