~ubuntu-branches/ubuntu/precise/grass/precise

« back to all changes in this revision

Viewing changes to gui/tcltk/gis.m/gm.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2011-04-13 17:08:41 UTC
  • mfrom: (8.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110413170841-ss1t9bic0d0uq0gz
Tags: 6.4.1-1
* New upstream version.
* Now build-dep on libjpeg-dev and current libreadline6-dev.
* Removed patch swig: obsolete.
* Policy bumped to 3.9.2, without changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
        exit 1
71
71
}
72
72
 
 
73
# if any of those is empty, there's no reason to continue. it's a failure.
 
74
if { $gisdbase=={} || $location_name=={} || $mapset=={} } {
 
75
        GmLib::errmsg [G_msg "GISDBASE or LOCATION_NAME or MAPSET is empty. \
 
76
        This is a fatal error. gis.m can not work without proper settings."]
 
77
        exit 1
 
78
}
73
79
 
74
80
# path to icons for GIS Manager
75
81
set iconpath [file join "$env(GISBASE)" "etc" "gui" "icons" "grass"]
146
152
        variable selectedfont
147
153
        variable encoding
148
154
        global array filename ;# mon
149
 
 
 
155
        variable last_directory ;# last save/load dir for reuse
150
156
}
151
157
 
152
158
 
271
277
                        Gm::cleanup}
272
278
        }
273
279
 
274
 
 
 
280
        if { [info exists env(HOME)] } {
 
281
                set Gm::last_directory $env(HOME)
 
282
        } else {
 
283
                set Gm::last_directory [pwd]
 
284
        }
275
285
 
276
286
}
277
287
 
513
523
 
514
524
};
515
525
 
 
526
# Provides remote exit call. Used by GRASS exit to close all session's gis.m instances.
 
527
# Argument session_id is exit caller's GIS_LOCK variable.
 
528
proc Gm::remoteExit { session_id } {
 
529
        global env
 
530
        if {$env(GIS_LOCK) == $session_id} Gm::quit
 
531
}
 
532
 
 
533
# Provides exit from gis.m. May also do some clean-up, save-settings et.al.
 
534
proc Gm::quit { } {
 
535
        global env
 
536
        
 
537
        # It's unsafe to call exit during Destroy event
 
538
        after idle [list destroy .]
 
539
}
 
540
 
516
541
###############################################################################
517
542
 
518
543
proc main {argc argv} {
538
563
                Gm::SaveFileBox
539
564
    }
540
565
    bind . <$keycontrol-Key-q> {
541
 
                exit
 
566
                Gm::quit
542
567
        }
543
568
    bind . <$keycontrol-Key-w> {
544
569
                GmTree::FileClose {}
562
587
    }
563
588
}
564
589
 
 
590
wm protocol . WM_DELETE_WINDOW {
 
591
        Gm::quit
 
592
}
565
593
 
566
594
main $argc $argv
567
595
wm geom . [wm geom .]