Support Application Indicators

Bug #497877 reported by Jorge Castro
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
HPLIP
New
Undecided
Unassigned
hplip (Ubuntu)
Incomplete
Wishlist
Canonical Desktop Experience Team

Bug Description

This application should be investigated to be ported to use Application
Indicators for Lucid - https://edge.launchpad.net/indicator-application

 affects ubuntu/hplip

 assignee canonical-dx-team
 tag indicator-application

smithj (smithj)
Changed in hplip (Ubuntu):
assignee: Canonical Desktop Experience Team (canonical-dx-team) → smithj (smithj)
status: New → In Progress
Changed in hplip (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
smithj (smithj) wrote :
Revision history for this message
smithj (smithj) wrote :

All the new stuff is dynamically loaded at run-time (python imports), so autofu shouldn't be needed. The ubuntu packager will, however, want to add a dep for this package on python-kde4.

Changed in hplip (Ubuntu):
assignee: smithj (smithj) → Ken VanDine (ken-vandine)
status: In Progress → Fix Committed
tags: added: patch
Jorge Castro (jorge)
Changed in hplip (Ubuntu):
assignee: Ken VanDine (ken-vandine) → Canonical Desktop Team (canonical-desktop-team)
Revision history for this message
Martin Pitt (pitti) wrote :

Till, can you please review this patch and comment/apply? Thank you!

Changed in hplip (Ubuntu):
assignee: Canonical Desktop Team (canonical-desktop-team) → Till Kamppeter (till-kamppeter)
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I did not apply and test this patch yet, but I see that python-kde4 (and so a lot of KDE-related libraries) is needed to make HPLIP's applet using the new application indicator concept. HPLIP's GUI is a pure Qt application and not a KDE application. To improve the probability that upstream accepts it it would be much better to have a Qt-only patch if possible.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :
Download full text (3.6 KiB)

I have tried the patch but it has a lot of problems. First, it is not able to put an icon into the tray. I get a "?" icon on one machine and no icon at all on another. Then it produces a lot of messages in the terminal from where I started "hp-systray" for testing. And if I quit via the "Quit" entry in the menu I get a segfault.

I use GNOME as the desktop, perhaps it works only on KDE desktops.

See all terminal output below.

till@till:~/ubuntu/hplip/svn/pkg-hpijs/hplip/build-area/hplip-3.10.2~rc1$ hp-systray

HP Linux Imaging and Printing System (ver. 3.10.2rc1)
System Tray Status Service ver. 2.0

Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

/usr/lib/pymodules/python2.6/gtk-2.0/gtk/__init__.py:127: RuntimeWarning: PyOS_InputHook is not available for interactive use of PyGTK
  set_interactive(1)
(8509) KStatusNotifierItemDBus::KStatusNotifierItemDBus: service is "org.freedesktop.StatusNotifierItem-8509-1"
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
(8509) KStatusNotifierItemPrivate::registerToDaemon: Registering a client interface to the KStatusNotifierWatcher
(8509) KStatusNotifierItemPrivate::registerToDaemon: KStatusNotifierWatcher not reachable
QSystemTrayIcon::setVisible: No Icon set
(8509) KToolInvocation::klauncher: klauncher not running... launching kdeinit
kdeinit4: preparing to launch /usr/lib/libkdeinit4_klauncher.so
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
klauncher(8519)/kio (KIOConnection) KIO::ConnectionServer::listenForRemote: Listening on "local:/tmp/ksocket-till/klauncherMT8519.slave-socket"
kdeinit4: preparing to launch /usr/lib/libkdeinit4_kded4.so
kdeinit4: preparing to launch /usr/lib/libkdeinit4_kbuildsycoca4.so
klauncher(8519)/kio (KLauncher) KLauncher::processRequestReturn: "/usr/bin/kbuildsycoca4" (pid 8528) up and running.
kbuildsycoca4 running...
kbuildsycoca4(8528)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-till/ksycoca4"
kbuildsycoca4(8528) KBuildSycoca::checkTimestamps: checking file timestamps
kbuildsycoca4(8528) KBuildSycoca::checkTimestamps: timestamps check ok
kbuildsycoca4(8528) kdemain: Emitting notifyDatabaseChanged ()
kded(8524)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-till/ksycoca4"
klauncher(8519)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-till/ksycoca4"
kdeinit4: preparing to launch /usr/lib/libkdeinit4_kconf_update.so
klauncher(8519)/kio (KLauncher) KLauncher::processRequestReturn: "kconf_update" (pid 8530) up and running.
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
klauncher(8519)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-till/ksycoca4"
kdeinit4: preparing to launch /usr/bin/knotify4
klauncher(8519)/kio (KLauncher) KLauncher...

Read more...

Revision history for this message
smithj (smithj) wrote :

With regards to KDE dependencies: it automatically falls back on Qt if KDE isn't present. So far as I know, there isn't an implementation of Status Notifier in pure Qt. http://www.notmart.org/misc/statusnotifieritem/index.html

Do you get a python traceback when quitting using the icon? If so, it would help me to see it. If not, could you provide a core dump?

I will look into your other output today.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

The output which I have posted includes the output which came out when I have quit via the menu of the icon. I do not see any Python traceback. The segfault also did not trigger apport.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

When starting hp-systray I get

till@till:~/ubuntu/hplip/svn/pkg-hpijs/hplip/build-area/hplip-3.10.2~rc1$ hp-systray

HP Linux Imaging and Printing System (ver. 3.10.2rc1)
System Tray Status Service ver. 2.0

-----------
Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

/usr/lib/pymodules/python2.6/gtk-2.0/gtk/__init__.py:127: RuntimeWarning: PyOS_InputHook is not available for interactive use of PyGTK
  set_interactive(1)
(9041) KStatusNotifierItemDBus::KStatusNotifierItemDBus: service is "org.freedesktop.StatusNotifierItem-9041-1"
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
(9041) KStatusNotifierItemPrivate::registerToDaemon: Registering a client interface to the KStatusNotifierWatcher
(9041) KStatusNotifierItemPrivate::registerToDaemon: KStatusNotifierWatcher not reachable
QSystemTrayIcon::setVisible: No Icon set
----------

and a "?" icon.

When right-clicking the "?" I get the HPLIP applet menu. If I click "Quit" I get

----------
knotify(8532) KNotify::event: 2 ref= 0
----------

and a dialog asking "Are you sure you want to quit?". Now I click "Quit" and get

----------
Segmentation fault (core dumped)
----------

and no Apport popping up.

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks Till. Indeed it's not adequate at all to add a dependency to python-kde4 just for supporting indicators. This, and the crashes need to be fixed first.

smithj, please reassign back to desktop team if/when there's an update. Thank you!

Changed in hplip (Ubuntu):
assignee: Till Kamppeter (till-kamppeter) → smithj (smithj)
status: Fix Committed → Incomplete
Revision history for this message
smithj (smithj) wrote :

OK, I finally tracked down what was happening in that segfault. Essentially, the python c module in pyqt can become... lets charitably call it "confused"... when python destroys objects in an order it isn't expecting. So, when exiting hplip, python's garbage collection runs (or doesn't) and triggers the edge case (or doesn't).

There are many discussions of this on the pyqt mailing lists, and each time the suggestion was to do one of the following:

1) instantiate your objects in a different order, until you find an order which doesn't cause the problem
2) figure out which object(s) is causing the issue, and explicitly kill it before you call QApplication.quit()

