[115758] trunk/dports/science/geant4

mojca at macports.org mojca at macports.org
Fri Jan 10 13:56:42 PST 2014


Revision: 115758
          https://trac.macports.org/changeset/115758
Author:   mojca at macports.org
Date:     2014-01-10 13:56:42 -0800 (Fri, 10 Jan 2014)
Log Message:
-----------
geant4.10.0: new port (new version of geant4)

Modified Paths:
--------------
    trunk/dports/science/geant4/Portfile
    trunk/dports/science/geant4/files/patch-cmake-Modules-Geant4BuildProjectConfig.cmake.4100.diff
    trunk/dports/science/geant4/files/patch-cmake-Modules-Geant4InterfaceOptions.cmake.4100.diff
    trunk/dports/science/geant4/files/patch-source-interfaces-common-src-G4Qt.cc.diff

Removed Paths:
-------------
    trunk/dports/science/geant4/files/patch-upstream-qt.4100.diff

Modified: trunk/dports/science/geant4/Portfile
===================================================================
--- trunk/dports/science/geant4/Portfile	2014-01-10 21:40:16 UTC (rev 115757)
+++ trunk/dports/science/geant4/Portfile	2014-01-10 21:56:42 UTC (rev 115758)
@@ -34,19 +34,20 @@
 set geant.versions_info {
      9.5  0  0  2  4.9.5.p02    33413f6233b75c003254af5888f4af32d17f515d  adb04fce9472228bb10d78cbc7f40493bfb37454beee22e7c80d630646cd3777
      9.6  0  0  2  4.9.6.p02    9ae32c3f8769e303b41df164693f77a74ca6db97  cf5df83b7e2c99e6729449b32d3ecb0727b4692317426b66fc7fd41951c7351f
+    10.0  1  0  0  4.10.00      cd8bb26e251f07ce8d6fa6e91062a1b70206b9ef  ffec1714b03748b6d691eb0b91906f4c74422c1ad1f8afa918e03be421af8a17
 }
