[opengtl-commits] [539] * add an options docker (to select between shiva/ctl)

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 539
Author:   cyrille
Date:     2008-12-10 23:39:46 +0100 (Wed, 10 Dec 2008)

Log Message:
-----------
* add an options docker (to select between shiva/ctl)
* add a parameters docker for embedding a kernel parameters widget
* use libQtGTL

Modified Paths:
--------------
    trunk/GTLDesigner/CMakeLists.txt
    trunk/GTLDesigner/src/CMakeLists.txt
    trunk/GTLDesigner/src/gtldesigner.cpp
    trunk/GTLDesigner/src/gtldesigner.h
    trunk/GTLDesigner/src/gtldesignerui.rc

Added Paths:
-----------
    trunk/GTLDesigner/cmake/modules/FindQtGTL.cmake
    trunk/GTLDesigner/cmake/modules/FindQtShiva.cmake
    trunk/GTLDesigner/src/OptionsDocker.ui

Removed Paths:
-------------
    trunk/GTLDesigner/src/QtGTL.h


Modified: trunk/GTLDesigner/CMakeLists.txt
===================================================================
--- trunk/GTLDesigner/CMakeLists.txt	2008-12-10 22:38:32 UTC (rev 538)
+++ trunk/GTLDesigner/CMakeLists.txt	2008-12-10 22:39:46 UTC (rev 539)
@@ -7,6 +7,8 @@
 find_package(OpenCTL REQUIRED)
 find_package(OpenShiva REQUIRED)
 find_package(GTLImageIO REQUIRED)
+find_package(QtGTL REQUIRED)
+find_package(QtShiva REQUIRED)
 find_package(KDE4 REQUIRED)
 include (KDE4Defaults)
 

Added: trunk/GTLDesigner/cmake/modules/FindQtGTL.cmake
===================================================================
--- trunk/GTLDesigner/cmake/modules/FindQtGTL.cmake	                        (rev 0)
+++ trunk/GTLDesigner/cmake/modules/FindQtGTL.cmake	2008-12-10 22:39:46 UTC (rev 539)
@@ -0,0 +1,35 @@
+
+INCLUDE(UsePkgConfig)
+PKGCONFIG(QtGTL _QtGTLIncDir _QtGTLLinkDir _QtGTLLinkFlags _QtGTLCflags)
+
+set(QTGTL_DEFINITIONS ${_QtGTLCflags})
+set(QTGTL_LIBRARIES ${_QtGTLLinkFlags})
+set(QTGTL_INCLUDE_DIR ${_QtGTLIncDir})
+
+if(QTGTL_DEFINITIONS AND QTGTL_LIBRARIES)
+
+  FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/bin/ /usr/local/bin )
+
+  # query pkg-config asking for QtGTL >= 0.9.0
+  EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.9.0 QtGTL RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
+
+  if(_return_VALUE STREQUAL "0")
+    set(QTGTL_FOUND TRUE)
+    set(HAVE_QTGTL TRUE)
+  else(_return_VALUE STREQUAL "0")
+    message(STATUS "QtGTL >= 0.9.0 was found")
+  endif(_return_VALUE STREQUAL "0")
+endif(QTGTL_DEFINITIONS AND QTGTL_LIBRARIES)
+
+if (QTGTL_FOUND)
+    if (NOT QTGTL_FIND_QUIETLY)
+        message(STATUS "Found QtGTL: ${QTGTL_LIBRARIES}")
+    endif (NOT QTGTL_FIND_QUIETLY)
+else (OPENShiva_FOUND)
+    if (NOT QtGTL_FIND_QUIETLY)
+        message(STATUS "QtGTL was NOT found.")
+    endif (NOT QtGTL_FIND_QUIETLY)
+    if (QtGTL_FIND_REQUIRED)
+        message(FATAL_ERROR "Could NOT find QtGTL")
+    endif (QtGTL_FIND_REQUIRED)
+endif (QTGTL_FOUND)

