summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakperm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone/drakperm')
-rwxr-xr-xperl-install/standalone/drakperm41
1 files changed, 18 insertions, 23 deletions
diff --git a/perl-install/standalone/drakperm b/perl-install/standalone/drakperm
index 1ad449519..fa69be838 100755
--- a/perl-install/standalone/drakperm
+++ b/perl-install/standalone/drakperm
@@ -7,10 +7,10 @@ use standalone;
use MDK::Common;
use common;
-use mygtk2 qw(gtknew gtkset);
-use ugtk2 qw(:create :dialogs :helpers :wrappers);
+use mygtk3 qw(gtknew gtkset);
+use ugtk3 qw(:create :dialogs :helpers :wrappers);
-$ugtk2::wm_icon = "/usr/share/mcc/themes/default/drakperm-mdk.png";
+$ugtk3::wm_icon = "/usr/share/mcc/themes/default/drakperm-mdk.png";
require_root_capability();
#- vars declaration
@@ -30,21 +30,21 @@ my ($editable, $modified) = (0, 0);
my @rules;
#- Widget declaration
-my $w = ugtk2->new(N("Security Permissions"));
+my $w = ugtk3->new(N("Security Permissions"));
$w->{rwindow}->set_size_request(620, 400) unless $::isEmbedded;
my $W = $w->{window};
-$W->signal_connect(delete_event => sub { ugtk2->exit });
-my $model = Gtk2::ListStore->new("Gtk2::Gdk::Pixbuf", ("Glib::String") x 5);
-my $permList = Gtk2::TreeView->new_with_model($model);
+$W->signal_connect(delete_event => sub { ugtk3->exit });
+my $model = Gtk3::ListStore->new("Gtk3::Gdk::Pixbuf", ("Glib::String") x 5);
+my $permList = Gtk3::TreeView->new_with_model($model);
my $pixbuf = gtknew('Pixbuf', file => 'non-editable');
my @column_sizes = (150, 100, 100, 15, -1);
# TreeView layout is (Editable, Path, User, Group, Permissions, [hidden]index_id)
-$permList->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Editable"), Gtk2::CellRendererPixbuf->new, 'pixbuf' => 0));
+$permList->append_column(Gtk3::TreeViewColumn->new_with_attributes(N("Editable"), Gtk3::CellRendererPixbuf->new, 'pixbuf' => 0));
each_index {
- my $col = Gtk2::TreeViewColumn->new_with_attributes($_, Gtk2::CellRendererText->new, 'text' => $::i + 1);
+ my $col = Gtk3::TreeViewColumn->new_with_attributes($_, Gtk3::CellRendererText->new, 'text' => $::i + 1);
$col->set_min_width($column_sizes[$::i+1]);
$permList->append_column($col);
} (N("Path"), N("User"), N("Group"), N("Permissions"));
@@ -103,10 +103,8 @@ $permList->signal_connect(button_press_event => sub {
});
-my $tips = Gtk2::Tooltips->new;
-
$W->add(gtknew('VBox', spacing => 5, children => [
- if_(!$::isEmbedded, 0, Gtk2::Banner->new('/usr/share/mcc/themes/default/drakperm-mdk.png', N("Permissions"))),
+ if_(!$::isEmbedded, 0, Gtk3::Banner->new('/usr/share/mcc/themes/default/drakperm-mdk.png', N("Permissions"))),
0, gtknew('Label_Left', text => N("Here you can see files to use in order to fix permissions, owners, and groups via msec.\nYou can also edit your own rules which will overwrite the default rules."), alignment => [ 0.5, 0 ]),
1, gtknew('VBox', border_width => 0, children => [
0, gtknew('Label_Left', text => N("The current security level is %s.
@@ -118,7 +116,7 @@ Select permissions to see/edit", $level), alignment => [ 0, 0 ]),
1, gtknew('ScrolledWindow', child => $permList),
0, my $up_down_box = gtknew('HBox', spacing => 5, children_loose => [ @buttons =
map {
- gtkset_tip($tips,
+ gtkset_tip(
gtknew('Button', text => $_->[0], clicked => $_->[2]),
$_->[1]);
} ([ N("Up"), N("Move selected rule up one level"), sub { move_callback('up') } ],
@@ -129,7 +127,7 @@ Select permissions to see/edit", $level), alignment => [ 0, 0 ]),
0, gtknew('VBox'),
]),
0, create_okcancel({
- cancel_clicked => sub { ugtk2->exit },
+ cancel_clicked => sub { ugtk3->exit },
ok_clicked => \&save_perm,
},
undef, undef, '',
@@ -160,7 +158,7 @@ $permList->get_selection->signal_connect('changed' => sub {
});
$w->main;
-ugtk2->exit;
+ugtk3->exit;
sub hide_up_button_iffirst_item {
@@ -211,7 +209,7 @@ sub save_perm() {
close $F;
}
$modified = 0;
- ugtk2->exit;
+ ugtk3->exit;
}
sub load_perms() {
@@ -292,7 +290,7 @@ sub row_setting_dialog {
]
);
- my $usr_check = gtksignal_connect(gtkset_tip($tips, gtknew('CheckButton', text => N("Current user")),
+ my $usr_check = gtksignal_connect(gtkset_tip(gtknew('CheckButton', text => N("Current user")),
N("When checked, owner and group will not be changed")),
clicked => sub { $id_box->set_sensitive(!$_[0]->get_active) });
@@ -316,7 +314,7 @@ sub row_setting_dialog {
});
my %perms;
- gtkpack_($dlg->vbox,
+ gtkpack_($dlg->get_child,
0, gtknew('Title2', label => N("Path")),
0, gtknew('HBox', border_width => 18, children => [
1, $file,
@@ -343,8 +341,7 @@ sub row_setting_dialog {
map {
my $c = $_;
my $active = $perms{$owner}{$c};
- $perms{$owner}{$c} = gtknew('CheckButton');
- $tips->set_tip($perms{$owner}{$c},
+ $perms{$owner}{$c} = gtkset_tip(gtknew('CheckButton'),
$checks{$c}{tip}{$owner},
);
gtkset_active($perms{$owner}{$c}, $active);
@@ -363,9 +360,7 @@ sub row_setting_dialog {
$perms{gid}->set_active($s_right{write});
$perms{suid}->set_active($s_right{read});
- $dlg->set_has_separator(0);
-
- gtkadd($dlg->action_area,
+ gtkadd($dlg->get_action_area,
create_okcancel(my $w =
{
cancel_clicked => sub { $dlg->destroy },