42 #define YUILogComponent "qt-pkg"
45 #include "YQPkgTechnicalDetailsView.h"
70 _selectable = selectable;
84 ZyppPkg candidate = tryCastToZyppPkg( selectable->candidateObj() );
85 ZyppPkg installed = tryCastToZyppPkg( selectable->installedObj() );
87 if ( candidate && installed && candidate != installed )
89 html_text +=
complexTable( selectable, installed, candidate );
100 html_text += htmlEnd();
102 setHtml( html_text );
109 QString html =
"<td align='top'>";
111 list<string> authors = pkg->authors();
112 list<string>::const_iterator it = authors.begin();
114 while ( it != authors.end() )
116 line = fromUTF8( *it );
118 html += line +
"<br>";
131 QStringList groups = fromUTF8( pkg->group() ).split(
'/', QString::KeepEmptyParts );
135 QStringList translated;
137 for ( QStringList::const_iterator it = groups.begin();
141 translated.append( QString::fromUtf8( dgettext(
"rpm-groups", (*it).toUtf8() ) ) );
144 return translated.join(
"/" );
154 html +=
row(
hcell( _(
"Version:" ) ) +
cell( pkg->edition().asString() ) );
155 html +=
row(
hcell( _(
"Build Time:" ) ) +
cell( pkg->buildtime() ) );
158 *pkg == selectable->installedObj() ?
159 row(
hcell( _(
"Install Time:" ) ) +
cell( pkg->installtime() ) ) :
"";
162 html +=
row(
hcell( _(
"License:" ) ) +
cell( pkg->license() ) );
163 html +=
row(
hcell( _(
"Installed Size:" ) ) +
cell( pkg->installSize().asString() ) );
164 html +=
row(
hcell( _(
"Download Size:" ) ) +
cell( pkg->downloadSize().asString() ) );
165 html +=
row(
hcell( _(
"Distribution:" ) ) +
cell( pkg->distribution() ) );
166 html +=
row(
hcell( _(
"Vendor:" ) ) +
cell( pkg->vendor() ) );
167 html +=
row(
hcell( _(
"Packager:" ) ) +
cell( pkg->packager() ) );
168 html +=
row(
hcell( _(
"Architecture:" ) ) +
cell( pkg->arch().asString() ) );
169 html +=
row(
hcell( _(
"Build Host:" ) ) +
cell( pkg->buildhost() ) );
170 html +=
row(
hcell( _(
"URL:" ) ) +
cell( pkg->url() ) );
171 html +=
row(
hcell( _(
"Source Package:" ) ) +
cell( pkg->sourcePkgName() +
"-" + pkg->sourcePkgEdition().asString() ) );
172 html +=
row(
hcell( _(
"Media No.:" ) ) +
cell( pkg->mediaNr() ) );
175 html =
"<br>" +
table( html );
186 ZyppPkg p1 = candidate;
187 ZyppPkg p2 = installed;
189 QString p1_header = _(
"<b>Alternate Version</b>" );
190 QString p2_header = _(
"<b>Installed Version</b>" );
194 html +=
row(
hcell( QString(
"" ) ) +
hcell(
"<b>" + p1_header +
"</b>" ) +
hcell(
"<b>" + p2_header +
"</b>" ) );
196 html +=
row(
hcell( _(
"Version:" ) ) +
cell( p1->edition().asString() ) +
cell( p2->edition().asString() ) );
197 html +=
row(
hcell( _(
"Build Time:" ) ) +
cell( p1->buildtime() ) +
cell( p2->buildtime() ) );
198 html +=
row(
hcell( _(
"Install Time:" ) ) +
cell( p1->installtime() ) +
cell( p2->installtime() ) );
200 html +=
row(
hcell( _(
"License:" ) ) +
cell( p1->license() ) +
cell( p2->license() ) );
201 html +=
row(
hcell( _(
"Installed Size:" ) ) +
cell( p1->installSize().asString() ) +
cell( p2->installSize().asString() ) );
202 html +=
row(
hcell( _(
"Download Size:" ) ) +
cell( p1->downloadSize().asString() ) +
cell( p2->downloadSize().asString() ) );
203 html +=
row(
hcell( _(
"Distribution:" ) ) +
cell( p1->distribution() ) +
cell( p2->distribution() ) );
204 html +=
row(
hcell( _(
"Vendor:" ) ) +
cell( p1->vendor() ) +
cell( p2->vendor() ) );
205 html +=
row(
hcell( _(
"Packager:" ) ) +
cell( p1->packager() ) +
cell( p2->packager() ) );
206 html +=
row(
hcell( _(
"Architecture:" ) ) +
cell( p1->arch().asString() ) +
cell( p2->arch().asString() ) );
207 html +=
row(
hcell( _(
"Build Host:" ) ) +
cell( p1->buildhost() ) +
cell( p2->buildhost() ) );
208 html +=
row(
hcell( _(
"URL:" ) ) +
cell( p1->url() ) +
cell( p2->url() ) );
209 html +=
row(
hcell( _(
"Source Package:" ) ) +
cell( p1->sourcePkgName() +
"-" + p1->sourcePkgEdition().asString() )
210 +
cell( p2->sourcePkgName() +
"-" + p2->sourcePkgEdition().asString() ) );
211 html +=
row(
hcell( _(
"Media No.:" ) ) +
cell( p1->mediaNr() ) +
cell( p2->mediaNr() ) );
215 html =
"<br>" +
table( html );
221 #include "YQPkgTechnicalDetailsView.moc"
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.
QString formatRpmGroup(ZyppPkg pkg) const
Format an RPM group.
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