[GRASS-SVN] r54610 - grass/trunk/gui/wxpython/web_services
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jan 13 06:54:13 PST 2013
Author: martinl
Date: 2013-01-13 06:54:13 -0800 (Sun, 13 Jan 2013)
New Revision: 54610
Modified:
grass/trunk/gui/wxpython/web_services/dialogs.py
grass/trunk/gui/wxpython/web_services/widgets.py
Log:
wxGUI: wms dialog layout cosmetics
Modified: grass/trunk/gui/wxpython/web_services/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/web_services/dialogs.py 2013-01-12 16:55:42 UTC (rev 54609)
+++ grass/trunk/gui/wxpython/web_services/dialogs.py 2013-01-13 14:54:13 UTC (rev 54610)
@@ -115,6 +115,10 @@
self.reqDataPanel = wx.Panel(parent = self, id = wx.ID_ANY)
+ self.layerNameBox = wx.StaticBox(parent = self.reqDataPanel,
+ id = wx.ID_ANY,
+ label = _(" Layer Manager Settings "))
+
self.layerNameText = wx.StaticText(parent = self.reqDataPanel, id = wx.ID_ANY,
label = _("Output layer name:"))
self.layerName = wx.TextCtrl(parent = self.reqDataPanel, id = wx.ID_ANY)
@@ -178,10 +182,10 @@
reqDataSizer = wx.BoxSizer(wx.VERTICAL)
- layerNameSizer = wx.BoxSizer(wx.HORIZONTAL)
+ layerNameSizer = wx.StaticBoxSizer(self.layerNameBox, wx.HORIZONTAL)
layerNameSizer.Add(item = self.layerNameText,
- flag = wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, border = 5)
+ flag = wx.ALIGN_CENTER_VERTICAL | wx.ALL, border = 5)
layerNameSizer.Add(item = self.layerName,
flag = wx.EXPAND, proportion = 1)
@@ -405,7 +409,7 @@
self.Bind(wx.EVT_RADIOBOX, self.OnChooseWs, self.choose_ws_rb)
self.ch_ws_sizer.Add(item = self.choose_ws_rb,
- flag = wx.TOP | wx.LEFT | wx.RIGHT, border = 5)
+ flag = wx.TOP | wx.LEFT | wx.RIGHT | wx.EXPAND, border = 5)
self._showWsPanel(self.web_service_sel[self.choose_ws_rb.GetSelection()])
self.statusbar.SetStatusText(_("Connected to <%s>" % self.server.GetValue().strip()))
for btn in self.run_btns:
@@ -466,7 +470,7 @@
WSDialogBase._createWidgets(self)
self.btn_add = wx.Button(parent = self, id = wx.ID_ANY, label = _("&Add layer"))
- self.btn_add.SetToolTipString(_("Import selected layers"))
+ self.btn_add.SetToolTipString(_("Add selected web service layers as map layer into layer tree"))
self.btn_add.Enable(False)
self.run_btns.append(self.btn_add)
@@ -896,7 +900,7 @@
msg = _('Output map <%s> already exists' % self.output)
if msg:
- GWarning(parent = self,
+ GMessage(parent = self,
message = msg)
return
Modified: grass/trunk/gui/wxpython/web_services/widgets.py
===================================================================
--- grass/trunk/gui/wxpython/web_services/widgets.py 2013-01-12 16:55:42 UTC (rev 54609)
+++ grass/trunk/gui/wxpython/web_services/widgets.py 2013-01-13 14:54:13 UTC (rev 54610)
@@ -7,7 +7,7 @@
- widgets::WSPanel
- widgets::LayersList
-(C) 2012 by the GRASS Development Team
+(C) 2012-2013 by the GRASS Development Team
This program is free software under the GNU General Public License
(>=v2). Read the file COPYING that comes with GRASS for details.
@@ -32,19 +32,16 @@
from core import globalvar
from core.debug import Debug
-from core.gcmd import GWarning
+from core.gcmd import GWarning, GMessage
from core.gconsole import CmdThread, EVT_CMD_DONE
-from web_services.cap_interface import WMSCapabilities, \
- WMTSCapabilities, \
- OnEarthCapabilities
+from web_services.cap_interface import WMSCapabilities, WMTSCapabilities, OnEarthCapabilities
from gui_core.widgets import GNotebook
import grass.script as grass
-WMSLibPath = os.path.join(os.getenv("GISBASE"), "etc", "r.in.wms")
-sys.path.append(WMSLibPath)
+sys.path.append(os.path.join(os.getenv("GISBASE"), "etc", "r.in.wms"))
from wms_base import WMSDriversInfo
@@ -158,11 +155,10 @@
self.params['srs'] = None
if 'srs' not in self.drv_props['ignored_params']:
projText = wx.StaticText(parent = self.req_page_panel, id = wx.ID_ANY, label = _("Source projection:"))
- self.params['srs'] = wx.Choice(parent = self.req_page_panel, id = wx.ID_ANY, pos = wx.DefaultPosition,
- choices = [], style = wx.RA_SPECIFY_COLS)
-
+ self.params['srs'] = wx.Choice(parent = self.req_page_panel, id = wx.ID_ANY, style = wx.RA_SPECIFY_COLS)
+
self.list.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnListSelChanged)
-
+
# layout
self.req_page_sizer = wx.BoxSizer(wx.VERTICAL)
@@ -170,24 +166,24 @@
layersSizer.Add(item = self.list, proportion = 1,
flag = wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border = 5)
-
self.req_page_sizer.Add(item = layersSizer, proportion = 1,
flag = wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border = 5)
+ self.source_sizer = wx.BoxSizer(wx.HORIZONTAL)
+
if self.params['format'] is not None:
- self.req_page_sizer.Add(item = self.params['format'],
- flag = wx.LEFT | wx.RIGHT | wx.BOTTOM, border = 5)
+ self.source_sizer.Add(item = self.params['format'],
+ flag = wx.LEFT | wx.RIGHT | wx.BOTTOM, border = 5)
- projSizer = wx.BoxSizer(wx.HORIZONTAL)
-
if self.params['srs'] is not None:
- projSizer.Add(item = projText, flag = wx.ALIGN_CENTER_VERTICAL)
- projSizer.Add(item = self.params['srs'])
-
- self.req_page_sizer.Add(item = projSizer,
+ self.source_sizer.Add(item = projText, flag = wx.ALIGN_CENTER_VERTICAL | wx.ALL, border = 5)
+ self.source_sizer.Add(item = self.params['srs'],
+ flag = wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP | wx.BOTTOM, border = 5)
+
+ self.req_page_sizer.Add(item = self.source_sizer,
flag = wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border = 5)
-
+
self.req_page_panel.SetSizer(self.req_page_sizer)
def enableButtons(self, enable = True):
@@ -751,9 +747,9 @@
label = _("Source image format"), pos = wx.DefaultPosition,
choices = formats_list, majorDimension = 4,
style = wx.RA_SPECIFY_COLS)
- self.req_page_sizer.Insert(item = self.params['format'], before = 2,
- flag = wx.LEFT | wx.RIGHT | wx.BOTTOM, border = 5)
-
+ self.source_sizer.Insert(item = self.params['format'], before = 2,
+ flag = wx.LEFT | wx.RIGHT | wx.BOTTOM, border = 5)
+
def _getFormats(self, layer = None):
"""!Get formats
@@ -795,11 +791,11 @@
show_war = True
if not self.o_layer_name:
- warning_str += _("Insert output layer name.\n")
+ warning_str += _("Choose output layer name.\n")
show_war = True
if show_war:
- GWarning(parent = self.parent,
+ GMessage(parent = self.parent,
message = warning_str)
return False
More information about the grass-commit
mailing list