libyui-qt-pkg  2.45.28
YQPkgTextDialog Class Reference

Dialog that shows a scrolled (HTML) text. More...

#include <YQPkgTextDialog.h>

Inheritance diagram for YQPkgTextDialog:
Collaboration diagram for YQPkgTextDialog:

Public Slots

void setText (const QString &text)
 Set the text contents.
 
void setText (const string &text)
 
void setText (ZyppSel selectable, const string &text)
 Show a text with a headline identifying a zypp::ResObject ( name+summary ).
 

Public Member Functions

 YQPkgTextDialog (const QString &text, QWidget *parent, const QString &acceptButtonLabel, const QString &rejectButtonLabel)
 Constructor. More...
 
 YQPkgTextDialog (const QString &text, QWidget *parent)
 Constructor. More...
 
virtual ~YQPkgTextDialog ()
 Destructor.
 
virtual QSize sizeHint () const
 Reimplemented from QWidget: Reserve a reasonable amount of space.
 

Static Public Member Functions

static void showText (QWidget *parent, const QString &text)
 Show a text and wait until the user confirmed with 'OK'.
 
static void showText (QWidget *parent, ZyppSel selectable, const string &text)
 Show a text with a headline identifying a selectable (name+summary).
 
static bool confirmText (QWidget *parent, const QString &text, const QString &acceptButtonLabel, const QString &rejectButtonLabel)
 Let the user confirm a text. More...
 
static bool confirmText (QWidget *parent, const QString &text)
 Let the use confirm a text with buttons "Accept" and "Cancel". More...
 
static bool confirmText (QWidget *parent, const char *text)
 
static bool confirmText (QWidget *parent, ZyppSel selectable, const string &text)
 Let the use confirm a text with a headline identifying a selectable (name+summary) with buttons "Accept" and "Cancel". More...
 
static QString htmlParagraphs (const string &rawText)
 Simple HTML formatting: Wrap paragraphs in. More...
 
static QString htmlHeading (const QString &text)
 Returns a uniform heading in HTML format.
 
static QString htmlHeading (ZyppSel selectable)
 Returns a uniform heading in HTML format for the specified selectable: name and summary.
 
static QString htmlEscape (const QString &plainText)
 Escapes characters special to HTML in a ( plain text ) string, such as: '<' -> '<' '>' -> '>' '&' -> '&'. More...
 

Protected Member Functions

void buildDialog (const QString &text, QWidget *parent, const QString &acceptButtonLabel, const QString &rejectButtonLabel="")
 Create the dialog. More...
 
bool eventFilter (QObject *obj, QEvent *ev)
 Grab [Return] press events and close dialog. More...
 

Protected Attributes

QPushButton * _acceptButton
 
QPushButton * _rejectButton
 
QTextBrowser * _textBrowser
 

Detailed Description

Dialog that shows a scrolled (HTML) text.

Definition at line 58 of file YQPkgTextDialog.h.

Constructor & Destructor Documentation

◆ YQPkgTextDialog() [1/2]

YQPkgTextDialog::YQPkgTextDialog ( const QString &  text,
QWidget *  parent,
const QString &  acceptButtonLabel,
const QString &  rejectButtonLabel 
)

Constructor.

Creates a dialog with a text browser and two buttons. This does not pop up a dialog yet. Use 'exec()' (inherited from QDialog). Or, better yet, use the static confirmText() method.

Definition at line 75 of file YQPkgTextDialog.cc.

Here is the call graph for this function:

◆ YQPkgTextDialog() [2/2]

YQPkgTextDialog::YQPkgTextDialog ( const QString &  text,
QWidget *  parent 
)

Constructor.

Creates a dialog with a text browser and an "OK" button. This does not pop up a dialog yet. Use 'exec()' (inherited from QDialog). Or, better yet, use the static showText() method.

Definition at line 68 of file YQPkgTextDialog.cc.

Here is the call graph for this function:

Member Function Documentation

◆ buildDialog()

void YQPkgTextDialog::buildDialog ( const QString &  text,
QWidget *  parent,
const QString &  acceptButtonLabel,
const QString &  rejectButtonLabel = "" 
)
protected

Create the dialog.

Called from all constructors.

Definition at line 91 of file YQPkgTextDialog.cc.

◆ confirmText() [1/3]

bool YQPkgTextDialog::confirmText ( QWidget *  parent,
const QString &  text,
const QString &  acceptButtonLabel,
const QString &  rejectButtonLabel 
)
static

Let the user confirm a text.

Returns "true" if the user clicked the accept button, false if he clicked the reject button.

Definition at line 238 of file YQPkgTextDialog.cc.

Here is the call graph for this function:

◆ confirmText() [2/3]

bool YQPkgTextDialog::confirmText ( QWidget *  parent,
const QString &  text 
)
static

Let the use confirm a text with buttons "Accept" and "Cancel".

Returns "true" if the user clicked "Accept", "false" on "Cancel".

Definition at line 255 of file YQPkgTextDialog.cc.

Here is the call graph for this function:

◆ confirmText() [3/3]

bool YQPkgTextDialog::confirmText ( QWidget *  parent,
ZyppSel  selectable,
const string &  text 
)
static

Let the use confirm a text with a headline identifying a selectable (name+summary) with buttons "Accept" and "Cancel".

Returns "true" if the user clicked "Accept", "false" on "Cancel".

Definition at line 268 of file YQPkgTextDialog.cc.

Here is the call graph for this function:

◆ eventFilter()

bool YQPkgTextDialog::eventFilter ( QObject *  obj,
QEvent *  ev 
)
protected

Grab [Return] press events and close dialog.

Inherited from QObject.

Definition at line 173 of file YQPkgTextDialog.cc.

◆ htmlEscape()

QString YQPkgTextDialog::htmlEscape ( const QString &  plainText)
static

Escapes characters special to HTML in a ( plain text ) string, such as: '<' -> '<' '>' -> '>' '&' -> '&'.

Returns the escaped string.

Definition at line 280 of file YQPkgTextDialog.cc.

◆ htmlParagraphs()

QString YQPkgTextDialog::htmlParagraphs ( const string &  rawText)
static

Simple HTML formatting: Wrap paragraphs in.

...

Paragraphs are delimited by empty lines. Return unformatted text if it contains "<!-- DT:Rich -->".

Definition at line 295 of file YQPkgTextDialog.cc.

Here is the call graph for this function:

The documentation for this class was generated from the following files: