예제 #1
0
 def newClicked(self):
    form = AddForm()
    
    self.holdOpen = True
    form.exec_()
    self.checkMouse()
    self.holdOpen = False
    
    if form.accepted:
       item = MenuItem()
       item.name = form.name
       item.command = form.command
       item.working = form.working
       item.folder = form.folder
       item.icon = form.icon
       item.findIcon()
       
       clicked = self.getClicked()
       if clicked:
          parent = clicked.item.parent
       elif self.leftList.mouseOver:
          if self.currentItem != None:
             parent = self.currentItem.parent
          else:
             parent = None
       else:
          parent = self.currentItem
       item.parent = parent
       
       self.menuItems.append(item)
       self.refresh()
예제 #2
0
 def buildMenu(self):
    for i in self.menus:
       currMenu = MenuItem()
       currMenu.name = i.name
       currMenu.folder = True
       if i.parent != None:
          currMenu.parent = i.parent.menuItem
       i.menuItem = currMenu
       self.menuItems.append(currMenu)
       for key, value in self.desktopEntries.items():
          if i.include(key, value.categories, 'Or', i.logic['Or']) and not value.noDisplay:
             newItem = MenuItem()
             newItem.parent = currMenu
             newItem.name = value.name
             newItem.command = value.command
             newItem.working = value.working
             newItem.icon = value.icon
             newItem.imported = True
             self.menuItems.append(newItem)