Added: trunk/GTLDesigner/cmake/modules/FindQtShiva.cmake
===================================================================
--- trunk/GTLDesigner/cmake/modules/FindQtShiva.cmake	                        (rev 0)
+++ trunk/GTLDesigner/cmake/modules/FindQtShiva.cmake	2008-12-10 22:39:46 UTC (rev 539)
@@ -0,0 +1,35 @@
+
+INCLUDE(UsePkgConfig)
+PKGCONFIG(QtShiva _QtShivaIncDir _QtShivaLinkDir _QtShivaLinkFlags _QtShivaCflags)
+
+set(QTSHIVA_DEFINITIONS ${_QtShivaCflags})
+set(QTSHIVA_LIBRARIES ${_QtShivaLinkFlags})
+set(QTSHIVA_INCLUDE_DIR ${_QtShivaIncDir})
+
+if(QTSHIVA_DEFINITIONS AND QTSHIVA_LIBRARIES)
+
+  FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/bin/ /usr/local/bin )
+
+  # query pkg-config asking for QtShiva >= 0.9.0
+  EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.9.0 QtShiva RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
+
+  if(_return_VALUE STREQUAL "0")
+    set(QTSHIVA_FOUND TRUE)
+    set(HAVE_QTSHIVA TRUE)
+  else(_return_VALUE STREQUAL "0")
+    message(STATUS "QtShiva >= 0.9.0 was found")
+  endif(_return_VALUE STREQUAL "0")
+endif(QTSHIVA_DEFINITIONS AND QTSHIVA_LIBRARIES)
+
+if (QTSHIVA_FOUND)
+    if (NOT QTSHIVA_FIND_QUIETLY)
+        message(STATUS "Found QtShiva: ${QTSHIVA_LIBRARIES}")
+    endif (NOT QTSHIVA_FIND_QUIETLY)
+else (QTSHIVA_FOUND)
+    if (NOT QtShiva_FIND_QUIETLY)
+        message(STATUS "QtShiva was NOT found.")
+    endif (NOT QtShiva_FIND_QUIETLY)
+    if (QtShiva_FIND_REQUIRED)
+        message(FATAL_ERROR "Could NOT find QtShiva")
+    endif (QtShiva_FIND_REQUIRED)
+endif (QTSHIVA_FOUND)

Modified: trunk/GTLDesigner/src/CMakeLists.txt
===================================================================
--- trunk/GTLDesigner/src/CMakeLists.txt	2008-12-10 22:38:32 UTC (rev 538)
+++ trunk/GTLDesigner/src/CMakeLists.txt	2008-12-10 22:39:46 UTC (rev 539)
@@ -1,4 +1,4 @@
-include_directories(${OPENSHIVA_INCLUDE_DIR} ${OPENCTL_LIBRARIES})
+include_directories(${OPENSHIVA_INCLUDE_DIR} ${OPENCTL_LIBRARIES} ${QTGTL_INCLUDE_DIR} ${QTSHIVA_INCLUDE_DIR})
 
 set(gtldesigner_SRCS
    gtldesigner.cpp
@@ -7,13 +7,17 @@
    ErrorMessagesModel.cpp
  )
 
-kde4_add_ui_files(gtldesigner_SRCS gtldesignerview_base.ui prefs_base.ui ImagesDocker.ui)
+kde4_add_ui_files( gtldesigner_SRCS
+  gtldesignerview_base.ui
+  prefs_base.ui
+  ImagesDocker.ui
+  OptionsDocker.ui )
 
 kde4_add_kcfg_files(gtldesigner_SRCS settings.kcfgc )
 
 kde4_add_executable(gtldesigner ${gtldesigner_SRCS})
 
-target_link_libraries(gtldesigner ${KDE4_KDEUI_LIBS} ${KDE4_KTEXTEDITOR_LIBS}  ${OPENSHIVA_LIBRARIES}  ${OPENCTL_LIBRARIES} ${GTLIMAGEIO_LIBRARIES})
+target_link_libraries(gtldesigner ${KDE4_KDEUI_LIBS} ${KDE4_KTEXTEDITOR_LIBS}  ${OPENSHIVA_LIBRARIES}  ${OPENCTL_LIBRARIES} ${GTLIMAGEIO_LIBRARIES} ${QTGTL_LIBRARIES} ${QTSHIVA_LIBRARIES})
 
 install(TARGETS gtldesigner DESTINATION ${BIN_INSTALL_DIR} )
 

