QtPass 2.0.0
Developer documentation
Loading...
Searching...
No Matches
PlainMessageBox Namespace Reference

Message boxes whose text is shown as the text it is. More...

Functions

auto show (QWidget *parent, QMessageBox::Icon icon, const QString &title, const QString &text, QMessageBox::StandardButtons buttons=QMessageBox::Ok) -> QMessageBox::StandardButton
 Show a modal message box with plain text and wait for it.
auto askYes (QWidget *parent, const QString &title, const QString &text) -> bool
 Ask a yes/no question in plain text.
auto askToGiveNewReaders (QWidget *parent, const QString &store, const QStringList &entries) -> bool
 Ask whether to go on although entries would gain readers: with the pass backend, pass re-encrypts every entry of a folder itself, so a copy someone planted from a folder you are not on would be handed to this folder's recipients.
auto confirmPassRun (QWidget *parent, const QString &store, const std::function< QStringList()> &check) -> bool
 Run check (which lists the entries a pass run would give new readers, one gpg call each) under a wait cursor, and ask about what it finds (askToGiveNewReaders()).
void warning (QWidget *parent, const QString &title, const QString &text)
 Show a warning in plain text.
void critical (QWidget *parent, const QString &title, const QString &text)
 Show an error in plain text.

Detailed Description

Message boxes whose text is shown as the text it is.

QMessageBox's static helpers read their text as rich text when it looks like it (Qt::AutoText). A message quoting a name from the store would then be markup that other writers of a shared store control: a folder named <img src=" with dev/zero">.gpg beneath it has Qt read /dev/zero without end. These set Qt::PlainText before the text, for every message that quotes a path, a field or anything else from the store.

Function Documentation

◆ askToGiveNewReaders()

auto PlainMessageBox::askToGiveNewReaders ( QWidget * parent,
const QString & store,
const QStringList & entries ) -> bool

Ask whether to go on although entries would gain readers: with the pass backend, pass re-encrypts every entry of a folder itself, so a copy someone planted from a folder you are not on would be handed to this folder's recipients.

Parameters
parentThe parent widget.
storeThe store root, for naming the entries.
entriesThe entries, absolute paths.
Returns
Whether to go on.

Definition at line 142 of file plainmessagebox.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ askYes()

auto PlainMessageBox::askYes ( QWidget * parent,
const QString & title,
const QString & text ) -> bool

Ask a yes/no question in plain text.

Parameters
parentThe parent widget.
titleThe window title.
textThe question, shown as it is.
Returns
Whether Yes was clicked.

Definition at line 126 of file plainmessagebox.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ confirmPassRun()

auto PlainMessageBox::confirmPassRun ( QWidget * parent,
const QString & store,
const std::function< QStringList()> & check ) -> bool

Run check (which lists the entries a pass run would give new readers, one gpg call each) under a wait cursor, and ask about what it finds (askToGiveNewReaders()).

Parameters
parentThe parent widget.
storeThe store root, for naming the entries.
checkLists the entries.
Returns
Whether to go on: nothing found, or the user agreed.

Definition at line 169 of file plainmessagebox.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ critical()

void PlainMessageBox::critical ( QWidget * parent,
const QString & title,
const QString & text )

Show an error in plain text.

Parameters
parentThe parent widget.
titleThe window title.
textThe error, shown as it is.

Definition at line 137 of file plainmessagebox.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ show()

auto PlainMessageBox::show ( QWidget * parent,
QMessageBox::Icon icon,
const QString & title,
const QString & text,
QMessageBox::StandardButtons buttons = QMessageBox::Ok ) -> QMessageBox::StandardButton

Show a modal message box with plain text and wait for it.

Parameters
parentThe parent widget.
iconThe icon.
titleThe window title.
textThe message, shown as it is: plain, with characters that turn the text around shown as U+FFFD (Util::displayable()), and cut longer than 40 lines or 4000 characters to its start and end, as tool output quoted in it can be any length; all of it (past 256 KB its start and end) is under "Show Details...".
buttonsThe buttons offered.
Returns
The button clicked.

Definition at line 95 of file plainmessagebox.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ warning()

void PlainMessageBox::warning ( QWidget * parent,
const QString & title,
const QString & text )

Show a warning in plain text.

Parameters
parentThe parent widget.
titleThe window title.
textThe warning, shown as it is.

Definition at line 132 of file plainmessagebox.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: