2 Shared code for ROX applications
4 http://rox.sourceforge.net
6 Note: for a detailed changelog, do:
8 svn log -v https://svn.sourceforge.net/svnroot/rox/trunk/ROX-Lib2
14 - Fix unit tests to use correct path (Thomas Leonard).
16 - Removed a load of unused imports spotted by PyFlakes (Thomas Leonard).
18 - ROX base platform is now Python 2.3, so run unit tests against that by
19 default (Thomas Leonard).
21 - Bugfix: Must use '..' in interface for backwards compat (Thomas Leonard).
23 - Removed some more deprecation warnings. Do not run testsu as part of testall
24 as it is interactive (Thomas Leonard).
26 - Ensure window response codes are treated as int(), required for python 2.5
27 and pygtk 2.6 (Stephen Watson).
29 - Drag-and-drop didn't work if the hostname contained '-', due to an error in
30 a regular expression (Thomas Leonard, reported by Lennon Cook).
32 - Function to fetch an appropriate icon for a file (Lennon Cook). Changed to
33 return a Pixbuf instead of an Image, to use the existing icon theme lookup
34 and to first check for a .DirIcon for directories (Stephen Watson).
36 - Added warning for when $DISPLAY is not set (gtk may segfault) (Stephen
41 - Update Chinese Translations (Babyfai Cheung).
43 - Update French translations (Vincent Lefèvre).
47 - Exception handler now copes with old-style non-class exceptions and
48 with missing tracebacks (Thomas Leonard).
52 - Added xattr support including test for user set MIME types (Stephen Watson).
56 - When there is only one section in the options box, don't show a frame (Thomas
59 - Added note about size-groups(Thomas Leonard).
61 - Added <filechooser> widget to OptionsBox, which lets the user choose a file
62 using a GtkFileChooser or by drag-and-drop (Jim Ramsay). Requires GTK >= 2.6.
64 - Added Clear button to filename options (Jim Ramsay and Thomas Leonard).
68 - Lookup icons from /rox.sourceforge.net/MIME-icons before /MIME-ICONS
73 - Prefered launcher for a URL scheme now part of uri_handler (Stephen Watson).
77 - Prefered launcher for a URL scheme now part of uri_handler (Stephen Watson).
81 - Fixed some deprecation warnings (Thomas Leonard).
83 - Bugfix: InputBlocker and OutputBlocker now trigger on IO_HUP too (Thomas
86 - Added Task.finished blocker, which is triggered when the task finishes,
87 successfully or by throwing an exception (Thomas Leonard; suggested by Ken
90 - Ensure that IO blocker callbacks return False, not None, or we get a
91 warning from PyGTK (Thomas Leonard).
95 - Added templates module as an interface to glade (Stephen Watson).
97 - Templates now has full dict behaviour and derives from glade.XML. Method
98 names have therefore changed to be the same used by glade.XML (Stephen
104 - Added thumbnail module to access thumbnail images of files and also to
105 generate them (Stephen Watson).
109 - Suppor shared configuration for launching URIs (Stephen Watson).
113 - Added xattr support including test for user set MIME types (Stephen Watson).
120 - Added ROX-Lib.xml file, which makes it easy to register a CVS copy of ROX-Lib
121 with the 0launch, using '0launch --add-feed' (Thomas Leonard).
123 - If pygtk is found, but not gtk, give a better error (Thomas Leonard; reported
126 - Double-click on a line in the stacktrace display of the debug box to
127 open the source code in Edit.
129 - Added rox.isappdir() function to test the validity of an AppDir (Stephen
132 - Set sys.excepthook to our graphical exception explorer so that untrapped
133 exceptions are reported nicely.
135 - Don't display KeyboardInterrupt in an error box.
140 - When displaying an uncaught exception, still write it to stderr as well as
141 opening the exception dialog box.
145 - Made message in AppRun translatable (Andras Mohari).
147 - Include AppRun when generating translations, and rename translation function
148 in OptionsBox to avoid confusing pygettext (reported by Andras Mohari).
150 - Added Hungarian translation.
152 - More strings marked for translation.
154 Current translations:
157 es Juan Carlos Jimenez Garcia
162 pt_BR * Jose Carlos do Nascimento
166 * indicates a translation which is out-of-date.
170 - Added method for applets to determine the panel orientation (Stephen Watson).
174 - Made filer.py use 0launch if available (Thomas Leonard; requested by
179 - Added launch module, which allows running programs easily using the injector,
180 and made filer.py use 0launch if available (Thomas Leonard; requested by
185 - Changed the doc string in Menu.py to prefer the new MenuItem based method
186 of defining menus not the old tuple method (Stephen Watson).
190 - Added mime.get_type_handler(), which uses the same algorithm as ROX-Filer to
191 find the handler for a file (Ken Hayber and Thomas Leonard).
195 - EXPERIMENTAL code for installing MIME handlers via 0launch (Stephen Watson)
197 - Better detection of the MIME-types/MIME-thumb location when installing type
198 handlers (Stephen Watson).
200 - Improve installation of MIME type handler under Zero Install (Stephen Watson)
202 - Bugfix: spurious argument when installing SendTo handler under Zero Install
203 (Stephen Watson, reported by Andras Mohari)
207 - Rename translation function in OptionsBox to avoid confusing pygettext.
209 - Make the options box use ComboBox instead of OptionMenu whenever possible. It
210 also makes sure that the OptionMenu's initial width is large enough to
211 display the widest item (Andras Mohari).
215 - When saving a file to a FAT filesystem, the chmod would fail. Log a warning
216 instead of aborting (Thomas Leonard; reported by QS Computing).
218 - Save box now selects icon from same icon theme as ROX-Filer (Stephen Watson).
222 - Added rox.session module for communicating with ROX-Session.
224 - Use XMLRPC if the DBUS version is too old.
226 - Check that ROX-Session is providing the dbus service, don't just assume that
227 it is (Stephen Watson).
231 - Added settings module (Tony Houghton, based on code from LookAndFeel).
233 - Don't create bus object until constructor is called.
235 - rox.settings now uses rox.session to communicate with ROX-Session and
236 the duplicate Options work has been removed from rox.session (Stephen
241 - If 'xterm' isn't available, give a sensible error message when using the
242 su module (Thomas Leonard; reported by Vincent Lefevre).
246 - Added 'xxmlrpc' module. This allows sending XML-RPC messages to other
247 processes, via the X server.
249 - Extended XML-RPC code to return response values and faults to caller.
251 - Better error codes (NoSuchService, UnknownObject, NoSuchMethod). Cope with
252 returning None (returns True instead). Simplified API (no need to subclass
253 ExportedObject, call register, or use invoke).
255 - If a service property exists but the window it points to doesn't, then
256 report that the service is no longer running.
258 - XXMLRPC call objects support the Blocker interface (so you can block
259 until the reply is available).
261 - If an XXMLRPC Call object is destroyed before the response is read then
262 display a warning and destroy the IPC window.
266 Updated French translation (Vincent Lefèvre).
270 Bugfix: spurious argument when installing SendTo handler under Zero
271 Install (Stephen Watson, reported by Andras Mohari)
275 When installing a type handler under Zero Install, make sure to pass the
276 arguments to the program and run 0launch in console mode (Stephen Watson).
280 Added mime.get_type_handler(), which uses the same algorithm as ROX-Filer to
281 find the handler for a file (Ken Hayber and Thomas Leonard).
285 New class Setting in rox.session is an option tied to a ROX-Session setting
290 Added rox.session module for communicating with ROX-Session.
291 Added method for applets to determine the panel orientation (Stephen Watson).
295 Set sys.excepthook to our graphical exception explorer so that untrapped
296 exceptions are reported nicely.
300 Save box now selects icon from same icon theme as ROX-Filer (Stephen Watson).
304 When saving a file to a FAT filesystem, the chmod would fail. Log a warning
305 instead of aborting (Thomas Leonard; reported by QS Computing).
309 Better detection of the MIME-types/MIME-thumb location when installing
310 type handlers (Stephen Watson).
314 Added rox.isappdir() function to test the validity of an AppDir (Stephen
316 EXPERIMENTAL code for installing MIME handlers via 0launch (Stephen Watson).
320 Changed the doc string in Menu.py to prefer the new MenuItem based method
321 of defining menus not the old tuple method (Stephen Watson).
325 Added Hungarian translation (Andras Mohari).
329 Made message in AppRun translatable (Andras Mohari).
333 Added launch module, which allows running programs easily using the injector,
334 and made filer.py use 0launch if available (Thomas Leonard; requested by
336 Double-click on a line in the stack-trace display of an error to open the
337 source file in Edit (Thomas Leonard).
341 If pygtk is found, but not gtk, give a better error (Thomas Leonard; reported
346 If 'xterm' isn't available, give a sensible error message when using the
347 su module (Thomas Leonard; reported by Vincent Lefevre).
351 Added ROX-Lib.xml file, which makes it easy to register a CVS copy of ROX-Lib
352 with the 0launch, using '0launch --add-feed' (Thomas Leonard).
354 25-Jul-2005 (Release 2.0.2)
356 Bugfix: Installing MIME handlers under the XDG base dir system didn't
357 work (Stephen Watson).
359 17-Jun-2005 (Release 2.0.1)
361 Send deprecation warnings to stdout, not stderr, so only developers will
362 see them (Thomas Leonard).
366 Fixed deprecation warning in processes.py (Thomas Leonard).
370 Avoid apparent PyGTK bug related to icon themes, may result in a
371 memory leak but probably won't (Stephen Watson).
375 Clean up of icon theme handling (Stephen Watson).
379 Compatability with PyGTK 2.4 retaining backwards compatability with
380 2.2 at least (Ken Hayber, Stephen Watson).
384 Updated Chinese translation (Babyfai Cheung).
388 Added Portuguese translation (José Carlos do Nascimento).
392 Don't try to get pygtk through Zero Install. The injector can be used to
393 choose the implementation of pygtk to use, including a version in Zero
394 Install if desired (Thomas Leonard).
398 MIME handler install now uses basedir (Stephen Watson).
399 Tests use gtk.main() instead of the deprecated gtk.mainloop() (Stephen Watson).
403 Some versions of GTK silently remove '-' from sys.argv (GTK bug #303166).
404 Added a work-around (Thomas Leonard).
408 Put "root" back in su command, but detect what the exact string should be, as
409 Solaris needs something here (reported by Stephen Watson).
413 The default SaveArea.confirm_new_path() now shows an error if the target
414 exists as a directory, instead of asking if you want to overwrite it (Thomas
415 Leonard; reported by Jonatan Liljedahl).
416 Remove "root" from the su command, as some systems call user 0 something else
417 (Thomas Leonard; reported by Jonatan Liljedahl).
421 When getting an icon for saving, specify the size if PyGTK is recent enough.
422 This prevents SVG icons from appearing in huge sizes (Thomas Leonard;
423 requested by John Pettigrew).
424 Bugfix: Theme index parser failed to cope with comments at the start of the
425 file (Thomas Leonard).
429 Compatability fixes for the su module (Stephen Watson).
433 Fixed Zero Install version test in findrox.py (Thomas Leonard).
435 16-Apr-2005 (Release 2.0.0)
437 Run unit tests in alphabetical order as it fixes a strange interaction between them (Stephen Watson).
441 Added unit tests for processes module, based on old tests in Archive (Thomas
446 Changed MakeDist to allow use of other SourceForge accounts (Stephen Watson).
450 Added 'testall' script to run all the unit tests together (Thomas Leonard).
452 23-Mar-2005 (Release 1.9.18)
454 German translation (Guido Schimmels).
458 Added TODO file to track bugs and changes needed for 2.0.0 release.
462 Bugfix: Set default in Options box to OK to avoid triggering a GTK bug
463 (Thomas Leonard, reported by Guido Schimmels).
465 16-Jan-2005 (Release 1.9.17)
467 Added OutputBlocker, which works in a similar way to InputBlocker (Thomas
472 Be consistent about URI escaping. set_uri() is now always passed an unescaped
473 UTF-8 string (Thomas Leonard).
477 Added fixedlist and varlist widgets to OptionsBox (Stephen Watson).
481 Added MIME type matching by file contents (Stephen Watson).
485 If a 'rox' module is in PYTHONPATH, use that without any searching (Thomas
490 Added Chinese translation (Babyfai Cheung).
494 Suppress warning when we use GtkItemFactory under pygtk 2.4 (Stephen Watson).
498 Added tasks.InputBlocker, which triggers when an input source becomes
499 readable (Thomas Leonard).
503 Bugfix: Use only text nodes when getting the tool tip from the Options.xml
504 file (Stephen Watson).
508 Bugfix: Theme subdirectories are separated by ',' not ';' (reported by
513 Bugfix: When a menu has more than one toggle item, only one is updated
514 correctly (Ken Hayber).
518 Replace g.mainloop() and g.mainquit() with g.main() and g.main_quit() as
519 recommended since pygtk 2.0.0 to avoid warnings with pygtk 2.4.0 (Stephen
524 Added options.ListOption to support multi-valued option widgets, such as
525 lists (Stephen Watson).
527 02-Oct-2004 (Release 1.9.16)
529 Cope better with user cancelling su operation. New interface to replace
530 create_su_proxy (Thomas Leonard).
534 The choices module is now deprecated. You can use choices.migrate() to move
535 settings over to the basedir system (Thomas Leonard). Also added
536 basedir.load_first_config(), which works like the old choices.load().
540 Several incompatible changes to the experimental proxy API to make it simpler
543 - Create_su_proxy now returns the MasterObject directly, not the MasterProxy.
544 - You can call finish on the MasterObject (so the MasterProxy isn't needed).
545 - Slave methods no longer take a 'request' argument. Instead, the return
546 value of the function is returned.
547 - Methods can only return one value. dequeue and dequeue_last have been
548 replaced with a 'result' property.
549 - Methods on MasterObject now return a RequestBlocker, not a Queue. This
550 means you just yield the object itself, not object.blocker.
552 Tasks API is no longer experimental, but proxy API is.
556 Added a Help button to the exception dialog, which opens the new Help/Errors
557 file (Thomas Leonard).
561 Bugfix: Failed to call the parent constructor to AbortSave correctly.
565 Simplified su code and interface.
566 New suchild methods: open, close, read, write, chmod and rename, which work
567 just like their normal Python counterparts (Thomas Leonard).
571 Removed code to turn off the separator in the debug dialog. GTK 2.4 doesn't
572 need it, and generates a warning if you use it (Thomas Leonard).
574 27-Aug-2004 (Release 1.9.15)
576 Added spawnvpe and waitpid methods to suchild.
580 If the unit field for a <numentry> option is blank, don't try to translate it
581 (reported by Guido Schimmels).
585 Added 'su' module for performing operations as root.
589 Allow "" as a valid value in a OptionsBox menu (reported by Guido Schimmels).
593 Added 'proxy' module. This allows one Python process to invoke methods on
594 another asynchronously.
595 Added rox.UserAbort exception, to be raised when users cancel something
600 Fix syntax error I caused when I added a docstring (Stephen Watson).
604 Get update-mime-database command through Zero Install, if possible.
608 mime_handler can now uninstall (Stephen Watson).
612 Translate menu items in options (Guido Schimmels).
616 Added <slider> widget to options.
620 Added 'size-group' attribute to Options.xml elements. This allows grouping
621 elements so that their labels all appear the same width.
625 Bugfix: Colour buttons in the Options boxes didn't work with some themes
628 17-Apr-2004 (Release 1.9.14)
630 Added ToggleItem (based on a patch from Ken Hayber).
634 Better <label> widgets (wrapping and icon). Taken from LookAndFeel.
638 Stop themes from overriding the display of the colour-picker buttons in
639 the options box (Rene Ejury).
643 Warn about old versions of findrox.py.
644 Bugfix: Bug in new menu API prevented submenus from working.
646 16-Mar-2004 (Release 1.9.13)
648 Bugfix: Icon themes didn't work with python versions older than 2.2.2
649 (reported by Thomas Zajic).
653 Bugfix: Use filer module to show ROX-Lib help, rather than using os.system,
654 so that it works with Zero Install (reported by Keith Hopper).
658 Added widget_registry to OptionsBox, to provide an easy way to register
659 new option types. Removed build_button in favour of this method.
661 Bugfix: If an error occurred loading the ROX theme at startup it could not
662 be reported, because icon_theme wants debug, debug wants saving, and
663 saving wants icon_theme (reported by Thomas Zajic).
667 Cope with pygtk2.2 API change (Stephen Watson, reported by Guido Schimmels).
671 Added secretentry and button options to the OptionsBox (Stephen Watson).
675 Cope with option values split into multiple DOM text nodes (Rene Ejury).
679 Allow a list of values to be stored in each menu Action. These are used as
680 the arguments to the callback function.
681 If a file's details were recorded (in document.save_last_stat) when it was
682 loaded, make sure they haven't changed when saving. Saving also updates this
683 variable (requested by Arnaud Calvo).
687 Updated examples in documentation for new findrox (Yuri Bongiorno).
691 New API for menus. Instead of passing tuples for menu items, python classes
692 can be used. The old tuple interface is still supported.
696 Don't stop DnD working in the savebox just because no icon can be found
697 (reported by Martin Lucina).
701 Added French translation (Vincent Lefèvre).
705 Also translate <label> elements in the Options box (reported by Arnaud Calvo).
709 Also translate section names in the Options box (reported by Arnaud Calvo).
711 22-Jan-2004 (Release 1.9.12)
713 Added 'tasks' module to provide a light-weight alternative to threads.
714 Bugfix: On non-zero-install systems, the sense of the version check in findrox
719 Added method to MIMEtype to fetch its icon. Install list window for
720 the MIME handler installation uses it (Stephen Watson).
724 Translate text in Options box.
728 Allow ROXLIB_DISABLE_ZEROINSTALL to override looking for ROX-Lib in Zero
729 Install (useful for ROX-Lib developers). Prefer a locally installed version
730 of ROX-Filer to the Zero Install version; this also allows users to select
731 which Zero Install version they want (eg, stable or developer).
732 Moved MIME handler installation into a separate module (mime_handler) and
733 made a few changes to the XML syntax.
737 Added <menu> OptionMenu widget for Options box (Chris Shaffer).
741 Fixed bug in findrox when not using Zero Install (Lionel Bringuier).
745 Escape and unescape URIs, as required by ROX-Filer 2.1.0 (reported by
747 Note that the xds_load_uris() method is now called with escaped URIs.
748 Try to run the filer through Zero Install, if possible.
752 If we can't get pygtk through Zero Install, try the local copy.
756 Added support in mime.py for an application to set MIME-type run
757 actions and thumbnail programs (Stephen Watson).
761 Simplified implementation of saving.SaveFilter by using the new
762 processes.PipeThroughCommand class. The child_run() method of SaveFilter
763 is no longer supported.
764 In processes.PipeThroughCommand, a None input stream gets /dev/null instead
765 of inheriting its parent's stream. The class has a new run_child_with_streams
766 to make overriding the behaviour easier.
767 findrox.py script now warns if ROX-Lib2 version is too old (unless requesting
768 a version too old to have a version number).
772 Changed 'Dismiss' to 'Close' (Chris Shaffer).
773 Bugfix: Error reporting in mime.py failed to import the _ function (reported
774 by Christopher Haines).
775 New AppInfo.py for parsing AppInfo.xml files (Christopher Arndt), InfoWin
776 converted to use it (Stephen Watson).
778 15-Oct-2003 (Release 1.9.11)
780 Bugfix: Python 2.3's new bool type broke options saving (reported by Lars
785 Added PipeThroughCommand class (copied from Archive, with some minor
790 Allow event to be None for Menu.popup. This allows the menu to be activated
791 from the keyboard, using the 'popup-menu' signal.
795 Added French translation in AppInfo.xml (Vincent Lefèvre).
797 03-Oct-2003 (Release 1.9.10)
799 Added support for icon themes (doesn't do inheritance yet).
803 Added some version information to the dialog you get when you run ROX-Lib
808 New bug() function to quickly bring up a debugging prompt.
812 The glob patterns in mime.py are now sorted longest first. Fix for setting
813 icon in the old way when there was no icon (Stephen Watson).
817 Try to cope better with bad hostname setup (reported by Nathan Howell).
821 Added InfoWin.py to provide standardized information window (Stephen Watson).
825 Fall back to old way of setting default icon for older pygtk's (Stephen
830 Added Italian translation (Yuri Bongiorno).
834 Better way to set the default icon.
836 16-Aug-2003 (Release 1.9.9)
838 Give windows a default icon from .DirIcon (Chris Shaffer).
842 Try to get pygtk through ZeroInstall.
846 Updated findrox to use ZeroInstall, if possible.
850 Work out correct application name even if invoked via a symlink. This stops
851 applications from calling themselves 'text_plain', etc (reported by Joe Hill).
853 19-Jul-2003 (Release 1.9.8)
855 Make default menu positioning function keep the pointer inside the menu.
856 Allow stock icons in menus.
860 Added position_fn argument to rox.Menu.popup.
864 Cope with % escaped URIs.
868 Added italian translation in AppInfo.xml (Yuri Bongiorno)
872 When loading data from another application, pass the suggested leafname to
873 xds_load_from_stream().
877 Code tidying, thanks to pychecker.
881 Added fileutils module, which provides an interactive makedirs() function
883 Changed savebox module to use it.
885 16-May-2003 (Release 1.9.7)
887 New icon (Geoff Youngs).
888 Added 'basedir' module for freedesktop.org Base Directory specification.
892 Added functions to read MIME database (Stephen Watson).
894 27-Jan-2003 (Release 1.9.6)
896 Make the default window class the name of the application directory, not
897 'AppRun' (suggested by Albert Wagner).
898 Bugfix: With pygtk-1.99.14, only the first error message from a process
899 would be detected; this meant that ROX-Lib wouldn't detect when the
900 process quit (reported by joehill).
901 Bugfix: <hbox> and <vbox> layouts didn't work in the options box (Allen
906 If python is too old, raise SystemExit instead of quitting.
907 Ensure that True and False are defined.
911 Work around bug in some versions of pygtk that stopped the options window
914 12-Dec-2002 (Release 1.9.5)
916 Upgrade Options box to new style.
920 Bugfix: If an option had an empty value, an exception was thrown on loading
921 (reported by Stephen Watson).
925 Cope with missing input_add_full.
929 Pygtk 1.99.12 seems to more-or-less work now (according to Alastair Porter), so
930 remove the warning for that so we can support RedHat 8.0.
932 20-Oct-2002 (Release 1.9.4)
934 More warnings about old pygtk versions.
935 Added Dialog class (does ref-counting, like Window).
939 Trying to use ROX-Lib2 with earlier versions of python now gives a sensible
944 Make clicking on ROX-Lib itself work again (Christopher Arndt).
948 Updated findrox.py to use pygtk 1.99.13 -- update your programs!
950 25-Aug-2002 (Release 1.9.3)
952 Switch to use new pygtk versioning system (requires pygtk 1.99.13).
956 Added 'processes' module, based on code in Archive, which makes controlling
961 Bugfix: Changing the keys lost any builtin shortcuts (Gtk behaviour has
966 Trap exceptions when activating menu items and report nicely.
970 Bugfix: Remember to call drop_finish() after a drag-and-drop operation.
972 05-Aug-2002 (Release 1.9.2)
974 Renamed XDSLoader module to 'loading' (like 'saving').
975 Added 'mime' module for installing extra MIME information.
976 Bugfix: XDSLoader didn't handle the drag-drop signal, and so only worked for
977 widgets with their own implementation!
981 Show local variables in report_exception, and allow expressions to be
982 evaluated in the context of any frame.
983 Added StringSaver class.
987 Added applet module for creating ROX panel applets.
991 Bugfix: saving code didn't cope with missing images (reported by Musus Umbra).
995 If 'gtk2' isn't available, see if 'gtk' is actually the 2.0 version.
996 Added save_set_permissions to Saveable interface, allowing the default
997 save_to_file to preserve file permissions.
998 Changes to XDSLoader: xds_load_from_stream(name, type, stream)
999 replaces the old xds_load_data(data).
1000 Loading files from remote filers works now.
1001 Added much improved exception reporting system.
1003 19-Jul-2002 (Release 1.9.1)
1005 Added support for translations.
1009 License change to the LGPL (allows commercial programs to use this library).
1010 Added AbortSave exception.
1014 Saveable.save_to_file() should raise an exception when saving fails, rather
1015 than returning 0. The return value is now ignored (note that raising an
1016 exception will still work with 1.9.0).
1017 toplevel_unref() ignores any arguments, so it is easier to use as a signal
1020 12-Jul-2002 (Release 1.9.0)
1022 First release for Gtk+-2.0.