[GRASS-SVN] r30676 - grass/trunk/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Mar 21 08:05:35 EDT 2008


Author: martinl
Date: 2008-03-21 08:05:35 -0400 (Fri, 21 Mar 2008)
New Revision: 30676

Modified:
   grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: fix message dialog when no layer is selected


Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py	2008-03-21 11:31:16 UTC (rev 30675)
+++ grass/trunk/gui/wxpython/wxgui.py	2008-03-21 12:05:35 UTC (rev 30676)
@@ -975,12 +975,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]:
@@ -1221,8 +1220,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
 
@@ -1264,9 +1262,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