From ae728969f2c0c4d6e4d0c6845f434bdead7c22df Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 2 May 2005 08:32:57 +0000 Subject: embedding cleanups resulting in reusing main window icon in sub dialogs --- perl-install/standalone/drakboot | 2 +- perl-install/standalone/drakfloppy | 2 +- perl-install/standalone/drakfont | 3 +-- perl-install/standalone/drakperm | 2 +- perl-install/standalone/draksec | 4 ++-- perl-install/standalone/drakups | 2 +- perl-install/standalone/harddrake2 | 10 +++++----- perl-install/standalone/logdrake | 3 ++- perl-install/standalone/printerdrake | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/perl-install/standalone/drakboot b/perl-install/standalone/drakboot index 12ab176a4..4229be543 100755 --- a/perl-install/standalone/drakboot +++ b/perl-install/standalone/drakboot @@ -64,7 +64,7 @@ sub run_boot_window { my $w = ugtk2->new($title); my $window = $w->{window}; - $::main_window = $w->{real_window} if !$::isEmbedded; + $::main_window = $w->{real_window}; $window->signal_connect(delete_event => sub { ugtk2->exit(0) }); unless ($::isEmbedded) { diff --git a/perl-install/standalone/drakfloppy b/perl-install/standalone/drakfloppy index 8c09bd013..9cdfb3e82 100755 --- a/perl-install/standalone/drakfloppy +++ b/perl-install/standalone/drakfloppy @@ -115,7 +115,7 @@ my $remove_but; sub pref_dialog() { my $dialog = gtkset_modal(gtkset_size_request(_create_dialog(N("Advanced preferences")), 600, -1), 1); - $dialog->set_transient_for($window->{real_window}) unless $::isEmbedded; + $dialog->set_transient_for($window->{real_window}); # Create root tree: diff --git a/perl-install/standalone/drakfont b/perl-install/standalone/drakfont index ad9b17d09..4f31f3c67 100755 --- a/perl-install/standalone/drakfont +++ b/perl-install/standalone/drakfont @@ -469,8 +469,7 @@ sub interactive_mode() { $interactive = 1; $window1 = ugtk2->new('drakfont'); $window1->{rwindow}->signal_connect(delete_event => sub { ugtk2->exit(0) }); - if ($::isEmbedded) { - } else { + if (!$::isEmbedded) { $window1->{rwindow}->set_position('center'); $window1->{rwindow}->set_title(N("DrakFont")); } diff --git a/perl-install/standalone/drakperm b/perl-install/standalone/drakperm index 6352f003f..2b0ee0900 100755 --- a/perl-install/standalone/drakperm +++ b/perl-install/standalone/drakperm @@ -236,7 +236,7 @@ sub row_setting_dialog { my ($title, $o_iter) = @_; my $dlg = Gtk2::Dialog->new; - $dlg->set_transient_for($w->{real_window}) unless $::isEmbedded; + $dlg->set_transient_for($w->{real_window}); $dlg->set_title($title); $dlg->set_modal(1); # $dlg->set_resizable(0); diff --git a/perl-install/standalone/draksec b/perl-install/standalone/draksec index a65a5ecf0..6bbbd817b 100755 --- a/perl-install/standalone/draksec +++ b/perl-install/standalone/draksec @@ -65,7 +65,7 @@ my %inv_fields = reverse %fields; # factorize this with rpmdrake and harddrake2 sub wait_msg { - my $mainw = ugtk2->new(N("Please wait"), (modal => 1, if_(!$::isEmbedded, transient => $w->{real_window}))); + my $mainw = ugtk2->new(N("Please wait"), (modal => 1, transient => $w->{real_window})); $mainw->{window}->add(Gtk2::WrappedLabel->new($_[0])); $mainw->{rwindow}->show_all; gtkset_mousecursor_wait($mainw->{rwindow}->window); @@ -343,7 +343,7 @@ gtkpack_($vbox, ] ), { use_markup => 1, - if_(!$::isEmbedded, transient => $w->{real_window}), + transient => $w->{real_window}, height => 400, width => 600, scroll => 1, diff --git a/perl-install/standalone/drakups b/perl-install/standalone/drakups index 5dbd6f6de..ca2d7f1bf 100755 --- a/perl-install/standalone/drakups +++ b/perl-install/standalone/drakups @@ -200,7 +200,7 @@ sub edit_row { # create new item if needed (that is when adding a new one) at end of list $iter ||= $model->append; my $dialog = Gtk2::Dialog->new; - $dialog->set_transient_for($w->{real_window}) unless $::isEmbedded; + $dialog->set_transient_for($w->{real_window}); $dialog->set_modal(1); gtkpack_($dialog->vbox, diff --git a/perl-install/standalone/harddrake2 b/perl-install/standalone/harddrake2 index 8a832d155..6125dfb8c 100755 --- a/perl-install/standalone/harddrake2 +++ b/perl-install/standalone/harddrake2 @@ -209,10 +209,10 @@ my @menu_items = my $info = lookup_field($_); if_($info->[0], formatAlaTeX(qq($info->[0]: $info->[1]))); } sort keys %$current_device), - { use_markup => 1, if_(!$::isEmbedded, transient => $w->{real_window}), height => 400, scroll => 1 }); + { use_markup => 1, transient => $w->{real_window}, height => 400, scroll => 1 }); } else { - create_dialog(N("Select a device!"), N("Once you've selected a device, you'll be able to see the device information in fields displayed on the right frame (\"Information\")"), { if_(!$::isEmbedded, transient => $w->{real_window}) }); + create_dialog(N("Select a device!"), N("Once you've selected a device, you'll be able to see the device information in fields displayed on the right frame (\"Information\")"), { transient => $w->{real_window} }); } }, undef, '' @@ -225,7 +225,7 @@ my @menu_items = #-PO: Do not alter the and tags N("This is HardDrake, a %s hardware configuration tool.\nVersion: %s Author: Thierry Vignaud <tvignaud\@mandriva.com>\n\n", $distro_name, $harddrake::data::version) . "\n" . - formatAlaTeX($::license), { use_markup => 1, if_(!$::isEmbedded, transient => $w->{real_window}) }); + formatAlaTeX($::license), { use_markup => 1, transient => $w->{real_window} }); }, undef, '' ] ); @@ -256,7 +256,7 @@ $w->{window}->add(gtkpack_(0, Gtk2::VBox->new(0, 0), 0, $menubar, 0, Gtk2::Banner->new("/usr/share/mcc/themes/default/harddrake-mdk.png", translate("Hardware")), 1, create_hpaned(gtkadd(Gtk2::Frame->new(N("Detected hardware")), - create_scrolled_window(gtkset_size_request(my $tree = Gtk2::TreeView->new_with_model($tree_model), $::isEmbedded ? 250 : 350, -1), ['automatic', 'automatic'])), + create_scrolled_window(gtkset_size_request(my $tree = Gtk2::TreeView->new_with_model($tree_model), 350, -1), ['automatic', 'automatic'])), gtkpack_(0, Gtk2::VBox->new(0, 0), 1, gtkadd(my $frame = Gtk2::Frame->new(N("Information")), create_scrolled_window(my $text = Gtk2::TextView->new)), @@ -544,7 +544,7 @@ sub popup_menu { sub upload() { my $dialog = _create_dialog(N("Upload the hardware list"), - { if_(!$::isEmbedded, transient => $w->{real_window}) }); #, height => 400 + { transient => $w->{real_window} }); #, height => 400 gtkpack($dialog->vbox, gtkset_markup(Gtk2::Label->new, qq() . N("Upload the hardware list") . "\n"), create_packtable({ col_spacings => 10, row_spacings => 5, mcc => 1 }, diff --git a/perl-install/standalone/logdrake b/perl-install/standalone/logdrake index bf491f71d..6a188a04d 100755 --- a/perl-install/standalone/logdrake +++ b/perl-install/standalone/logdrake @@ -216,13 +216,14 @@ sub parse_file { $file =~ s/\.gz$//; my ($pbar, $win_pb); unless ($::isEmbedded && $isExplain) { + local $::main_window = $my_win->{real_window}; gtkadd($win_pb = gtkset_modal(Gtk2::Window->new('toplevel'), 1), gtkpack(Gtk2::VBox->new(2,0), Gtk2::Label->new(" " . N("please wait, parsing file: %s", $descr) . " "), $pbar = Gtk2::ProgressBar->new ) ); - $win_pb->set_transient_for($my_win->{real_window}) unless $::isEmbedded; + $win_pb->set_transient_for($my_win->{real_window}); $win_pb->set_position('center'); $win_pb->realize; $win_pb->show_all; diff --git a/perl-install/standalone/printerdrake b/perl-install/standalone/printerdrake index 4172d3364..352406fa1 100755 --- a/perl-install/standalone/printerdrake +++ b/perl-install/standalone/printerdrake @@ -540,7 +540,7 @@ sub CreateTree { sub NewDialog { my ($title, $o_no_button) = @_; my $dialog = gtkset_border_width(Gtk2::Dialog->new, 10); - $dialog->set_transient_for($us->{wnd}{real_window}) if !$isEmbedded; + $dialog->set_transient_for($us->{wnd}{real_window}); $dialog->set_position('center-on-parent'); $dialog->set_title($title); $dialog->action_area->pack_start(gtkadd(Gtk2::HButtonBox->new, -- cgit v1.2.1