This message on the topic is somewhat enlightening: http://<email address hidden>/msg20499.html

However, since the segfault occurs even without my patch, I've filed it (along with a fix using #2 above) as launchpad bug #546816

Revision history for this message
smithj (smithj) wrote :

Here's a new patch implementing status notifier with the icons set correctly. This patch doesn't include the segfault fix (hopefully the segfault fix will be merged quicker than this bug can be reviewed), but you can pull it from the other bug. Neither overwrite or conflict with the other.

Let me know what you think :)

Changed in hplip (Ubuntu):
status: Incomplete → Fix Released
status: Fix Released → In Progress
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I tried the attached patch, but it is still not working. No icon appears in the system-tray, also no icons in the menu. "hp-systray --debug" output attached.

I am on Lucid with HPLIP 2.10.2 and GNOME as desktop.

Changed in hplip (Ubuntu):
status: In Progress → Incomplete
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I mean HPLIP 3.10.2.

Jorge Castro (jorge)
Changed in hplip (Ubuntu):
assignee: smithj (smithj) → Karl Lattimer (karl-qdh)
tags: added: patch-needswork
removed: patch
Changed in hplip (Ubuntu):
assignee: Karl Lattimer (karl-qdh) → nobody
Revision history for this message
Sean Cleary (seanearlyaug) wrote :
Download full text (8.1 KiB)

