42 #define YUILogComponent "qt-pkg"
45 #include <qdatetime.h>
46 #include "YQPkgDependenciesView.h"
66 _selectable = selectable;
77 ZyppObj candidate = selectable->candidateObj();
78 ZyppObj installed = selectable->installedObj();
80 if ( candidate && installed && candidate != installed )
93 html_text += htmlEnd();
102 QString html =
"<br>" +
104 row(
hcell( _(
"Version:" ) ) +
cell( pkg->edition().asString() ) ) +
106 row( _(
"Provides:"), pkg->dep( zypp::Dep::PROVIDES ) ) +
107 row( _(
"Prerequires:"), pkg->dep( zypp::Dep::PREREQUIRES ) ) +
108 row( _(
"Requires:"), pkg->dep( zypp::Dep::REQUIRES ) ) +
109 row( _(
"Conflicts:"), pkg->dep( zypp::Dep::CONFLICTS ) ) +
110 row( _(
"Obsoletes:"), pkg->dep( zypp::Dep::OBSOLETES ) ) +
111 row( _(
"Recommends:"), pkg->dep( zypp::Dep::RECOMMENDS ) ) +
112 row( _(
"Suggests:"), pkg->dep( zypp::Dep::SUGGESTS ) ) +
113 row( _(
"Enhances:"), pkg->dep( zypp::Dep::ENHANCES ) ) +
114 row( _(
"Supplements:"), pkg->dep( zypp::Dep::SUPPLEMENTS ) )
124 ZyppObj p1 = candidate;
125 ZyppObj p2 = installed;
127 QString p1_header = _(
"<b>Alternate Version</b>" );
128 QString p2_header = _(
"<b>Installed Version</b>" );
130 QString html =
"<br>" +
132 row(
hcell( QString(
"" ) ) +
hcell(
"<b>" + p1_header +
"</b>" ) +
hcell(
"<b>" + p2_header +
"</b>" ) ) +
134 row(
hcell( _(
"Version:" ) ) +
cell( p1->edition().asString() ) +
cell( p2->edition().asString() ) ) +
136 row( _(
"Provides:"), p1->dep( zypp::Dep::PROVIDES ), p2->dep( zypp::Dep::PROVIDES ) ) +
137 row( _(
"Prerequires:"), p1->dep( zypp::Dep::PREREQUIRES ), p2->dep( zypp::Dep::PREREQUIRES ) ) +
138 row( _(
"Requires:"), p1->dep( zypp::Dep::REQUIRES ), p2->dep( zypp::Dep::REQUIRES ) ) +
139 row( _(
"Conflicts:"), p1->dep( zypp::Dep::CONFLICTS ), p2->dep( zypp::Dep::CONFLICTS ) ) +
140 row( _(
"Obsoletes:"), p1->dep( zypp::Dep::OBSOLETES ), p2->dep( zypp::Dep::OBSOLETES ) ) +
141 row( _(
"Recommends:"), p1->dep( zypp::Dep::RECOMMENDS ), p2->dep( zypp::Dep::RECOMMENDS ) ) +
142 row( _(
"Suggests:"), p1->dep( zypp::Dep::SUGGESTS ), p2->dep( zypp::Dep::SUGGESTS ) ) +
143 row( _(
"Enhances:"), p1->dep( zypp::Dep::ENHANCES ), p2->dep( zypp::Dep::ENHANCES ) ) +
144 row( _(
"Supplements:"), p1->dep( zypp::Dep::SUPPLEMENTS ), p2->dep( zypp::Dep::SUPPLEMENTS ) )
153 const zypp::Capabilities & capSet )
157 if ( content.isEmpty() )
160 return QString(
"<tr>" ) +
162 "<td>" + content +
"</td>"
169 const zypp::Capabilities & capSet1,
170 const zypp::Capabilities & capSet2 )
175 if ( content1.isEmpty() && content2.isEmpty() )
178 return QString(
"<tr>" ) +
180 "<td>" + content1 +
"</td>" +
181 "<td>" + content2 +
"</td>" +
191 for ( zypp::Capabilities::const_iterator it = capSet.begin();
195 if ( ! html.isEmpty() )
198 html +=
htmlEscape( ( *it).asString().c_str() );
205 #include "YQPkgDependenciesView.moc"
static QString hcell(QString contents)
Returns a string containing a HTML table cell with 'contents' for table headers.
static QString row(const QString &heading, const zypp::Capabilities &capSet)
Format a zypp::CapSet (describing zypp::Dep::REQUIRES etc.) with a heading in HTML lines...
static QString htmlHeading(ZyppSel selectable, bool showVersion=false)
Returns a uniform heading in HTML format for the specified selectable: name and summary or name...
YQPkgDependenciesView(QWidget *parent)
Constructor.
Abstract base class for details views.
QString simpleTable(ZyppObj pkg)
Returns a string containing a HTML table for technical details for one package.
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: '<' -> '<' '>' -> '>' '&' -> ...
virtual ~YQPkgDependenciesView()
Destructor.
static QString table(const QString &contents)
Returns a string containing a HTML table with 'contents'.
static QString htmlLines(const zypp::Capabilities &capSet)
Format a zypp::Capabilities (describing zypp::Dep::REQUIRES etc.) in HTML lines, separated with ...
QString complexTable(ZyppObj installed, ZyppObj candidate)
Returns a string containing a HTML table for technical details for two package instances: The install...
static QString htmlStart()
starts the html tag and set the style
virtual void showDetails(ZyppSel selectable)
Show details for the specified selectable: In this case technical data, very much like "rpm -qi"...