fix crash when calendar is already configured in config file
This commit is contained in:
@@ -20,6 +20,7 @@ class MyMuellDataModel(object):
|
||||
return json.loads(str(response.read(), encoding='utf-8'))
|
||||
|
||||
def get_events(self, city_id, area_id):
|
||||
self.client.connect()
|
||||
self.client.request('GET', '/mmapp/loxone/lox.php?r=dates/0&city_id={city_id}&area_id={area_id}'.format(city_id=city_id, area_id=area_id))
|
||||
response = self.client.getresponse()
|
||||
ret = str(response.read(), encoding='utf-8')
|
||||
|
||||
@@ -73,9 +73,7 @@ class MyMuell2CalDavGui(QMainWindow):
|
||||
self._settings["url"] = self._url.text()
|
||||
self._settings["user"] = self._user.text()
|
||||
self._settings["password"] = self._password.text()
|
||||
|
||||
if self._calendarNames.currentText() != '':
|
||||
self._settings["calendar"] = self._calendarNames.currentText()
|
||||
self._settings["calendar"] = ""
|
||||
|
||||
if len(self._citiesWidget.selectedItems()) > 0:
|
||||
self._settings["mymuellcity"] = self._citiesWidget.selectedItems()[0].text()
|
||||
@@ -141,9 +139,6 @@ class MyMuell2CalDavGui(QMainWindow):
|
||||
self._calendarNames.blockSignals(False)
|
||||
self._calendarNames.setEnabled(True)
|
||||
|
||||
if self._settings["calendar"] != '':
|
||||
self._calendarNames.setCurrentText(self._settings["calendar"])
|
||||
|
||||
worker.stateChanged.emit("connected.")
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user