Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
6e3bc165 by lovetox at 2021-05-03T22:52:55+02:00
AdHoc: Cancel action is always possible
- - - - -
1 changed file:
- nbxmpp/modules/adhoc.py
Changes:
=====================================
nbxmpp/modules/adhoc.py
=====================================
@@ -150,12 +150,15 @@ def _parse_notes(command):
def _parse_actions(command):
+ if command.getAttr('status') != 'executing':
+ return [], None
+
actions_node = command.getTag('actions')
if actions_node is None:
# If there is no <actions/> element,
# the user-agent can use a single-stage dialog or view.
# The action "execute" is equivalent to the action "complete".
- return [AdHocAction.COMPLETE], AdHocAction.COMPLETE
+ return [AdHocAction.CANCEL, AdHocAction.COMPLETE], AdHocAction.COMPLETE
actions = []
for action in actions_node.getChildren():
@@ -167,6 +170,9 @@ def _parse_actions(command):
if not actions:
raise ValueError('actions element without actions')
+ # The action "cancel" is always allowed.
+ actions.append(AdHocAction.CANCEL)
+
default = actions_node.getAttr('execute')
if default is None:
# If the "execute" attribute is absent, it defaults to "next".
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/6e3bc1655ed7210a9ef86fdb…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/6e3bc1655ed7210a9ef86fdb…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
384bed1e by lovetox at 2021-05-03T22:31:10+02:00
AdHoc: There is always a default action
- - - - -
5685a7c7 by lovetox at 2021-05-03T23:00:36+02:00
AdHoc: Don’t add cancel action
nbxmpp provides it already
- - - - -
1 changed file:
- gajim/gtk/adhoc.py
Changes:
=====================================
gajim/gtk/adhoc.py
=====================================
@@ -297,12 +297,9 @@ def _on_is_valid(self, _widget, is_valid):
def get_visible_buttons(self):
actions = list(map(lambda action: action.value,
self._last_stage_data.actions))
- actions.append('cancel')
return actions
def get_default_button(self):
- if self._last_stage_data.default is None:
- return None
return self._last_stage_data.default.value
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/3d87009dd904a3b5e731e41f7a996f7…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/3d87009dd904a3b5e731e41f7a996f7…
You're receiving this email because of your account on dev.gajim.org.