Mageia Bugzilla – Attachment 4058 Details for
Bug 10310
userdrake should use dbus org.freedesktop.Accounts to get/set user account info
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
small patch to show dbus use
userdrake-dbus-small.patch (text/plain), 1.73 KB, created by
Pablo Saratxaga
on 2013-05-27 10:52:16 CEST
(
hide
)
Description:
small patch to show dbus use
Filename:
MIME Type:
Creator:
Pablo Saratxaga
Created:
2013-05-27 10:52:16 CEST
Size:
1.73 KB
patch
obsolete
>--- /usr/sbin/userdrake_bak 2013-05-27 10:45:49.917164090 +0200 >+++ /usr/sbin/userdrake 2013-05-27 10:47:42.433521447 +0200 >@@ -41,6 +41,7 @@ > use Gtk2::Gdk::Keysyms; > use utf8; > use log; >+use Net::DBus; > > $ugtk2::wm_icon = "userdrake"; > >@@ -48,11 +49,16 @@ > my $secfile = '/etc/sysconfig/msec'; > my $pixdir = '/usr/share/userdrake/pixmaps/'; > my @pix = ($pixdir . 'selected.png', $pixdir . 'unselected.png'); >+my $bus = Net::DBus->system; >+my $accounts_service = $bus->get_service("org.freedesktop.Accounts"); >+my $accounts_manager = $accounts_service->get_object( >+ "/org/freedesktop/Accounts", >+ "org.freedesktop.Accounts"); > > my $in = interactive->vnew('su'); > > my $us = {}; >-$us->{VERSION} = '1.13.3'; >+$us->{VERSION} = '1.14.2'; > > my $window_splash = Gtk2::Window->new('popup'); > $window_splash->signal_connect(delete_event => \&QuitGlobal); >@@ -334,7 +340,19 @@ > my @icons = any::facesnames(); > my $i; > my $current_icon; >- my $user_icon = "$::prefix/usr/share/faces/$user.png"; >+ my $accounts_user_path = $accounts_manager->FindUserByName($user); >+ # service doens't provide Get methods; we need to use different >+ # interface to read properties >+ my $accounts_user_get = $accounts_service->get_object( >+ $accounts_user_path, >+ "org.freedesktop.DBus.Properties"); >+ my $accounts_user_set = $accounts_service->get_object( >+ $accounts_user_path, >+ "org.freedesktop.Accounts.User"); >+ my $user_icon = $accounts_user_get->Get( >+ "org.freedesktop.Accounts.User", >+ "IconFile"); >+ if (!$user_icon) { $user_icon = "$::prefix/usr/share/faces/$user.png"; } > gtkpack_(my $hb = Gtk2::HBox->new(0, 2), > 0, Gtk2::Label->new(N("Click on the icon to change it") . ' '), > 0, my $bt = Gtk2::Button->new
--- /usr/sbin/userdrake_bak 2013-05-27 10:45:49.917164090 +0200 +++ /usr/sbin/userdrake 2013-05-27 10:47:42.433521447 +0200 @@ -41,6 +41,7 @@ use Gtk2::Gdk::Keysyms; use utf8; use log; +use Net::DBus; $ugtk2::wm_icon = "userdrake"; @@ -48,11 +49,16 @@ my $secfile = '/etc/sysconfig/msec'; my $pixdir = '/usr/share/userdrake/pixmaps/'; my @pix = ($pixdir . 'selected.png', $pixdir . 'unselected.png'); +my $bus = Net::DBus->system; +my $accounts_service = $bus->get_service("org.freedesktop.Accounts"); +my $accounts_manager = $accounts_service->get_object( + "/org/freedesktop/Accounts", + "org.freedesktop.Accounts"); my $in = interactive->vnew('su'); my $us = {}; -$us->{VERSION} = '1.13.3'; +$us->{VERSION} = '1.14.2'; my $window_splash = Gtk2::Window->new('popup'); $window_splash->signal_connect(delete_event => \&QuitGlobal); @@ -334,7 +340,19 @@ my @icons = any::facesnames(); my $i; my $current_icon; - my $user_icon = "$::prefix/usr/share/faces/$user.png"; + my $accounts_user_path = $accounts_manager->FindUserByName($user); + # service doens't provide Get methods; we need to use different + # interface to read properties + my $accounts_user_get = $accounts_service->get_object( + $accounts_user_path, + "org.freedesktop.DBus.Properties"); + my $accounts_user_set = $accounts_service->get_object( + $accounts_user_path, + "org.freedesktop.Accounts.User"); + my $user_icon = $accounts_user_get->Get( + "org.freedesktop.Accounts.User", + "IconFile"); + if (!$user_icon) { $user_icon = "$::prefix/usr/share/faces/$user.png"; } gtkpack_(my $hb = Gtk2::HBox->new(0, 2), 0, Gtk2::Label->new(N("Click on the icon to change it") . ' '), 0, my $bt = Gtk2::Button->new
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 10310
:
4058
|
4126
|
5892
|
5893