Added: trunk/GTLDesigner/src/OptionsDocker.ui
===================================================================
--- trunk/GTLDesigner/src/OptionsDocker.ui	                        (rev 0)
+++ trunk/GTLDesigner/src/OptionsDocker.ui	2008-12-10 22:39:46 UTC (rev 539)
@@ -0,0 +1,83 @@
+<ui version="4.0" >
+ <class>OptionsDocker</class>
+ <widget class="QWidget" name="OptionsDocker" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>311</width>
+    <height>114</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout" >
+   <item row="0" column="0" >
+    <widget class="QLabel" name="label_2" >
+     <property name="text" >
+      <string>Type:</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1" >
+    <widget class="QComboBox" name="type" >
+     <item>
+      <property name="text" >
+       <string>Unknown</string>
+      </property>
+     </item>
+     <item>
+      <property name="text" >
+       <string>Shiva</string>
+      </property>
+     </item>
+     <item>
+      <property name="text" >
+       <string>CTL</string>
+      </property>
+     </item>
+    </widget>
+   </item>
+   <item row="1" column="0" >
+    <widget class="QLabel" name="label" >
+     <property name="text" >
+      <string>Optimization:</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1" >
+    <widget class="QSpinBox" name="spinBox" >
+     <property name="maximum" >
+      <number>4</number>
+     </property>
+     <property name="value" >
+      <number>2</number>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0" colspan="2" >
+    <widget class="QPushButton" name="pushButton" >
+     <property name="text" >
+      <string>Add Libraries Directory</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0" >
+    <spacer name="verticalSpacer" >
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0" >
+      <size>
+       <width>20</width>
+       <height>3</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

Deleted: trunk/GTLDesigner/src/QtGTL.h
===================================================================
--- trunk/GTLDesigner/src/QtGTL.h	2008-12-10 22:38:32 UTC (rev 538)
+++ trunk/GTLDesigner/src/QtGTL.h	2008-12-10 22:39:46 UTC (rev 539)
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either 
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public 
- * License along with this library.  If not, see <http://www.gnu.org/licenses/>. */
-
-
-#ifndef _QTGTL_H_
-#define _QTGTL_H_
-
-#include <QImage>
-#include <GTLCore/Buffer.h>
-#include <GTLCore/BufferImage.h>
-#include <GTLCore/PixelDescription.h>
-#include <GTLCore/Type.h>
-
-class QImageBuffer : public GTLCore::Buffer {
-  public:
-    QImageBuffer(const QImage& img) : m_image(img) { }
-    ~QImageBuffer() {}
-    virtual char * rawData() { return (char*)m_image.bits(); }
-    virtual const char * rawData() const { return (const char*)m_image.bits(); }
-    virtual int size() const { return m_image.numBytes(); }
-    QImage image() const { return m_image; }
-  private:
-    QImage m_image;
-};
-
-class QImageImage : public GTLCore::BufferImage {
-  public:
-    QImageImage(const QImage& img) : BufferImage( img.width(), img.height(), new QImageBuffer( img ), imageToPixelDescription( img ) )
-    {
-    }
-    ~QImageImage() {}
-    QImage image() const { return static_cast<const QImageBuffer*>(buffer())->image(); }
-  private:
-    GTLCore::PixelDescription imageToPixelDescription( const QImage& img )
-    {
-      switch( img.format())
-      {
-        case QImage::Format_RGB32:
-          return GTLCore::PixelDescription( GTLCore::Type::UnsignedInteger8, 4 );
-        case QImage::Format_ARGB32:
-          return GTLCore::PixelDescription( GTLCore::Type::UnsignedInteger8, 4 );
-        case QImage::Format_RGB888:
-          return GTLCore::PixelDescription( GTLCore::Type::UnsignedInteger8, 3 );
-        default:
-          qFatal("Unsupported QImage");
-      }
-    }
-};
-
-
-#endif

Modified: trunk/GTLDesigner/src/gtldesigner.cpp
===================================================================
--- trunk/GTLDesigner/src/gtldesigner.cpp	2008-12-10 22:38:32 UTC (rev 538)
+++ trunk/GTLDesigner/src/gtldesigner.cpp	2008-12-10 22:39:46 UTC (rev 539)
@@ -17,7 +17,7 @@
 #include "gtldesigner.h"
 #include "settings.h"
 
-#include "QtGTL.h"
+#include "QtGTL/QImageImage.h"
 
 #include <QDockWidget>
 #include <QListView>
@@ -43,19 +43,25 @@
 #include <ktexteditor/configpage.h>
 #include <ktexteditor/cursor.h>
 
