def _save(self):
        (themeSize, themeSizeOk) = self._themeSizeField.itemData(self._themeSizeField.currentIndex()).toInt()
        (awayTime, awayTimeOk) = self._awayTimeField.itemData(self._awayTimeField.currentIndex()).toInt()
        (awayTimeBetweenMessages, awayTimeBetweenMessagesOk) = self._awayTimeBetweenMessagesField.itemData(self._awayTimeBetweenMessagesField.currentIndex()).toInt()

        connectionSettings = {
            "subdomain": str(self._subdomainField.text().trimmed()),
            "user": str(self._usernameField.text().trimmed()),
            "password": str(self._passwordField.text()),
            "ssl": self._sslField.isChecked(),
            "connect": self._connectField.isChecked(),
            "join": self._joinField.isChecked()
        }
        programSettings = {
            "minimize": self._minimizeField.isChecked(),
            "spell_language": self._spellLanguageField.itemData(self._spellLanguageField.currentIndex()).toString(),
            "away": self._awayField.isChecked(),
            "away_time": awayTime if awayTimeOk else 10,
            "away_time_between_messages": awayTimeBetweenMessages if awayTimeBetweenMessagesOk else 5,
            "away_message": str(self._awayMessageField.text().trimmed())
        }
        displaySettings = {
            "theme": self._themeField.itemData(self._themeField.currentIndex()).toString(),
            "size": themeSize if themeSizeOk else 100,
            "show_join_message": self._showJoinMessageField.isChecked(),
            "show_part_message": self._showPartMessageField.isChecked(),
            "show_message_timestamps": self._showMessageTimestampsField.isChecked(),
        }

        self._mainFrame.setSettings("connection", connectionSettings)
        self._mainFrame.setSettings("program", programSettings)
        self._mainFrame.setSettings("display", displaySettings)