[opengtl-commits] [542] * open file from command line

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


Revision: 542
Author:   cyrille
Date:     2008-12-12 19:00:58 +0100 (Fri, 12 Dec 2008)

Log Message:
-----------
* open file from command line
* generate the parameters widget when loading a shiva file

Modified Paths:
--------------
    trunk/GTLDesigner/src/gtldesigner.cpp
    trunk/GTLDesigner/src/gtldesigner.h
    trunk/GTLDesigner/src/main.cpp


Modified: trunk/GTLDesigner/src/gtldesigner.cpp
===================================================================
--- trunk/GTLDesigner/src/gtldesigner.cpp	2008-12-12 17:55:43 UTC (rev 541)
+++ trunk/GTLDesigner/src/gtldesigner.cpp	2008-12-12 18:00:58 UTC (rev 542)
@@ -134,6 +134,7 @@
   optionsDockerDockWidget->setWidget( optionsDockerWidget );
   ui_optionsDocker = new Ui::OptionsDocker;
   ui_optionsDocker->setupUi( optionsDockerWidget );
+  connect( ui_optionsDocker->type, SIGNAL(activated(int)), SLOT(sourceChanged() ) );
   
   addDockWidget( Qt::RightDockWidgetArea, optionsDockerDockWidget );
   
@@ -180,7 +181,11 @@
 void GTLDesigner::fileOpen()
 {
   KUrl file = KFileDialog::getOpenFileName( KUrl(), "*.ctl *.shiva", this);
-  
+  openFile( file );
+}
+
+void GTLDesigner::openFile( const KUrl& file )
+{
   m_document->openUrl(file);
   updateCaption();
   
@@ -188,6 +193,7 @@
   if( suffix == "shiva" )
   {
     ui_optionsDocker->type->setCurrentIndex( 1 );
+    sourceChanged();
   } else if( suffix == "ctl" )
   {
     ui_optionsDocker->type->setCurrentIndex( 2 );

Modified: trunk/GTLDesigner/src/gtldesigner.h
===================================================================
--- trunk/GTLDesigner/src/gtldesigner.h	2008-12-12 17:55:43 UTC (rev 541)
+++ trunk/GTLDesigner/src/gtldesigner.h	2008-12-12 18:00:58 UTC (rev 542)
@@ -67,6 +67,7 @@
      * Default Destructor
      */
     virtual ~GTLDesigner();
+    void openFile( const KUrl& file );
 
 private slots:
     void fileNew();

Modified: trunk/GTLDesigner/src/main.cpp
===================================================================
--- trunk/GTLDesigner/src/main.cpp	2008-12-12 17:55:43 UTC (rev 541)
+++ trunk/GTLDesigner/src/main.cpp	2008-12-12 18:00:58 UTC (rev 542)
@@ -39,6 +39,8 @@
         }
         else
         {
+            widget->show();
+            widget->openFile( args->url( 0 ) );
             int i = 0;
             for (; i < args->count(); i++)
             {


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