Changeset 593 for trunk/geant4/interfaces/basic/src
- Timestamp:
- Nov 9, 2007, 3:32:25 PM (17 years ago)
- Location:
- trunk/geant4/interfaces/basic/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/interfaces/basic/src/G4UIArrayString.cc
r483 r593 26 26 // 27 27 // $Id: G4UIArrayString.cc,v 1.8 2006/06/29 19:09:43 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 -
trunk/geant4/interfaces/basic/src/G4UIQt.cc
r579 r593 25 25 // 26 26 // 27 // $Id: G4UIQt.cc,v 1. 14 2007/05/29 11:09:49$28 // GEANT4 tag $Name: geant4-08-01$27 // $Id: G4UIQt.cc,v 1.3 2007/11/08 17:00:09 lgarnier Exp $ 28 // GEANT4 tag $Name: $ 29 29 // 30 30 // L. Garnier … … 46 46 #include "G4Qt.hh" 47 47 48 #include <QtGui/qapplication.h> 49 #include <QtGui/qwidget.h> 50 #include <QtGui/qmenu.h> 51 #include <QtGui/qmenubar.h> 52 #include <QtGui/qboxlayout.h> 53 #include <QtGui/qpushbutton.h> 54 #include <QtGui/qlabel.h> 55 #include <QtGui/qsplitter.h> 56 #include <QtGui/qscrollbar.h> 57 #include <QtGui/qdialog.h> 58 #include <QtGui/qevent.h> 48 #include <QtGui/QApplication.h> 49 #include <QtGui/QMainWindow.h> 50 #include <QtGui/QLineEdit.h> 51 #include <QtGui/QWidget.h> 52 #include <QtGui/QMenu.h> 53 #include <QtGui/QMenuBar.h> 54 #include <QtGui/QBoxLayout.h> 55 #include <QtGui/QPushButton.h> 56 #include <QtGui/QLabel.h> 57 #include <QtGui/QSplitter.h> 58 #include <QtGui/QScrollBar.h> 59 #include <QtGui/QDialog.h> 60 #include <QtGui/QEvent.h> 61 #include <QtGui/QListWidget.h> 62 #include <QtGui/QTextEdit.h> 63 #include <QtGui/QTreeWidget.h> 64 #include <QtCore/QSignalMapper.h> 65 59 66 60 67 #include <stdlib.h> -
trunk/geant4/interfaces/basic/src/G4UIQt_moc.cc
r577 r593 2 2 ** Meta object code from reading C++ file 'G4UIQt.hh' 3 3 ** 4 ** Created: Mon Sep 17 14:28:15 20074 ** Created: Mon Oct 1 10:59:35 2007 5 5 ** by: The Qt Meta Object Compiler version 59 (Qt 4.2.2) 6 6 ** 7 7 ** WARNING! All changes made in this file will be lost! 8 8 *****************************************************************************/ 9 10 #ifdef G4UI_BUILD_QT_SESSION 9 11 10 12 #include "../include/G4UIQt.hh" … … 99 101 QMetaObject::activate(this, &staticMetaObject, 0, _a); 100 102 } 103 104 #endif -
trunk/geant4/interfaces/basic/src/G4UIWin32.cc
r483 r593 26 26 // 27 27 // $Id: G4UIWin32.cc,v 1.13 2006/06/29 19:09:45 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // G.Barrand -
trunk/geant4/interfaces/basic/src/G4UIXaw.cc
r483 r593 26 26 // 27 27 // $Id: G4UIXaw.cc,v 1.6 2006/06/29 19:09:47 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // G.Barrand -
trunk/geant4/interfaces/basic/src/G4UIXm.cc
r483 r593 26 26 // 27 27 // $Id: G4UIXm.cc,v 1.14 2006/06/29 19:09:49 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // G.Barrand -
trunk/geant4/interfaces/basic/src/G4UIcsh.cc
r483 r593 26 26 // 27 27 // $Id: G4UIcsh.cc,v 1.8 2006/06/29 19:09:51 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 -
trunk/geant4/interfaces/basic/src/G4UItcsh.cc
r483 r593 25 25 // 26 26 // 27 // $Id: G4UItcsh.cc,v 1.1 2 2006/06/29 19:09:54 gunterExp $28 // GEANT4 tag $Name: geant4-08-01-patch-01$27 // $Id: G4UItcsh.cc,v 1.15 2007/11/06 09:36:23 kmura Exp $ 28 // GEANT4 tag $Name: $ 29 29 // 30 30 … … 37 37 #include <ctype.h> 38 38 #include <sstream> 39 #include <fstream> 40 #include <stdlib.h> 39 41 40 42 // ASCII character code … … 59 61 static const int AsciiPrintableMin = 32; 60 62 63 // history file 64 static const G4String historyFileName= "/.g4_hist"; 65 61 66 ///////////////////////////////////////////////////////// 62 67 G4UItcsh::G4UItcsh(const G4String& prompt, G4int maxhist) … … 69 74 // get current terminal mode 70 75 tcgetattr(0, &tios); 76 77 // read a shell history file 78 G4String homedir= getenv("HOME"); 79 G4String fname= homedir + historyFileName; 80 81 std::ifstream histfile; 82 enum { BUFSIZE= 1024 }; char linebuf[BUFSIZE]; 83 84 histfile.open(fname, std::ios::in); 85 while (histfile.good()) { 86 if(histfile.eof()) break; 87 88 histfile.getline(linebuf, BUFSIZE); 89 G4String aline= linebuf; 90 aline.strip(G4String::both); 91 if(aline.size() != 0) StoreHistory(linebuf); 92 } 93 histfile.close(); 71 94 } 72 95 … … 75 98 ///////////////////// 76 99 { 77 } 100 // store a shell history 101 G4String homedir= getenv("HOME"); 102 G4String fname= homedir + historyFileName; 103 104 std::ofstream histfile; 105 histfile.open(fname, std::ios::out); 106 107 G4int n0hist= 1; 108 if( currentHistoryNo > maxHistory ) n0hist= currentHistoryNo-maxHistory+1; 109 110 for (G4int i=n0hist; i<= currentHistoryNo; i++) { 111 histfile << RestoreHistory(i) << G4endl; 112 } 78 113 79 /////////////////////////// 114 histfile.close(); 115 } 116 117 ////////////////////////////////////////// 80 118 void G4UItcsh::MakePrompt(const char* msg) 81 /////////////////////////// 119 ////////////////////////////////////////// 82 120 { 83 121 if(promptSetting.length()<=1) { … … 130 168 } 131 169 170 171 ////////////////////////////// 172 void G4UItcsh::ResetTerminal() 173 ////////////////////////////// 174 { 175 RestoreTerm(); 176 } 177 178 132 179 // -------------------------------------------------------------------- 133 180 // commad line operations … … 465 512 466 513 G4int jt= input.find_last_of('/'); 467 if(jt<jhead) jt=G4 String::npos;514 if(jt<jhead) jt=G4int(G4String::npos); 468 515 469 516 if(jt==G4int(G4String::npos)) jt= jhead; … … 472 519 G4String dspstr; 473 520 G4int i; 474 for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(AsciiBS); // cleanup521 for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(AsciiBS); 475 522 for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(' '); 476 523 for(i=jt; i<=G4int(input.length())-1; i++) dspstr+= G4String(AsciiBS); … … 592 639 } 593 640 594 /////////////////////////////////// 641 ////////////////////////////////////////////////// 595 642 G4String G4UItcsh::GetCommandLine(const char* msg) 596 /////////////////////////////////// 643 ////////////////////////////////////////////////// 597 644 { 598 645 SetTermToInputMode(); -
trunk/geant4/interfaces/basic/src/G4UIterminal.cc
r483 r593 25 25 // 26 26 // 27 // $Id: G4UIterminal.cc,v 1.21 2006/06/29 19:09:56 gunter Exp $ 28 // GEANT4 tag $Name: geant4-08-01-patch-01 $ 29 // 30 27 // $Id: G4UIterminal.cc,v 1.27 2007/10/29 18:49:45 asaim Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // ==================================================================== 31 // G4UIterminal.cc 32 // 33 // ==================================================================== 31 34 #include "G4Types.hh" 32 35 #include "G4StateManager.hh" … … 38 41 #include <sstream> 39 42 40 41 ////////////////////////////////////////////// 42 G4UIterminal::G4UIterminal(G4VUIshell* aShell) 43 ////////////////////////////////////////////// 43 #ifndef WIN32 44 #include <signal.h> 45 #endif 46 47 // ==================================================================== 48 // signal handler for soft-abort 49 // ==================================================================== 50 51 static G4VUIshell* theshell= 0; 52 53 #ifndef WIN32 54 55 extern "C" { 56 57 //////////////////////////////// 58 static void SignalHandler(G4int) 59 //////////////////////////////// 60 { 61 G4StateManager* stateManager= G4StateManager::GetStateManager(); 62 G4ApplicationState state= stateManager-> GetCurrentState(); 63 64 if(state==G4State_GeomClosed || state==G4State_EventProc) { 65 G4cout << "aborting Run ..."; 66 G4UImanager::GetUIpointer()->ApplyCommand("/run/abort"); 67 G4cout << G4endl; 68 } else { 69 G4cout << G4endl 70 << "Session terminated." << G4endl; 71 theshell-> ResetTerminal(); 72 exit(0); 73 } 74 75 // for original Unix / System V 76 signal(SIGINT, SignalHandler); 77 } 78 79 } 80 #endif 81 82 // ==================================================================== 83 // 84 // class description 85 // 86 // ==================================================================== 87 88 /////////////////////////////////////////////////////////// 89 G4UIterminal::G4UIterminal(G4VUIshell* aShell, G4bool qsig) 90 /////////////////////////////////////////////////////////// 44 91 { 45 92 UI= G4UImanager::GetUIpointer(); … … 52 99 if(aShell) shell= aShell; 53 100 else shell= new G4UIcsh; 101 theshell= shell; // locally stored for the signal handler 102 103 // add signal handler 104 if(qsig) { 105 #ifndef WIN32 106 signal(SIGINT, SignalHandler); 107 #endif 108 } 54 109 } 55 110 -
trunk/geant4/interfaces/basic/src/G4VUIshell.cc
r483 r593 25 25 // 26 26 // 27 // $Id: G4VUIshell.cc,v 1. 9 2006/06/29 19:09:59 gunterExp $28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $27 // $Id: G4VUIshell.cc,v 1.10 2007/06/14 05:44:58 kmura Exp $ 28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 … … 59 59 } 60 60 61 ///////////////////////////// 61 //////////////////////////////////////////// 62 62 void G4VUIshell::MakePrompt(const char* msg) 63 ///////////////////////////// 63 //////////////////////////////////////////// 64 64 { 65 65 if(promptSetting.length()<=1) { … … 106 106 107 107 108 //////////////////////////////// 109 void G4VUIshell::ResetTerminal() 110 //////////////////////////////// 111 { 112 113 } 114 108 115 // -------------------------------------------------------------------- 109 116 // G4command operations … … 308 315 arrayString.Show(nColumn); 309 316 } 317
Note: See TracChangeset
for help on using the changeset viewer.