diff options
-rw-r--r-- | AdminPanel/Users/GUsers.pm | 26 | ||||
-rwxr-xr-x | modules/usermanager/adminUser | 16 | ||||
-rwxr-xr-x | modules/usermanager/mgaAddUser | 17 |
3 files changed, 26 insertions, 33 deletions
diff --git a/AdminPanel/Users/GUsers.pm b/AdminPanel/Users/GUsers.pm index 5371c440..97f35588 100644 --- a/AdminPanel/Users/GUsers.pm +++ b/AdminPanel/Users/GUsers.pm @@ -31,7 +31,6 @@ package AdminPanel::Users::GUsers; use strict; # TODO evaluate if Moose is too heavy and use Moo # instead -use Moose; use POSIX qw(ceil); # use Time::localtime; use common qw(N @@ -47,6 +46,7 @@ use Glib; use yui; use AdminPanel::Shared; use AdminPanel::Users::users; +use Moose; extends qw( Module ); has '+icon' => ( @@ -670,7 +670,9 @@ sub _buildUserData { =head3 INPUT - $self: this object + $self: this object + $standalone: if set the application title is set + from the name set in costructor =head3 DESCRIPTION @@ -682,6 +684,7 @@ sub _buildUserData { #============================================================= sub addUserDialog { my $self = shift; + my $standalone = shift; my $dontcreatehomedir = 0; my $is_system = 0; @@ -689,7 +692,12 @@ sub addUserDialog { ## push application title my $appTitle = yui::YUI::app()->applicationTitle(); ## set new title to get it in dialog - yui::YUI::app()->setApplicationTitle(N("Create New User")); + if ($standalone) { + yui::YUI::app()->setApplicationTitle($self->name); + } + else { + yui::YUI::app()->setApplicationTitle(N("Create New User")); + } my $factory = yui::YUI::widgetFactory; my $optional = yui::YUI::optionalWidgetFactory; @@ -877,7 +885,7 @@ sub addUserDialog { destroy $dlg; #restore old application title - yui::YUI::app()->setApplicationTitle($appTitle); + yui::YUI::app()->setApplicationTitle($appTitle) if $appTitle; } #============================================================= @@ -2279,8 +2287,12 @@ sub manageUsersDialog { my $pixdir = '/usr/share/userdrake/pixmaps/'; ## push application title my $appTitle = yui::YUI::app()->applicationTitle(); + ## set new title to get it in dialog - yui::YUI::app()->setApplicationTitle(N("Mageia Users Management Tool")); + yui::YUI::app()->setApplicationTitle($self->name); + ## set icon if not already set by external launcher + yui::YUI::app()->setApplicationIcon($self->icon); + my $factory = yui::YUI::widgetFactory; my $optional = yui::YUI::optionalWidgetFactory; @@ -2459,7 +2471,7 @@ sub manageUsersDialog { $self->dialog->destroy() ; #restore old application title - yui::YUI::app()->setApplicationTitle($appTitle); + yui::YUI::app()->setApplicationTitle($appTitle) if $appTitle; } #============================================================= @@ -2549,4 +2561,4 @@ sub member { my $e = shift; foreach (@_) { $e eq $_ and return 1 } 0 } no Moose; __PACKAGE__->meta->make_immutable; -1;
\ No newline at end of file +1; diff --git a/modules/usermanager/adminUser b/modules/usermanager/adminUser index e4cbe5fd..c7f5b23a 100755 --- a/modules/usermanager/adminUser +++ b/modules/usermanager/adminUser @@ -2,22 +2,12 @@ use lib qw(/usr/lib/libDrakX); -use standalone; #- warning, standalone must be loaded very first, for 'explanations' +use common qw(N); -use common; -use security::level; - -use AdminPanel::Shared; use AdminPanel::Users::GUsers; -use yui; - -my $wm_icon = "/usr/share/icons/userdrake.png"; - -yui::YUI::app()->setApplicationTitle(N("Mageia Users Management Tool")); -yui::YUI::app()->setApplicationIcon($wm_icon); - -my $userMan = AdminPanel::Users::GUsers->new(); +my $userMan = AdminPanel::Users::GUsers->new({icon => "/usr/share/icons/userdrake.png", + name => N("Mageia Users Management Tool"),}); $userMan->start(); 1; diff --git a/modules/usermanager/mgaAddUser b/modules/usermanager/mgaAddUser index d9d2297c..f1af4bd3 100755 --- a/modules/usermanager/mgaAddUser +++ b/modules/usermanager/mgaAddUser @@ -2,21 +2,12 @@ use lib qw(/usr/lib/libDrakX); -use standalone; #- warning, standalone must be loaded very first, for 'explanations' +use common qw(N); -use common; - -use AdminPanel::Shared; use AdminPanel::Users::GUsers; -use yui; - -my $wm_icon = "/usr/share/icons/userdrake.png"; - -yui::YUI::app()->setApplicationTitle(N("Mageia Add Users Tool")); -yui::YUI::app()->setApplicationIcon($wm_icon); - -my $userMan = AdminPanel::Users::GUsers->new(); -$userMan->addUserDialog(); +my $userMan = AdminPanel::Users::GUsers->new({icon => "/usr/share/icons/userdrake.png", + name => N("Mageia Add Users Tool"),}); +$userMan->addUserDialog(1); 1; |