コード例 #1
0
ファイル: core.py プロジェクト: andersk/zulip-terminal
 def stream_muting_confirmation_popup(self, button: Any) -> None:
     currently_muted = self.model.is_muted_stream(button.stream_id)
     type_of_action = "unmuting" if currently_muted else "muting"
     question = urwid.Text(("bold", "Confirm " + type_of_action +
                            " of stream '" + button.stream_name + "' ?"),
                           "center")
     mute_this_stream = partial(self.model.toggle_stream_muted_status,
                                button.stream_id)
     self.loop.widget = PopUpConfirmationView(self, question,
                                              mute_this_stream)
コード例 #2
0
ファイル: core.py プロジェクト: Rohitth007/zulip-terminal
 def stream_muting_confirmation_popup(
     self, stream_id: int, stream_name: str
 ) -> None:
     currently_muted = self.model.is_muted_stream(stream_id)
     type_of_action = "unmuting" if currently_muted else "muting"
     question = urwid.Text(
         ("bold", f"Confirm {type_of_action} of stream '{stream_name}' ?"),
         "center",
     )
     mute_this_stream = partial(self.model.toggle_stream_muted_status, stream_id)
     self.loop.widget = PopUpConfirmationView(self, question, mute_this_stream)
コード例 #3
0
 def popup_view(self, mocker, stream_button):
     self.controller = mocker.Mock()
     self.controller.view.LEFT_WIDTH = 27
     self.callback = mocker.Mock()
     self.list_walker = mocker.patch(LISTWALKER, return_value=[])
     self.divider = mocker.patch(MODULE + ".urwid.Divider")
     self.text = mocker.patch(MODULE + ".urwid.Text")
     self.wrapper_w = mocker.patch(MODULE + ".urwid.WidgetWrap")
     return PopUpConfirmationView(
         self.controller,
         self.text,
         self.callback,
     )
コード例 #4
0
 def popup_view(self, mocker, stream_button):
     self.controller = mocker.Mock()
     self.controller.view.LEFT_WIDTH = 27
     self.callback = mocker.Mock()
     self.list_walker = mocker.patch(VIEWS + ".urwid.SimpleFocusListWalker",
                                     return_value=[])
     self.divider = mocker.patch(VIEWS + '.urwid.Divider')
     self.text = mocker.patch(VIEWS + '.urwid.Text')
     self.wrapper_w = mocker.patch(VIEWS + '.urwid.WidgetWrap')
     return PopUpConfirmationView(
         self.controller,
         self.text,
         self.callback,
     )
コード例 #5
0
 def save_draft_confirmation_popup(self, draft: Composition) -> None:
     question = urwid.Text('Save this message as a draft?'
                           ' (This will overwrite the existing draft.)')
     save_draft = partial(self.model.save_draft, draft)
     self.loop.widget = PopUpConfirmationView(self, question, save_draft)