def convertToDoToTask(self, todo: ToDo ): task = Task() task.title = todo.title task.description = todo.description task.completed = todo.completed task.priority = todo.priority taskDialog = TaskDialog( task, self.parentWidget ) taskDialog.setModal( True ) dialogCode = taskDialog.exec_() if dialogCode == QDialog.Rejected: return self.undoStack.push( ConvertToDoToTaskCommand( self, todo, taskDialog.task ) )
if __name__ != '__main__': sys.exit(0) app = QApplication(sys.argv) app.setApplicationName("Hanlendar") app.setOrganizationName("arnet") ### app.setOrganizationDomain("www.my-org.com") taskDate = datetime.today().replace( hour=8 ) task1 = Task() task1.title = "Completed Task" task1.description = "Description" task1.completed = 100 task1.priority = 5 task1.startDateTime = taskDate task1.dueDateTime = task1.startDateTime + timedelta( hours=4 ) task2 = Task() task2.title = "Task 1" task2.description = "Description" task2.completed = 0 task2.priority = 3 task2.setDefaultDateTime( taskDate + timedelta( hours=6 ) ) task3 = Task() task3.title = "Full Day Task" task3.description = "Description"
### app.setOrganizationDomain("www.my-org.com") parentTask = Task() parentTask.recurrence = Recurrent() parentTask.recurrence.setWeekly(1) task = Task() task.setParent(parentTask) task.title = "Task 1" # pylint: disable=C0301 task.description = ( '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">' '<html><head><meta name="qrichtext" content="1" /><style type="text/css">' 'p, li { white-space: pre-wrap; }' '</style></head><body style=" font-family:\'Noto Sans\'; font-size:9pt; font-weight:400; font-style:normal;">' '<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">A description</p>' '<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>' '<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="www.google.pl"><span style=" text-decoration: underline; color:#0000ff;">www.google.pl</span></a> </p>' '<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>' '<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="file:///var/log/kern.log"><span style=" text-decoration: underline; color:#0000ff;">file:///var/log/kern.log</span></a> </p>' '<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>' ) task.completed = 50 task.priority = 5 task.setDefaultDateTime(datetime.today().replace(hour=12, minute=0, second=0)) setup_interrupt_handling() dialog = TaskDialog(task) dialog.resize(400, 450)
from hanlendar.gui.sigint import setup_interrupt_handling from hanlendar.gui.widget.taskdetails import TaskDetails from hanlendar.domainmodel.task import Task ## ============================= main section =================================== if __name__ != '__main__': sys.exit(0) app = QApplication(sys.argv) app.setApplicationName("Hanlendar") app.setOrganizationName("arnet") ### app.setOrganizationDomain("www.my-org.com") task = Task() task.title = "Task title" task.description = "Description" task.completed = 50 task.priority = 5 task.setDefaultDateTime(datetime.today()) setup_interrupt_handling() widget = TaskDetails() widget.setTask(task) widget.show() exitCode = app.exec_() sys.exit(exitCode)