diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-05-24 13:10:24 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-05-24 13:10:24 +0000 |
commit | 762dee42a6cbe4a3e803d402ccadc8050897752e (patch) | |
tree | dc99aaa2ba5ec957f2c1854557e96be6778b3618 | |
parent | 55e82bbb21c394f5d939a3b3827ceb99364554cb (diff) | |
download | drakx-backup-do-not-use-762dee42a6cbe4a3e803d402ccadc8050897752e.tar drakx-backup-do-not-use-762dee42a6cbe4a3e803d402ccadc8050897752e.tar.gz drakx-backup-do-not-use-762dee42a6cbe4a3e803d402ccadc8050897752e.tar.bz2 drakx-backup-do-not-use-762dee42a6cbe4a3e803d402ccadc8050897752e.tar.xz drakx-backup-do-not-use-762dee42a6cbe4a3e803d402ccadc8050897752e.zip |
switch from deprecated OptionMenu into new ComboBox widget
-rw-r--r-- | perl-install/Xconfig/resolution_and_depth.pm | 2 | ||||
-rw-r--r-- | perl-install/interactive/gtk.pm | 5 | ||||
-rwxr-xr-x | perl-install/standalone/drakTermServ | 3 | ||||
-rwxr-xr-x | perl-install/standalone/drakbackup | 26 | ||||
-rwxr-xr-x | perl-install/standalone/drakboot | 6 | ||||
-rwxr-xr-x | perl-install/standalone/drakbug | 2 | ||||
-rwxr-xr-x | perl-install/standalone/drakconnect | 11 | ||||
-rwxr-xr-x | perl-install/standalone/drakfloppy | 5 | ||||
-rwxr-xr-x | perl-install/standalone/drakperm | 6 | ||||
-rwxr-xr-x | perl-install/standalone/draksec | 2 | ||||
-rwxr-xr-x | perl-install/standalone/draksplash | 3 |
11 files changed, 38 insertions, 33 deletions
diff --git a/perl-install/Xconfig/resolution_and_depth.pm b/perl-install/Xconfig/resolution_and_depth.pm index e01ac7ea7..00881d9c9 100644 --- a/perl-install/Xconfig/resolution_and_depth.pm +++ b/perl-install/Xconfig/resolution_and_depth.pm @@ -228,7 +228,7 @@ sub choose_gtk { %h; }; - my ($depth_combo, $x_res_combo) = (Gtk2::OptionMenu->new, Gtk2::OptionMenu->new); + my ($depth_combo, $x_res_combo) = (Gtk2::ComboBox->new_text, Gtk2::ComboBox->new_text); my $pix_colors = Gtk2::Image->new; my $set_chosen_Depth_image = sub { diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 88a102b41..b6dade81d 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -535,8 +535,8 @@ sub ask_fromW { my @l = sort { $b <=> $a } map { length } @formatted_list; my $width = $l[@l / 16]; # take the third octile (think quartile) - if ($e->{not_edit} && $width < 60) { #- OptionMenus do not have an horizontal scroll-bar. This can cause havoc for long strings (eg: diskdrake Create dialog box in expert mode) - $w = Gtk2::OptionMenu->new; + if ($e->{not_edit} && $width < 160) { #- ComboBoxes do not have an horizontal scroll-bar. This can cause havoc for long strings (eg: diskdrake Create dialog box in expert mode) + $w = Gtk2::ComboBox->new_text; } else { $w = Gtk2::Combo->new; $w->set_use_arrows_always(1); @@ -545,6 +545,7 @@ sub ask_fromW { } $w->set_popdown_strings(@formatted_list); + $w->set_text($formatted_list[0]) if $w->isa('Gtk2::ComboBox'); ($real_w, $w) = ($w, $w->entry); #- FIXME workaround gtk suckiness (set_text generates two 'change' signals, one when removing the whole, one for inserting the replacement..) diff --git a/perl-install/standalone/drakTermServ b/perl-install/standalone/drakTermServ index 1b3a62220..80f0bce1d 100755 --- a/perl-install/standalone/drakTermServ +++ b/perl-install/standalone/drakTermServ @@ -719,8 +719,9 @@ sub make_nbi() { update_list($list_model); - my $combo_default_kernel = new Gtk2::OptionMenu(); + my $combo_default_kernel = Gtk2::ComboBox->new_text; $combo_default_kernel->set_popdown_strings(N("Default kernel version"), @kernels); + $combo_default_kernel->set_active(0); $combo_default_kernel->entry->signal_connect('changed', sub { my $default_kernel = $combo_default_kernel->entry->get_text; my $config; diff --git a/perl-install/standalone/drakbackup b/perl-install/standalone/drakbackup index 08532c12f..a035c5ba4 100755 --- a/perl-install/standalone/drakbackup +++ b/perl-install/standalone/drakbackup @@ -1596,7 +1596,7 @@ sub advanced_where_net_types { 0, my $check_where_use_net = new Gtk2::CheckButton(N("Use network connection to backup")), 1, new Gtk2::HBox(0,10), 0, new Gtk2::Label(N("Net Method:")), - 0, gtkset_sensitive(my $entry_net_type = new Gtk2::OptionMenu(), $conf{USE_NET}), + 0, gtkset_sensitive(my $entry_net_type = Gtk2::ComboBox->new_text, $conf{USE_NET}), ), 0, gtkpack_(new Gtk2::HBox(0,5), 0, gtkset_sensitive(my $check_use_expect = new Gtk2::CheckButton(N("Use Expect for SSH")), ($conf{USE_NET} && $conf{NET_PROTO} eq 'ssh')), @@ -1726,14 +1726,14 @@ sub advanced_where_cd { $dev_codes{$cd_devices{$key}{rec_dev}} = $key; } - my $combo_where_cd_device = new Gtk2::OptionMenu(); + my $combo_where_cd_device = Gtk2::ComboBox->new_text; if (keys %cd_devices) { $combo_where_cd_device->set_popdown_strings('', sort keys %dev_codes); } else { $combo_where_cd_device->set_popdown_strings(@no_devices); } - my $combo_where_cd_time = new Gtk2::OptionMenu(); + my $combo_where_cd_time = Gtk2::ComboBox->new_text; $combo_where_cd_time->set_popdown_strings("650 MB", "700 MB", "750 MB", "800 MB", "4.7 GB"); gtkpack($advanced_box, @@ -1837,7 +1837,7 @@ sub advanced_where_tape { #- look for tape devices; get_tape_info(); - my $combo_where_tape_device = new Gtk2::OptionMenu(); + my $combo_where_tape_device = Gtk2::ComboBox->new_text; if (@tape_devices) { $combo_where_tape_device->set_popdown_strings('', @tape_devices) } else { @@ -2031,7 +2031,7 @@ sub advanced_where() { sub advanced_when() { my $box_when; my $allow_custom = $backup_daemon && $custom_cron; - my $combo_when_space = new Gtk2::OptionMenu(); + my $combo_when_space = Gtk2::ComboBox->new_text; my %trans = (N("hourly") => 'hourly', N("daily") => 'daily', N("weekly") => 'weekly', @@ -2046,20 +2046,20 @@ sub advanced_when() { set_help_tip($combo_when_space, 'when_space'); #- custom setup - let user specify month, day of month, day of week, hour, minute - my $combo_month_when = new Gtk2::OptionMenu(); + my $combo_month_when = Gtk2::ComboBox->new_text; my @months = ("*", N("January"), N("February"), N("March"), N("April"), N("May"), N("June"), N("July"), N("August"), N("September"), N("October"), N("November"), N("December")); $combo_month_when->set_popdown_strings(@months); - my $combo_day_when = new Gtk2::OptionMenu(); + my $combo_day_when = Gtk2::ComboBox->new_text; $combo_day_when->set_popdown_strings("*", (1..31)); - my $combo_weekday_when = new Gtk2::OptionMenu(); + my $combo_weekday_when = Gtk2::ComboBox->new_text; my @weekdays = ("*", N("Sunday"), N("Monday"), N("Tuesday"), N("Wednesday"), N("Thursday"), N("Friday"), N("Saturday")); $combo_weekday_when->set_popdown_strings(@weekdays); - my $combo_hour_when = new Gtk2::OptionMenu(); + my $combo_hour_when = Gtk2::ComboBox->new_text; $combo_hour_when->set_popdown_strings("*", (0..23)); - my $combo_minute_when = new Gtk2::OptionMenu(); + my $combo_minute_when = Gtk2::ComboBox->new_text; $combo_minute_when->set_popdown_strings("*", (0..59)); my $entry_crontab = new Gtk2::Entry(); @@ -2081,7 +2081,7 @@ sub advanced_when() { } #- drop down list of possible media - default to config value - my $entry_media_type = new Gtk2::OptionMenu(); + my $entry_media_type = Gtk2::ComboBox->new_text; $entry_media_type->set_popdown_strings(sort(@net_methods, @media_types)); $entry_media_type->entry->set_text($conf{DAEMON_MEDIA}); @@ -2180,7 +2180,7 @@ sub combo_to_cron_string { sub advanced_options() { my $box_options; - my $entry_comp_mode = new Gtk2::OptionMenu(); + my $entry_comp_mode = Gtk2::ComboBox->new_text; $entry_comp_mode->set_popdown_strings("tar", "tar.gz", "tar.bz2"); $entry_comp_mode->entry->set_text($conf{OPTION_COMP}); gtkpack($advanced_box, @@ -2991,7 +2991,7 @@ sub restore_step_user() { sub restore_step_sys() { my $restore_step_sys; - my $combo_restore_step_sys = new Gtk2::OptionMenu(); + my $combo_restore_step_sys = Gtk2::ComboBox->new_text; $combo_restore_step_sys->set_popdown_strings(@sys_backuped); $combo_restore_step_sys->entry->set_text($restore_step_sys_date); gtkpack($advanced_box, diff --git a/perl-install/standalone/drakboot b/perl-install/standalone/drakboot index c4b548d55..3298a3d39 100755 --- a/perl-install/standalone/drakboot +++ b/perl-install/standalone/drakboot @@ -72,10 +72,10 @@ unless ($::isEmbedded) { ######### menus end } -my $user_combo = Gtk2::OptionMenu->new; +my $user_combo = Gtk2::ComboBox->new_text; $user_combo->set_popdown_strings(list_users()); $user_combo->entry->set_text($auto_mode->{autologin}) if $auto_mode->{autologin}; -my $desktop_combo = Gtk2::OptionMenu->new; +my $desktop_combo = Gtk2::ComboBox->new_text; $desktop_combo->set_popdown_strings(split(' ', `/usr/sbin/chksession -l`)); $desktop_combo->entry->set_text($auto_mode->{desktop}) if $auto_mode->{desktop}; @@ -127,7 +127,7 @@ foreach (all('.')) { } my %combo = ('thms' => '', 'lilo' => '', 'boot' => ''); foreach (keys(%combo)) { - $combo{$_} = gtkset_size_request(Gtk2::OptionMenu->new, 10, -1); + $combo{$_} = gtkset_size_request(Gtk2::ComboBox->new_text, 10, -1); } $combo{boot}->set_popdown_strings(@boot_thms); diff --git a/perl-install/standalone/drakbug b/perl-install/standalone/drakbug index bd48eb4d5..7cce5ec9e 100755 --- a/perl-install/standalone/drakbug +++ b/perl-install/standalone/drakbug @@ -99,7 +99,7 @@ my $lspci; if ($stable_release == 0) { $table = create_packtable({ col_spacings => 5, row_spacings => 10 }, - [ new Gtk2::Label(N("Application:")), $comb_app = Gtk2::OptionMenu->new ], + [ new Gtk2::Label(N("Application:")), $comb_app = Gtk2::ComboBox->new_text ], [ new Gtk2::Label(N("Package: ")), $package = Gtk2::Entry->new_with_text("...") ], # complain on gtk-perl@ml [ Gtk2::Label->new(N("Kernel:")), gtkset_editable(Gtk2::Entry->new_with_text($kernel_release), 0) ], [ Gtk2::Label->new(N("Release: ")), gtkset_editable(Gtk2::Entry->new_with_text($mandrake_release), 0) ] diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect index dbcfe9533..22ac69826 100755 --- a/perl-install/standalone/drakconnect +++ b/perl-install/standalone/drakconnect @@ -216,7 +216,7 @@ sub manage { $window->{rwindow}->add(gtkpack_(Gtk2::VBox->new, 0, gtkpack__(Gtk2::HBox->new, Gtk2::Label->new(N("Device selected")), - $interface_menu = gtksignal_connect(Gtk2::OptionMenu->new, + $interface_menu = gtksignal_connect(Gtk2::ComboBox->new_text, changed => sub { $selected = $interface_menu->get_text; $notebook->set_current_page($p->{$selected}{gui}{index}); @@ -252,6 +252,7 @@ sub manage { } (sort keys %$p); $interface_menu->set_popdown_strings(sort keys %$p); + $interface_menu->set_active(0); $apply_button->set_sensitive(0); $window->{rwindow}->show_all; @@ -315,7 +316,7 @@ sub build_notebook { if_($is_ethernet, 0, gtkpack__(Gtk2::HBox->new, Gtk2::Label->new(N("Protocol")), - $gui->{intf}{BOOTPROTO} = gtksignal_connect(Gtk2::OptionMenu->new, + $gui->{intf}{BOOTPROTO} = gtksignal_connect(Gtk2::ComboBox->new_text, changed => sub { return if !$_[0]->realized; my $proto = $gui->{intf}{BOOTPROTO}; @@ -458,7 +459,7 @@ sub build_notebook { if_($interface eq 'modem', 0, gtkpack(Gtk2::VBox->new(1,0), gtkpack__(Gtk2::HBox->new, Gtk2::Label->new(N("Authentication"))), - gtkpack__(Gtk2::HBox->new, $gui->{intf}{auth} = gtksignal_connect(Gtk2::OptionMenu->new, + gtkpack__(Gtk2::HBox->new, $gui->{intf}{auth} = gtksignal_connect(Gtk2::ComboBox->new_text, changed => $apply)), )), map { (0, gtkpack(Gtk2::VBox->new(1,0), @@ -485,7 +486,7 @@ sub build_notebook { gtkpack__(Gtk2::VBox->new(0,5), (map { (gtkpack(Gtk2::VBox->new(1,0), gtkpack__(Gtk2::HBox->new, Gtk2::Label->new($_->[0])), - gtkpack__(Gtk2::HBox->new, $gui->{intf}{$_->[1]} = gtksignal_connect(Gtk2::OptionMenu->new, + gtkpack__(Gtk2::HBox->new, $gui->{intf}{$_->[1]} = gtksignal_connect(Gtk2::ComboBox->new_text, changed => $apply)), ), ), @@ -842,7 +843,7 @@ Configure them first by clicking on 'Configure'"))); $vbox_local->pack_start($infos[2*$i], 1, 1, 0); my $c; if (defined $j->[2]) { - $c = Gtk2::OptionMenu->new; + $c = Gtk2::ComboBox->new_text; $c->set_popdown_strings(@{$j->[2]}); $infos[2*$i+1] = $c->entry; $infos[2*$i]->pack_start($c,0,0,0); diff --git a/perl-install/standalone/drakfloppy b/perl-install/standalone/drakfloppy index b91d85d15..d58305f61 100755 --- a/perl-install/standalone/drakfloppy +++ b/perl-install/standalone/drakfloppy @@ -62,12 +62,13 @@ eval { %options = getVarsFromSh($conffile) }; ######## up part # device part -my $device_combo = new Gtk2::OptionMenu(); +my $device_combo = Gtk2::ComboBox->new_text; $device_combo->set_popdown_strings(map { "/dev/" . $_->{device} } detect_devices::floppies()); +$device_combo->set_active(0); # kernel part -my $kernel_combo = new Gtk2::OptionMenu(); +my $kernel_combo = Gtk2::ComboBox->new_text; $kernel_combo->set_popdown_strings(sort grep { !/^\.\.?$/ } sort(all("/lib/modules"))); $kernel_combo->entry->set_text(chomp_(`uname -r`)); diff --git a/perl-install/standalone/drakperm b/perl-install/standalone/drakperm index 096ce8e8b..aecf7e0c8 100755 --- a/perl-install/standalone/drakperm +++ b/perl-install/standalone/drakperm @@ -51,7 +51,7 @@ my $index = 0; load_perms(); #- widgets settings -my $combo_perm = new Gtk2::OptionMenu; +my $combo_perm = Gtk2::ComboBox->new_text; $combo_perm->set_popdown_strings(sort(values %perm_l10n)); sub add_callback() { @@ -271,11 +271,11 @@ sub row_setting_dialog { my $alrd_exsts = defined $iter; $file->set_text($model->get($iter, 1)) if $iter; - my $users = Gtk2::OptionMenu->new; + my $users = Gtk2::ComboBox->new_text; $users->set_popdown_strings(&get_user_or_group('users')); $users->entry->set_text($model->get($iter, 2)) if $iter; - my $groups = Gtk2::OptionMenu->new; + my $groups = Gtk2::ComboBox->new_text; $groups->set_popdown_strings(&get_user_or_group); $groups->entry->set_text($model->get($iter, 3)) if $iter; diff --git a/perl-install/standalone/draksec b/perl-install/standalone/draksec index a1a2d9915..628df6862 100755 --- a/perl-install/standalone/draksec +++ b/perl-install/standalone/draksec @@ -117,7 +117,7 @@ maximum"))) ]); sub new_nonedit_combo { my ($string_list, $o_default_value) = @_; - my $w = new Gtk2::OptionMenu(); + my $w = Gtk2::ComboBox->new_text ; $w->set_popdown_strings(to_i18n(@$string_list)) unless is_empty_array_ref $string_list; $w->entry->set_text(to_i18n($o_default_value)) if $o_default_value; $w; diff --git a/perl-install/standalone/draksplash b/perl-install/standalone/draksplash index 3101128fd..703896be4 100755 --- a/perl-install/standalone/draksplash +++ b/perl-install/standalone/draksplash @@ -389,8 +389,9 @@ sub mk_frame { my @popdown; if ($ref->{widget}{combo}{$1}) { @popdown = @{$ref->{widget}{combo}{$1}}; - my $w = $ref->{widgets}{combo}{$1} = $ref->{widget}{extras}{$1}{noneditable} ? Gtk2::OptionMenu->new : Gtk2::Combo->new; + my $w = $ref->{widgets}{combo}{$1} = $ref->{widget}{extras}{$1}{noneditable} ? Gtk2::ComboBox->new_text : Gtk2::Combo->new; $ref->{widgets}{combo}{$1}->set_popdown_strings(@popdown); + $w->set_active(0) if $w->isa('Gtk2::ComboBox'); push @widgets, $w; } |