[GRASS-SVN] r30677 - grass/branches/releasebranch_6_3/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Mar 21 08:49:51 EDT 2008


Author: martinl
Date: 2008-03-21 08:49:51 -0400 (Fri, 21 Mar 2008)
New Revision: 30677

Modified:
   grass/branches/releasebranch_6_3/gui/wxpython/wxgui.py
Log:
wxGUI: fix message dialog when no layer is selected (backported from trunk)


Modified: grass/branches/releasebranch_6_3/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/releasebranch_6_3/gui/wxpython/wxgui.py	2008-03-21 12:05:35 UTC (rev 30676)
+++ grass/branches/releasebranch_6_3/gui/wxpython/wxgui.py	2008-03-21 12:49:51 UTC (rev 30677)
@@ -970,12 +970,11 @@
             maptype = None
 
         if not maptype or maptype != 'vector':
-            dlg = wx.MessageDialog(parent=self,
-                                   message=_("Attribute management is available only "
-                                             "for vector maps."),
-                                   caption=_("Error"), style=wx.OK | wx.ICON_ERROR)
-            dlg.ShowModal()
-            dlg.Destroy()
+            wx.MessageBox(parent=self,
+                          message=_("Attribute management is available only "
+                                    "for vector maps."),
+                          caption=_("Message"),
+                          style=wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
             return
 
         if not self.curr_page.maptree.GetPyData(layer)[0]:
@@ -1216,8 +1215,7 @@
         """
         Delete selected map display layer in GIS Manager tree widget
         """
-
-        if not self.curr_page.maptree.GetSelections():
+        if not self.curr_page.maptree.layer_selected:
             self.MsgNoLayerSelected()
             return
 
@@ -1259,9 +1257,10 @@
 
     def MsgNoLayerSelected(self):
         """Show dialog message 'No layer selected'"""
-        dlg = wx.MessageDialog(self, _("No layer selected"), _("Error"), wx.OK | wx.ICON_ERROR)
-        dlg.ShowModal()
-        dlg.Destroy()
+        wx.MessageBox(parent=self,
+                      message=_("No map layer selected. Operation cancelled."),
+                      caption=_("Message"),
+                      style=wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
 
 class GMApp(wx.App):
     """



More information about the grass-commit mailing list