Re: [gedit-list] "import" functionality in Python plugin



On Mon, 2007-04-30 at 23:22 +0100, Bob Allerum wrote:

> Sorry. I have created a menu item in the file menu
> called "Import Markdown file". When the user selects
> this I would like the normal file open dialog to
> appear, and when the user has chosen a file to load
> and clicked "Open", I would like to load the file,
> process it, and show the processed file in a new tab.

Then you'll have to reimplement your own open dialog using
gtk.FileChooserDialog, load the file using gedit.commands.* and when
it's done, do what you want on it. I think there is no way to actually
reuse the dialog we use in gedit.

But is it really needed to add your own open dialog beside the one we
provide ? couldn't you just add a handler on "tab-added" and do what's
needed if the file happens to be a markdown file ? IT would indeed look
cleaner IMHO.




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