[gedit-list] Re cent Documents plugin



Hello,
I am trying to develop an plugin that shows a recent documents plugin.
The idea is: you press <ctrl><shift>o and the dialog pops up, you choose the
file via arrow-keys and press enter. Thats a feature I found in 
http://scribes.sf.net scribes  and I liked very much.
Now to my problem: I use the gtk.RecentChooserDialog class and this gives me
a lot of files, but the order is different to the order in the files menu.
Here is the code snippet. Am I doing something wrong? I'm not so sure about
line 2 (dialog = ....).

def on_example_menu_item_activate(self):
    dialog = gtk.RecentChooserDialog("Recent Documents", self._window,
None,(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN,
gtk.RESPONSE_ACCEPT))
    if dialog.run() == gtk.RESPONSE_ACCEPT:
      info = dialog.get_current_item ()      
      print info.get_uri()
      self._open_file(info.get_uri())
      #gedit.document.load(info.get_uri(), None, 1, False)
    dialog.destroy()
    return


If somebody has a suggestion I would be very pleased.

Regard,

macco
-- 
View this message in context: http://www.nabble.com/Recent-Documents-plugin-tp15641416p15641416.html
Sent from the Gnome - Gedit mailing list archive at Nabble.com.



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