Example #1
0
    def __init__(self, id, parent=None):
        super(MsBoxForm, self).__init__(parent)

        self.setupUi(self)
        self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
        self.setStyleSheet(cfg.STYLES_DICT['forms_css'])

        self._id = id
        self._task = task_pool.load_task(self._id)

        self.pushButton_ok.clicked.connect(self.done)
        self.pushButton_cancel.clicked.connect(self.delay)
        self.toolButton_close.clicked.connect(self.close)

        self.label_title.setText("Reminder")
        self.label_message.setText(self._task['message'])
Example #2
0
    def __init__(self, id=None, parent=None):
        super(AddTaskForm, self).__init__(parent)
        self.setupUi(self)
        self.setWindowFlags(Qt.FramelessWindowHint)
        self.setStyleSheet(cfg.STYLES_DICT['forms_css'])
        self._id = id
        self.idea = None
        self.add_idea_form = None

        for opt in cfg.PRIORITY_LIST:
            self.comboBox_priority.addItem(opt, opt)

        for opt, value in cfg.ACTION_DICT.items():
            self.comboBox_event.addItem(opt, value)

        if not self._id:
            self.pushButton_ok.clicked.connect(self.create)
            self.pushButton_done.setDisabled(True)
            self.pushButton_delete.setDisabled(True)
            self.pushButton_show_idea.hide()

        else:
            self.task = task_pool.load_task(self._id)
            self.pushButton_ok.clicked.connect(self.update)

            if self.task.get('done'):
                self.pushButton_done.setText("Restore")
                self.pushButton_done.clicked.connect(self.set_not_done_task)
            else:
                self.pushButton_done.clicked.connect(self.set_done_task)

            self.pushButton_delete.clicked.connect(self.delete)

            self.idea = idea_pool.load_idea_by_task_id(self._id)

            if self.idea:
                self.pushButton_show_idea.clicked.connect(
                    self.open_edit_idea_form)
            else:
                self.pushButton_show_idea.setDisabled(True)

            self.fill_form()

        self.pushButton_cancel.clicked.connect(self.hide)
        self.toolButton_close.clicked.connect(self.hide)
        self.offset = None
Example #3
0
    def __init__(self, id=None, parent=None):
        super(AddTaskForm, self).__init__(parent)
        self.setupUi(self)
        self.setWindowFlags(Qt.FramelessWindowHint)
        self.setStyleSheet(cfg.STYLES_DICT['forms_css'])
        self._id = id
        self.idea = None
        self.add_idea_form = None

        for opt in cfg.PRIORITY_LIST:
            self.comboBox_priority.addItem(opt, opt)

        for opt, value in cfg.ACTION_DICT.items():
            self.comboBox_event.addItem(opt, value)

        if not self._id:
            self.pushButton_ok.clicked.connect(self.create)
            self.pushButton_done.setDisabled(True)
            self.pushButton_delete.setDisabled(True)
            self.pushButton_show_idea.hide()

        else:
            self.task = task_pool.load_task(self._id)
            self.pushButton_ok.clicked.connect(self.update)

            if self.task.get('done'):
                self.pushButton_done.setText("Restore")
                self.pushButton_done.clicked.connect(self.set_not_done_task)
            else:
                self.pushButton_done.clicked.connect(self.set_done_task)

            self.pushButton_delete.clicked.connect(self.delete)

            self.idea = idea_pool.load_idea_by_task_id(self._id)

            if self.idea:
                self.pushButton_show_idea.clicked.connect(self.open_edit_idea_form)
            else:
                self.pushButton_show_idea.setDisabled(True)

            self.fill_form()

        self.pushButton_cancel.clicked.connect(self.hide)
        self.toolButton_close.clicked.connect(self.hide)
        self.offset = None
Example #4
0
    def __init__(self, id=None, parent=None):
        super(AlertBoxForm, self).__init__(parent)
        self.setupUi(self)
        self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
        self.setStyleSheet(cfg.STYLES_DICT['alert_css'])
        self._id = id
        self._task = task_pool.load_task(self._id)
        self.alert_qml = QUrl("alert.qml")

        self.context = {'Task': TaskWrapper(self._task)}
        self.qml_alert_view = QQuickView()
        self.qml_alert_view.setSource(self.alert_qml)
        self.ctx = self.qml_alert_view.rootContext()
        self.ctx.setContextProperty('context', self.context)

        self.container = QOpenGLWidget.createWindowContainer(self.qml_alert_view, self)
        self.container.setFocusPolicy(Qt.TabFocus)
        self.root = self.qml_alert_view.rootObject()
        self.root.doneClicked.connect(self.done)
        self.root.cancelClicked.connect(self.delay)
        self.verticalLayout.addWidget(self.container)
        self.offset = None
Example #5
0
    def __init__(self, id=None, parent=None):
        super(AlertBoxForm, self).__init__(parent)
        self.setupUi(self)
        self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
        self.setStyleSheet(cfg.STYLES_DICT['alert_css'])
        self._id = id
        self._task = task_pool.load_task(self._id)
        self.alert_qml = QUrl("alert.qml")

        self.context = {'Task': TaskWrapper(self._task)}
        self.qml_alert_view = QQuickView()
        self.qml_alert_view.setSource(self.alert_qml)
        self.ctx = self.qml_alert_view.rootContext()
        self.ctx.setContextProperty('context', self.context)

        self.container = QOpenGLWidget.createWindowContainer(
            self.qml_alert_view, self)
        self.container.setFocusPolicy(Qt.TabFocus)
        self.root = self.qml_alert_view.rootObject()
        self.root.doneClicked.connect(self.done)
        self.root.cancelClicked.connect(self.delay)
        self.verticalLayout.addWidget(self.container)
        self.offset = None