Changeset 39350
- Timestamp:
- Sep 30, 2009, 3:57:05 AM (15 years ago)
- Location:
- grass/branches/develbranch_6
- Files:
-
- 4 edited
-
gui/tcltk/gis.m/gm.tcl (modified) (3 diffs)
-
gui/tcltk/gis.m/gmmenu.tcl (modified) (1 diff)
-
lib/init/grass.src (modified) (1 diff)
-
lib/init/init.sh (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
grass/branches/develbranch_6/gui/tcltk/gis.m/gm.tcl
r38296 r39350 514 514 }; 515 515 516 # Provides remote exit call. Used by GRASS exit to close all session's gis.m instances. 517 # Argument session_id is exit caller's GIS_LOCK variable. 518 proc Gm::remoteExit { session_id } { 519 global env 520 if {$env(GIS_LOCK) == $session_id} Gm::quit 521 } 522 523 # Provides exit from gis.m. May also do some clean-up, save-settings et.al. 524 proc Gm::quit { {full_exit false} } { 525 global env 526 527 if { $full_exit } { 528 if { [catch {set spid $env(GRASS_SHELL_PID)}] == 0 } { 529 set leave [tk_dialog .leave [G_msg "End current GRASS session"] \ 530 [G_msg "Do You really want to terminate current\ 531 GRASS session?\n\nThis action will colse all sessions gis.m instances.\n\nIf You have running some \ 532 GRASS module from comandline, GRASS will terminate after it\ 533 finishes to run."] warning 1 [G_msg "Terminate current GRASS sesion"] [G_msg "Cancel"]] 534 if { $leave == 0 } { 535 exec kill -SIGINT $env(GRASS_SHELL_PID) 536 } else { 537 return 538 } 539 } else { 540 tk_messageBox -type ok -title [G_msg "Not supported"] -message \ 541 [G_msg "We sorry. Your shell does not support this feature. \n\ 542 You have to type 'exit' in terminal manualy."] 543 } 544 } 545 546 exit 547 } 548 516 549 ############################################################################### 517 550 … … 539 572 } 540 573 bind . <$keycontrol-Key-q> { 541 exit574 Gm::quit 542 575 } 543 576 bind . <$keycontrol-Key-w> { … … 563 596 } 564 597 598 wm protocol . WM_DELETE_WINDOW { 599 Gm::quit 600 } 565 601 566 602 main $argc $argv -
grass/branches/develbranch_6/gui/tcltk/gis.m/gmmenu.tcl
r38427 r39350 202 202 {command {[G_msg "PostScript plot"]} {} "ps.map: Create cartographic PostScript plot" {} -command { execute ps.map }} 203 203 {separator} 204 {command {[G_msg "E&xit"]} {} "Exit GIS Manager" {} -accelerator $keyctrl-Q -command { exit } } 204 {command {[G_msg "Exit &GRASS"]} {} "End current GRASS session" {} -command { Gm::quit true } } 205 {command {[G_msg "&Quit GIS Manager"]} {} "Exit GIS Manager" {} -accelerator $keyctrl-Q -command { Gm::quit } } 205 206 } 206 207 {[G_msg "&Config"]} all options $tmenu { -
grass/branches/develbranch_6/lib/init/grass.src
r39326 r39350 41 41 else 42 42 # Returning user may have preffered GRASS terminal application 43 GRASS_XTERM=`awk '/GRASS_XTERM/ {print $2}' "$GISRCRC" 2>/dev/null` 43 if [ -z "$GRASS_XTERM" ]; then 44 GRASS_XTERM=`awk '/GRASS_XTERM/ {print $2}' "$GISRCRC" 2>/dev/null` 45 fi; 44 46 if [ -n "$GRASS_XTERM" ]; then 45 47 # User has preffered GRASS terminal app -
grass/branches/develbranch_6/lib/init/init.sh
r39278 r39350 818 818 # Check for tcltk interface 819 819 tcltk | gis.m) 820 "$GISBASE/scripts/gis.m" 820 if [ $sh -ne bash ] || [ $sh -ne msh ] || [ $sh -ne cygwin ]; then 821 # trap is not supported by csh/tcsh and rc 822 "$GISBASE/scripts/gis.m" 823 fi; 821 824 ;; 822 825 oldtcltk | d.m) … … 967 970 echo "export PATH=\"$PATH\"" >> "$bashrc" 968 971 echo "export HOME=\"$USERHOME\"" >> "$bashrc" # restore user home path 972 echo 'export GRASS_SHELL_PID=$$' >> "$bashrc" # can be used to terminate GRASS session from GUI 973 if [ "$GRASS_GUI" == tcltk ] || [ "$GRASS_GUI" == gis.m ]; then 974 echo '$GISBASE/scripts/gis.m' >> "$bashrc" # Start gis.m 975 fi; 976 echo 'trap "echo \"GUI issued an exit\"; exit" SIGINT' >> "$bashrc" 969 977 970 978 "$ETC/run" "$SHELL" … … 1013 1021 done 1014 1022 1023 # Attempt to close any open gis.m instances. 1024 # Will work only on some systems, still has no harm to others 1025 if [ $TCLTKGRASSBASE ] ; then 1026 echo "Closing open gis.m sessions....." 1027 echo 'foreach gwin [lsearch -all -inline [winfo interps] gm_tcl*] { 1028 catch {send -async $gwin Gm::remoteExit $env(GIS_LOCK)} 1029 } 1030 exit' | $GRASS_WISH >/dev/null 2>&1 1031 fi 1032 1015 1033 echo "Cleaning up temporary files ..." 1016 1034
Note:
See TracChangeset
for help on using the changeset viewer.
