|
@@ -704,19 +704,21 @@ def import_file(guiparent, filePath):
|
|
|
parent=guiparent)
|
|
|
|
|
|
|
|
|
-def switch_mapset_interactively(guiparent, giface, dbase, location, mapset):
|
|
|
+def switch_mapset_interactively(guiparent, giface, dbase, location, mapset,
|
|
|
+ show_confirmation=False):
|
|
|
"""Switch current mapset. Emits giface.currentMapsetChanged signal."""
|
|
|
if dbase:
|
|
|
if RunCommand('g.mapset', parent=guiparent,
|
|
|
location=location,
|
|
|
mapset=mapset,
|
|
|
dbase=dbase) == 0:
|
|
|
- GMessage(parent=guiparent,
|
|
|
- message=_("Current GRASS database is <%(dbase)s>.\n"
|
|
|
- "Current location is <%(loc)s>.\n"
|
|
|
- "Current mapset is <%(mapset)s>."
|
|
|
- ) %
|
|
|
- {'dbase': dbase, 'loc': location, 'mapset': mapset})
|
|
|
+ if show_confirmation:
|
|
|
+ GMessage(parent=guiparent,
|
|
|
+ message=_("Current GRASS database is <%(dbase)s>.\n"
|
|
|
+ "Current location is <%(loc)s>.\n"
|
|
|
+ "Current mapset is <%(mapset)s>."
|
|
|
+ ) %
|
|
|
+ {'dbase': dbase, 'loc': location, 'mapset': mapset})
|
|
|
giface.currentMapsetChanged.emit(dbase=dbase,
|
|
|
location=location,
|
|
|
mapset=mapset)
|
|
@@ -724,10 +726,11 @@ def switch_mapset_interactively(guiparent, giface, dbase, location, mapset):
|
|
|
if RunCommand('g.mapset', parent=guiparent,
|
|
|
location=location,
|
|
|
mapset=mapset) == 0:
|
|
|
- GMessage(parent=guiparent,
|
|
|
- message=_("Current location is <%(loc)s>.\n"
|
|
|
- "Current mapset is <%(mapset)s>.") %
|
|
|
- {'loc': location, 'mapset': mapset})
|
|
|
+ if show_confirmation:
|
|
|
+ GMessage(parent=guiparent,
|
|
|
+ message=_("Current location is <%(loc)s>.\n"
|
|
|
+ "Current mapset is <%(mapset)s>.") %
|
|
|
+ {'loc': location, 'mapset': mapset})
|
|
|
giface.currentMapsetChanged.emit(dbase=None,
|
|
|
location=location,
|
|
|
mapset=mapset)
|
|
@@ -735,6 +738,7 @@ def switch_mapset_interactively(guiparent, giface, dbase, location, mapset):
|
|
|
if RunCommand('g.mapset',
|
|
|
parent=guiparent,
|
|
|
mapset=mapset) == 0:
|
|
|
- GMessage(parent=guiparent,
|
|
|
- message=_("Current mapset is <%s>.") % mapset)
|
|
|
+ if show_confirmation:
|
|
|
+ GMessage(parent=guiparent,
|
|
|
+ message=_("Current mapset is <%s>.") % mapset)
|
|
|
giface.currentMapsetChanged.emit(dbase=None, location=None, mapset=mapset)
|