Changeset 22

Show
Ignore:
Timestamp:
08/27/07 00:01:18 (9 months ago)
Author:
kestas
Message:

The last used dictionary now is used as default dictionary and the menu entry "Dictionaries" shows the active dictionary

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/gui/mainwin.py

    r16 r22  
    282282 
    283283         try: 
    284             item = wx.MenuItem(self.menuDict, 
    285                               itemID, 
    286                               encoded) 
    287             self.menuDict.AppendItem(item) 
     284#            item = wx.MenuItem(self.menuDict, 
     285#                              itemID, 
     286#                              encoded) 
     287#            self.menuDict.AppendItem(item) 
     288            self.menuDict.AppendRadioItem(itemID, encoded, "") 
    288289            wx.EVT_MENU(self, itemID, self.onDefault) 
     290            if self.app.config.get('defaultDict') == name: 
     291               self.menuDict.FindItemById(itemID).Check(1) 
     292                 
    289293         except Exception, e: 
    290294            systemLog(ERROR, "Unable to create menu item for '%s' (%s)" \ 
     
    10141018         dictionary = self.app.dictionaries.get(self.app.config.ids.get(eventID)) 
    10151019         self.loadDictionary(dictionary) 
     1020         label = self.menuDict.FindItemById(eventID).GetLabel() 
     1021         self.app.config.set('defaultDict', label) 
    10161022 
    10171023      elif 2100 <= eventID < 2500: