Skip to content

Commit

Permalink
Minor fix for basemap dialog
Browse files Browse the repository at this point in the history
to account for the fact that lsm is now a dict
see psyplot/psy-maps#17
  • Loading branch information
Chilipp committed May 17, 2020
1 parent c07435d commit e04b72a
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions psy_view/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ def __init__(self, plotter, *args, **kwargs):
self.lsm_box.setCheckable(True)
hbox = QtWidgets.QHBoxLayout(self.lsm_box)
hbox.addWidget(QtWidgets.QLabel("Resolution:"))
self.opt_110 = QtWidgets.QRadioButton("110m")
self.opt_50 = QtWidgets.QRadioButton("50m")
self.opt_10 = QtWidgets.QRadioButton("10m")
hbox.addWidget(self.opt_110)
hbox.addWidget(self.opt_50)
hbox.addWidget(self.opt_10)
self.opt_110m = QtWidgets.QRadioButton("110m")
self.opt_50m = QtWidgets.QRadioButton("50m")
self.opt_10m = QtWidgets.QRadioButton("10m")
hbox.addWidget(self.opt_110m)
hbox.addWidget(self.opt_50m)
hbox.addWidget(self.opt_10m)

vbox.addWidget(self.lsm_box)

Expand Down Expand Up @@ -119,13 +119,12 @@ def fill_from_plotter(self, plotter):
if plotter.clat.value is not None:
self.txt_clat.setText(str(plotter.clat.value))

if not plotter.lsm.value[0]:
lsm = plotter.lsm.value

if not lsm:
self.lsm_box.setChecked(False)
else:
try:
res = plotter.lsm.value[0][:-1]
except TypeError:
res = '110'
res = lsm['res']
getattr(self, 'opt_' + res).setChecked(True)

self.xgrid_value = None
Expand Down Expand Up @@ -186,11 +185,11 @@ def value(self):
self.txt_clat.text().strip())

if self.lsm_box.isChecked():
if self.opt_110.isChecked():
if self.opt_110m.isChecked():
ret['lsm'] = '110m'
elif self.opt_50.isChecked():
elif self.opt_50m.isChecked():
ret['lsm'] = '50m'
elif self.opt_10.isChecked():
elif self.opt_10m.isChecked():
ret['lsm'] = '10m'
else:
ret['lsm'] = False
Expand Down

0 comments on commit e04b72a

Please sign in to comment.