-#include <OpenShiva/Kernel.h>
-#include <OpenCTL/Module.h>
-#include <OpenCTL/Program.h>
+#include <GTLCore/PixelDescription.h>
 #include <GTLCore/Region.h>
+
 #include <GTLImageIO/ImageDCRegistry.h>
 #include <GTLImageIO/ImageDC.h>
 
+#include <OpenShiva/Kernel.h>
+#include <OpenCTL/Module.h>
+#include <OpenCTL/Program.h>
+
+#include <QtShiva/ParametersWidget.h>
+
 #include "ImageViewer.h"
 #include "ErrorMessagesModel.h"
 
 GTLDesigner::GTLDesigner()
     : KXmlGuiWindow(),
       m_view(0),
+      m_kernel( new OpenShiva::Kernel(4)),
       m_printer(0)
 {
     // accept dnd
@@ -65,6 +71,8 @@
     m_document = editor->createDocument(this);
     connect( m_document, SIGNAL(documentNameChanged( KTextEditor::Document *) ), SLOT(updateCaption()) );
     connect( m_document, SIGNAL(textChanged( KTextEditor::Document *) ), SLOT(updateCaption()) );
+    connect( m_document, SIGNAL(textChanged( KTextEditor::Document *) ), SLOT(sourceChanged()) );
+    
     m_view = qobject_cast<KTextEditor::View*>(m_document->createView(this));
     
     QMetaObject::invokeMethod(m_view, "toggleLineNumbersOn", Qt::DirectConnection );
@@ -95,28 +103,47 @@
 
 void GTLDesigner::setupDockers()
 {
-    QDockWidget* errorMessagesDockWidget = new QDockWidget(i18n("Error messages"), this);
-    errorMessagesDockWidget->setObjectName( "ErrorMessagesDocker" );
-    m_listView = new QListView( errorMessagesDockWidget );
-    errorMessagesDockWidget->setWidget( m_listView );
-    connect( m_listView, SIGNAL(activated(const QModelIndex &)),
-             SLOT( errorLineActivated(const QModelIndex&)) );
-    connect( m_listView, SIGNAL(clicked(const QModelIndex &)),
-             SLOT( errorLineActivated(const QModelIndex&)) );
-    addDockWidget( Qt::BottomDockWidgetArea, errorMessagesDockWidget );
+  // Error message
+  QDockWidget* errorMessagesDockWidget = new QDockWidget(i18n("Error messages"), this);
+  errorMessagesDockWidget->setObjectName( "ErrorMessagesDocker" );
+  m_listView = new QListView( errorMessagesDockWidget );
+  errorMessagesDockWidget->setWidget( m_listView );
+  connect( m_listView, SIGNAL(activated(const QModelIndex &)),
+            SLOT( errorLineActivated(const QModelIndex&)) );
+  connect( m_listView, SIGNAL(clicked(const QModelIndex &)),
+            SLOT( errorLineActivated(const QModelIndex&)) );
+  addDockWidget( Qt::BottomDockWidgetArea, errorMessagesDockWidget );
     
-    QDockWidget* imagesDockerDockWidget = new QDockWidget(i18n("Images"), this);
-    imagesDockerDockWidget->setObjectName("ImagesDocker");
-    QWidget* imagesDockerWidget = new QWidget( imagesDockerDockWidget );
-    imagesDockerDockWidget->setWidget( imagesDockerWidget );
-    ui_imagesDocker = new Ui::ImagesDocker;
-    ui_imagesDocker->setupUi( imagesDockerWidget );
-    
-    connect(ui_imagesDocker->buttonAdd, SIGNAL(released()), SLOT(addImage()));
-    connect(ui_imagesDocker->buttonRemove, SIGNAL(released()), SLOT(removeImage()));
-    
-    addDockWidget( Qt::RightDockWidgetArea, imagesDockerDockWidget );
-    
+  // Images docker
+  QDockWidget* imagesDockerDockWidget = new QDockWidget(i18n("Images"), this);
+  imagesDockerDockWidget->setObjectName("ImagesDocker");
+  QWidget* imagesDockerWidget = new QWidget( imagesDockerDockWidget );
+  imagesDockerDockWidget->setWidget( imagesDockerWidget );
+  ui_imagesDocker = new Ui::ImagesDocker;
+  ui_imagesDocker->setupUi( imagesDockerWidget );
+  
+  connect(ui_imagesDocker->buttonAdd, SIGNAL(released()), SLOT(addImage()));
+  connect(ui_imagesDocker->buttonRemove, SIGNAL(released()), SLOT(removeImage()));
+  
+  addDockWidget( Qt::RightDockWidgetArea, imagesDockerDockWidget );
+  
+  // Options docker
+  QDockWidget* optionsDockerDockWidget = new QDockWidget(i18n("Options"), this);
+  optionsDockerDockWidget->setObjectName("OptionsDocker");
+  QWidget* optionsDockerWidget = new QWidget( optionsDockerDockWidget );
+  optionsDockerDockWidget->setWidget( optionsDockerWidget );
+  ui_optionsDocker = new Ui::OptionsDocker;
+  ui_optionsDocker->setupUi( optionsDockerWidget );
+  
+  addDockWidget( Qt::RightDockWidgetArea, optionsDockerDockWidget );
+  
+  // Parameters docker
+  QDockWidget* parametersDockerDockWidget = new QDockWidget(i18n("Parameters"), this);
+  parametersDockerDockWidget->setObjectName("ParametersDocker");
+  m_parametersWidget = new QtShiva::ParametersWidget( parametersDockerDockWidget );
+  parametersDockerDockWidget->setWidget( m_parametersWidget );
+  
+  addDockWidget( Qt::RightDockWidgetArea, parametersDockerDockWidget );
 }
 
 void GTLDesigner::setupActions()
@@ -138,12 +165,6 @@
     KAction* actionExecuteRun = new KAction(i18n("Run"), this );
     connect( actionExecuteRun, SIGNAL(triggered()), SLOT(executeRun()));
     actionCollection()->addAction( QLatin1String("execute_run"), actionExecuteRun );
-    KAction* actionExecuteRunCTL = new KAction(i18n("Run as CTL"), this );
-    connect( actionExecuteRunCTL, SIGNAL(triggered()), SLOT(executeCTL()));
-    actionCollection()->addAction( QLatin1String("execute_run_as_ctl"), actionExecuteRunCTL );
-    KAction* actionExecuteRunShiva = new KAction(i18n("Run as Shiva"), this );
-    connect( actionExecuteRunShiva, SIGNAL(triggered()), SLOT(executeShiva()));
-    actionCollection()->addAction( QLatin1String("execute_run_as_shiva"), actionExecuteRunShiva );
 }
 
 void GTLDesigner::fileNew()
