summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps_interactive.pm
Commit message (Expand)AuthorAgeFilesLines
* perl_checker adaptations + fixesPascal Rigaux2003-04-241-2/+4
* fix typos and cleanup syntaxPascal Rigaux2003-04-221-4/+4
* new perl_checker compliancePascal Rigaux2003-04-171-3/+3
* move harddrake::sound $index param in hash and pass only the hash ref aroundThierry Vignaud2003-04-011-2/+2
* hp fixThierry Vignaud2003-03-241-1/+1
* fixed typo.Francois Pons2003-03-201-1/+1
* add probe for netncx type in case of not already setted.Francois Pons2003-03-201-0/+3
* fix for newer kernel module package name.Francois Pons2003-03-121-1/+1
* install additional locales package for country according to the locale that w...Guillaume Cottenceau2003-03-111-1/+1
* make perl_checker a happy progPascal Rigaux2003-03-091-1/+1
* no "Previous" button when choosing install or upgradePascal Rigaux2003-03-091-8/+10
* mask encryption key (using stars)Pascal Rigaux2003-03-071-1/+3
* basic encrypt_key handling in upgrade (don't mistype!)Pascal Rigaux2003-03-061-0/+5
* dropped allowNVIDIA_rpmsFrancois Pons2003-03-061-1/+1
* let fix #2244, #2245, #2730Thierry Vignaud2003-03-061-1/+4
* - (getTVcards, isTVcard) : consolidate tv detection codeThierry Vignaud2003-03-051-1/+1
* fix typoPascal Rigaux2003-03-041-4/+3
* add some explaination for translatorsPascal Rigaux2003-03-031-1/+4
* translate _bootloader_ on _device_Pascal Rigaux2003-03-031-1/+1
* translate mouse namesPascal Rigaux2003-03-031-2/+2
* The generation of the "Summary" button for printer configuration created a bl...Till Kamppeter2003-03-011-2/+5
* ensure the $::expert flag in netconnect doesn't propagate to the rest of thePascal Rigaux2003-02-281-0/+1
* added mirror url not given.Francois Pons2003-02-271-1/+1
* fixed small typo.Francois Pons2003-02-271-1/+1
* added cancel button.Francois Pons2003-02-271-6/+9
* fixed message displayed.Francois Pons2003-02-271-1/+1
* added dialog more precisely.Francois Pons2003-02-271-1/+1
* added message box in case of error.Francois Pons2003-02-271-1/+1
* moved type detection code to network.Francois Pons2003-02-261-4/+1
* allow neuneus to quit install at license step (esp. for Ann & Warly's father)Pascal Rigaux2003-02-241-1/+6
* Fixed bug of printerdrake loosing the printer queue info during theTill Kamppeter2003-02-231-5/+18
* "Generate auto install floppy" and "Save packages selection" are now availabl...Pascal Rigaux2003-02-211-4/+2
* oops i didn't understand the internals of wait_message hence breaking it. hop...Guillaume Cottenceau2003-02-201-4/+4
* added wait message when building groups.Francois Pons2003-02-201-0/+3
* install the potentially needed locales country when user selectedGuillaume Cottenceau2003-02-201-0/+1
* Gtk2::Label::set is deprecatedGuillaume Cottenceau2003-02-201-4/+4
* help perl_checker find the N("...") the #-PO corresponds toPascal Rigaux2003-02-201-2/+3
* add a PO comment to try to keep buttons in the window..Guillaume Cottenceau2003-02-201-0/+1
* Made sure that printerdrake does not open its main window when called during ...Till Kamppeter2003-02-201-1/+1
* to workaround perl bug removing UTF8 flag when passing scalars to die's, passGuillaume Cottenceau2003-02-191-2/+2
* add some more formatErrorPascal Rigaux2003-02-191-1/+1
* fixed if update fail to allow retry.Francois Pons2003-02-191-2/+2
* added code to retry finding an update medium if something went wrong.Francois Pons2003-02-191-19/+25
* add ugly probed type of network configuration.Francois Pons2003-02-191-1/+6
* make sure network::network:: is used (just in case)Francois Pons2003-02-191-1/+1
* add default configuration for network for summary.Francois Pons2003-02-191-0/+4
* remove unneeded pablo's change on RTLGuillaume Cottenceau2003-02-181-3/+0
* define language directionPablo Saratxaga2003-02-181-0/+3
* (setRootPassword): display "Authentication" in AdvancedPascal Rigaux2003-02-181-3/+1
* display the release even when there is only one system to upgradePascal Rigaux2003-02-181-3/+1
an>0, 5); my $label = Gtk3::Label->new($o_text || N("Please wait...")); $label->set_alignment(0.5, 0.5); $wait_vbox->pack_start($label, 1, 1, 0); $w->change_widget($wait_vbox); $w->sync; } # From ugtk3.pm/mygtk3.pm: sub gtk_new_Label_Left { my ($text) = @_; my $w = Gtk3::Label->new($text); $w->set_alignment(0, 0); $w; } =item init_progressbar($w) Put a progress bar in the dialog. =cut sub init_progressbar { my ($w) = @_; my $vbox = Gtk3::VBox->new(0, 5); my $global_label = gtk_new_Label_Left('<b>' . $w->title . '</b>'); $global_label->set_use_markup(1); $vbox->pack_start($global_label, 0, 0, 0); my $global_progressbar = $w->{global_progressbar} = Gtk3::ProgressBar->new; $vbox->pack_start($global_progressbar, 0, 0, 0); $vbox->pack_start($w->{progresslabel} = gtk_new_Label_Left('-'), 1, 1, 0); my $progressbar = Gtk3::ProgressBar->new; $progressbar->set_size_request($progressbar_size, -1); $vbox->pack_start($progressbar, 0, 0, 0); $w->{progressbar} = $progressbar; $progress_nb = $download_nb = $index = 0; $w->change_widget($vbox); } =item set_progresslabel($w, $text) Update the progress label =cut sub set_progresslabel { my ($w, $text) = @_; $w->{progresslabel}->set_label($text); } =item set_progressbar($w, $local_ratio) Update the progress bar =cut sub set_progressbar { my ($w, $local_ratio) = @_; if ($progress_nb || $download_nb) { # this happens when computing transaction $w->{global_progressbar}->set_fraction(($download_nb + $progress_nb - 1 + $local_ratio) / 2 / $urpm->{nb_install}); } $w->{progressbar}->set_fraction($local_ratio); } =item validate_cancel($self, $cancel_msg, $cancel_cb) Add a "Cancel" button, with $cancel_msg as label, calling $cancel_cb when clicked. =cut sub validate_cancel { my ($self, $cancel_msg, $cancel_cb) = @_; if (!$self->{cancel}) { $self->{hbox_cancel} = Gtk3::HButtonBox->new; $self->{hbox_cancel}->add($self->{cancel} = Gtk3::Button->new($cancel_msg)); $self->{mainbox}->add($self->{hbox_cancel}); $self->{cancel}->signal_connect('clicked' => \&$cancel_cb); $self->{hbox_cancel}->show_all; } $self->{cancel}->set_sensitive(1); $self->{cancel}->show; } =item invalidate_cancel($self) Disable the "Cancel" button if any. =cut sub invalidate_cancel { my ($self) = @_; $self->{cancel} and $self->{cancel}->set_sensitive(0); } =item invalidate_cancel($self) Disable the "Cancel" button if any. =cut sub invalidate_cancel_forever { my ($self) = @_; $self->{hbox_cancel} or return; $self->{hbox_cancel}->destroy; } =item sync($w) tell Gtk+ to refresh the dialog content if needed. =cut sub sync { my ($w) = @_; $w->show; Gtk3::main_iteration while Gtk3::events_pending; } =item gurpm::RPMProgressDialog::get_something_done() Whether some package has been installed or removed =cut sub get_something_done() { $progress_nb; } =item canceled($w) Whether downloading has been canceled or not. =cut sub canceled { my ($w) = @_; $w->{canceled}; } =back =head2 Callbacks =over 4 =item callback_pre_check_sig() This callback is called when checking packages before installing them. Its purpose is to display installation progress in the dialog. =cut sub callback_pre_check_sig { $mainw->set_progresslabel(N("Verifying package signatures...")); $mainw->sync; } =item callback_inst($urpm, $type, $id, $subtype, $amount, $total) This callback is called when a new RPM DB transaction is created and when packages are installed. Its purpose is to display installation progress in the dialog. =cut sub callback_inst { my ($urpm, $type, $id, $subtype, $amount, $total) = @_; my $pkg = defined $id ? $urpm->{depslist}[$id] : undef; if ($subtype eq 'start') { if ($type eq 'trans') { $index = 0; $mainw->set_progresslabel(N("Preparing...")); } else { my $msg; if ($type eq 'uninst') { $msg = N("Removing package `%s' ...", $urpm->{trans}->Element_fullname($index)); } else { $progress_nb++; $msg = N("Installing package `%s' (%s/%s)...", $pkg->name, $progress_nb, $urpm->{nb_install}); } $index++; $download_nb = max($download_nb, $progress_nb); $mainw->set_progressbar(0); $mainw->set_progresslabel($msg); } } elsif ($subtype eq 'progress') { $mainw->set_progressbar($amount / $total); } $mainw->sync; } =item callback_download($mode, $file, $percent, $total, $eta, $speed) This callback is called when packages are downloaded prior being installed in a RPM transaction. Its purpose is to display download progress in the dialog. =cut sub callback_download { my ($mode, $file, $percent, $total, $eta, $speed) = @_; urpm::download::sync_logger($mode, $file, $percent, $total, $eta, $speed); if (member($mode, 'start', 'progress')) { $file =~ s|/*\s*$||; $file =~ s|.*/||; $mainw->set_progresslabel(N("Downloading package `%s'...", $file) . "\n" . &urpm::download::progress_text($mode, $percent, $total, $eta, $speed)); } if ($mode eq 'start') { $mainw->validate_cancel(N("Cancel"), \&callback_cancel); $download_nb++; $mainw->set_progressbar(0); select(undef, undef, undef, 0.1); #- hackish } elsif ($mode eq 'progress') { $mainw->set_progressbar($percent / 100); } elsif ($mode eq 'end') { $mainw->set_progressbar(1); } elsif ($mode eq 'error') { #- error is 3rd argument, saved in $percent push @{$urpm->{download_errors}}, N("...retrieving failed: %s", $percent); } $mainw->sync; } =item callback_cancel() This callback is to be called when canceling packages download. =cut sub callback_cancel { $mainw->{canceled} = 1; } sub DESTROY { my ($self) = @_; undef $mainw; undef $urpm; $::main_window = $old_main_window; $self = undef; } =back =head1 Copyright Copyright (C) 2005 MandrakeSoft SA Copyright (C) 2005-2010 Mandriva SA Copyright (C) 2011-2013 Mageia =cut 1;