My printer does not work anymore and I have
No System Tray Detected On This System.
And someone asked for details, so here is the dump:

sean@gamer ~ $ hp-check -t

HP Linux Imaging and Printing System (ver. 3.11.3a)

Dependency/Version Check Utility ver. 14.3

Copyright (c) 2001-9 Hewlett-Packard Development Company, LP

This software comes with ABSOLUTELY NO WARRANTY.

This is free software, and you are welcome to distribute it

under certain conditions. See COPYING file for more details.

Note: hp-check can be run in three modes:

1. Compile-time check mode (-c or --compile): Use this mode before compiling the

HPLIP supplied tarball (.tar.gz or .run) to determine if the proper dependencies

are installed to successfully compile HPLIP.

2. Run-time check mode (-r or --run): Use this mode to determine if a distro

supplied package (.deb, .rpm, etc) or an already built HPLIP supplied tarball

has the proper dependencies installed to successfully run.

3. Both compile- and run-time check mode (-b or --both) (Default): This mode

will check both of the above cases (both compile- and run-time dependencies).

Saving output in log file: hp-check.log

Initializing. Please wait...

---------------

| SYSTEM INFO |

---------------

Basic system information:

Linux gamer 2.6.35-22-generic #33-Ubuntu SMP Sun Sep 19 20:34:50 UTC 2010 i686 GNU/Linux

Distribution:

linuxmint 10

Checking Python version...

OK, version 2.6.6 installed

Checking PyQt 4.x version...

OK, version 4.7.4 installed.

Checking for CUPS...

Status: scheduler is running

Version: 1.4.4

error_log is set to level: warn

Checking for dbus/python-dbus...

dbus daemon is running.

python-dbus version: 0.83.0

------------------------------------

| COMPILE AND RUNTIME DEPENDENCIES |

------------------------------------

note: To check for compile-time only dependencies, re-run hp-check with the -c parameter (ie, hp-check -c).

note: To check for run-time only dependencies, re-run hp-check with the -r parameter (ie, hp-check -r).

Checking for dependency: CUPS - Common Unix Printing System...

OK, found.

Checking for dependency: CUPS devel- Common Unix Printing System development files...

OK, found.

Checking for dependency: CUPS image - CUPS image development files...

OK, found.

Checking for dependency: DBus - Message bus system...

OK, found.

Checking for dependency: gcc - GNU Project C and C++ Compiler...

OK, found.

Checking for dependency: GhostScript - PostScript and PDF language interpreter and previewer...

OK, found.

Checking for dependency: libcrypto - OpenSSL cryptographic library...

OK, found.

Checking for dependency: libjpeg - JPEG library...

OK, found.

Checking for dependency: libnetsnmp-devel - SNMP networking library development files...

OK, found.

Checking for dependency: libpthread - POSIX threads library...

OK, found.

Checking for dependency: libtool - Library building support services...

OK, found.

Checking for dependency: libusb - USB library...

OK, found.

Checking for dependency: make - GNU make utility to maintai...

Read more...

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Assigning to Canonical DX team. Perhaps it can be done for Precise ...

Changed in hplip (Ubuntu):
assignee: nobody → Canonical Desktop Experience Team (canonical-dx-team)
Revision history for this message
gf (gf-interlinks-deactivatedaccount) wrote :

Hello Jorge,
Thank you for submitting this feature/enhancement request for the hplip package. You made this request quite some time ago and Ubuntu has been updated since then.

Do you think this feature/enhancement is still needed or can we close this bug report?

Thank you again for helping make Ubuntu better.
G
[Ubuntu Bug Squad volunteer triager]

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.