Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /newedit/src/mixins/

newedit
Discussion topic

Back to topic list

CVS update: /newedit/src/mixins/

Reply

Author limodou
Full name limodou
Date 2004-05-13 22:46:30 PDT
Message User: limodou
Date: 04/05/13 22:46:30

Modified:
 /newedit/src/mixins/
  RecentFile.py

Log:
 Issue number:
 Obtained from:
 Submitted by:
 Reviewed by:
 Fix Recentfile bug

File Changes:

Directory: /newedit/src/mixins/
===============================

File [changed]: RecentFile.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/R​ecentFile.py?r1=1.3​&r2=1.4
Delta lines: +6 -9
-------------------
--- RecentFile.py 14 May 2004 05:10:09 -0000 1.3
+++ RecentFile.py 14 May 2004 05:46:28 -0000 1.4
@@ -16,6 +16,7 @@
 Mixin.setMixin('mainframe', 'menulist', menulist)
 
 def main_init(win):
+ win.recentmenu_ids = [win.IDM_FILE_RECENT​FILES_ITEMS]
     create_recent_menu(win)
 Mixin.setPlugin('mainframe', 'init', main_init)
 
@@ -29,12 +30,10 @@
     pref.recent_files_num = 10
 Mixin.setPlugin('preference', 'init', pref_init)
 
-def afteropen(win, filename, id):
+def afteropen(win, filename):
     if win.pref.recent_file​s.count(filename) > 0:
         win.pref.recent_file​s.remove(filename)
- win.recentfile_ids.remove(id)
     win.pref.recent_files.insert(0, filename)
- win.recentfile_ids.insert(0, id)
     while len(win.pref.recent_​files)>win.pref.r​ecent_files_num:
         win.pref.recent_files.pop(-1)
         win.recentfile_ids.pop(-1)
@@ -46,11 +45,9 @@
 
 def create_recent_menu(win):
     menu = makemenu.findmenu(wi​n.menuitems, 'IDM_FILE_RECENTFILES')
- items = menu.GetMenuItems()
- x = len(items) - 1
- while x > -1:
- menu.Delete(win.IDM_​FILE_RECENTFILES_ITE​MS + x)
- x -= 1
+
+ for id in win.recentmenu_ids:
+ menu.Delete(id)
 
     if len(win.pref.recent_files) == 0:
         id = win.IDM_FILE_RECENTFILES_ITEMS
@@ -69,5 +66,5 @@
     index = win.recentmenu_ids.index(eid)
     filename = win.pref.recent_files[index]
     win.editctrl.new(filename)
- afteropen(win, filename, eid)
+ afteropen(win, filename)
 Mixin.setMixin('mainframe', 'OnOpenRecentFiles', OnOpenRecentFiles)




--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@newe​dit.tigris.org
For additional commands, e-mail: cvs-help at newedit dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /newedit/src/mixins/ limodou limodou 2004-05-13 22:46:30 PDT
Messages per page: