Exemplo n.º 1
0
 def onChooseEvent(self):
     cmd, params = self.parse_cmd()
     if cmd:
         event = ObservableEvent(ObservableEvent.execute, command=cmd, params=params)
         self.notifyObservers(event)
         self.hide()
         Observable.notifyObservers(self, event)
Exemplo n.º 2
0
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        Observable.__init__(self)
        
        self.preferences = Preferences(self)
        notesFolder = self.preferences.notesFolder
                
        self.editorPanel = EditorNotes(notesFolder, self)
        self.treePanel = DOMTreeWidget(self.preferences.xmlPath, self.editorPanel)
        
        self.registerObserver(self.treePanel)     
        self.registerObserver(self.editorPanel)

        self.catsDialog = CatsDialog(self.editorPanel.getActions(), self)
        self.catsDialog.registerObserver(self.editorPanel)
        self.catsDialog.registerObserver(self.treePanel)
        addShortcutAction(self, getShortcut('CTRL', 'SPACE'), self.showDialog)
        
        self.makeInterface()
        self.start()
Exemplo n.º 3
0
    def __init__(self, actions, parent=None):
        
        width, height, color = 700, 400, "#aaa"
        DialogBox.__init__(self, width, height, color, parent)
        Observable.__init__(self)
        self.registerObserver(self)
                
        self.actions = actions
        self.catsActions = {
            "google": self.google, 
            "wikipedia": self.wikipedia,
            "all": self.showAllCommands
        }
        c = '|'.join(self.getAllActions())
        self.re_pre_cmd = re.compile(r'^(%s)\s*(.*)'%c)
        self.re_post_cmd = re.compile(r'^([^\s]*)\s+(%s)'%c)

        self.createUI(width)
        self.complectionList.registerObserver(self)
        self.complectionList.registerObserver(self.cmd)
        self.cmd.registerObserver(self)
        self.cmd.registerObserver(self.complectionList)
Exemplo n.º 4
0
 def __init__(self, parent=None): 
     QtGui.QListWidget.__init__(self, parent)
     Observable.__init__(self)
     self.isFocusIn = False
Exemplo n.º 5
0
 def __init__(self, parent=None):
     QtGui.QLineEdit.__init__(self, parent)
     Observable.__init__(self)