@@ -162,6 +183,18 @@
   
   m_document->openUrl(file);
   updateCaption();
+  
+  QString suffix = QFileInfo( m_document->url().fileName() ).suffix();
+  if( suffix == "shiva" )
+  {
+    ui_optionsDocker->type->setCurrentIndex( 1 );
+  } else if( suffix == "ctl" )
+  {
+    ui_optionsDocker->type->setCurrentIndex( 2 );
+  } else {
+    ui_optionsDocker->type->setCurrentIndex( 0 );
+  }
+
 }
 
 void GTLDesigner::fileSave()
@@ -178,17 +211,19 @@
 
 void GTLDesigner::executeRun()
 {
-  QString suffix = QFileInfo( m_document->url().fileName() ).suffix();
-  if( suffix == "shiva" )
+  switch( ui_optionsDocker->type->currentIndex() )
   {
-    executeShiva();
-  } else if( suffix == "ctl" )
-  {
-    executeCTL();
-  } else {
-    KMessageBox::error( this, "Can't find an interpreter");
+    case 1:
+      executeShiva();
+      break;
+    case 2:
+      executeCTL();
+      break;
+    default:
+      KMessageBox::error( this, "Unknow interpreter");
   }
 }
+
 void GTLDesigner::executeCTL()
 {
   if( ui_imagesDocker->listImages->count() < 1 )
@@ -229,7 +264,7 @@
         for( int j = 0; j < region.height(); ++j)
         {
           quint8* px = reinterpret_cast<quint8*>(image->data(i, j ));
-          QRgb rgb;
+          QRgb rgb = 0;
           switch( image->pixelDescription().channels() )
           {
             case 4:
@@ -259,15 +294,13 @@
 }
 void GTLDesigner::executeShiva()
 {
-  OpenShiva::Kernel p("", 4);
-  p.setSource( m_document->text().toAscii ().data() );
-  p.compile();
-  if(p.isCompiled())
+  m_kernel->compile();
+  if(m_kernel->isCompiled())
   {
     GTLCore::Region region(0,0,800,600);
-    if( p.hasGeneratedFunction() )
+    if( m_kernel->hasGeneratedFunction() )
     {
-      region = p.generated();
+      region = m_kernel->generated();
     }
     std::list<GTLCore::AbstractImage*> inputImages;
     std::list<GTLCore::Region> inputDOD;
@@ -292,17 +325,17 @@
       inputImages.push_back( image );
       inputDOD.push_back( region );
     }
-    if( p.hasChangedFunction() )
+    if( m_kernel->hasChangedFunction() )
     {
       int i = 0;
       for( std::list<GTLCore::Region>::iterator it = inputDOD.begin(); it != inputDOD.end(); ++it, ++i)
       {
-        region += p.changed( *it, i, inputDOD );
+        region += m_kernel->changed( *it, i, inputDOD );
       }
     }
     kDebug() << region.width() << " " << region.height();
-    QImageImage image( QImage( region.width(), region.height(), QImage::Format_ARGB32) );
-    p.evaluatePixeles( region, inputImages, &image );
+    QtGTL::QImageImage image( QImage( region.width(), region.height(), QImage::Format_ARGB32) );
+    m_kernel->evaluatePixeles( region, inputImages, &image );
     showImage( image.image() );
     for( std::list<GTLCore::AbstractImage*>::iterator it = inputImages.begin();
          it != inputImages.end(); ++it)
@@ -310,7 +343,7 @@
       delete *it;
     }
   } else {
-    m_listView->setModel( new ErrorMessagesModel( p.compilationErrors() ) );
+    m_listView->setModel( new ErrorMessagesModel( m_kernel->compilationErrors() ) );
   }
 }
 
