[GRASS-SVN] r52688 - grass/trunk/gui/wxpython/gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Aug 17 03:13:50 PDT 2012
Author: annakrat
Date: 2012-08-17 03:13:50 -0700 (Fri, 17 Aug 2012)
New Revision: 52688
Modified:
grass/trunk/gui/wxpython/gui_core/dialogs.py
Log:
wxGUI: close button instead of cancel in import dialog, close on finish added
Modified: grass/trunk/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/dialogs.py 2012-08-17 09:41:10 UTC (rev 52687)
+++ grass/trunk/gui/wxpython/gui_core/dialogs.py 2012-08-17 10:13:50 UTC (rev 52688)
@@ -1628,14 +1628,17 @@
self.overwrite.SetValue(UserSettings.Get(group = 'cmd', key = 'overwrite', subkey = 'enabled'))
self.add = wx.CheckBox(parent = self.panel, id = wx.ID_ANY)
+ self.closeOnFinish = wx.CheckBox(parent = self.panel, id = wx.ID_ANY,
+ label = _("Close dialog on finish"))
+ self.closeOnFinish.SetValue(UserSettings.Get(group = 'cmd', key = 'closeDlg', subkey = 'enabled'))
#
# buttons
#
# cancel
- self.btn_cancel = wx.Button(parent = self.panel, id = wx.ID_CANCEL)
- self.btn_cancel.SetToolTipString(_("Close dialog"))
- self.btn_cancel.Bind(wx.EVT_BUTTON, self.OnCancel)
+ self.btn_close = wx.Button(parent = self.panel, id = wx.ID_CLOSE)
+ self.btn_close.SetToolTipString(_("Close dialog"))
+ self.btn_close.Bind(wx.EVT_BUTTON, self.OnClose)
# run
self.btn_run = wx.Button(parent = self.panel, id = wx.ID_OK, label = _("&Import"))
self.btn_run.SetToolTipString(_("Import selected layers"))
@@ -1680,6 +1683,8 @@
dialogSizer.Add(item = self.add, proportion = 0,
flag = wx.LEFT | wx.RIGHT | wx.BOTTOM, border = 5)
+ dialogSizer.Add(item = self.closeOnFinish, proportion = 0,
+ flag = wx.LEFT | wx.RIGHT | wx.BOTTOM, border = 5)
#
# buttons
#
@@ -1689,7 +1694,7 @@
flag = wx.RIGHT | wx.ALIGN_CENTER,
border = 10)
- btnsizer.Add(item = self.btn_cancel, proportion = 0,
+ btnsizer.Add(item = self.btn_close, proportion = 0,
flag = wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER,
border = 10)
@@ -1718,7 +1723,7 @@
"""!Get command"""
return ''
- def OnCancel(self, event = None):
+ def OnClose(self, event = None):
"""!Close dialog"""
self.Close()
@@ -1889,6 +1894,9 @@
if popOGR:
os.environ.pop('GRASS_VECTOR_OGR')
+
+ if self.closeOnFinish.IsChecked():
+ self.Close()
def _getCommand(self):
"""!Get command"""
More information about the grass-commit
mailing list