-# temporary disabled beta version (until the official version gets released)
-#   10.0  0  0  0  4.10.00.b01  14820eca2893ffa7a27cd44f51c6c9b4b125b491  0fa7c9b0e1b09fd11b682523b839b4c6c67f4c3cd5bc9a9357512c37ea4a9e1e
 
 set geant.data_versions_10.0 {
-    G4NDL              4.3   G4NDL                G4NEUTRONHPDATA    55493e74cba90e6cb167a5008e138cd7  d7559295e71e373246f90db9ab8ce652a1bb71c2  169dbc6d6c1c5b7bb57ee676687ae5b830847cf4e75fecb1e35187172f472e6a
-    G4EMLOW            6.33  G4EMLOW              G4LEDATA           0002a1c16c9b1fb5e8d49dfbce12a576  e6b3b60c04d6e5faa6ea9d9f04c805fd479dbc47  441542ed5359b536f7908369d4abc045468a14e89975855dd145ffd352d3701f
-    PhotonEvaporation  2.3   G4PhotonEvaporation  G4LEVELGAMMADATA   08848ebdd536280a0629d802040b70be  8cd383005f5f8c38f69e4818cf5b1ad397925abc  60449df933794aa0ad3938886c8c023e3093ff59ad6c752923390d5c550f34cb
-    RadioactiveDecay   3.7   G4RadioactiveDecay   G4RADIOACTIVEDATA  039e5f64b0e451eb5c095bf81552cb42  a30e4c0123242405219da4194f37653719a53cbc  f0b96a5f39fb58c1fff80140b4b471fee9718e96d01660bc1d6bff85e0ceab53
-    G4NEUTRONXS        1.3   G4NEUTRONXS          G4NEUTRONXSDATA    ede7c4b3e99cbe1773b672a7404fe0f6  33ed98449ad754cfd756247392d5484aca8a276b  0aad03ecaf3762e38d9cede48366615d694544c3a1fd843141c548a9a128028f
+    G4NDL              4.4   G4NDL                G4NEUTRONHPDATA    cd8cc1d96aeb9b9ed37189edda26f5ad  8ba64e2f71ccaef278450d292239b889daae72fb  e9fe8800566a83ccaf9b5229a1fa1d2cd24530bbd2e9fcb96eb6b5b117233071
+    G4EMLOW            6.35  G4EMLOW              G4LEDATA           3345d693b012c80f3e7e4432ae9884a0  1f0310afff7d6429ad054185dda233a9f469356d  1564045a0acad344c8d432cd48c2c3bb2e051a81ab3099a84e0f56ba0fe82cec
+    PhotonEvaporation  3.0   G4PhotonEvaporation  G4LEVELGAMMADATA   f72d6d694f608fe10cc2126a0ac1f2a6  2502330f6e654e926eb8a0007725651644d25e95  c76a843672eca21110e97a274a6b5cd9a58b66f35235301c8e1b162926e0e7cb
+    RadioactiveDecay   4.0   G4RadioactiveDecay   G4RADIOACTIVEDATA  44a43b8f62c9f9cd4c3cb31c2b2bb7c3  cae534121a147fbd94979c1a3109e0ed130df580  ed2053bddee507920a29a27db4364fbef255b951597686b0410d5458e9b38cb5
+    G4NEUTRONXS        1.4   G4NEUTRONXS          G4NEUTRONXSDATA    665a12771267e3b31a08c622ba1238a7  41278460f9c4a720f2b9e47dee878b9ec289ebd1  57b38868d7eb060ddd65b26283402d4f161db76ed2169437c266105cca73a8fd
     G4PII              1.3   G4PII                G4PIIDATA          05f2471dbcdf1a2b17cbff84e8e83b37  313a2615903b0682b8aabc344bedde82c345704b  6225ad902675f4381c98c6ba25fc5a06ce87549aa979634d3d03491d6616e926
     RealSurface        1.0   RealSurface          G4REALSURFACEDATA  0dde95e00fcd3bcd745804f870bb6884  030513fe340e0cccbfe0b9ae9acb3ba6b5291ebb  3e2d2506600d2780ed903f1f2681962e208039329347c58ba1916740679020b1
     G4SAIDDATA         1.1   G4SAIDDATA           G4SAIDXSDATA       d88a31218fdf28455e5c5a3609f7216f  7f0c75c86eea3d227379d3dfe77e4600752f99a2  a38cd9a83db62311922850fe609ecd250d36adf264a88e88c82ba82b7da0ed7f
+    G4ABLA             3.0   G4ABLA               G4ABLADATA         d7049166ef74a592cb97df0ed4b757bd  656b10fc9d8022e89e99a728576d0b502161aa69  99fd4dcc9b4949778f14ed8364088e45fa4ff3148b3ea36f9f3103241d277014
+    G4ENSDFSTATE       1.0   G4ENSDFSTATE         G4ENSDFSTATEDATA   0c153d96c74e3856288b450436a5e4db  e643d1ef8bbcfaedb6108b889e3c2cc9a05a673e  4562e7476aa2df7204a1a77263e9d2331e9ffcdb591d11814dcc2d6b605021dd
 }
 set geant.data_versions_9.6 {
     G4NDL              4.2   G4NDL                G4NEUTRONHPDATA    2302d7ffeef1a450955302f027ee1cf4  5289896235ccb84f551f642447372f286084a695  173f60a506b9176d7ff531d6a5f6195dcec74df30ffafc09644f47f979bd641b
@@ -63,13 +64,13 @@
     G4EMLOW            6.23  G4EMLOW              G4LEDATA           98cdca1024bf168c8f8ca1deb40f43b9  84529979894ed5e35ade27201fee67884d7b381d  6452215d9a0acbd35c71eed47f3581fd0276d7088b1a1a8588c003d9072aed3e
     PhotonEvaporation  2.2   G4PhotonEvaporation  G4LEVELGAMMADATA   8010e7ce8a92564e38dd3418e6040563  8efc16c40b4755d209f83f31f2d251bbef52ccb8  9db02ef8e5b065c1b7f7d1becd1b72dde2b8fc617bcedde97788040418f239c0
     RadioactiveDecay   3.4   G4RadioactiveDecay   G4RADIOACTIVEDATA  a5b681048584631608ab0965b33c7959  378c237cd5857b4205980815a3c47cdb654506d4  1ecfb477ca3c3966dd128193d8e11e24d6c3dc29cc188c8c9b0b21b941f9c30c
-    G4ABLA             3.0   G4ABLA               G4ABLADATA         d2d4e99b14f7a5057f4c10d9c2d647dd  5a032ee8e90d00f39b67114fe257ec47001f347b  ff0b77be6b36204eeeba71099f6b7530edd80b79eb015994535bc4334bc821eb
+    G4ABLA             3.0   G4ABLA               G4ABLADATA         d7049166ef74a592cb97df0ed4b757bd  656b10fc9d8022e89e99a728576d0b502161aa69  99fd4dcc9b4949778f14ed8364088e45fa4ff3148b3ea36f9f3103241d277014
     G4NEUTRONXS        1.1   G4NEUTRONXS          G4NEUTRONXSDATA    61ef3a05b56525db04e11820e3f603f1  a4cd8791219f0df856da39295e7f913a537bde1a  d477a377aee229bf9d75d3c9cc4b7cd48b414285a246449e4e44a72bf037472b
     G4PII              1.3   G4PII                G4PIIDATA          05f2471dbcdf1a2b17cbff84e8e83b37  313a2615903b0682b8aabc344bedde82c345704b  6225ad902675f4381c98c6ba25fc5a06ce87549aa979634d3d03491d6616e926
     RealSurface        1.0   RealSurface          G4REALSURFACEDATA  0dde95e00fcd3bcd745804f870bb6884  030513fe340e0cccbfe0b9ae9acb3ba6b5291ebb  3e2d2506600d2780ed903f1f2681962e208039329347c58ba1916740679020b1
 }