@@ -377,4 +410,13 @@
   delete ui_imagesDocker->listImages->currentItem();
 }
 
+void GTLDesigner::sourceChanged()
+{
+  if( ui_optionsDocker->type->currentIndex() == 1 )
+  {
+    m_kernel->setSource( m_document->text().toAscii ().data() );
+    m_parametersWidget->setKernel( m_kernel );
+  }
+}
+
 #include "gtldesigner.moc"

Modified: trunk/GTLDesigner/src/gtldesigner.h
===================================================================
--- trunk/GTLDesigner/src/gtldesigner.h	2008-12-10 22:38:32 UTC (rev 538)
+++ trunk/GTLDesigner/src/gtldesigner.h	2008-12-10 22:39:46 UTC (rev 539)
@@ -22,6 +22,7 @@
 
 #include "ui_prefs_base.h"
 #include "ui_ImagesDocker.h"
+#include "ui_OptionsDocker.h"
 
 class GTLDesignerView;
 class QPrinter;
@@ -37,6 +38,14 @@
   class View;
 }
 
+namespace QtShiva {
+  class ParametersWidget;
+}
+
+namespace OpenShiva {
+  class Kernel;
+}
+
 /**
  * This class serves as the main window for GTLDesigner.  It handles the
  * menus, toolbars, and status bars.
@@ -74,6 +83,8 @@
     void addImage();
     void removeImage();
     
+    void sourceChanged();
+    
     void errorLineActivated(const QModelIndex& index);
 private:
     void setupActions();
@@ -85,6 +96,9 @@
     
     Ui::prefs_base ui_prefs_base ;
     Ui::ImagesDocker* ui_imagesDocker;
+    Ui::OptionsDocker* ui_optionsDocker;
+    QtShiva::ParametersWidget* m_parametersWidget;
+    OpenShiva::Kernel* m_kernel;
 
     QPrinter   *m_printer;
     KToggleAction *m_toolbarAction;

Modified: trunk/GTLDesigner/src/gtldesignerui.rc
===================================================================
--- trunk/GTLDesigner/src/gtldesignerui.rc	2008-12-10 22:38:32 UTC (rev 538)
+++ trunk/GTLDesigner/src/gtldesignerui.rc	2008-12-10 22:39:46 UTC (rev 539)
@@ -3,8 +3,6 @@
 <MenuBar>
   <Menu name="execute"><text>&amp;Execute</text>
     <Action name="execute_run" />
-    <Action name="execute_run_as_shiva" />
-    <Action name="execute_run_as_ctl" />
   </Menu>
   <Menu name="settings"><text>&amp;Settings</text>
     <Action name="configure_editor" />


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/