[gedit-list] Fwd: Scroll Convert Special Characters Plugin for Gedit



Hello,
 I built/ updated a plugin for Gedit. It is called 'Scroll Convert':

https://github.com/nogre/gedit-scroll-convert

The basic functionality is to convert special characters between different fomattings using a single shortcut key, i.e. scroll through the different encodings. The languages include ascii, hex, decimal, html name and latex, and it should be easy to add additional languages if desired. This work is based on Convert Special Characters by Marco Crippa for Gedit version 3.8.

Before submission to the wiki, I had a few (noob) questions:

First, it would be nice to have a selectable shortcut key in the plugin preferences. I was able to set the shortcut key on start-up without difficulty, but if I try to change it later, I get an error. Specifically, when I run
    `self.app.set_accels_for_action("win."+actions[0], actions[1])`
in the
    `do_activate(self)`
function, everything works. But if I try to set_accels_for_action() later, I get
    `AttributeError: 'NoneType' object has no attribute 'set_accels_for_action'`.
I looked through as many working plugins as I could find and tried to search for a solution, but searching the keywords, eg  "gedit plugin settings", are too generic to return useful results.  To replicate this error, uncomment line 528, install, activate and attempt to change the shortcut key in the Scroll Convert plugin preferences. Any pointer to working code or instructions on how to do this would be appreciated.

Second, if there is a straightforward way to save plugin settings, I was again unable to find it. Any help would be appreciated.

Thanks,
 Noah Greenstein



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]