-# new file (stealth-updated; the file above needs to be fetched from a MacPorts mirror):
-#   G4ABLA             3.0   G4ABLA               G4ABLADATA         d7049166ef74a592cb97df0ed4b757bd  656b10fc9d8022e89e99a728576d0b502161aa69  99fd4dcc9b4949778f14ed8364088e45fa4ff3148b3ea36f9f3103241d277014
+# old file (that has been stealth-updated later and might still reside on a MacPorts mirror):
+#   G4ABLA             3.0   G4ABLA               G4ABLADATA         d2d4e99b14f7a5057f4c10d9c2d647dd  5a032ee8e90d00f39b67114fe257ec47001f347b  ff0b77be6b36204eeeba71099f6b7530edd80b79eb015994535bc4334bc821eb
 
 foreach {geant.version geant.revision geant.datarevision geant.patchlevel geant.version_full geant.rmd160 geant.sha256} ${geant.versions_info} {
 
@@ -105,6 +106,18 @@
             distfiles-append ${filename}
             checksums-append ${filename} md5 ${data.md5} rmd160 ${data.rmd160} sha256 ${data.sha256}
         }
+        # remove an old file that has been stealth-updated in November 2011
+        # (this code has been added in January 2014 and may be removed after a while)
+        pre-fetch {
+            set file_abla "${prefix}/var/macports/distfiles/geant4/G4ABLA.3.0.tar.gz"
+            if {[file exists ${file_abla}]} {
+                if {[md5 file ${file_abla}] != "d7049166ef74a592cb97df0ed4b757bd"} {
+                    # problematic md5: d2d4e99b14f7a5057f4c10d9c2d647dd
+                    ui_warn "deleting an old '${file_abla}'"
+                    file delete ${file_abla}
+                }
+            }
+        }
         post-extract {
             # only necessary for G4EMLOW 6.23 & 6.32
             # but G4NEUTRONXS 1.1, 1.2, 1.3 and PhotonEvaporation 2.2 also have some weird permissions
@@ -177,14 +190,13 @@
         # - patch-source-interfaces-common-src-G4Qt.cc:
         #       http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1487
         # - patch-examples-advanced-xray_fluorescence:
-        #       http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1501
+        #       http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1501 (fixed on 2013-12-13)
         # - patch-cmake-Modules-Geant4InterfaceOptions.cmake:
         #       prevents linking against X11 in /usr (maybe less aggressive patch would also work)
         # - patch-cmake-Modules-Geant4BuildProjectConfig.cmake:
         #       allows placing *.cmake files to a different location than LIBDIR
         if {${geant.version} == "10.0"} {
-            patchfiles      patch-upstream-qt.4100.diff \
-                            patch-source-interfaces-common-src-G4Qt.cc.diff \
+            patchfiles      patch-source-interfaces-common-src-G4Qt.cc.diff \
                             patch-examples-advanced-xray_fluorescence.diff \
                             patch-cmake-Modules-Geant4InterfaceOptions.cmake.4100.diff \
                             patch-cmake-Modules-Geant4BuildProjectConfig.cmake.4100.diff

Modified: trunk/dports/science/geant4/files/patch-cmake-Modules-Geant4BuildProjectConfig.cmake.4100.diff
===================================================================
--- trunk/dports/science/geant4/files/patch-cmake-Modules-Geant4BuildProjectConfig.cmake.4100.diff	2014-01-10 21:40:16 UTC (rev 115757)
+++ trunk/dports/science/geant4/files/patch-cmake-Modules-Geant4BuildProjectConfig.cmake.4100.diff	2014-01-10 21:56:42 UTC (rev 115758)
@@ -1,6 +1,6 @@
 --- cmake/Modules/Geant4BuildProjectConfig.cmake.orig
 +++ cmake/Modules/Geant4BuildProjectConfig.cmake
-@@ -173,7 +173,7 @@ configure_file(
+@@ -182,7 +182,7 @@ configure_file(
  # - Generate Install Tree Configuration Files
  #-----------------------------------------------------------------------
  # Set needed variables for the install tree

Modified: trunk/dports/science/geant4/files/patch-cmake-Modules-Geant4InterfaceOptions.cmake.4100.diff
===================================================================
--- trunk/dports/science/geant4/files/patch-cmake-Modules-Geant4InterfaceOptions.cmake.4100.diff	2014-01-10 21:40:16 UTC (rev 115757)
+++ trunk/dports/science/geant4/files/patch-cmake-Modules-Geant4InterfaceOptions.cmake.4100.diff	2014-01-10 21:56:42 UTC (rev 115758)
@@ -1,30 +1,29 @@
 --- cmake/Modules/Geant4InterfaceOptions.cmake.orig
 +++ cmake/Modules/Geant4InterfaceOptions.cmake
-@@ -139,20 +139,11 @@ if(UNIX)
+@@ -196,20 +196,11 @@ if(UNIX)
      set(CMAKE_FIND_FRAMEWORK NEVER)
  
      set(X11_INC_SEARCH_PATH
 -        /usr/pkg/xorg/include
--        /usr/X11R6/include 
--        /usr/X11R7/include 
+-        /usr/X11R6/include
+-        /usr/X11R7/include
 -        /usr/include/X11
--        /usr/openwin/include 
--        /usr/openwin/share/include 
+-        /usr/openwin/include
+-        /usr/openwin/share/include
 -        /opt/graphics/OpenGL/include
--        )
 +        @PREFIX@/include
-+    )
+         )
  
      set(X11_LIB_SEARCH_PATH
 -        /usr/pkg/xorg/lib
 -        /usr/X11R6/lib
 -        /usr/X11R7/lib
--        /usr/openwin/lib 
+-        /usr/openwin/lib
 +        @PREFIX@/lib
          )
  
      find_path(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH})
-@@ -195,17 +186,17 @@ if(UNIX)
+@@ -252,17 +243,17 @@ if(UNIX)
        set(CMAKE_FIND_FRAMEWORK NEVER)
  
        find_path(OPENGL_X11_INCLUDE_DIR GL/gl.h

Modified: trunk/dports/science/geant4/files/patch-source-interfaces-common-src-G4Qt.cc.diff
===================================================================
--- trunk/dports/science/geant4/files/patch-source-interfaces-common-src-G4Qt.cc.diff	2014-01-10 21:40:16 UTC (rev 115757)
+++ trunk/dports/science/geant4/files/patch-source-interfaces-common-src-G4Qt.cc.diff	2014-01-10 21:56:42 UTC (rev 115758)
@@ -1,6 +1,6 @@
 --- source/interfaces/common/src/G4Qt.cc.orig
 +++ source/interfaces/common/src/G4Qt.cc
-@@ -148,6 +148,20 @@ G4Qt::G4Qt (
+@@ -153,6 +153,20 @@ G4Qt::G4Qt (
    }
  #endif
    //  AddDispatcher     ((G4DispatchFunction)XtDispatchEvent);

Deleted: trunk/dports/science/geant4/files/patch-upstream-qt.4100.diff
===================================================================
--- trunk/dports/science/geant4/files/patch-upstream-qt.4100.diff	2014-01-10 21:40:16 UTC (rev 115757)
+++ trunk/dports/science/geant4/files/patch-upstream-qt.4100.diff	2014-01-10 21:56:42 UTC (rev 115758)
@@ -1,259 +0,0 @@
-A bunch of upstream patches:
- * fix loading icons in some examples
- * allow pasting multiple lines
- * remember the last dir to open/save macro files
- * do not throw errors during menu creation when using '/control/verbose 0'
---- source/interfaces/basic/include/G4UIQt.hh.orig
-+++ source/interfaces/basic/include/G4UIQt.hh
-@@ -215,6 +215,8 @@ private:
- 
-   QToolBar *fToolbarApp;
-   QToolBar *fToolbarUser;
-+  G4String fLastErrMessage;
-+  QString fLastOpenPath;
- 
-   bool fMoveSelected;
-   bool fRotateSelected;
-@@ -226,6 +228,7 @@ private Q_SLOTS :
-   void ExitSession();
-   void ClearButtonCallback();
-   void CommandEnteredCallback();
-+  void CommandEditedCallback(const QString &);
-   void ButtonCallback(const QString&);
-   void HelpTreeClicCallback();
-   void HelpTreeDoubleClicCallback();
---- source/interfaces/basic/src/G4UIQt.cc.orig
-+++ source/interfaces/basic/src/G4UIQt.cc
-@@ -138,6 +138,7 @@ G4UIQt::G4UIQt (
- ,fPickSelected(false)
- ,fZoomInSelected(false)
- ,fZoomOutSelected(false)
-+,fLastOpenPath("")
- {
- 
-   G4Qt* interactorManager = G4Qt::getInstance (argc,argv,(char*)"Qt");
-@@ -278,6 +279,7 @@ G4UIQt::G4UIQt (
- 
-   // Connect signal
-   connect(fCommandArea, SIGNAL(returnPressed()), SLOT(CommandEnteredCallback()));
-+  connect(fCommandArea, SIGNAL(textEdited(const QString &)), SLOT(CommandEditedCallback(const QString &)));
-   connect(fUITabWidget, SIGNAL(currentChanged(int)), SLOT(ToolBoxActivated(int)));
- 
-   if(UI!=NULL) UI->SetCoutDestination(this);  // TO KEEP
-@@ -772,7 +774,11 @@ G4int G4UIQt::ReceiveG4cerr (
- 
-   // Suppress space, \n,\t,\r...
-   if (QString(aString.data()).trimmed() != "") {
--    QMessageBox::critical(fMainWindow, "Error",aString.data());
-+    if ((G4StateManager::GetStateManager()->GetCurrentState() == G4State_Abort) ||
-+        (G4StateManager::GetStateManager()->GetCurrentState() == G4State_Quit )) {
-+      // In case of Abort or Quit, the useful error message should be in the last error message !
-+      QMessageBox::critical(fMainWindow, "Error",QString(fLastErrMessage.data())+"\n"+aString.data());
-+    }
-   }
-   QColor previousColor = fCoutTBTextArea->textColor();
-   fCoutTBTextArea->setTextColor(Qt::red);
-@@ -780,6 +786,10 @@ G4int G4UIQt::ReceiveG4cerr (
-   fCoutTBTextArea->setTextColor(previousColor);
-   fCoutTBTextArea->verticalScrollBar()->setSliderPosition(fCoutTBTextArea->verticalScrollBar()->maximum());
-   fCoutTBTextArea->repaint();
-+
-+  if (QString(aString.data()).trimmed() != "") {
-+    fLastErrMessage = aString;
-+  }
-   return 0;
- }
- 
-@@ -824,9 +834,14 @@ void G4UIQt::AddButton (
-   QMenu *parentTmp = (QMenu*)GetInteractor(aMenu);
- 
-   if(parentTmp==NULL) {
--    G4cout << "Menu name " << aMenu<< " does not exist, please define it before using it."<< G4endl;
-+    G4UImanager* UImanager = G4UImanager::GetUIpointer();
-+    G4int verbose = UImanager->GetVerboseLevel();
-+    
-+    if (verbose >= 2) {
-+      G4cout << "Menu name " << aMenu<< " does not exist, please define it before using it."<< G4endl;
-+    }
-   }
--  
-+
-   // Find the command in the command tree
-   G4UImanager* UI = G4UImanager::GetUIpointer();
-   if(UI==NULL) return;
-@@ -839,7 +854,12 @@ void G4UIQt::AddButton (
-   }
-   
-   if(treeTop->FindPath(aCommand) == NULL) {
--    G4cout << "Warning: command '"<< aCommand <<"' does not exist, please define it before using it."<< G4endl;
-+    G4UImanager* UImanager = G4UImanager::GetUIpointer();
-+    G4int verbose = UImanager->GetVerboseLevel();
-+    
-+    if (verbose >= 2) {
-+      G4cout << "Warning: command '"<< aCommand <<"' does not exist, please define it before using it."<< G4endl;
-+    }
-   }
- 
-   QSignalMapper *signalMapper = new QSignalMapper(this);
-@@ -870,7 +890,12 @@ void G4UIQt::AddIcon(const char* aLabel, const char* aIconFile, const char* aCom
-     // try to open a file
-     pix = QPixmap(aFileName);
-     if (pix.isNull()) {
--      G4cout << "Warning: file '"<< aFileName <<"' is incorrect or does not exist, this command will not be build"<< G4endl;
-+      G4UImanager* UImanager = G4UImanager::GetUIpointer();
-+      G4int verbose = UImanager->GetVerboseLevel();
-+      
-+      if (verbose >= 2) {
-+        G4cout << "Warning: file '"<< aFileName <<"' is incorrect or does not exist, this command will not be build"<< G4endl;
-+      }
-       return;
-     }
-     userToolBar = true; 
-@@ -1601,23 +1626,29 @@ void G4UIQt::AddIcon(const char* aLabel, const char* aIconFile, const char* aCom
-       ;
-     pix = QPixmap(xpm);
-   } else {
--    G4cout << "Parameter"<< aIconFile <<" not defined"<< G4endl;
-+    G4UImanager* UImanager = G4UImanager::GetUIpointer();
-+    G4int verbose = UImanager->GetVerboseLevel();
-+    
-+    if (verbose >= 2) {
-+      G4cout << "Parameter"<< aIconFile <<" not defined"<< G4endl;
-+    }
-     return;
-   }
-   QToolBar *currentToolbar = NULL;
-   if (userToolBar) {
-     if (fToolbarUser == NULL) {
--      fToolbarUser = new QToolBar(fMainWindow);
-+      fToolbarUser = new QToolBar();
-       fToolbarUser->setIconSize (QSize(20,20));
-       fMainWindow->addToolBar(Qt::TopToolBarArea, fToolbarUser);
-     }
-     currentToolbar = fToolbarUser;
-   } else {
-     if (fToolbarApp == NULL) {
--      fToolbarApp = new QToolBar(fMainWindow);
-+      fToolbarApp = new QToolBar();
-       fToolbarApp->setIconSize (QSize(20,20));
-       fMainWindow->addToolBar(Qt::TopToolBarArea, fToolbarApp);
-     }
-+    fMainWindow->show();
-     currentToolbar = fToolbarApp;
-   }
- 
-@@ -1712,7 +1743,12 @@ void G4UIQt::AddIcon(const char* aLabel, const char* aIconFile, const char* aCom
-     G4UIcommandTree * treeTop = UI->GetTree();
-     
-     if(treeTop->FindPath(aCommand) == NULL) {
--      G4cout << "Warning: command '"<< aCommand <<"' does not exist, please define it before using it."<< G4endl;
-+      G4UImanager* UImanager = G4UImanager::GetUIpointer();
-+      G4int verbose = UImanager->GetVerboseLevel();
-+      
-+      if (verbose >= 2) {
-+        G4cout << "Warning: command '"<< aCommand <<"' does not exist, please define it before using it."<< G4endl;
-+      }
-     }
-     
-     connect(signalMapper, SIGNAL(mapped(const QString &)),this, SLOT(ButtonCallback(const QString&)));
-@@ -2580,27 +2616,56 @@ void G4UIQt::ExitHelp(
- void G4UIQt::CommandEnteredCallback (
- )
- {
--  G4String command (fCommandArea->text().toStdString().c_str());
--  if (fCommandArea->text().trimmed() != "") {
--    fHistoryTBTableList->addItem(fCommandArea->text());
--    fHistoryTBTableList->clearSelection();
--    fHistoryTBTableList->setCurrentItem(NULL);
--    fCommandArea->setText("");
--
--    G4Qt* interactorManager = G4Qt::getInstance ();
--    if (interactorManager) { 
--      interactorManager->FlushAndWaitExecution();
--    }
--    if (command(0,4) != "help") {
--      ApplyShellCommand (command,exitSession,exitPause);
--    } else {
--      ActivateCommand(command);
-+  // split by any new line character
-+  QStringList list = fCommandArea->text().split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
-+
-+  // Apply for all commands
-+  for (unsigned int a=0; a< list.size(); a++) {
-+    QString txt (list[a].trimmed());
-+    if (txt != "") {
-+      fHistoryTBTableList->addItem(txt);
-+      fHistoryTBTableList->clearSelection();
-+      fHistoryTBTableList->setCurrentItem(NULL);
-+      fCommandArea->setText("");
-+      G4Qt* interactorManager = G4Qt::getInstance ();
-+      if (interactorManager) {
-+        interactorManager->FlushAndWaitExecution();
-+      }
-+
-+      G4String command = txt.toStdString().c_str();
-+      if (command(0,4) != "help") {
-+        ApplyShellCommand (command,exitSession,exitPause);
-+      } else {
-+        ActivateCommand(command);
-+      }
-     }
--    // Rebuild help tree
--    FillHelpTree();
-+  }
-+
-+  // Rebuild help tree
-+  FillHelpTree();
-+
-+  if(exitSession==true)
-+    SessionTerminate();
-+}
- 
--    if(exitSession==true) 
--      SessionTerminate();
-+
-+/** Callback when the text in the line edit is changed.
-+ When a newline is inserted, trigger the Activate Command
-+ on this text end set unchanged the end of the line after the newline.
-+ */
-+void G4UIQt::CommandEditedCallback(const QString & )
-+{
-+  QStringList list = fCommandArea->text().split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
-+
-+  if (list.size() > 1) { // trigger ActivateCommand
-+    for (int a=0; a<list.size()-1; a++) {
-+      // set only the first part
-+      fCommandArea->setText(list[a]);
-+      // trigger callback
-+      CommandEnteredCallback();
-+    }
-+    // reset unfinished command
-+    fCommandArea->setText(list[list.size()-1]);
-   }
- }
- 
-@@ -3167,18 +3232,22 @@ void G4UIQt::ChangeSurfaceStyle(const QString& action) {
- 
- void G4UIQt::OpenIconCallback(const QString& aCommand) {
- 
--  QString nomFich = QFileDialog::getOpenFileName(fMainWindow, "Load", "vis", "Macro files (*.mac)");
-+  QString nomFich = QFileDialog::getOpenFileName(fMainWindow, "Load", fLastOpenPath, "Macro files (*.mac)");
-    if (nomFich != "") {
-      G4UImanager::GetUIpointer()->ApplyCommand((QString(aCommand)+ QString(" ")+ nomFich).toStdString().c_str());
-+     QDir dir;
-+     fLastOpenPath = dir.absoluteFilePath(nomFich);
-    }
- }
- 
- 
- void G4UIQt::SaveIconCallback(const QString& aCommand) {
- 
--  QString nomFich = QFileDialog::getSaveFileName(fMainWindow, "Save", "viewerState", "Macro files (*.mac)");
-+  QString nomFich = QFileDialog::getSaveFileName(fMainWindow, "Save", fLastOpenPath, "Macro files (*.mac)");
-   if (nomFich != "") {
-     G4UImanager::GetUIpointer()->ApplyCommand((QString(aCommand)+ QString(" ")+nomFich).toStdString().c_str());
-+    QDir dir;
-+    fLastOpenPath = dir.absoluteFilePath(nomFich);
-   }
- }
- 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140110/3bbf7f30/attachment-0001.html>


More information about the macports-changes mailing list