Exemplo n.º 1
0
def newEvent(parent):
    text, ok = QtGui.QInputDialog.getText(parent, 'New Task',
            'Enter the new Task:')

    if ok:
        # Create new TaskModel and add it to the window.
        newTask = ServerCommunicator.createNewTask(text)
        parent.addTask(newTask)
Exemplo n.º 2
0
    def paint(self):
        """
            Defines how the main window looks like.
        """
        # Load tasks and create and add widgets.
        self.grid = QtGui.QGridLayout()
        self.taskVBox = QtGui.QVBoxLayout()

        tasks = ServerCommunicator.loadTasks()
        for task in tasks:
            self.addTask(task)

        # Buttons to edit your tasks.
        self.new = QtGui.QPushButton("New")
        self.new.clicked.connect(todoEvents.newEvent.__get__(self))

        self.grid.addLayout(self.taskVBox, 0, 1)
        self.grid.addWidget(self.new, 1, 1)

        self.setLayout(self.grid)
        self.move(300, 300)
        self.show()
Exemplo n.º 3
0
 def onDeleteClicked(self):
     ServerCommunicator.deleteTask(self.taskModel)
     self.taskDeleteClicked.emit()