libyui-qt-pkg  2.42.13
 All Classes Functions Variables Enumerations
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)
 
void setText (const string &text)
 
void setText (ZyppSel selectable, const string &text)
 

Public Member Functions

 YQPkgTextDialog (const QString &text, QWidget *parent, const QString &acceptButtonLabel, const QString &rejectButtonLabel)
 
 YQPkgTextDialog (const QString &text, QWidget *parent)
 
virtual ~YQPkgTextDialog ()
 
virtual QSize sizeHint () const
 

Static Public Member Functions

static void showText (QWidget *parent, const QString &text)
 
static void showText (QWidget *parent, ZyppSel selectable, const string &text)
 
static bool confirmText (QWidget *parent, const QString &text, const QString &acceptButtonLabel, const QString &rejectButtonLabel)
 
static bool confirmText (QWidget *parent, const QString &text)
 
static bool confirmText (QWidget *parent, const char *text)
 
static bool confirmText (QWidget *parent, ZyppSel selectable, const string &text)
 
static QString htmlParagraphs (const string &rawText)
 
static QString htmlHeading (const QString &text)
 
static QString htmlHeading (ZyppSel selectable)
 
static QString htmlEscape (const QString &plainText)
 

Protected Member Functions

void buildDialog (const QString &text, QWidget *parent, const QString &acceptButtonLabel, const QString &rejectButtonLabel="")
 
bool eventFilter (QObject *obj, QEvent *ev)
 

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::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::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:

YQPkgTextDialog::~YQPkgTextDialog ( )
virtual

Destructor.

Definition at line 85 of file YQPkgTextDialog.cc.

Member Function Documentation

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.

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:

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:

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:

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.

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.

QString YQPkgTextDialog::htmlHeading ( const QString &  text)
static

Returns a uniform heading in HTML format.

Definition at line 313 of file YQPkgTextDialog.cc.

QString YQPkgTextDialog::htmlHeading ( ZyppSel  selectable)
static

Returns a uniform heading in HTML format for the specified selectable: name and summary

Definition at line 327 of file YQPkgTextDialog.cc.

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:

void YQPkgTextDialog::setText ( const QString &  text)
slot

Set the text contents.

Definition at line 202 of file YQPkgTextDialog.cc.

void YQPkgTextDialog::setText ( ZyppSel  selectable,
const string &  text 
)
slot

Show a text with a headline identifying a zypp::ResObject ( name+summary ).

Definition at line 214 of file YQPkgTextDialog.cc.

Here is the call graph for this function:

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

Show a text and wait until the user confirmed with 'OK'.

Definition at line 221 of file YQPkgTextDialog.cc.

Here is the call graph for this function:

void YQPkgTextDialog::showText ( QWidget *  parent,
ZyppSel  selectable,
const string &  text 
)
static

Show a text with a headline identifying a selectable (name+summary).

Definition at line 230 of file YQPkgTextDialog.cc.

Here is the call graph for this function:

QSize YQPkgTextDialog::sizeHint ( ) const
virtual

Reimplemented from QWidget: Reserve a reasonable amount of space.

Definition at line 166 of file YQPkgTextDialog.cc.


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