aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2010-03-03 16:21:27 +0000
committerThierry Vignaud <tv@mandriva.org>2010-03-03 16:21:27 +0000
commitbe0dcd37ef406ecf5eceee8b29a3b6fcf30a43d2 (patch)
tree7d0ab46a4176b1d5ac72bbefec6c4bc26b886aa7
parent3c1c8d60190ba3c20848257bb57e90557fac6604 (diff)
downloadrpmdrake-be0dcd37ef406ecf5eceee8b29a3b6fcf30a43d2.tar
rpmdrake-be0dcd37ef406ecf5eceee8b29a3b6fcf30a43d2.tar.gz
rpmdrake-be0dcd37ef406ecf5eceee8b29a3b6fcf30a43d2.tar.bz2
rpmdrake-be0dcd37ef406ecf5eceee8b29a3b6fcf30a43d2.tar.xz
rpmdrake-be0dcd37ef406ecf5eceee8b29a3b6fcf30a43d2.zip
(get_main_text) split it out of format_pkg_simplifiedinfo()
-rw-r--r--Rpmdrake/gui.pm28
1 files changed, 17 insertions, 11 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index 2ad32c02..d0bb11c1 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -149,6 +149,22 @@ sub get_description {
)) };
}
+sub get_main_text {
+ my ($name, $summary, $is_update, $update_descr) = @_;
+ ugtk2::markup_to_TextView_format(
+ # force align "name - summary" to the right with RTL languages (#33603):
+ if_(lang::text_direction_rtl(), "\x{200f}") .
+ join("\n",
+ format_header(join(' - ', $name, $summary)) .
+ # workaround gtk+ bug where GtkTextView wronly limit embedded widget size to bigger line's width (#25533):
+ "\x{200b} \x{feff}" . ' ' x 120,
+ if_($is_update, # is it an update?
+ format_field(N("Importance: ")) . format_update_field($update_descr->{importance}),
+ format_field(N("Reason for update: ")) . format_update_field(rpm_description($update_descr->{pre})),
+ ),
+ '' # extra empty line
+ ));
+}
sub format_pkg_simplifiedinfo {
my ($pkgs, $key, $urpm, $descriptions) = @_;
@@ -162,17 +178,7 @@ sub format_pkg_simplifiedinfo {
# discard update fields if not matching:
my $is_update = ($upkg->flag_upgrade && $update_descr && $update_descr->{pre});
my $summary = get_summary($key);
- my $s = ugtk2::markup_to_TextView_format(
- # force align "name - summary" to the right with RTL languages (#33603):
- if_(lang::text_direction_rtl(), "\x{200f}") .
- join("\n", format_header(join(' - ', $name, $summary)) .
- # workaround gtk+ bug where GtkTextView wronly limit embedded widget size to bigger line's width (#25533):
- "\x{200b} \x{feff}" . ' ' x 120,
- if_($is_update, # is it an update?
- format_field(N("Importance: ")) . format_update_field($update_descr->{importance}),
- format_field(N("Reason for update: ")) . format_update_field(rpm_description($update_descr->{pre})),
- ),
- '')); # extra empty line
+ my $s = get_main_text($name, $summary, $is_update, $update_descr);
push @$s, get_advisory_link($update_descr) if $is_update;
push @$s, get_description($pkg, $update_descr);