diff options
author | Angelo Naselli <anaselli@linux.it> | 2014-01-14 18:24:35 +0100 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2014-01-14 18:24:35 +0100 |
commit | ba8f98e4dbb9ae9490f86a5587818fde9ab31c45 (patch) | |
tree | d54a307e63f20e8dc00087000438ab6102f7e043 | |
parent | e09c0e78c3e46bfc842f3c7fdbf0d01c90087710 (diff) | |
download | colin-keep-ba8f98e4dbb9ae9490f86a5587818fde9ab31c45.tar colin-keep-ba8f98e4dbb9ae9490f86a5587818fde9ab31c45.tar.gz colin-keep-ba8f98e4dbb9ae9490f86a5587818fde9ab31c45.tar.bz2 colin-keep-ba8f98e4dbb9ae9490f86a5587818fde9ab31c45.tar.xz colin-keep-ba8f98e4dbb9ae9490f86a5587818fde9ab31c45.zip |
Managed title and icon accordingly to the constructor
-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 5371c44..97f3558 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 e4cbe5f..c7f5b23 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 d9d2297..f1af4bd 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; |