aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2013-11-19 21:37:27 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2013-12-05 14:16:06 +0100
commit4473fb769b8aa88daede1eaaa4c65e74cbd17401 (patch)
tree51a78dff3cad962195a7a729fcc887d2d73c0c3f
parentcc91f03150dba941470fd80c10211eaead298c89 (diff)
downloadrpmdrake-4473fb769b8aa88daede1eaaa4c65e74cbd17401.tar
rpmdrake-4473fb769b8aa88daede1eaaa4c65e74cbd17401.tar.gz
rpmdrake-4473fb769b8aa88daede1eaaa4c65e74cbd17401.tar.bz2
rpmdrake-4473fb769b8aa88daede1eaaa4c65e74cbd17401.tar.xz
rpmdrake-4473fb769b8aa88daede1eaaa4c65e74cbd17401.zip
use Gtk3 namespace instead of Gtk2
-rwxr-xr-xMageiaUpdate20
-rw-r--r--Rpmdrake/edit_urpm_sources.pm126
-rw-r--r--Rpmdrake/gui.pm14
-rw-r--r--Rpmdrake/gurpm.pm2
-rw-r--r--Rpmdrake/init.pm2
-rw-r--r--Rpmdrake/pkg.pm10
-rw-r--r--Rpmdrake/rpmnew.pm22
-rw-r--r--Rpmdrake/widgets.pm2
-rwxr-xr-xrpmdrake48
-rw-r--r--rpmdrake.pm94
10 files changed, 170 insertions, 170 deletions
diff --git a/MageiaUpdate b/MageiaUpdate
index 6192c5d9..df1bbd09 100755
--- a/MageiaUpdate
+++ b/MageiaUpdate
@@ -39,7 +39,7 @@ use Rpmdrake::widgets;
use mygtk3 qw(gtknew); #- do not import anything else, especially gtkadd() which conflicts with ugtk3 one
use ugtk3 qw(:all);
-use Gtk2::SimpleList;
+use Gtk3::SimpleList;
# make Rpmdrake::gui aware MageiaUpdate do not use the same columns ids as rpmdrake:
%pkg_columns = (
@@ -151,7 +151,7 @@ sub run_treeview_dialog {
0, gtknew('Title2', label => N("Here is the list of software package updates"), width => 600),
1, create_vpaned(
gtknew('ScrolledWindow', width => $typical_width*0.9, height => $is_small_screen ? 150 : 200,
- child => $list = Gtk2::SimpleList->new(
+ child => $list = Gtk3::SimpleList->new(
" " => 'pixbuf',
" " . " " . " " => 'bool', #N("Selected")
'' => 'hidden',
@@ -164,19 +164,19 @@ sub run_treeview_dialog {
),
gtknew('ScrolledWindow', width => $typical_width*0.9,
- child => $info = Gtk2::Mdv::TextView->new, height => $is_small_screen ? 150 : 190,
+ child => $info = Gtk3::Mdv::TextView->new, height => $is_small_screen ? 150 : 190,
),
resize1 => 1,
),
- 0, gtkset_size_request(Gtk2::HSeparator->new, -1, 5),
+ 0, gtkset_size_request(Gtk3::HSeparator->new, -1, 5),
0, gtkpack_(
gtknew('HBox', spacing => 20),
0, gtksignal_connect(
- Gtk2::Button->new(but_(N("Help"))),
+ Gtk3::Button->new(but_(N("Help"))),
clicked => sub { rpmdrake::open_help($MODE) },
),
0, gtksignal_connect(
- Gtk2::Button->new(but_(N("Select all"))),
+ Gtk3::Button->new(but_(N("Select all"))),
clicked => sub {
toggle_all({
widgets => {
@@ -189,7 +189,7 @@ sub run_treeview_dialog {
),
1, gtknew('Label'),
0, my $action_button = gtksignal_connect(
- $update_button = Gtk2::Button->new(but_(N("Update"))),
+ $update_button = Gtk3::Button->new(but_(N("Update"))),
clicked => sub {
my $res = do_action({ tree_mode => 'all_updates' }, $callback_action);
$initialized = 0 if !$res;
@@ -197,14 +197,14 @@ sub run_treeview_dialog {
},
),
0, gtksignal_connect(
- Gtk2::Button->new(but_(N("Quit"))),
+ Gtk3::Button->new(but_(N("Quit"))),
clicked => \&quit,
),
),
- #0, $statusbar = Gtk2::Statusbar->new,
+ #0, $statusbar = Gtk3::Statusbar->new,
),
);
- $statusbar = Gtk2::Statusbar->new;
+ $statusbar = Gtk3::Statusbar->new;
$list->get_model->set_sort_func($pkg_columns{image} + 1, sub {
my ($store, $treeiter1, $treeiter2) = @_;
diff --git a/Rpmdrake/edit_urpm_sources.pm b/Rpmdrake/edit_urpm_sources.pm
index bcfe5bd5..024c4da9 100644
--- a/Rpmdrake/edit_urpm_sources.pm
+++ b/Rpmdrake/edit_urpm_sources.pm
@@ -180,7 +180,7 @@ sub add_callback() {
my $notebook = gtknew('Notebook');
$notebook->set_show_tabs(0); $notebook->set_show_border(0);
my ($count_nbs, %pages);
- my $size_group = Gtk2::SizeGroup->new('horizontal');
+ my $size_group = Gtk3::SizeGroup->new('horizontal');
my ($cb1, $cb2);
foreach (@radios_names_ordered) {
my $info = $radios_infos{$_};
@@ -267,7 +267,7 @@ really want to replace it?"), yesno => 1) or return 0;
gtknew('VBox', spacing => 5),
gtknew('Title2', label => N("Adding a medium:")),
gtknew('HBox', children_tight => [
- Gtk2::Label->new(but(N("Type of medium:"))),
+ Gtk3::Label->new(but(N("Type of medium:"))),
gtknew('ComboBox', text_ref => \$type,
list => \@radios_names_ordered,
format => sub { $radios_infos{$_[0]}{name} },
@@ -277,7 +277,7 @@ really want to replace it?"), yesno => 1) or return 0;
gtknew('HSeparator'),
gtkpack(
gtknew('HButtonBox'),
- gtknew('Button', text => N("Cancel"), clicked => sub { $w->{retval} = 0; Gtk2->main_quit }),
+ gtknew('Button', text => N("Cancel"), clicked => sub { $w->{retval} = 0; Gtk3->main_quit }),
gtksignal_connect(
gtknew('Button', text => N("Ok")), clicked => sub {
if ($checkok->()) {
@@ -301,7 +301,7 @@ really want to replace it?"), yesno => 1) or return 0;
? ($info->{login_entry}->get_text . ':' . $info->{pass_entry}->get_text . '@')
: '',
$i{url};
- Gtk2->main_quit;
+ Gtk3->main_quit;
}
},
),
@@ -391,7 +391,7 @@ sub options_callback() {
gtkpack(
gtknew('HButtonBox'),
- gtknew('Button', text => N("Cancel"), clicked => sub { Gtk2->main_quit }),
+ gtknew('Button', text => N("Cancel"), clicked => sub { Gtk3->main_quit }),
gtksignal_connect(
gtknew('Button', text => N("Ok")), clicked => sub {
$urpm->{global_config}{'verify-rpm'} = $verify_rpm;
@@ -400,7 +400,7 @@ sub options_callback() {
$something_changed = 1;
urpm::media::write_config($urpm);
$urpm = fast_open_urpmi_db();
- Gtk2->main_quit;
+ Gtk3->main_quit;
},
),
),
@@ -482,7 +482,7 @@ sub edit_callback() {
{},
[ gtknew('Label_Left', text => N("URL:")), $url_entry = gtkentry($verbatim_medium->{url} || $verbatim_medium->{mirrorlist}) ],
[ gtknew('Label_Left', text => N("Downloader:")),
- my $download_combo = Gtk2::ComboBox->new_with_strings([ urpm::download::available_ftp_http_downloaders() ],
+ my $download_combo = Gtk3::ComboBox->new_with_strings([ urpm::download::available_ftp_http_downloaders() ],
$verbatim_medium->{downloader} || '') ],
),
0, gtknew('HSeparator'),
@@ -490,7 +490,7 @@ sub edit_callback() {
gtknew('HButtonBox'),
gtksignal_connect(
gtknew('Button', text => N("Cancel")),
- clicked => sub { $w->{retval} = 0; Gtk2->main_quit },
+ clicked => sub { $w->{retval} = 0; Gtk3->main_quit },
),
gtksignal_connect(
gtknew('Button', text => N("Save changes")),
@@ -498,7 +498,7 @@ sub edit_callback() {
$w->{retval} = 1;
$url = $url_entry->get_text;
$downloader = $downloader_entry->get_text;
- Gtk2->main_quit;
+ Gtk3->main_quit;
},
),
gtksignal_connect(
@@ -555,7 +555,7 @@ sub proxy_callback {
my ($proxy, $proxy_user) = readproxy($medium_name);
my ($user, $pass) = $proxy_user =~ /^([^:]*):(.*)$/;
my ($proxybutton, $proxyentry, $proxyuserbutton, $proxyuserentry, $proxypasswordentry);
- my $sg = Gtk2::SizeGroup->new('horizontal');
+ my $sg = Gtk3::SizeGroup->new('horizontal');
gtkadd(
$w->{window},
gtkpack__(
@@ -592,12 +592,12 @@ sub proxy_callback {
$proxy = $proxybutton->get_active ? $proxyentry->get_text : '';
$proxy_user = $proxyuserbutton->get_active
? ($proxyuserentry->get_text . ':' . $proxypasswordentry->get_text) : '';
- Gtk2->main_quit;
+ Gtk3->main_quit;
},
),
gtksignal_connect(
gtknew('Button', text => N("Cancel")),
- clicked => sub { $w->{retval} = 0; Gtk2->main_quit },
+ clicked => sub { $w->{retval} = 0; Gtk3->main_quit },
)
)
)
@@ -659,8 +659,8 @@ sub add_callback_ {
gtknew('HSeparator'),
gtkpack(
gtknew('HButtonBox'),
- gtknew('Button', text => N("Ok"), clicked => sub { $w->{retval} = 1; $get_value->(); Gtk2->main_quit }),
- gtknew('Button', text => N("Cancel"), clicked => sub { $w->{retval} = 0; Gtk2->main_quit })
+ gtknew('Button', text => N("Ok"), clicked => sub { $w->{retval} = 1; $get_value->(); Gtk3->main_quit }),
+ gtknew('Button', text => N("Cancel"), clicked => sub { $w->{retval} = 0; Gtk3->main_quit })
)
)
);
@@ -674,11 +674,11 @@ sub edit_parallel {
local $::main_window = $w->{real_window};
my $name_entry;
- my ($medias_ls, $hosts_ls) = (Gtk2::ListStore->new("Glib::String"), Gtk2::ListStore->new("Glib::String"));
+ my ($medias_ls, $hosts_ls) = (Gtk3::ListStore->new("Glib::String"), Gtk3::ListStore->new("Glib::String"));
my ($medias, $hosts) = map {
- my $list = Gtk2::TreeView->new_with_model($_);
- $list->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => 0));
+ my $list = Gtk3::TreeView->new_with_model($_);
+ $list->append_column(Gtk3::TreeViewColumn->new_with_attributes(undef, Gtk3::CellRendererText->new, 'text' => 0));
$list->set_headers_visible(0);
$list->get_selection->set_mode('browse');
$list;
@@ -687,9 +687,9 @@ sub edit_parallel {
$medias_ls->append_set([ 0 => $_ ]) foreach @{$edited->{medias}};
my $add_media = sub {
- my $medias_list_ls = Gtk2::ListStore->new("Glib::String");
- my $medias_list = Gtk2::TreeView->new_with_model($medias_list_ls);
- $medias_list->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => 0));
+ my $medias_list_ls = Gtk3::ListStore->new("Glib::String");
+ my $medias_list = Gtk3::TreeView->new_with_model($medias_list_ls);
+ $medias_list->append_column(Gtk3::TreeViewColumn->new_with_attributes(undef, Gtk3::CellRendererText->new, 'text' => 0));
$medias_list->set_headers_visible(0);
$medias_list->get_selection->set_mode('browse');
$medias_list_ls->append_set([ 0 => $_->{name} ]) foreach @{$urpm->{media}};
@@ -737,8 +737,8 @@ sub edit_parallel {
1, gtknew('Frame', shadow_type => 'in', child =>
gtknew('ScrolledWindow', h_policy => 'never', child => $medias)),
0, gtknew('VBox', children_tight => [
- gtksignal_connect(Gtk2::Button->new(but(N("Add"))), clicked => sub { $add_media->() }),
- gtksignal_connect(Gtk2::Button->new(but(N("Remove"))), clicked => sub {
+ gtksignal_connect(Gtk3::Button->new(but(N("Add"))), clicked => sub { $add_media->() }),
+ gtksignal_connect(Gtk3::Button->new(but(N("Remove"))), clicked => sub {
remove_from_list($medias, $edited->{medias}, $medias_ls);
}) ]) ]) ],
[ N("Hosts:"),
@@ -746,8 +746,8 @@ sub edit_parallel {
1, gtknew('Frame', shadow_type => 'in', child =>
gtknew('ScrolledWindow', h_policy => 'never', child => $hosts)),
0, gtknew('VBox', children_tight => [
- gtksignal_connect(Gtk2::Button->new(but(N("Add"))), clicked => sub { $add_host->() }),
- gtksignal_connect(Gtk2::Button->new(but(N("Remove"))), clicked => sub {
+ gtksignal_connect(Gtk3::Button->new(but(N("Add"))), clicked => sub { $add_host->() }),
+ gtksignal_connect(Gtk3::Button->new(but(N("Remove"))), clicked => sub {
remove_from_list($hosts, $hosts_list, $hosts_ls);
}) ]) ]) ]
),
@@ -759,10 +759,10 @@ sub edit_parallel {
$w->{retval} = 1;
$edited->{name} = $name_entry->get_text;
mapn { $_[0]->get_active and $edited->{protocol} = $_[1] } \@protocols, \@protocols_names;
- Gtk2->main_quit;
+ Gtk3->main_quit;
}
),
- gtknew('Button', text => N("Cancel"), clicked => sub { $w->{retval} = 0; Gtk2->main_quit }))
+ gtknew('Button', text => N("Cancel"), clicked => sub { $w->{retval} = 0; Gtk3->main_quit }))
)
);
$w->{rwindow}->set_size_request(600, -1);
@@ -779,10 +779,10 @@ sub edit_parallel {
sub parallel_callback() {
my $w = ugtk3->new(N("Configure parallel urpmi (distributed execution of urpmi)"), grab => 1, center => 1, transient => $mainw->{real_window});
local $::main_window = $w->{real_window};
- my $list_ls = Gtk2::ListStore->new("Glib::String", "Glib::String", "Glib::String", "Glib::String");
- my $list = Gtk2::TreeView->new_with_model($list_ls);
- each_index { $list->append_column(Gtk2::TreeViewColumn->new_with_attributes($_, Gtk2::CellRendererText->new, 'text' => $::i)) } N("Group"), N("Protocol"), N("Media limit");
- $list->append_column(my $commandcol = Gtk2::TreeViewColumn->new_with_attributes(N("Command"), Gtk2::CellRendererText->new, 'text' => 3));
+ my $list_ls = Gtk3::ListStore->new("Glib::String", "Glib::String", "Glib::String", "Glib::String");
+ my $list = Gtk3::TreeView->new_with_model($list_ls);
+ each_index { $list->append_column(Gtk3::TreeViewColumn->new_with_attributes($_, Gtk3::CellRendererText->new, 'text' => $::i)) } N("Group"), N("Protocol"), N("Media limit");
+ $list->append_column(my $commandcol = Gtk3::TreeViewColumn->new_with_attributes(N("Command"), Gtk3::CellRendererText->new, 'text' => 3));
$commandcol->set_max_width(200);
my $conf;
@@ -808,11 +808,11 @@ sub parallel_callback() {
0, gtkpack__(
gtknew('VBox', spacing => 5),
gtksignal_connect(
- Gtk2::Button->new(but(N("Remove"))),
+ Gtk3::Button->new(but(N("Remove"))),
clicked => sub { remove_parallel(selrow($list), $conf); $reread->() },
),
gtksignal_connect(
- Gtk2::Button->new(but(N("Edit..."))),
+ Gtk3::Button->new(but(N("Edit..."))),
clicked => sub {
my $row = selrow($list);
$row != -1 and edit_parallel($row, $conf);
@@ -820,7 +820,7 @@ sub parallel_callback() {
},
),
gtksignal_connect(
- Gtk2::Button->new(but(N("Add..."))),
+ Gtk3::Button->new(but(N("Add..."))),
clicked => sub { edit_parallel(-1, $conf) and $reread->() },
)
)
@@ -828,7 +828,7 @@ sub parallel_callback() {
0, gtknew('HSeparator'),
0, gtkpack(
gtknew('HButtonBox'),
- gtknew('Button', text => N("Ok"), clicked => sub { Gtk2->main_quit })
+ gtknew('Button', text => N("Ok"), clicked => sub { Gtk3->main_quit })
)
)
);
@@ -840,16 +840,16 @@ sub keys_callback() {
local $::main_window = $w->{real_window};
$w->{real_window}->set_size_request(600, 300);
- my $media_list_ls = Gtk2::ListStore->new("Glib::String");
- my $media_list = Gtk2::TreeView->new_with_model($media_list_ls);
- $media_list->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Medium"), Gtk2::CellRendererText->new, 'text' => 0));
+ my $media_list_ls = Gtk3::ListStore->new("Glib::String");
+ my $media_list = Gtk3::TreeView->new_with_model($media_list_ls);
+ $media_list->append_column(Gtk3::TreeViewColumn->new_with_attributes(N("Medium"), Gtk3::CellRendererText->new, 'text' => 0));
$media_list->get_selection->set_mode('browse');
my $key_col_size = 200;
- my $keys_list_ls = Gtk2::ListStore->new("Glib::String", "Glib::String");
- my $keys_list = Gtk2::TreeView->new_with_model($keys_list_ls);
+ my $keys_list_ls = Gtk3::ListStore->new("Glib::String", "Glib::String");
+ my $keys_list = Gtk3::TreeView->new_with_model($keys_list_ls);
$keys_list->set_rules_hint(1);
- $keys_list->append_column(my $col = Gtk2::TreeViewColumn->new_with_attributes(N("_:cryptographic keys\nKeys"), my $renderer = Gtk2::CellRendererText->new, 'text' => 0));
+ $keys_list->append_column(my $col = Gtk3::TreeViewColumn->new_with_attributes(N("_:cryptographic keys\nKeys"), my $renderer = Gtk3::CellRendererText->new, 'text' => 0));
$col->set_sizing('fixed');
$col->set_fixed_width($key_col_size);
$renderer->set_property('width' => 1);
@@ -885,9 +885,9 @@ sub keys_callback() {
});
my $add_key = sub {
- my $available_keyz_ls = Gtk2::ListStore->new("Glib::String", "Glib::String");
- my $available_keyz = Gtk2::TreeView->new_with_model($available_keyz_ls);
- $available_keyz->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => 0));
+ my $available_keyz_ls = Gtk3::ListStore->new("Glib::String", "Glib::String");
+ my $available_keyz = Gtk3::TreeView->new_with_model($available_keyz_ls);
+ $available_keyz->append_column(Gtk3::TreeViewColumn->new_with_attributes(undef, Gtk3::CellRendererText->new, 'text' => 0));
$available_keyz->set_headers_visible(0);
$available_keyz->get_selection->set_mode('browse');
$available_keyz_ls->append_set([ 0 => sprintf("%s (%s)", $_, $key_name->($_)), 1 => $_ ]) foreach keys %{$urpm->{keys}};
@@ -930,11 +930,11 @@ sub keys_callback() {
0, gtkpack__(
gtknew('VBox', spacing => 5),
gtksignal_connect(
- Gtk2::Button->new(but(N("Add"))),
+ Gtk3::Button->new(but(N("Add"))),
clicked => \&$add_key,
),
gtksignal_connect(
- Gtk2::Button->new(but(N("Remove"))),
+ Gtk3::Button->new(but(N("Remove"))),
clicked => \&$remove_key,
)
)
@@ -942,7 +942,7 @@ sub keys_callback() {
0, gtknew('HSeparator'),
0, gtkpack(
gtknew('HButtonBox'),
- gtknew('Button', text => N("Ok"), clicked => sub { Gtk2->main_quit })
+ gtknew('Button', text => N("Ok"), clicked => sub { Gtk3->main_quit })
),
),
);
@@ -962,7 +962,7 @@ sub mainwindow() {
[ N("/_File") . N("/_Update"), N("<control>U"), sub { update_callback() and $reread_media->() }, undef, '<Item>', ],
[ N("/_File") . N("/Add a specific _media mirror"), N("<control>M"), sub { easy_add_callback_with_mirror() and $reread_media->() }, undef, '<Item>' ],
[ N("/_File") . N("/_Add a custom medium"), N("<control>A"), sub { add_callback() and $reread_media->() }, undef, '<Item>' ],
- [ N("/_File") . N("/Close"), N("<control>W"), sub { Gtk2->main_quit }, undef, '<Item>', ],
+ [ N("/_File") . N("/Close"), N("<control>W"), sub { Gtk3->main_quit }, undef, '<Item>', ],
[ N("/_Options"), undef, undef, undef, '<Branch>' ],
[ N("/_Options") . N("/_Global options"), N("<control>G"), \&options_callback, undef, '<Item>' ],
[ N("/_Options") . N("/Manage _keys"), N("<control>K"), \&keys_callback, undef, '<Item>' ],
@@ -996,8 +996,8 @@ sub mainwindow() {
),
);
- my $list = Gtk2::ListStore->new("Glib::Boolean", "Glib::Boolean", "Glib::String", "Glib::String", "Glib::Boolean");
- $list_tv = Gtk2::TreeView->new_with_model($list);
+ my $list = Gtk3::ListStore->new("Glib::Boolean", "Glib::Boolean", "Glib::String", "Glib::String", "Glib::Boolean");
+ $list_tv = Gtk3::TreeView->new_with_model($list);
$list_tv->get_selection->set_mode('multiple');
my ($dw_button, $edit_button, $remove_button, $up_button);
$list_tv->get_selection->signal_connect(changed => sub {
@@ -1041,18 +1041,18 @@ sub mainwindow() {
},
);
- $list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Enabled"),
- my $tr = Gtk2::CellRendererToggle->new,
+ $list_tv->append_column(Gtk3::TreeViewColumn->new_with_attributes(N("Enabled"),
+ my $tr = Gtk3::CellRendererToggle->new,
'active' => $col{mainw}{is_enabled}));
- $list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Updates"),
- my $cu = Gtk2::CellRendererToggle->new,
+ $list_tv->append_column(Gtk3::TreeViewColumn->new_with_attributes(N("Updates"),
+ my $cu = Gtk3::CellRendererToggle->new,
'active' => $col{mainw}{is_update},
activatable => $col{mainw}{activatable}));
- $list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Type"),
- Gtk2::CellRendererText->new,
+ $list_tv->append_column(Gtk3::TreeViewColumn->new_with_attributes(N("Type"),
+ Gtk3::CellRendererText->new,
'text' => $col{mainw}{type}));
- $list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Medium"),
- Gtk2::CellRendererText->new,
+ $list_tv->append_column(Gtk3::TreeViewColumn->new_with_attributes(N("Medium"),
+ Gtk3::CellRendererText->new,
'text' => $col{mainw}{name}));
my $id;
$id = $tr->signal_connect(
@@ -1128,24 +1128,24 @@ sub mainwindow() {
gtkpack_(
gtknew('VBox', spacing => 5),
0, $menu,
- ($0 =~ /rpm-edit-media|edit-urpm-sources/ ? (0, Gtk2::Banner->new($ugtk3::wm_icon, N("Configure media"))) : ()),
+ ($0 =~ /rpm-edit-media|edit-urpm-sources/ ? (0, Gtk3::Banner->new($ugtk3::wm_icon, N("Configure media"))) : ()),
1, gtkpack_(
gtknew('HBox', spacing => 10),
1, gtknew('ScrolledWindow', child => $list_tv),
0, gtkpack__(
gtknew('VBox', spacing => 5),
gtksignal_connect(
- $remove_button = Gtk2::Button->new(but(N("Remove"))),
+ $remove_button = Gtk3::Button->new(but(N("Remove"))),
clicked => sub { remove_callback() and $reread_media->() },
),
gtksignal_connect(
- $edit_button = Gtk2::Button->new(but(N("Edit"))),
+ $edit_button = Gtk3::Button->new(but(N("Edit"))),
clicked => sub {
my $name = edit_callback(); defined $name and $reread_media->($name);
}
),
gtksignal_connect(
- Gtk2::Button->new(but(N("Add"))),
+ Gtk3::Button->new(but(N("Add"))),
clicked => sub { easy_add_callback() and $reread_media->() },
),
gtkpack(
@@ -1164,8 +1164,8 @@ sub mainwindow() {
),
0, gtknew('HSeparator'),
0, gtknew('HButtonBox', layout => 'edge', children_loose => [
- gtksignal_connect(Gtk2::Button->new(but(N("Help"))), clicked => sub { rpmdrake::open_help('sources') }),
- gtksignal_connect(Gtk2::Button->new(but(N("Ok"))), clicked => sub { Gtk2->main_quit })
+ gtksignal_connect(Gtk3::Button->new(but(N("Help"))), clicked => sub { rpmdrake::open_help('sources') }),
+ gtksignal_connect(Gtk3::Button->new(but(N("Ok"))), clicked => sub { Gtk3->main_quit })
])
)
);
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index 8a471901..9181a3da 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -113,7 +113,7 @@ sub build_expander {
my $textview;
gtkadd(
gtkshow(my $exp = gtksignal_connect(
- Gtk2::Expander->new(format_field($label)),
+ Gtk3::Expander->new(format_field($label)),
activate => sub {
state $first;
return if $first;
@@ -132,7 +132,7 @@ sub build_expander {
sub get_advisory_link {
my ($update_descr) = @_;
- my $link = gtkshow(Gtk2::LinkButton->new($update_descr->{URL}, N("Security advisory")));
+ my $link = gtkshow(Gtk3::LinkButton->new($update_descr->{URL}, N("Security advisory")));
$link->set_uri_hook(\&run_help_callback);
[ $link ];
}
@@ -226,7 +226,7 @@ sub get_new_deps {
my $deps_textview;
my @a = [ gtkadd(
gtksignal_connect(
- gtkshow(my $dependencies = Gtk2::Expander->new(format_field(N("New dependencies:")))),
+ gtkshow(my $dependencies = Gtk3::Expander->new(format_field(N("New dependencies:")))),
activate => sub {
slow_func($::main_window->window, sub {
my $state = {};
@@ -263,7 +263,7 @@ sub get_url_link {
my @a =
(@{ ugtk3::markup_to_TextView_format(format_field("\n$spacing" . N("URL: "))) },
- [ my $link = gtkshow(Gtk2::LinkButton->new($url, $url)) ]);
+ [ my $link = gtkshow(Gtk3::LinkButton->new($url, $url)) ]);
$link->set_uri_hook(\&run_help_callback);
@a;
}
@@ -295,7 +295,7 @@ sub format_pkg_simplifiedinfo {
push @$s, [ "\n" ];
my $installed_version = eval { find_installed_version($upkg) };
- push @$s, [ gtkadd(gtkshow(my $details_exp = Gtk2::Expander->new(format_field(N("Details:")))),
+ push @$s, [ gtkadd(gtkshow(my $details_exp = Gtk3::Expander->new(format_field(N("Details:")))),
gtknew('TextView', text => get_details($pkg, $upkg, $installed_version, $raw_medium))) ];
$details_exp->set_use_markup(1);
push @$s, [ "\n\n" ];
@@ -736,7 +736,7 @@ sub deps_msg {
interactive_msg(N("More information on package..."), get_info($pkg), scroll => 1);
}) ] } @deps ],
[ gtknew('Button', text => N("Ok"),
- clicked => sub { Gtk2->main_quit }) ]
+ clicked => sub { Gtk3->main_quit }) ]
);
goto deps_msg_again;
} else {
@@ -898,7 +898,7 @@ sub real_quit() {
if (is_there_selected_packages()) {
interactive_msg(N("Some packages are selected."), N("Some packages are selected.") . "\n" . N("Do you really want to quit?"), yesno => 1) or return;
}
- Gtk2->main_quit;
+ Gtk3->main_quit;
}
sub do_action__real {
diff --git a/Rpmdrake/gurpm.pm b/Rpmdrake/gurpm.pm
index 06cfd6b5..af3fb369 100644
--- a/Rpmdrake/gurpm.pm
+++ b/Rpmdrake/gurpm.pm
@@ -105,7 +105,7 @@ sub invalidate_cancel_forever {
$self->{hbox_cancel} or return;
$self->{hbox_cancel}->destroy;
# FIXME: temporary workaround that prevents
- # Gtk2::Label::set_text() set_text_internal() -> queue_resize() ->
+ # Gtk3::Label::set_text() set_text_internal() -> queue_resize() ->
# size_allocate() call chain to mess up when ->shrink_topwindow()
# has been called (#32613):
#$self->shrink_topwindow;
diff --git a/Rpmdrake/init.pm b/Rpmdrake/init.pm
index 4fcd8be8..817f8050 100644
--- a/Rpmdrake/init.pm
+++ b/Rpmdrake/init.pm
@@ -78,7 +78,7 @@ BEGIN { #- for mcc
}
-#- This is needed because text printed by Gtk2 will always be encoded
+#- This is needed because text printed by Gtk3 will always be encoded
#- in UTF-8; we first check if LC_ALL is defined, because if it is,
#- changing only LC_COLLATE will have no effect.
use POSIX qw(setlocale LC_ALL LC_COLLATE strftime);
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index 55895210..0407e498 100644
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -366,7 +366,7 @@ sub get_installed_packages {
@installed_pkgs;
}
-urpm::select::add_packages_to_priority_upgrade_list('rpmdrake', 'perl-Glib', 'perl-Gtk2');
+urpm::select::add_packages_to_priority_upgrade_list('rpmdrake', 'perl-Glib', 'perl-Gtk3');
my $priority_state;
our $need_restart;
@@ -437,7 +437,7 @@ sub get_pkgs {
my $gurpm = Rpmdrake::gurpm->new(1 ? N("Please wait") : N("Package installation..."), N("Initializing..."), transient => $::main_window);
my $_gurpm_clean_guard = before_leaving { undef $gurpm };
- #my $_flush_guard = Gtk2::GUI_Update_Guard->new;
+ #my $_flush_guard = Gtk3::GUI_Update_Guard->new;
warn_about_media($w, %options);
@@ -607,7 +607,7 @@ sub display_READMEs_if_needed {
},
),
] } keys %Readmes ],
- [ gtknew('Button', text => N("Ok"), clicked => sub { Gtk2->main_quit }) ]
+ [ gtknew('Button', text => N("Ok"), clicked => sub { Gtk3->main_quit }) ]
);
}
}
@@ -657,7 +657,7 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
my $_restore_sensitive = before_leaving { $w->set_sensitive(1) };
# prevent perl to segfault upon receiving SIGALARM (mga#4918):
- #my $_flush_guard = Gtk2::GUI_Update_Guard->new;
+ #my $_flush_guard = Gtk3::GUI_Update_Guard->new;
if (my $group = get_parallel_group()) {
return perform_parallel_install($urpm, $group, $w, \$statusbar_msg_id);
@@ -794,7 +794,7 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
$done += grep { !/\.src\.rpm$/ } values %$transaction_sources_install; # installs
},
pre_removable => sub {
- # Gtk2::GUI_Update_Guard->new use of alarm() kill us when
+ # Gtk3::GUI_Update_Guard->new use of alarm() kill us when
# running system(), thus making DVD being ejected and printing
# wrong error messages (#30463)
diff --git a/Rpmdrake/rpmnew.pm b/Rpmdrake/rpmnew.pm
index fa81b346..14a01a75 100644
--- a/Rpmdrake/rpmnew.pm
+++ b/Rpmdrake/rpmnew.pm
@@ -87,8 +87,8 @@ sub inspect {
my $d = ugtk3->new(N("Inspecting %s", $file), grab => 1, transient => $::main_window);
my $save_wsize = sub { @inspect_wsize = $d->{rwindow}->get_size };
my %texts;
- require Gtk2::SourceView2;
- my $lang_manager = Gtk2::SourceView2::LanguageManager->get_default;
+ require Gtk3::SourceView2;
+ my $lang_manager = Gtk3::SourceView2::LanguageManager->get_default;
gtkadd(
$d->{window},
gtkpack_(
@@ -98,25 +98,25 @@ sub inspect {
gtkpack_(
gtknew('VBox'),
0, gtknew('Label', text_markup => qq(<span font_desc="monospace">$file:</span>)),
- 1, gtknew('ScrolledWindow', child => $texts{file} = Gtk2::SourceView2::View->new),
+ 1, gtknew('ScrolledWindow', child => $texts{file} = Gtk3::SourceView2::View->new),
),
gtkpack_(
gtknew('VBox'),
0, gtknew('Label', text_markup => qq(<span font_desc="monospace">$rpmnew:</span>)),
- 1, gtknew('ScrolledWindow', child => $texts{rpmnew} = Gtk2::SourceView2::View->new),
+ 1, gtknew('ScrolledWindow', child => $texts{rpmnew} = Gtk3::SourceView2::View->new),
),
resize1 => 1,
),
gtkpack_(
gtknew('VBox'),
0, gtknew('Label', text => N("Changes:")),
- 1, gtknew('ScrolledWindow', child => $texts{diff} = Gtk2::SourceView2::View->new),
+ 1, gtknew('ScrolledWindow', child => $texts{diff} = Gtk3::SourceView2::View->new),
),
resize1 => 1,
),
- 0, Gtk2::HSeparator->new,
+ 0, Gtk3::HSeparator->new,
0, gtknew('WrappedLabel',
- # prevent bad sizing of Gtk2::WrappedLabel:
+ # prevent bad sizing of Gtk3::WrappedLabel:
width => $inspect_wsize[0],
text => N("You can either remove the .%s file, use it as main file or do nothing. If unsure, keep the current file (\"%s\").",
$rpmfile, N("Remove .%s", $rpmfile)),
@@ -125,15 +125,15 @@ sub inspect {
gtknew('HButtonBox'),
gtksignal_connect(
gtknew('Button', text => N("Remove .%s", $rpmfile)),
- clicked => sub { $save_wsize->(); unlink $rpmnew; Gtk2->main_quit },
+ clicked => sub { $save_wsize->(); unlink $rpmnew; Gtk3->main_quit },
),
gtksignal_connect(
gtknew('Button', text => N("Use .%s as main file", $rpmfile)),
- clicked => sub { $save_wsize->(); renamef($rpmnew, $file); Gtk2->main_quit },
+ clicked => sub { $save_wsize->(); renamef($rpmnew, $file); Gtk3->main_quit },
),
gtksignal_connect(
gtknew('Button', text => N("Do nothing")),
- clicked => sub { $save_wsize->(); Gtk2->main_quit },
+ clicked => sub { $save_wsize->(); Gtk3->main_quit },
),
)
)
@@ -183,7 +183,7 @@ sub dialog_rpmnew {
} @{$p2r{$pkg}};
} keys %p2r ],
[ gtknew('Button', text => N("Ok"),
- clicked => sub { Gtk2->main_quit }) ]
+ clicked => sub { Gtk3->main_quit }) ]
);
return 0;
}
diff --git a/Rpmdrake/widgets.pm b/Rpmdrake/widgets.pm
index 2c99fd41..98faf09e 100644
--- a/Rpmdrake/widgets.pm
+++ b/Rpmdrake/widgets.pm
@@ -1,4 +1,4 @@
-package Gtk2::Mdv::TextView;
+package Gtk3::Mdv::TextView;
#*****************************************************************************
#
# Copyright (c) 2002 Guillaume Cottenceau
diff --git a/rpmdrake b/rpmdrake
index 1f19f173..78e06f0e 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -103,7 +103,7 @@ sub do_search($$$$$$$) {
gtkpack__(
gtknew('HButtonBox', layout => 'spread'),
gtksignal_connect(
- Gtk2::Button->new(but(N("Stop"))),
+ Gtk3::Button->new(but(N("Stop"))),
clicked => sub { $searchstop = 1 },
),
),
@@ -247,16 +247,16 @@ sub run_treeview_dialog {
rebuild_tree => sub {},
};
- $tree_model = Gtk2::TreeStore->new("Glib::String", "Glib::String", "Gtk2::Gdk::Pixbuf");
+ $tree_model = Gtk3::TreeStore->new("Glib::String", "Glib::String", "Gtk3::Gdk::Pixbuf");
$tree_model->set_sort_column_id($grp_columns{label}, 'ascending');
- $tree = Gtk2::TreeView->new_with_model($tree_model);
+ $tree = Gtk3::TreeView->new_with_model($tree_model);
$tree->get_selection->set_mode('browse');
- $tree->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::MDV::CellRendererPixWithLabel->new, 'pixbuf' => $grp_columns{icon}, label => $grp_columns{label}));
+ $tree->append_column(Gtk3::TreeViewColumn->new_with_attributes(undef, Gtk3::MDV::CellRendererPixWithLabel->new, 'pixbuf' => $grp_columns{icon}, label => $grp_columns{label}));
$tree->set_headers_visible(0);
- $detail_list_model = Gtk2::ListStore->new("Glib::String",
- "Gtk2::Gdk::Pixbuf",
+ $detail_list_model = Gtk3::ListStore->new("Glib::String",
+ "Gtk3::Gdk::Pixbuf",
"Glib::String",
"Glib::Boolean",
"Glib::String",
@@ -265,11 +265,11 @@ sub run_treeview_dialog {
"Glib::String",
"Glib::Boolean");
- $detail_list = Gtk2::TreeView->new_with_model($detail_list_model);
+ $detail_list = Gtk3::TreeView->new_with_model($detail_list_model);
$detail_list->append_column(
- my $col_sel = Gtk2::TreeViewColumn->new_with_attributes(
+ my $col_sel = Gtk3::TreeViewColumn->new_with_attributes(
undef,
- Gtk2::CellRendererToggle->new,
+ Gtk3::CellRendererToggle->new,
active => $pkg_columns{selected},
activatable => $pkg_columns{selectable}
));
@@ -303,9 +303,9 @@ sub run_treeview_dialog {
foreach my $col (@columns{@columns}) {
$detail_list->append_column(
$col->{widget} =
- Gtk2::TreeViewColumn->new_with_attributes(
+ Gtk3::TreeViewColumn->new_with_attributes(
' ' . $col->{title} . ' ',
- $col->{renderer} = Gtk2::CellRendererText->new,
+ $col->{renderer} = Gtk3::CellRendererText->new,
($col->{markup} ? (markup => $col->{markup}) : (text => $col->{text})),
)
);
@@ -322,10 +322,10 @@ sub run_treeview_dialog {
$detail_list->append_column(
my $pixcolumn =
- Gtk2::TreeViewColumn->new_with_attributes(
+ Gtk3::TreeViewColumn->new_with_attributes(
#-PO: "Status" should be kept *small* !!!
N("Status"),
- my $rdr = Gtk2::CellRendererPixbuf->new,
+ my $rdr = Gtk3::CellRendererPixbuf->new,
'pixbuf' => $pkg_columns{state_icon})
);
$rdr->set_fixed_size(34, 24);
@@ -486,18 +486,18 @@ sub run_treeview_dialog {
my @search_types = qw(normal descriptions summaries files);
my $current_search_type = $search_types[0];
- my $search_menu = Gtk2::Menu->new;
+ my $search_menu = Gtk3::Menu->new;
my $i = 0;
my $previous;
foreach (N("in names"), N("in descriptions"), N("in summaries"), N("in file names")) {
my ($name, $val) = ($_, $i);
$search_menu->append(gtksignal_connect(gtkshow(
- $previous = Gtk2::RadioMenuItem->new_with_label($previous, $name)),
+ $previous = Gtk3::RadioMenuItem->new_with_label($previous, $name)),
activate => sub { $current_search_type = $search_types[$val] }));
$i++;
}
- my $info = Gtk2::Mdv::TextView->new;
+ my $info = Gtk3::Mdv::TextView->new;
$info->set_left_margin(2);
$info->set_right_margin(15); #- workaround when right elevator of scrolled window appears
@@ -564,7 +564,7 @@ sub run_treeview_dialog {
$size_selected = 0;
$force_displaying_group = 1;
my $tree_selection = $tree->get_selection;
- $tree_selection->select_path(Gtk2::TreePath->new_from_string('0')) if !$tree_selection->get_selected;
+ $tree_selection->select_path(Gtk3::TreePath->new_from_string('0')) if !$tree_selection->get_selected;
$tree_selection->signal_emit('changed');
}, undef, '<Item>' ],
[ N("/_File") . N("/Reload the _packages list"), undef, $reload_db_and_clear_all, undef, '<Item>' ],
@@ -670,8 +670,8 @@ sub run_treeview_dialog {
$checkbox_show_autoselect = $factory->get_widget("<main>" . strip_first_underscore(N("/_Options"), N("/_Show automatically selected packages")))
and $checkbox_show_autoselect->set_active(!$dont_show_selections->[0]);
- my $accel = Gtk2::AccelGroup->new;
- $accel->connect(Gtk2::Gdk->keyval_from_name('F'), [ 'control-mask' ], [ 'visible' ], sub { $find_entry->grab_focus });
+ my $accel = Gtk3::AccelGroup->new;
+ $accel->connect(Gtk3::Gdk->keyval_from_name('F'), [ 'control-mask' ], [ 'visible' ], sub { $find_entry->grab_focus });
$w->{real_window}->add_accel_group($accel);
gtkadd(
@@ -705,7 +705,7 @@ sub run_treeview_dialog {
$search_menu->popup(undef, undef, undef, undef, $event->button, $event->time);
},
key_press_event => sub {
- member($_[1]->keyval, $Gtk3::Gdk::KEY_Return, $Gtk2::Gdk::Keysyms{KP_Enter})
+ member($_[1]->keyval, $Gtk3::Gdk::KEY_Return, $Gtk3::Gdk::Keysyms{KP_Enter})
and $find_callback->();
},
),
@@ -715,24 +715,24 @@ sub run_treeview_dialog {
0, gtkpack_(
gtknew('HBox', spacing => 20),
0, gtksignal_connect(
- Gtk2::Button->new(but_(N("Select all"))),
+ Gtk3::Button->new(but_(N("Select all"))),
clicked => sub {
toggle_all($options, 1);
},
),
1, gtknew('Label'),
0, my $action_button = gtksignal_connect(
- Gtk2::Button->new(but_(N("Apply"))),
+ Gtk3::Button->new(but_(N("Apply"))),
clicked => sub { do_action($options, $callback_action, $info) },
),
0, gtksignal_connect(
- Gtk2::Button->new(but_(N("Quit"))),
+ Gtk3::Button->new(but_(N("Quit"))),
clicked => \&quit,
),
),
),
),
- 0, $statusbar = Gtk2::Statusbar->new,
+ 0, $statusbar = Gtk3::Statusbar->new,
),
);
$action_button->set_sensitive(0) if $>;
diff --git a/rpmdrake.pm b/rpmdrake.pm
index da349b36..e5697957 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -130,14 +130,14 @@ sub rpmdrake::prompt::prompt {
gtkadd(
$d->{window},
gtkpack(
- Gtk2::VBox->new(0, 5),
- Gtk2::WrappedLabel->new($self->{title}),
+ Gtk3::VBox->new(0, 5),
+ Gtk3::WrappedLabel->new($self->{title}),
(map { gtkpack(
- Gtk2::HBox->new(0, 5),
- Gtk2::Label->new($self->{prompts}[$_]),
+ Gtk3::HBox->new(0, 5),
+ Gtk3::Label->new($self->{prompts}[$_]),
$answers[$_] = gtkset_visibility(gtkentry(), !$self->{hidden}[$_]),
) } 0 .. $#{$self->{prompts}}),
- gtksignal_connect(Gtk2::Button->new(N("Ok")), clicked => sub { Gtk2->main_quit }),
+ gtksignal_connect(Gtk3::Button->new(N("Ok")), clicked => sub { Gtk3->main_quit }),
),
);
$d->main;
@@ -236,7 +236,7 @@ sub getbanner() {
install => N("Software Packages Installation"),
};
}
- Gtk2::Banner->new($ugtk3::wm_icon, $::MODE eq 'update' ? N("Software Packages Update") : N("Software Management"));
+ Gtk3::Banner->new($ugtk3::wm_icon, $::MODE eq 'update' ? N("Software Packages Update") : N("Software Management"));
}
# return value:
@@ -259,11 +259,11 @@ sub interactive_msg {
gtkadd(
$d->{window},
gtkpack_(
- Gtk2::VBox->new(0, 5),
+ Gtk3::VBox->new(0, 5),
1,
(
$options{scroll} ?
- ($text_w = create_scrolled_window(gtktext_insert(Gtk2::TextView->new, $contents)))
+ ($text_w = create_scrolled_window(gtktext_insert(Gtk3::TextView->new, $contents)))
: ($text_w = gtknew('WrappedLabel', text_markup => $contents))
),
if_($options{widget}, 0, $options{widget}),
@@ -274,24 +274,24 @@ sub interactive_msg {
ref($options{yesno}) eq 'ARRAY' ? map {
my $label = $_;
gtksignal_connect(
- $button_yes = Gtk2::Button->new($label),
- clicked => sub { $d->{retval} = $label; Gtk2->main_quit }
+ $button_yes = Gtk3::Button->new($label),
+ clicked => sub { $d->{retval} = $label; Gtk3->main_quit }
);
} @{$options{yesno}}
: (
$options{yesno} ? (
gtksignal_connect(
- Gtk2::Button->new($options{text}{no} || N("No")),
- clicked => sub { $d->{retval} = 0; Gtk2->main_quit }
+ Gtk3::Button->new($options{text}{no} || N("No")),
+ clicked => sub { $d->{retval} = 0; Gtk3->main_quit }
),
gtksignal_connect(
- $button_yes = Gtk2::Button->new($options{text}{yes} || N("Yes")),
- clicked => sub { $d->{retval} = 1; Gtk2->main_quit }
+ $button_yes = Gtk3::Button->new($options{text}{yes} || N("Yes")),
+ clicked => sub { $d->{retval} = 1; Gtk3->main_quit }
),
)
: gtksignal_connect(
- $button_yes = Gtk2::Button->new(N("Ok")),
- clicked => sub { Gtk2->main_quit }
+ $button_yes = Gtk3::Button->new(N("Ok")),
+ clicked => sub { Gtk3->main_quit }
)
)
)
@@ -313,8 +313,8 @@ sub interactive_packtable {
my $packtable = create_packtable({}, @$lines);
gtkadd($w->{window},
- gtkpack_(Gtk2::VBox->new(0, 5),
- if_($top_label, 0, Gtk2::Label->new($top_label)),
+ gtkpack_(Gtk3::VBox->new(0, 5),
+ if_($top_label, 0, Gtk3::Label->new($top_label)),
1, create_scrolled_window($packtable),
0, gtkpack__(create_hbox(), @$action_buttons)));
my $preq = $packtable->size_request;
@@ -337,29 +337,29 @@ sub interactive_list {
my $n = $_[1];
[ $_[0],
gtksignal_connect(
- Gtk2::Button->new(but(N("Info..."))),
+ Gtk3::Button->new(but(N("Info..."))),
clicked => sub { $callback->($n) },
) ];
} \@radios, $list,
- ) : gtkpack__(Gtk2::VBox->new(0, 0), @radios);
+ ) : gtkpack__(Gtk3::VBox->new(0, 0), @radios);
my $choice;
my $button_ok;
gtkadd(
$d->{window},
gtkpack__(
- Gtk2::VBox->new(0,5),
- Gtk2::Label->new($contents),
+ Gtk3::VBox->new(0,5),
+ Gtk3::Label->new($contents),
int(@$list) > 8 ? gtkset_size_request(create_scrolled_window($vbradios), 250, 320) : $vbradios,
gtkpack__(
create_hbox(),
if_(!$options{nocancel},
gtksignal_connect(
- Gtk2::Button->new(N("Cancel")), clicked => sub { Gtk2->main_quit }),
+ Gtk3::Button->new(N("Cancel")), clicked => sub { Gtk3->main_quit }),
),
gtksignal_connect(
- $button_ok=Gtk2::Button->new(N("Ok")), clicked => sub {
+ $button_ok=Gtk3::Button->new(N("Ok")), clicked => sub {
each_index { $_->get_active and $choice = $::i } @radios;
- Gtk2->main_quit;
+ Gtk3->main_quit;
}
)
)
@@ -384,11 +384,11 @@ sub wait_msg {
local $::isEmbedded;
my $mainw = ugtk3->new(N("Please wait"), grab => 1, if_(exists $options{transient}, transient => $options{transient}));
$mainw->{real_window}->set_position($options{transient} ? 'center_on_parent' : 'center_always');
- my $label = ref($msg) =~ /^Gtk/ ? $msg : Gtk2::WrappedLabel->new($msg);
+ my $label = ref($msg) =~ /^Gtk/ ? $msg : Gtk3::WrappedLabel->new($msg);
gtkadd(
$mainw->{window},
gtkpack__(
- gtkset_border_width(Gtk2::VBox->new(0, 5), 6),
+ gtkset_border_width(Gtk3::VBox->new(0, 5), 6),
$label,
if_(exists $options{widgets}, @{$options{widgets}}),
)
@@ -669,16 +669,16 @@ by Mageia Official Updates.")), %options
my $w = ugtk3->new(N("Mirror choice"), grab => 1, @transient_options);
$w->{rwindow}->set_position($options{transient} ? 'center_on_parent' : 'center_always');
- my $tree_model = Gtk2::TreeStore->new("Glib::String");
- my $tree = Gtk2::TreeView->new_with_model($tree_model);
+ my $tree_model = Gtk3::TreeStore->new("Glib::String");
+ my $tree = Gtk3::TreeView->new_with_model($tree_model);
$tree->get_selection->set_mode('browse');
- $tree->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, text => 0));
+ $tree->append_column(Gtk3::TreeViewColumn->new_with_attributes(undef, Gtk3::CellRendererText->new, text => 0));
$tree->set_headers_visible(0);
gtkadd(
$w->{window},
gtkpack_(
- Gtk2::VBox->new(0,5),
+ Gtk3::VBox->new(0,5),
0, N("Please choose the desired mirror."),
1, create_scrolled_window($tree),
0, gtkpack(
@@ -686,13 +686,13 @@ by Mageia Official Updates.")), %options
map {
my $retv = $_->[1];
gtksignal_connect(
- Gtk2::Button->new(but($_->[0])),
+ Gtk3::Button->new(but($_->[0])),
clicked => sub {
if ($retv) {
my ($model, $iter) = $tree->get_selection->get_selected;
$model and $w->{retval} = { sel => $model->get($iter, 0) };
}
- Gtk2->main_quit;
+ Gtk3->main_quit;
},
);
} [ N("Cancel"), 0 ], [ N("Ok"), 1 ]
@@ -706,7 +706,7 @@ by Mageia Official Updates.")), %options
$w->{window}->set_size_request(500, 400);
$w->{rwindow}->show_all;
- my $path = Gtk2::TreePath->new_first;
+ my $path = Gtk3::TreePath->new_first;
$tree->expand_row($path, 0);
$path->down;
$tree->get_selection->select_path($path);
@@ -754,21 +754,21 @@ sub show_urpm_progress {
}
}
}
- Gtk2->main_iteration while Gtk2->events_pending;
+ Gtk3->main_iteration while Gtk3->events_pending;
}
sub update_sources {
my ($urpm, %options) = @_;
my $cancel = 0;
my $w; my $label; $w = wait_msg(
- $label = Gtk2::Label->new(N("Please wait, updating media...")),
+ $label = Gtk3::Label->new(N("Please wait, updating media...")),
no_wait_cursor => 1,
widgets => [
- my $pb = gtkset_size_request(Gtk2::ProgressBar->new, 300, -1),
+ my $pb = gtkset_size_request(Gtk3::ProgressBar->new, 300, -1),
gtkpack(
create_hbox(),
gtksignal_connect(
- Gtk2::Button->new(N("Cancel")),
+ Gtk3::Button->new(N("Cancel")),
clicked => sub {
$cancel = 1;
$urpm->{error}->(N("Canceled"));
@@ -831,35 +831,35 @@ sub update_sources_interactive {
gtkadd(
$w->{window},
gtkpack_(
- 0, Gtk2::VBox->new(0,5),
- 0, Gtk2::Label->new(N("Select the media you wish to update:")),
+ 0, Gtk3::VBox->new(0,5),
+ 0, Gtk3::Label->new(N("Select the media you wish to update:")),
1, gtknew('ScrolledWindow', height => 300, child =>
# FIXME: using a listview would be just better:
gtknew('VBox', spacing => 5, children_tight => [
@buttons = map {
- Gtk2::CheckButton->new_with_label($_->{name});
+ Gtk3::CheckButton->new_with_label($_->{name});
} @media
])
),
- 0, Gtk2::HSeparator->new,
+ 0, Gtk3::HSeparator->new,
0, gtkpack(
create_hbox(),
gtksignal_connect(
- Gtk2::Button->new(N("Cancel")),
- clicked => sub { $w->{retval} = 0; Gtk2->main_quit },
+ Gtk3::Button->new(N("Cancel")),
+ clicked => sub { $w->{retval} = 0; Gtk3->main_quit },
),
gtksignal_connect(
- Gtk2::Button->new(N("Select all")),
+ Gtk3::Button->new(N("Select all")),
clicked => sub { $_->set_active(1) foreach @buttons },
),
gtksignal_connect(
- Gtk2::Button->new(N("Update")),
+ Gtk3::Button->new(N("Update")),
clicked => sub {
$w->{retval} = any { $_->get_active } @buttons;
# list of media listed in the checkbox panel
my @buttonmedia = grep { !$_->{ignore} } @{$urpm->{media}};
@media = map_index { if_($_->get_active, $buttonmedia[$::i]{name}) } @buttons;
- Gtk2->main_quit;
+ Gtk3->main_quit;
},
),
)