aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2006-09-16 09:49:56 +0000
committerThierry Vignaud <tv@mandriva.org>2006-09-16 09:49:56 +0000
commitc744d374c7cedac301804da70bea655764702bb2 (patch)
treeae2495b694f5d981d37b946f8bfe342dfb5e72c2
parent24c1c8186a8187454354a11c04f49843d86d27bb (diff)
downloadrpmdrake-c744d374c7cedac301804da70bea655764702bb2.tar
rpmdrake-c744d374c7cedac301804da70bea655764702bb2.tar.gz
rpmdrake-c744d374c7cedac301804da70bea655764702bb2.tar.bz2
rpmdrake-c744d374c7cedac301804da70bea655764702bb2.tar.xz
rpmdrake-c744d374c7cedac301804da70bea655764702bb2.zip
center on main window sub dialogs
-rwxr-xr-xedit-urpm-sources.pl27
1 files changed, 15 insertions, 12 deletions
diff --git a/edit-urpm-sources.pl b/edit-urpm-sources.pl
index c1874333..7e8ae707 100755
--- a/edit-urpm-sources.pl
+++ b/edit-urpm-sources.pl
@@ -76,7 +76,7 @@ sub remove_row {
sub easy_add_callback {
#- cooker and community don't have update sources
- my $want_base_distro = distro_type(0) eq 'updates' ? interactive_msg(
+ my $want_base_distro = distro_type(0) eq 'updates' ? interactive_msg_(
N("Choose media type"),
N("This step enables you to add sources from a Mandriva Linux web or FTP mirror.
@@ -99,7 +99,7 @@ Is it ok to continue?", $rpmdrake::mandrake_release),
want_base_distro => $want_base_distro,
transient => $mainw->{real_window},
) or return 0;
- my $wait = wait_msg(N("Please wait, adding media..."));
+ my $wait = wait_msg_(N("Please wait, adding media..."));
my $url = $want_base_distro ? make_url_mirror_dist($m) : make_url_mirror($m);
my $medium_name;
if ($want_base_distro) {
@@ -225,10 +225,10 @@ sub add_callback {
my $checkok = sub {
my $info = $radios_infos{$radios_names_ordered[$notebook->get_current_page]};
my ($name, $url) = map { $info->{$_ . '_entry'}->get_text } qw(name url);
- $name eq '' || $url eq '' and interactive_msg('rpmdrake', N("You need to fill up at least the two first entries.")), return 0;
+ $name eq '' || $url eq '' and interactive_msg_('rpmdrake', N("You need to fill up at least the two first entries.")), return 0;
if (member($name, map { $_->{name} } @{$urpm->{media}})) {
$info->{name_entry}->select_region(0, -1);
- interactive_msg('rpmdrake',
+ interactive_msg_('rpmdrake',
N("There is already a medium by that name, do you
really want to replace it?"), yesno => 1) or return 0;
}
@@ -351,14 +351,14 @@ sub options_callback {
sub remove_callback {
my $row = selrow();
$row == -1 and return;
- interactive_msg(
+ interactive_msg_(
N("Source Removal"),
N("Are you sure you want to remove source \"%s\"?", to_utf8($urpm->{media}[$row]{name})),
yesno => 1,
transient => $mainw->{real_window},
) or return;
- my $wait = wait_msg(N("Please wait, removing medium..."));
+ my $wait = wait_msg_(N("Please wait, removing medium..."));
my $name = $urpm->{media}[$row]{name};
$urpm->select_media($name);
$urpm->remove_selected_media;
@@ -433,7 +433,7 @@ sub edit_callback {
if ($w->main) {
my ($name, $update) = map { $medium->{$_} } qw(name update);
$url =~ m|^removable://| and (
- interactive_msg(
+ interactive_msg_(
N("You need to insert the medium to continue"),
N("In order to save the changes, you need to insert the medium in the drive."),
yesno => 1, text => { yes => N("Ok"), no => N("Cancel") }
@@ -835,7 +835,7 @@ sub keys_callback {
my ($model, $iter) = $keys_list->get_selection->get_selected;
$model && $iter or return;
my $key = $model->get($iter, 1);
- interactive_msg(N("Remove a key"),
+ interactive_msg_(N("Remove a key"),
N("Are you sure you want to remove the key %s from medium %s?\n(name of the key: %s)",
$key, $current_medium, $key_name->($key)),
yesno => 1, transient => $w->{real_window}) or return;
@@ -875,7 +875,7 @@ sub keys_callback {
sub mainwindow {
$mainw = ugtk2->new(N("Configure media"), center => 1);
- $::main_window = $mainw->{rwindow};
+ $::main_window = $mainw->{real_window};
my $list = Gtk2::ListStore->new("Glib::Boolean", "Glib::Boolean", "Glib::String");
$list_tv = Gtk2::TreeView->new_with_model($list);
@@ -929,7 +929,7 @@ sub mainwindow {
$reread_media->();
if (!$ignored && $urpm->{media}[$path]{ignore}) {
#- Enabling this media failed, force update
- interactive_msg('rpmdrake',
+ interactive_msg_('rpmdrake',
N("This medium needs to be updated to be usable. Update it now ?"),
yesno => 1,
) and $reread_media->($urpm->{media}[$path]{name});
@@ -1023,10 +1023,13 @@ sub mainwindow {
$mainw->main;
}
+sub interactive_msg_ { interactive_msg(@_, if_(defined $::main_window, transient => $::main_window)) }
+sub wait_msg_ { wait_msg(@_, if_(defined $::main_window, transient => $::main_window)) }
+
readconf();
if (!member(basename($0), @$already_splashed)) {
- interactive_msg('rpmdrake',
+ interactive_msg_('rpmdrake',
N("%s
Is it ok to continue?",
@@ -1041,7 +1044,7 @@ or to perform updates.")), yesno => 1) or myexit -1;
{
$urpm = urpm->new;
local $urpm->{fatal} = sub {
- interactive_msg('rpmdrake',
+ interactive_msg_('rpmdrake',
N("Packages database is locked. Please close other applications
working with packages database (do you have another media
manager on another desktop, or are you currently installing