diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-09-10 22:20:42 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-09-10 22:20:42 +0000 |
commit | ca93c3dd1750ae75a79671a62cd6fbf74985707f (patch) | |
tree | 8b80b489515d57a7681f9a9dfd98a9a3eb4d1732 | |
parent | c461723804838cb6b1feeb2c16e578a23bffea24 (diff) | |
download | drakx-ca93c3dd1750ae75a79671a62cd6fbf74985707f.tar drakx-ca93c3dd1750ae75a79671a62cd6fbf74985707f.tar.gz drakx-ca93c3dd1750ae75a79671a62cd6fbf74985707f.tar.bz2 drakx-ca93c3dd1750ae75a79671a62cd6fbf74985707f.tar.xz drakx-ca93c3dd1750ae75a79671a62cd6fbf74985707f.zip |
- make diskdrake work in embedded mode
- $my_gtk::pop_it used where it should
-rw-r--r-- | perl-install/interactive_gtk.pm | 18 | ||||
-rw-r--r-- | perl-install/my_gtk.pm | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm index b10aba394..c3a9c1cc9 100644 --- a/perl-install/interactive_gtk.pm +++ b/perl-install/interactive_gtk.pm @@ -14,7 +14,6 @@ my $forgetTime = 1000; #- in milli-seconds sub new { ($::windowheight, $::windowwidth) = my_gtk::gtkroot()->get_size if !$::isInstall; - ($::wantedheight, $::wantedwidth) = $::isEmbedded ? (450, 380) : ($::windowheight * 0.8, $::windowwidth * 0.8); goto &interactive::new; } sub enter_console { my ($o) = @_; $o->{suspended} = common::setVirtual(1) } @@ -500,11 +499,13 @@ sub ask_fromW { my $create_widgets = sub { my $w = create_packtable({}, map { [($_->{icon_w}, $_->{e}{label}, $_->{real_w})]} @_); + my ($wantedheight, $wantedwidth) = $::isEmbedded && !$my_gtk::pop_it ? (450, 380) : ($::windowheight * 0.8, $::windowwidth * 0.8); + my $width = max(250, $max_width * 5); - $mainw->{box_width} = min($::wantedwidth, $width); + $mainw->{box_width} = min($wantedwidth, $width); my $height = max(200, my_gtk::n_line_size($always_total_size, 'various', $mainw->{rwindow})); - $mainw->{box_height} = min($::wantedheight, $height); + $mainw->{box_height} = min($wantedheight, $height); my $has = $width > $mainw->{box_width} || $height > $mainw->{box_height}; $has_scroll ||= $has; @@ -526,11 +527,10 @@ sub ask_fromW { $pack->pack_start($advanced_pack, 1, 1, 0); gtkadd($mainw->{window}, $pack); - if ($has_scroll && !$::isEmbedded &&!$::isWizard) { - $mainw->{rwindow}->set_default_size($mainw->{box_width}, $mainw->{box_height}); - } elsif ($has_horiz_scroll && !$::isEmbedded &&!$::isWizard) { - $mainw->{rwindow}->set_default_size($mainw->{box_width}, 0); - } + if (!$::isEmbedded && !$::isWizard || $my_gtk::pop_it) { + $mainw->{rwindow}->set_default_size($mainw->{box_width}, $mainw->{box_height}) if $has_scroll; + $mainw->{rwindow}->set_default_size($mainw->{box_width}, 0) if $has_horiz_scroll; + } $set_advanced->(0); (@widgets ? $widgets[0]{focus_w} : $common->{focus_cancel} ? $mainw->{cancel} : $mainw->{ok})->grab_focus(); @@ -761,7 +761,7 @@ sub wait_messageW($$$) { $box->pack_start($_, 1, 1, 4) foreach my @l = map { new Gtk::Label(join("\n", warp_text($_))) } @$messages; ($w->{wait_messageW} = $l[$#l])->signal_connect(expose_event => sub { $w->{displayed} = 1 }); - $w->{rwindow}->set_position('center') if ($::isStandalone && !$::isEmbedded && !$::isWizard); + $w->{rwindow}->set_position('center') if ($::isStandalone && (!$::isEmbedded && !$::isWizard || $my_gtk::pop_it)); $w->{window}->show_all; $w->sync until $w->{displayed}; $w; diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm index 8a72ba2d4..47060bbda 100644 --- a/perl-install/my_gtk.pm +++ b/perl-install/my_gtk.pm @@ -99,7 +99,7 @@ sub new { $::WizardTable->attach($o->{window}, 1, 2, 1, 2, {'fill', 'expand'}, {'fill', 'expand'}, 0, 0); } - ($::isEmbedded && !$my_gtk::pop_it) or return $o; + $::isEmbedded && !$my_gtk::pop_it or return $o; $o->{window} = new Gtk::HBox(0,0); $o->{rwindow} = $o->{window}; defined($::Plug) or $::Plug = new Gtk::Plug ($::XID); @@ -115,7 +115,7 @@ sub main { my $timeout = Gtk->timeout_add(1000, sub { gtkset_mousecursor_normal(); 1 }); my $b = before_leaving { Gtk->timeout_remove($timeout) }; $o->show; - $o->{rwindow}->window->set_events(['key_press_mask', 'key_release_mask', 'exposure_mask']) if !$::isEmbedded; + $o->{rwindow}->window->set_events(['key_press_mask', 'key_release_mask', 'exposure_mask']) if $o->{rwindow}->window; do { local $::setstep = 1; |