After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 580423 - Remove deprecated libgnomeui dependency
Remove deprecated libgnomeui dependency
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: general
2.26.x
Other Linux
: Normal normal
: 2.26.2
Assigned To: Willie Walker
Orca Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-27 11:11 UTC by André Klapper
Modified: 2009-05-03 00:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to do D-Bus equivalent of the gnome.ui calls (1.58 KB, patch)
2009-05-02 13:43 UTC, Willie Walker
none Details | Review
Revised patch to use '1' as the Logout parameter and which also pylints to a 10.0 (1.73 KB, patch)
2009-05-03 00:54 UTC, Willie Walker
committed Details | Review

Description André Klapper 2009-04-27 11:11:22 UTC
http://live.gnome.org/LibgnomeMustDie
This library will be removed for GNOME 3.

$:andre\> grep -r gnome.ui .
./src/orca/orca_console_prefs.py:    import gnome.ui
./src/orca/orca_console_prefs.py:    client = gnome.ui.master_client()
./src/orca/orca_console_prefs.py:    client.request_save(gnome.ui.SAVE_GLOBAL,
./src/orca/orca_console_prefs.py:    gnome.ui.INTERACT_ANY,
Comment 1 Willie Walker 2009-04-30 18:24:48 UTC
The code in question uses gnome.ui to popup a logout screen for the desktop:

def logoutUser():
    """Automatically log the user out of the GNOME desktop."""

    import gnome
    import gnome.ui

    gnome.init(platform.package, platform.version)
    client = gnome.ui.master_client()

    client.request_save(gnome.ui.SAVE_GLOBAL,  # Save style
                        True,                  # Shutdown
                        gnome.ui.INTERACT_ANY, # Allow user interaction
                        False,                 # Fast
                        True)                  # All apps save state

In looking at http://live.gnome.org/LibgnomeMustDie, I'm not sure what I'd need to do to pop up the dialog.  Do you have any suggestions?
Comment 2 Willie Walker 2009-05-01 12:53:21 UTC
After digging, it looks like the proposal is to replace GnomeClient with EggSMClient:

http://live.gnome.org/SessionManagement/EggSMClient

http://git.gnome.org/cgit/libegg/tree/libegg/smclient/README says the following:

	- gnome_client_request_save - Shutdown saves are now done via
	  egg_sm_client_end_session. There is no way to request a
	  non-shutdown save, either for yourself, or for the whole
	  session. (Requesting a local SaveYourself for yourself won't
	  actually have any effect under most session managers, and
	  requesting it for the whole session is something that only a
	  program directly associated with the session manager ought
	  to do, so there doesn't seem to be a need for a public API
	  for this.)

Now to find Python bindings for this....
Comment 3 Vincent Untz 2009-05-02 03:16:46 UTC
Willie: no need to use EggSMClient. There's a dbus method to log out. See org.gnome.SessionManager.xml in the gnome-session code for the API.
Comment 4 Matthias Clasen 2009-05-02 03:18:23 UTC
Or you can just directly call org.gnome.SessionManager.Logout on the session bus.
Comment 5 Willie Walker 2009-05-02 13:08:16 UTC
Woo hoo.  Thanks for the tip.  This command works well from the command line:

dbus-send --session  --dest=org.gnome.SessionManager --type=method_call /org/gnome/SessionManager org.gnome.SessionManager.Logout uint32:0

Now to make the Python equivalent.  Coming up.
Comment 6 Willie Walker 2009-05-02 13:19:58 UTC
This seems to work.  The cast to UInt32 seems necessary:

import dbus
bus = dbus.SessionBus()
sessionManager = bus.get_object('org.gnome.SessionManager',
                                '/org/gnome/SessionManager')
sessionManager.Logout(dbus.types.UInt32(0))
Comment 7 Willie Walker 2009-05-02 13:43:49 UTC
Created attachment 133803 [details] [review]
Patch to do D-Bus equivalent of the gnome.ui calls

This patch replaces the gnome.ui calls with the equivalent D-Bus calls.  The end result is the same, which is to pop up a dialog asking the user if they want to log out.

I would like, however, for the logout to automatically happen if possible.  The reason for this is that the typical use case where this dialog is presented is when the user is configuring Orca for the very first time and accessibility has not yet been enabled for the desktop.  As a result, the logout dialog is not yet accessible.  As a result, we need to tell the user to press "Return" a couple times in order to logout.

Vuntz/Matthias - would a parameter value of '1' be the better thing to use (from the *.xml - "<doc:definition>No confirmation inferface should be shown.</doc:definition>")?  A parameter of '2' for the forceful logout seems a bit too forceful.
Comment 8 Vincent Untz 2009-05-02 14:13:55 UTC
Yes, you probably want to use 1.
Comment 9 Willie Walker 2009-05-03 00:54:37 UTC
Created attachment 133835 [details] [review]
Revised patch to use '1' as the Logout parameter and which also pylints to a 10.0

This patch works nicely. Thanks for the confirmation about the parameter value of '1', Vincent!
Comment 10 Willie Walker 2009-05-03 00:56:56 UTC
Committed to master and gnome-2-26 branches for GNOME 2.27.1 and GNOME 2.26.2.  Closing as FIXED.