summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakups
diff options
context:
space:
mode:
authorFrancesc Pinyol Margalef <francesc.pinyol.m@gmail.com>2013-12-21 13:37:33 +0100
committerFrancesc Pinyol Margalef <francesc.pinyol.m@gmail.com>2013-12-21 13:37:33 +0100
commit095c6b25885ce3d22eedba8cdb98f1fd7e8708a5 (patch)
tree5bfc768996b3ddec185abeb02b602b48b14d10db /perl-install/standalone/drakups
parentdf60191bdbddfa7c8e5bd11a2578aae6740963c0 (diff)
parentf76dc0931e47338aa9c7db257d28e5015d8a2f47 (diff)
downloaddrakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.tar
drakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.tar.gz
drakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.tar.bz2
drakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.tar.xz
drakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.zip
Merge branch 'master' of git://git.mageia.org/software/drakx
Diffstat (limited to 'perl-install/standalone/drakups')
-rwxr-xr-xperl-install/standalone/drakups40
1 files changed, 20 insertions, 20 deletions
diff --git a/perl-install/standalone/drakups b/perl-install/standalone/drakups
index b5baee934..427216069 100755
--- a/perl-install/standalone/drakups
+++ b/perl-install/standalone/drakups
@@ -6,7 +6,7 @@ use standalone;
use common;
use mouse;
use detect_devices;
-use ugtk2 qw(:create :dialogs :helpers :wrappers);
+use ugtk3 qw(:create :dialogs :helpers :wrappers);
use interactive;
use Libconf qw(:functions);
use Libconf::Glueconf::NUT::Ups_conf;
@@ -197,24 +197,24 @@ sub edit_row {
my ($model, $o_iter) = @_;
# create new item if needed (that is when adding a new one) at end of list
my $iter = $o_iter || $model->append;
- my $dialog = Gtk2::Dialog->new;
+ my $dialog = Gtk3::Dialog->new;
$dialog->set_transient_for($w->{real_window});
$dialog->set_modal(1);
- gtkpack_($dialog->vbox,
+ gtkpack_($dialog->get_child,
#map {
#}
);
- gtkadd($dialog->action_area,
- gtksignal_connect(Gtk2::Button->new(N("Ok")), clicked => sub {
+ gtkadd($dialog->get_action_area,
+ gtksignal_connect(Gtk3::Button->new(N("Ok")), clicked => sub {
# create new item if needed (that is when adding a new one) at end of list
$iter ||= $model->append;
# $model->set($iter, 1 => $file->get_text); # FILL ME
$dialog->destroy;
# $modified++;
}),
- gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => sub { $dialog->destroy }),
+ gtksignal_connect(Gtk3::Button->new(N("Cancel")), clicked => sub { $dialog->destroy }),
);
$dialog->show_all;
@@ -313,7 +313,7 @@ my @pages = (
#$in = 'interactive'->vnew('su'); # require_root_capability();
$in = 'interactive'->vnew;
-$ugtk2::wm_icon = "drakups";
+$ugtk3::wm_icon = "drakups";
if (!$::testing) {
$in->do_pkgs->ensure_is_installed('nut-server', '/usr/sbin/upsd') or $in->exit(1);
@@ -326,9 +326,9 @@ if (member('--wizard', @ARGV)) {
$in->exit($@ ? 1 : 0);
}
-$w = ugtk2->new(N("UPS Management"));
+$w = ugtk3->new(N("UPS Management"));
if (!$::isEmbedded) {
- mygtk2::register_main_window($w->{real_window});
+ mygtk3::register_main_window($w->{real_window});
$w->{window}->set_size_request(500, 550);
$w->{rwindow}->set_title(N("DrakUPS"));
}
@@ -338,9 +338,9 @@ if (!$::isEmbedded) {
my $_msg = N("Welcome to the UPS configuration tools");
-$w->{window}->add(gtkpack_(Gtk2::VBox->new,
- if_(!$::isEmbedded, 0, Gtk2::Banner->new('drakups', N("DrakUPS"))),
- 1, my $nb = Gtk2::Notebook->new,
+$w->{window}->add(gtkpack_(Gtk3::VBox->new,
+ if_(!$::isEmbedded, 0, Gtk3::Banner->new('drakups', N("DrakUPS"))),
+ 1, my $nb = Gtk3::Notebook->new,
0, create_okcancel(
{
ok_clicked => sub {
@@ -358,18 +358,18 @@ $w->{window}->add(gtkpack_(Gtk2::VBox->new,
# build the notebook
foreach my $i (@pages) {
- my $model = $models{$i->{id}} = Gtk2::ListStore->new("Glib::Int", ("Glib::String") x listlength(@{$i->{columns}}));
+ my $model = $models{$i->{id}} = Gtk3::ListStore->new("Glib::Int", ("Glib::String") x listlength(@{$i->{columns}}));
my (%buttons, $list);
$indexes{$i->{name}} = 0;
my $idx = \$indexes{$i->{name}};
my $getindex = sub { $$idx++ };
- $nb->append_page(gtkpack_(Gtk2::VBox->new,
- 1, create_scrolled_window($list = Gtk2::TreeView->new_with_model($model),
+ $nb->append_page(gtkpack_(Gtk3::VBox->new,
+ 1, create_scrolled_window($list = Gtk3::TreeView->new_with_model($model),
[ 'automatic', 'automatic' ]),
- 0, gtkpack(Gtk2::HButtonBox->new,
+ 0, gtkpack(Gtk3::HButtonBox->new,
(map {
my ($id, $label, $sub) = @$_;
- gtksignal_connect($buttons{$id} = Gtk2::Button->new($label), clicked => sub {
+ gtksignal_connect($buttons{$id} = Gtk3::Button->new($label), clicked => sub {
$sub->($model, $list, $getindex);
});
} ([ 'add', N("Add"), $i->{callbacks}{add} || \&add_callback ],
@@ -378,15 +378,15 @@ foreach my $i (@pages) {
)
)
#(map {
- # gtksignal_connect(Gtk2::Button->new($_), clicked => $i->{callbacks}{$_}),
+ # gtksignal_connect(Gtk3::Button->new($_), clicked => $i->{callbacks}{$_}),
#} keys %{$i->{callbacks}})
),
),
- Gtk2::Label->new($i->{name}),
+ Gtk3::Label->new($i->{name}),
);
#$i->{list} = $list;
each_index {
- $list->append_column(Gtk2::TreeViewColumn->new_with_attributes($_, Gtk2::CellRendererText->new, 'text' => $::i + 1));
+ $list->append_column(Gtk3::TreeViewColumn->new_with_attributes($_, Gtk3::CellRendererText->new, 'text' => $::i + 1));
} @{$i->{columns}};
my @u = $i->{load}->();
foreach my $line (@u) {