[referencer] Fwd: Referencer Plugin: Configuration Dialog
Matej Urbas
matej.urbas at gmail.com
Tue Jun 22 19:05:11 EDT 2010
Hi!
I have resolved the issue.
The 'gtk.Builder' class tried to find the UI definition file via a
relative path. Constructing an absolute path fixed this.
The code is available here:
https://urbas.si/pub/Public/Programming/ReferencerNotes/
Cheers!
On Tue, 2010-06-22 at 14:54 +0100, John Spray wrote:
>
>
> ---------- Forwarded message ----------
> From: Matej Urbas <matej.urbas at gmail.com>
> Date: Tue, Jun 22, 2010 at 1:06 AM
> Subject: Referencer Plugin: Configuration Dialog
> To: jcspray at icculus.org
>
>
> Hi!
>
> Could I please ask you for advice on how to display a configuration
> dialog for a python plugin in Referencer?
>
> This is my current code (excerpt from file 'ReferencerNotes.py'),
> which
> works as a standalone application but not if invoked from Referencer:
>
>
>
> def referencer_config():
> dlg = ConfigDialog()
> dlg.mainWindow.run()
>
> class ConfigDialog:
> def __init__(self):
> # Initialise the UI builder
> self.builder = gtk.Builder()
> self.builder.add_from_file(CONFIG_DIALOG_GLADE_FILE)
> self.builder.connect_signals(self)
>
> # Fetch all relevant widgets in the dialog
> self.mainWindow=self.builder.get_object("dlgConfig")
> self.fileChooser=self.builder.get_object("fcbNotesPath")
>
> # Initialise the currently configured directory...
> self.fileChooser.set_filename(NOTES_DIRECTORY)
>
> def config_ok_click(self, widget, data=None):
> set_notes_directory(self.fileChooser.get_filename())
>
>
> Thank you very much for your help!
>
>
> Cheers,
> ---
> Matej
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://icculus.org/pipermail/referencer/attachments/20100623/d0c8d193/attachment.pgp>
More information about the referencer
mailing list