MCPcopy
hub / github.com/freedomofpress/dangerzone / prompt_user

Method prompt_user

dangerzone/gui/startup.py:159–173  ·  view source on GitHub ↗

Prompt user to enable updates. When download is required (no container available), this blocks until the user responds. Otherwise, this is non-blocking (user will be asked again next run). Returns True if user accepts, False if user declines, None if dismissed/non-blocking.

(self, download_required: bool = False)

Source from the content-addressed store, hash-verified

157 container_update_available = QtCore.Signal(object)
158
159 def prompt_user(self, download_required: bool = False) -> bool | None:
160 """Prompt user to enable updates.
161
162 When download is required (no container available), this blocks until the user
163 responds. Otherwise, this is non-blocking (user will be asked again next run).
164
165 Returns True if user accepts, False if user declines, None if dismissed/non-blocking.
166 """
167 if download_required:
168 # No container available: block until user responds
169 return PromptRequest().ask(self.needs_user_input_download)
170 else:
171 # Container available: non-blocking, just emit and return
172 self.needs_user_input.emit()
173 return None
174
175 def handle_app_update(self, report: ReleaseReport) -> None:
176 self.app_update_available.emit(report)

Callers

nothing calls this directly

Calls 3

PromptRequestClass · 0.85
askMethod · 0.80
emitMethod · 0.80

Tested by

no test coverage detected