Example #1
0
    def refresh(self, args=None):
        super().refresh(args)

        summary = ntp.get_ntp_servers_summary(self._servers, self._states)

        self.window.add_with_separator(TextWidget(summary))

        self._container = ListColumnContainer(1, columns_width=78, spacing=1)
        self._container.add(TextWidget(_("Add NTP server")),
                            self._add_ntp_server)

        # only add the remove option when we can remove something
        if self._servers:
            self._container.add(TextWidget(_("Remove NTP server")),
                                self._remove_ntp_server)

        self.window.add_with_separator(self._container)
Example #2
0
    def _summary_text(self):
        """Return summary of current timezone & NTP configuration.

        :returns: current status
        :rtype: str
        """
        msg = ""

        # timezone
        kickstart_timezone = self._timezone_module.Timezone
        timezone_msg = _("not set")
        if kickstart_timezone:
            timezone_msg = kickstart_timezone

        msg += _("Timezone: %s\n") % timezone_msg

        # newline section separator
        msg += "\n"

        # NTP
        msg += ntp.get_ntp_servers_summary(self._ntp_servers,
                                           self._ntp_servers_states)

        return msg