aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-09-19 10:03:39 +0000
committerThierry Vignaud <tv@mandriva.org>2007-09-19 10:03:39 +0000
commit4ae2e35bfbbbca202f481e465d62324bea0e6766 (patch)
treec4d7b3af2dd2b0ff65347cfdf8a7f018d276c6db
parent8ba9a22793edc8e744c4d81d2d8776b9065190ef (diff)
downloadrpmdrake-4ae2e35bfbbbca202f481e465d62324bea0e6766.tar
rpmdrake-4ae2e35bfbbbca202f481e465d62324bea0e6766.tar.gz
rpmdrake-4ae2e35bfbbbca202f481e465d62324bea0e6766.tar.bz2
rpmdrake-4ae2e35bfbbbca202f481e465d62324bea0e6766.tar.xz
rpmdrake-4ae2e35bfbbbca202f481e465d62324bea0e6766.zip
(format_name_n_summary) factorize package name and summary formatting there
-rwxr-xr-xMandrivaUpdate2
-rw-r--r--Rpmdrake/formatting.pm7
-rw-r--r--Rpmdrake/gui.pm3
3 files changed, 8 insertions, 4 deletions
diff --git a/MandrivaUpdate b/MandrivaUpdate
index 32468741..6150846a 100755
--- a/MandrivaUpdate
+++ b/MandrivaUpdate
@@ -75,7 +75,7 @@ sub refresh_packages_list {
@{$list->{data}} = map {
$data{$_} = $i++;
my $summary = translate($pkgs->{$_}{pkg}->summary);
- [ $pkgs->{$_}{selected}, join("\n", "<b>$_</b>", escape_text_for_TextView_markup_format($summary) ];
+ [ $pkgs->{$_}{selected}, format_name_n_summary($_, $summary) ];
} grep { $pkgs->{$_}{pkg} } @requested;
gtktext_insert($info,
formatAlaTeX(N("The list of updates is empty. This means that either there is
diff --git a/Rpmdrake/formatting.pm b/Rpmdrake/formatting.pm
index 700ef317..a5632aa0 100644
--- a/Rpmdrake/formatting.pm
+++ b/Rpmdrake/formatting.pm
@@ -33,7 +33,7 @@ use ugtk2 qw(escape_text_for_TextView_markup_format);
use Exporter;
our @ISA = qw(Exporter);
-our @EXPORT = qw(format_field format_header localtime2changelog my_fullname pkg2medium rpm_description split_fullname urpm_name);
+our @EXPORT = qw(format_field format_header format_name_n_summary localtime2changelog my_fullname pkg2medium rpm_description split_fullname urpm_name);
sub rpm_description {
@@ -82,6 +82,11 @@ sub pkg2medium {
#- encodings; but if a user has a so broken setup we can't do much anyway
sub localtime2changelog { to_utf8(POSIX::strftime("%c", localtime($_[0]))) }
+sub format_name_n_summary {
+ my ($name, $summary) = @_;
+ join("\n", '<b>' . $name . '</b>', escape_text_for_TextView_markup_format($summary));
+}
+
sub format_header {
my ($str) = @_;
'<big>' . escape_text_for_TextView_markup_format($str) . '</big>';
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index d71d5068..32ec8c1f 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -237,8 +237,7 @@ sub add_node {
if (is_a_package($leaf)) {
my ($name, $version, $arch) = split_fullname($leaf);
$iter = $w->{detail_list_model}->append_set([ $pkg_columns{text} => $leaf,
- $pkg_columns{short_name} => '<b>' . $name . '</b>' .
- "\n" . get_summary($leaf),
+ $pkg_columns{short_name} => format_name_n_summary($name, get_summary($leaf)),
$pkg_columns{version} => $version,
$pkg_columns{arch} => $arch,
]);