42 #define YUILogComponent "qt-pkg" 45 #include "YQPkgTechnicalDetailsView.h" 68 _selectable = selectable;
82 ZyppPkg candidate = tryCastToZyppPkg( selectable->candidateObj() );
83 ZyppPkg installed = tryCastToZyppPkg( selectable->installedObj() );
85 if ( candidate && installed && candidate != installed )
87 html_text +=
complexTable( selectable, installed, candidate );
98 html_text += htmlEnd();
100 setHtml( html_text );
107 QString html =
"<td align='top'>";
109 list<string> authors = pkg->authors();
110 list<string>::const_iterator it = authors.begin();
112 while ( it != authors.end() )
114 line = fromUTF8( *it );
116 html += line +
"<br>";
132 html +=
row(
hcell( _(
"Version:" ) ) +
cell( pkg->edition().asString() ) );
133 html +=
row(
hcell( _(
"Build Time:" ) ) +
cell( pkg->buildtime() ) );
136 *pkg == selectable->installedObj() ?
137 row(
hcell( _(
"Install Time:" ) ) +
cell( pkg->installtime() ) ) :
"";
139 html +=
row(
hcell( _(
"License:" ) ) +
cell( pkg->license() ) );
140 html +=
row(
hcell( _(
"Installed Size:" ) ) +
cell( pkg->installSize().asString() ) );
141 html +=
row(
hcell( _(
"Download Size:" ) ) +
cell( pkg->downloadSize().asString() ) );
142 html +=
row(
hcell( _(
"Distribution:" ) ) +
cell( pkg->distribution() ) );
143 html +=
row(
hcell( _(
"Vendor:" ) ) +
cell( pkg->vendor() ) );
144 html +=
row(
hcell( _(
"Packager:" ) ) +
cell( pkg->packager() ) );
145 html +=
row(
hcell( _(
"Architecture:" ) ) +
cell( pkg->arch().asString() ) );
146 html +=
row(
hcell( _(
"Build Host:" ) ) +
cell( pkg->buildhost() ) );
147 html +=
row(
hcell( _(
"URL:" ) ) +
cell( pkg->url() ) );
148 html +=
row(
hcell( _(
"Source Package:" ) ) +
cell( pkg->sourcePkgName() +
"-" + pkg->sourcePkgEdition().asString() ) );
149 html +=
row(
hcell( _(
"Media No.:" ) ) +
cell( pkg->mediaNr() ) );
152 html =
"<br>" +
table( html );
163 ZyppPkg p1 = candidate;
164 ZyppPkg p2 = installed;
166 QString p1_header = _(
"<b>Alternate Version</b>" );
167 QString p2_header = _(
"<b>Installed Version</b>" );
171 html +=
row(
hcell( QString(
"" ) ) +
hcell(
"<b>" + p1_header +
"</b>" ) +
hcell(
"<b>" + p2_header +
"</b>" ) );
173 html +=
row(
hcell( _(
"Version:" ) ) +
cell( p1->edition().asString() ) +
cell( p2->edition().asString() ) );
174 html +=
row(
hcell( _(
"Build Time:" ) ) +
cell( p1->buildtime() ) +
cell( p2->buildtime() ) );
175 html +=
row(
hcell( _(
"Install Time:" ) ) +
cell( p1->installtime() ) +
cell( p2->installtime() ) );
176 html +=
row(
hcell( _(
"License:" ) ) +
cell( p1->license() ) +
cell( p2->license() ) );
177 html +=
row(
hcell( _(
"Installed Size:" ) ) +
cell( p1->installSize().asString() ) +
cell( p2->installSize().asString() ) );
178 html +=
row(
hcell( _(
"Download Size:" ) ) +
cell( p1->downloadSize().asString() ) +
cell( p2->downloadSize().asString() ) );
179 html +=
row(
hcell( _(
"Distribution:" ) ) +
cell( p1->distribution() ) +
cell( p2->distribution() ) );
180 html +=
row(
hcell( _(
"Vendor:" ) ) +
cell( p1->vendor() ) +
cell( p2->vendor() ) );
181 html +=
row(
hcell( _(
"Packager:" ) ) +
cell( p1->packager() ) +
cell( p2->packager() ) );
182 html +=
row(
hcell( _(
"Architecture:" ) ) +
cell( p1->arch().asString() ) +
cell( p2->arch().asString() ) );
183 html +=
row(
hcell( _(
"Build Host:" ) ) +
cell( p1->buildhost() ) +
cell( p2->buildhost() ) );
184 html +=
row(
hcell( _(
"URL:" ) ) +
cell( p1->url() ) +
cell( p2->url() ) );
185 html +=
row(
hcell( _(
"Source Package:" ) ) +
cell( p1->sourcePkgName() +
"-" + p1->sourcePkgEdition().asString() )
186 +
cell( p2->sourcePkgName() +
"-" + p2->sourcePkgEdition().asString() ) );
187 html +=
row(
hcell( _(
"Media No.:" ) ) +
cell( p1->mediaNr() ) +
cell( p2->mediaNr() ) );
191 html =
"<br>" +
table( html );
static QString hcell(QString contents)
Returns a string containing a HTML table cell with 'contents' for table headers.
virtual ~YQPkgTechnicalDetailsView()
Destructor.
virtual void showDetails(ZyppSel selectable)
Show details for the specified zypp::ResObject: In this case technical data, very much like "rpm -qi"...
static QString htmlHeading(ZyppSel selectable, bool showVersion=false)
Returns a uniform heading in HTML format for the specified selectable: name and summary or name...
Abstract base class for details views.
static QString cell(QString contents)
Returns a string containing a HTML table cell with 'contents'.
static QString htmlEscape(const QString &plainText)
Escapes characters special to HTML in a ( plain text ) string, such as: '<' -> '<' '>' -> '>' '&' -> ...
QString complexTable(ZyppSel selectable, ZyppPkg installedPkg, ZyppPkg candidatePkg)
Returns a string containing a HTML table for technical details for two package instances: The install...
QString authorsListCell(ZyppPkg pkg) const
Returns a string containing HTML code for a package's authors list.
YQPkgTechnicalDetailsView(QWidget *parent)
Constructor.
QString simpleTable(ZyppSel selectable, ZyppPkg pkg)
Returns a string containing a HTML table for technical details for one package.
static QString table(const QString &contents)
Returns a string containing a HTML table with 'contents'.
static QString row(const QString &contents)
Returns a string containing a HTML table row with 'contents'.
static QString htmlStart()
starts the html tag and set the style