Пример #1
0
 def _initUI(self):
     layout = QtGui.QGridLayout(self)
     layout.setSpacing(10)
     
     self.filter_tasks = FilterTasksView(getIcon("zoom.png"), getIcon("cross.png"), self)
     self.tasks_list_view = TasksListView(self)
     
     layout.addWidget(self.filter_tasks, 1, 0)
     layout.addWidget(self.tasks_list_view, 2, 0)
     self.setLayout(layout)
Пример #2
0
 def _initFilterTypeMappings(self):
     self._filterItemByFilterType[ContextFilter] = self._contextsItem
     self._filterItemByFilterType[ProjectFilter] = self._projectsItem
     self._filterIconByFilterType[ContextFilter] = getIcon('at.png')
     self._filterIconByFilterType[ProjectFilter] = getIcon('plus.png')
     self._treeItemByFilterType[IncompleteTasksFilter] = self._incompleteTasksItem
     self._treeItemByFilterType[UncategorizedTasksFilter] = self._uncategorizedTasksItem
     self._treeItemByFilterType[CompleteTasksFilter] = self._completeTasksItem
     self._treeItemByFilterType[HasProjectsFilter] = self._projectsItem
     self._treeItemByFilterType[HasContextsFilter] = self._contextsItem
Пример #3
0
    def _initUI(self):
        layout = QtGui.QGridLayout(self)
        layout.setSpacing(10)

        self.filter_tasks = FilterTasksView(getIcon("zoom.png"),
                                            getIcon("cross.png"), self)
        self.tasks_list_view = TasksListView(self)

        layout.addWidget(self.filter_tasks, 1, 0)
        layout.addWidget(self.tasks_list_view, 2, 0)
        self.setLayout(layout)
Пример #4
0
    def _initUI(self):
        layout = QtGui.QGridLayout(self)
        layout.setSpacing(10)

        self.tasks_filter = TasksFilterView(getIcon("zoom.png"), getIcon("cross.png"), self)
        self.tasks_list_view = TasksListView(self)
        self.setContentsMargins(2 * UI_MARGINS_OFFSET, UI_MARGINS_OFFSET,
                                UI_MARGINS_OFFSET, UI_MARGINS_OFFSET)
        layout.addWidget(self.tasks_filter, 1, 0)
        layout.addWidget(self.tasks_list_view, 2, 0)
        self.setLayout(layout)
Пример #5
0
    def _initUI(self):
        layout = QtWidgets.QVBoxLayout(self)
        layout.setSpacing(10)

        self.tasks_search_view = TasksSearchView(getIcon("ActionSearch.png"), getIcon("ActionClear.png"), self)
        self.tasks_list_view = TasksListView(self)
        offset = QtCore.QSettings().value("ui_margin_offset", -4)
        self.setContentsMargins(2 * offset, offset, offset, offset)
        layout.addWidget(self.tasks_search_view)
        layout.addWidget(self.tasks_list_view)
        self.setLayout(layout)
Пример #6
0
    def _initUI(self):
        layout = QtGui.QGridLayout(self)
        layout.setSpacing(10)

        self.filter_tasks = FilterTasksView(getIcon("zoom.png"),
                                            getIcon("cross.png"), self)
        self.tasks_list_view = TasksListView(self)
        self.setContentsMargins(2 * UI_MARGINS_OFFSET, UI_MARGINS_OFFSET,
                                UI_MARGINS_OFFSET, UI_MARGINS_OFFSET)
        layout.addWidget(self.filter_tasks, 1, 0)
        layout.addWidget(self.tasks_list_view, 2, 0)
        self.setLayout(layout)
Пример #7
0
    def _initUI(self):
        layout = QtGui.QVBoxLayout(self)
        layout.setSpacing(10)

        self.tasks_filter = TasksFilterView(getIcon("ActionSearch.png"),
                                            getIcon("ActionClear.png"), self)
        self.tasks_list_view = TasksListView(self)
        offset = QtCore.QSettings().value("ui_margin_offset", -4)
        self.setContentsMargins(2 * offset, offset, offset, offset)
        layout.addWidget(self.tasks_filter)
        layout.addWidget(self.tasks_list_view)
        self.setLayout(layout)
Пример #8
0
 def _initFilterTypeMappings(self):
     self._filterItemByFilterType[ContextFilter] = self._contextsItem
     self._filterItemByFilterType[ProjectFilter] = self._projectsItem
     self._filterIconByFilterType[ContextFilter] = getIcon('at.png')
     self._filterIconByFilterType[ProjectFilter] = getIcon('plus.png')
     self._treeItemByFilterType[
         IncompleteTasksFilter] = self._incompleteTasksItem
     self._treeItemByFilterType[
         UncategorizedTasksFilter] = self._uncategorizedTasksItem
     self._treeItemByFilterType[
         CompleteTasksFilter] = self._completeTasksItem
     self._treeItemByFilterType[HasProjectsFilter] = self._projectsItem
     self._treeItemByFilterType[HasContextsFilter] = self._contextsItem
Пример #9
0
 def _addDefaultTreeItems(self, tree):
     self._incompleteTasksItem = \
         FilterTreeWidgetItem(None, ['Pending'], IncompleteTasksFilter(), getIcon('time.png'))
     self._uncategorizedTasksItem = \
         FilterTreeWidgetItem(None, ['Uncategorized'], UncategorizedTasksFilter(), getIcon('help.png'))
     self._contextsItem = \
         FilterTreeWidgetItem(None, ['Contexts'], HasContextsFilter(), getIcon('at.png'))
     self._projectsItem = \
         FilterTreeWidgetItem(None, ['Projects'], HasProjectsFilter(), getIcon('plus.png'))
     self._completeTasksItem = \
         FilterTreeWidgetItem(None, ['Complete'], CompleteTasksFilter(), getIcon('x.png'))
     tree.addTopLevelItems([
         self._incompleteTasksItem, self._uncategorizedTasksItem,
         self._contextsItem, self._projectsItem, self._completeTasksItem
     ])
Пример #10
0
    def _initIcon(self):
        view = self._controller.getView()
        icon = getIcon('qtodotxt.png')
        QtWidgets.QSystemTrayIcon.__init__(self, icon, view)
        self.activated.connect(self._onActivated)
        self.setToolTip('QTodoTxt')

        menu = QtWidgets.QMenu()
        create_task_action = menu.addAction(getIcon('TaskCreate.png'), "Create New Task")
        create_task_action.triggered.connect(self._createTask)
        toggle_visible_action = menu.addAction("Show/Hide Window")
        toggle_visible_action.triggered.connect(self._controller.toggleVisible)
        exit_action = menu.addAction(getIcon('ApplicationExit.png'), "Exit")
        exit_action.triggered.connect(self._controller.exit)
        self.setContextMenu(menu)
Пример #11
0
 def _initCreateTaskAction(self):
     action = QtWidgets.QAction(getIcon('TaskCreate.png'),
                                '&Create New Task', self)
     action.setShortcuts(['Insert', 'Ctrl+I', 'Ctrl+N'])
     action.triggered.connect(self.createTask)
     self.view.addListAction(action)
     self.createTaskAction = action
Пример #12
0
 def _initCopySelectedTasksAction(self):
     action = QtWidgets.QAction(getIcon('TaskCopy.png'),
                                'Copy Selected Tasks', self)
     action.setShortcuts([QtGui.QKeySequence.Copy])
     action.triggered.connect(self._copySelectedTasks)
     self.view.addListAction(action)
     self.copySelectedTasksAction = action
Пример #13
0
 def _createNewAction(self):
     action = QtWidgets.QAction(getIcon('FileNew.png'), '&New', self)
     # infrequent action, I prefer to use ctrl+n for new task.
     action.setShortcuts(["Ctrl+Shift+N"])
     action.triggered.connect(self._main_controller.new)
     self.newAction = action
     return action
Пример #14
0
 def _initCompleteSelectedTasksAction(self):
     action = QtGui.QAction(getIcon('checked.svg'),
                            'C&omplete Selected Tasks', self)
     action.setShortcuts(['x', 'c'])
     action.triggered.connect(self._completeSelectedTasks)
     self._view.addListAction(action)
     self.completeSelectedTasksAction = action
Пример #15
0
 def _initCompleteSelectedTasksAction(self):
     action = QtWidgets.QAction(getIcon('TaskComplete.png'),
                                'C&omplete Selected Tasks', self)
     action.setShortcuts(['x', 'c'])
     action.triggered.connect(self._completeSelectedTasks)
     self.view.addListAction(action)
     self.completeSelectedTasksAction = action
Пример #16
0
 def _initDecreasePrioritySelectedTasksAction(self):
     action = QtWidgets.QAction(getIcon('TaskPriorityDecrease.png'),
                                'Decrease Priority', self)
     action.setShortcuts(['-', '<'])
     action.triggered.connect(self._decreasePriority)
     self.view.addListAction(action)
     self.decreasePrioritySelectedTasksAction = action
Пример #17
0
 def _initDeleteSelectedTasksAction(self):
     action = QtWidgets.QAction(getIcon('TaskDelete.png'),
                                '&Delete Selected Tasks', self)
     action.setShortcut('Delete')
     action.triggered.connect(self._deleteSelectedTasks)
     self.view.addListAction(action)
     self.deleteSelectedTasksAction = action
Пример #18
0
 def _initIncreasePrioritySelectedTasksAction(self):
     action = QtWidgets.QAction(getIcon('TaskPriorityIncrease.png'),
                                'Increase Priority', self)
     action.setShortcuts(['+', '>'])
     action.triggered.connect(self._increasePriority)
     self.view.addListAction(action)
     self.increasePrioritySelectedTasksAction = action
Пример #19
0
 def _createNewAction(self):
     action = QtWidgets.QAction(getIcon('FileNew.png'), '&New', self)
     # infrequent action, I prefer to use ctrl+n for new task.
     action.setShortcuts(["Ctrl+Shift+N"])
     action.triggered.connect(self._main_controller.new)
     self.newAction = action
     return action
Пример #20
0
 def _addDefaultTreeItems(self, tree):
     self._incompleteTasksItem = \
         FilterTreeWidgetItem(None, ['Pending'], IncompleteTasksFilter(), getIcon('time.png'))
     self._uncategorizedTasksItem = \
         FilterTreeWidgetItem(None, ['Uncategorized'], UncategorizedTasksFilter(), getIcon('help.png'))
     self._contextsItem = \
         FilterTreeWidgetItem(None, ['Contexts'], HasContextsFilter(), getIcon('at.png'))
     self._projectsItem = \
         FilterTreeWidgetItem(None, ['Projects'], HasProjectsFilter(), getIcon('plus.png'))
     self._completeTasksItem = \
         FilterTreeWidgetItem(None, ['Complete'], CompleteTasksFilter(), getIcon('x.png'))
     tree.addTopLevelItems([
         self._incompleteTasksItem,
         self._uncategorizedTasksItem,
         self._contextsItem,
         self._projectsItem,
         self._completeTasksItem])
Пример #21
0
    def _initFilterTypeMappings(self):
        self._filterItemByFilterType[ContextFilter] = self._contextsItem
        self._filterItemByFilterType[ProjectFilter] = self._projectsItem
        self._filterItemByFilterType[DueFilter] = self._dueItem

        self._filterIconByFilterType[ContextFilter] = getIcon('at.png')
        self._filterIconByFilterType[ProjectFilter] = getIcon('plus.png')

        self._filterIconByFilterType[DueTodayFilter] = getIcon('due_today.png')
        self._filterIconByFilterType[DueTomorrowFilter] = getIcon(
            'due_tomorrow.png')
        self._filterIconByFilterType[DueThisWeekFilter] = getIcon('due.png')
        self._filterIconByFilterType[DueThisMonthFilter] = getIcon(
            'due_this_month.png')
        self._filterIconByFilterType[DueOverdueFilter] = getIcon(
            'due_overdue.png')

        self._treeItemByFilterType[
            IncompleteTasksFilter] = self._incompleteTasksItem
        self._treeItemByFilterType[
            UncategorizedTasksFilter] = self._uncategorizedTasksItem
        self._treeItemByFilterType[
            CompleteTasksFilter] = self._completeTasksItem
        self._treeItemByFilterType[HasProjectsFilter] = self._projectsItem
        self._treeItemByFilterType[HasDueDateFilter] = self._dueItem
        self._treeItemByFilterType[HasContextsFilter] = self._contextsItem
Пример #22
0
 def _addDefaultTreeItems(self, tree):
     self._allTasksItem = FilterTreeWidgetItem(None, ['All'],
                                               AllTasksFilter(),
                                               getIcon('FilterAll.png'))
     self._incompleteTasksItem = FilterTreeWidgetItem(
         None, ['Pending'], IncompleteTasksFilter(),
         getIcon('FilterPending.png'))
     self._dueItem = FilterTreeWidgetItem(None, ['Due'], HasDueDateFilter(),
                                          getIcon('FilterDue.png'))
     self._uncategorizedTasksItem = FilterTreeWidgetItem(
         None, ['Uncategorized'], UncategorizedTasksFilter(),
         getIcon('FilterUncategorized.png'))
     self._contextsItem = FilterTreeWidgetItem(
         None, ['Contexts'], HasContextsFilter(),
         getIcon('FilterContexts.png'))
     self._projectsItem = FilterTreeWidgetItem(
         None, ['Projects'], HasProjectsFilter(),
         getIcon('FilterProjects.png'))
     self._completeTasksItem = FilterTreeWidgetItem(
         None, ['Complete'], CompleteTasksFilter(),
         getIcon('FilterComplete.png'))
     tree.addTopLevelItems([
         self._allTasksItem, self._incompleteTasksItem,
         self._uncategorizedTasksItem, self._dueItem, self._contextsItem,
         self._projectsItem, self._completeTasksItem
     ])
Пример #23
0
    def _initFilterTypeMappings(self):
        self._filterItemByFilterType[ContextFilter] = self._contextsItem
        self._filterItemByFilterType[ProjectFilter] = self._projectsItem
        self._filterItemByFilterType[DueFilter] = self._dueItem

        self._filterIconByFilterType[ContextFilter] = getIcon(
            'FilterContexts.png')
        self._filterIconByFilterType[ProjectFilter] = getIcon(
            'FilterProjects.png')

        self._filterIconByFilterType[DueTodayFilter] = getIcon(
            'FilterDueToday.png')
        self._filterIconByFilterType[DueTomorrowFilter] = getIcon(
            'FilterDueTomorrow.png')
        self._filterIconByFilterType[DueThisWeekFilter] = getIcon(
            'FilterDueWeek.png')
        self._filterIconByFilterType[DueThisMonthFilter] = getIcon(
            'FilterDueMonth.png')
        self._filterIconByFilterType[DueOverdueFilter] = getIcon(
            'FilterDueOverdue.png')

        self._treeItemByFilterType[AllTasksFilter] = self._allTasksItem
        self._treeItemByFilterType[
            UncategorizedTasksFilter] = self._uncategorizedTasksItem
        self._treeItemByFilterType[
            CompleteTasksFilter] = self._completeTasksItem
        self._treeItemByFilterType[HasProjectsFilter] = self._projectsItem
        self._treeItemByFilterType[HasDueDateFilter] = self._dueItem
        self._treeItemByFilterType[HasContextsFilter] = self._contextsItem
Пример #24
0
    def _initActions(self):
        self.filterViewAction = QtWidgets.QAction(getIcon('sidepane.png'), '&Show Filters', self)
        self.filterViewAction.setCheckable(True)
        # action.setShortcuts(['Ctrl+E']) # what should it be?
        self.filterViewAction.triggered.connect(self._toggleFilterView)

        self.showFutureAction = QtWidgets.QAction(getIcon('future.png'), '&Show Future Tasks', self)
        self.showFutureAction.setCheckable(True)
        # action.setShortcuts(['Ctrl+E']) # what should it be?
        self.showFutureAction.triggered.connect(self._toggleShowFuture)

        self.showCompletedAction = QtWidgets.QAction(getIcon('show_completed.png'), '&Show Completed Tasks', self)
        self.showCompletedAction.setCheckable(True)
        # action.setShortcuts(['Ctrl+E']) # what should it be?
        self.showCompletedAction.triggered.connect(self._toggleShowCompleted)

        self.archiveAction = QtWidgets.QAction(getIcon('archive.png'), '&Archive Completed Tasks', self)
        # action.setShortcuts(['Ctrl+E']) # what should it be?
        self.archiveAction.triggered.connect(self._archive_all_done_tasks)
Пример #25
0
    def _initActions(self):
        self.filterViewAction = QtWidgets.QAction(getIcon('sidepane.png'), '&Show Filters', self)
        self.filterViewAction.setCheckable(True)
        # action.setShortcuts(['Ctrl+E']) # what should it be?
        self.filterViewAction.triggered.connect(self._toggleFilterView)

        self.showFutureAction = QtWidgets.QAction(getIcon('future.png'), '&Show Future Tasks', self)
        self.showFutureAction.setCheckable(True)
        # action.setShortcuts(['Ctrl+E']) # what should it be?
        self.showFutureAction.triggered.connect(self._toggleShowFuture)

        self.showCompletedAction = QtWidgets.QAction(getIcon('show_completed.png'), '&Show Completed Tasks', self)
        self.showCompletedAction.setCheckable(True)
        # action.setShortcuts(['Ctrl+E']) # what should it be?
        self.showCompletedAction.triggered.connect(self._toggleShowCompleted)

        self.archiveAction = QtWidgets.QAction(getIcon('archive.png'), '&Archive Completed Tasks', self)
        # action.setShortcuts(['Ctrl+E']) # what should it be?
        self.archiveAction.triggered.connect(self._archive_all_done_tasks)
Пример #26
0
 def _initFileMenu(self):
     fileMenu = self._menu.addMenu('&File')
     fileMenu.addAction(self._createNewAction())     
     fileMenu.addAction(self._createOpenAction())        
     fileMenu.addAction(self._createSaveAction())
     fileMenu.addAction(self._createRevertAction())
     fileMenu.addSeparator()
     preferenceMenu = fileMenu.addMenu(getIcon('wrench.png'),'&Preferences')
     preferenceMenu.addAction(self._createPreferenceAction())
     fileMenu.addSeparator()
     fileMenu.addAction(self._createExitAction())
Пример #27
0
 def _addDefaultTreeItems(self, tree):
     self._incompleteTasksItem = FilterTreeWidgetItem(
         None, ["Pending"], IncompleteTasksFilter(), getIcon("time.png")
     )
     self._dueItem = FilterTreeWidgetItem(None, ["Due"], HasDueDateFilter(), getIcon("due.png"))
     self._uncategorizedTasksItem = FilterTreeWidgetItem(
         None, ["Uncategorized"], UncategorizedTasksFilter(), getIcon("help.png")
     )
     self._contextsItem = FilterTreeWidgetItem(None, ["Contexts"], HasContextsFilter(), getIcon("at.png"))
     self._projectsItem = FilterTreeWidgetItem(None, ["Projects"], HasProjectsFilter(), getIcon("plus.png"))
     self._completeTasksItem = FilterTreeWidgetItem(None, ["Complete"], CompleteTasksFilter(), getIcon("x.png"))
     tree.addTopLevelItems(
         [
             self._incompleteTasksItem,
             self._dueItem,
             self._uncategorizedTasksItem,
             self._contextsItem,
             self._projectsItem,
             self._completeTasksItem,
         ]
     )
Пример #28
0
    def _initUI(self):

        splitter = QtGui.QSplitter()

        self.filters_tree_view = FiltersTreeView(splitter)
        self.tasks_view = TasksView(splitter)

        self.setCentralWidget(splitter)

        self.resize(800, 400)
        splitter.setSizes([250, 550])
        self.setWindowIcon(getIcon('qtodotxt.ico'))
Пример #29
0
 def _addDefaultTreeItems(self, tree):
     self._allTasksItem = FilterTreeWidgetItem(None,
                                               ['All'],
                                               AllTasksFilter(),
                                               getIcon('FilterAll.png'))
     self._dueItem = FilterTreeWidgetItem(None,
                                          ['Due'],
                                          HasDueDateFilter(),
                                          getIcon('FilterDue.png'))
     self._uncategorizedTasksItem = FilterTreeWidgetItem(None,
                                                         ['Uncategorized'],
                                                         UncategorizedTasksFilter(),
                                                         getIcon('FilterUncategorized.png'))
     self._contextsItem = FilterTreeWidgetItem(None,
                                               ['Contexts'],
                                               HasContextsFilter(),
                                               getIcon('FilterContexts.png'))
     self._projectsItem = FilterTreeWidgetItem(None,
                                               ['Projects'],
                                               HasProjectsFilter(),
                                               getIcon('FilterProjects.png'))
     self._completeTasksItem = FilterTreeWidgetItem(None,
                                                    ['Complete'],
                                                    CompleteTasksFilter(),
                                                    getIcon('FilterComplete.png'))
     tree.addTopLevelItems([
         self._allTasksItem,
         self._uncategorizedTasksItem,
         self._dueItem,
         self._contextsItem,
         self._projectsItem,
         self._completeTasksItem
     ])
Пример #30
0
 def _addDefaultTreeItems(self, tree):
     self._allTasksItem = FilterTreeWidgetItem(None, ["All"], AllTasksFilter(), getIcon("FilterAll.png"))
     self._dueItem = FilterTreeWidgetItem(None, ["Due"], HasDueDateFilter(), getIcon("FilterDue.png"))
     self._uncategorizedTasksItem = FilterTreeWidgetItem(
         None, ["Uncategorized"], UncategorizedTasksFilter(), getIcon("FilterUncategorized.png")
     )
     self._contextsItem = FilterTreeWidgetItem(
         None, ["Contexts"], HasContextsFilter(), getIcon("FilterContexts.png")
     )
     self._projectsItem = FilterTreeWidgetItem(
         None, ["Projects"], HasProjectsFilter(), getIcon("FilterProjects.png")
     )
     self._completeTasksItem = FilterTreeWidgetItem(
         None, ["Complete"], CompleteTasksFilter(), getIcon("FilterComplete.png")
     )
     tree.addTopLevelItems(
         [
             self._allTasksItem,
             self._uncategorizedTasksItem,
             self._dueItem,
             self._contextsItem,
             self._projectsItem,
             self._completeTasksItem,
         ]
     )
Пример #31
0
    def _initUI(self):

        self.splitter = QtWidgets.QSplitter()
        self.splitter.setHandleWidth(1)

        self.filters_tree_view = FiltersTreeView(self.splitter)
        self.tasks_view = TasksView(self.splitter)

        self.setCentralWidget(self.splitter)

        self.resize(800, 400)
        self.splitter.setSizes([250, 550])
        self.setWindowIcon(getIcon('qtodotxt.png'))
Пример #32
0
 def _initFileMenu(self):
     fileMenu = self._menu.addMenu('&File')
     fileMenu.addAction(self._createNewAction())
     fileMenu.addAction(self._createOpenAction())
     fileMenu.addAction(self._createSaveAction())
     fileMenu.addAction(self._createRevertAction())
     fileMenu.addSeparator()
     preferenceMenu = fileMenu.addMenu(getIcon('ApplicationPreferences.png'), '&Preferences')
     preferenceMenu.addAction(self._createPreferenceAction())
     preferenceMenu.addAction(self._autoSavePreferenceAction())
     preferenceMenu.addAction(self._autoArchivePreferenceAction())
     preferenceMenu.addAction(self._hideFutureTasksAction())
     fileMenu.addSeparator()
     fileMenu.addAction(self._createExitAction())
Пример #33
0
 def _initFileMenu(self):
     fileMenu = self._menu.addMenu('&File')
     fileMenu.addAction(self._createNewAction())
     fileMenu.addAction(self._createOpenAction())
     fileMenu.addAction(self._createSaveAction())
     fileMenu.addAction(self._createRevertAction())
     fileMenu.addSeparator()
     preferenceMenu = fileMenu.addMenu(getIcon('wrench.png'), '&Preferences')
     preferenceMenu.addAction(self._createPreferenceAction())
     preferenceMenu.addAction(self._autoSavePreferenceAction())
     preferenceMenu.addAction(self._autoArchivePreferenceAction())
     preferenceMenu.addAction(self._hideFutureTasksAction())
     fileMenu.addSeparator()
     fileMenu.addAction(self._createExitAction())
Пример #34
0
    def _initUI(self):

        self.splitter = QtWidgets.QSplitter()
        self.splitter.setHandleWidth(1)

        cssPath = getResourcePath("css/default.css")
        css = open(cssPath, 'r', encoding='utf-8').read()
        self.setStyleSheet(css)

        self.filters_tree_view = FiltersTreeView(self.splitter)
        self.tasks_view = TasksView(self.splitter)

        self.setCentralWidget(self.splitter)

        self.resize(800, 400)
        self.splitter.setSizes([250, 550])
        self.setWindowIcon(getIcon('qtodotxt.png'))
Пример #35
0
    def _initFilterTypeMappings(self):
        self._filterItemByFilterType[ContextFilter] = self._contextsItem
        self._filterItemByFilterType[ProjectFilter] = self._projectsItem
        self._filterItemByFilterType[DueFilter] = self._dueItem

        self._filterIconByFilterType[ContextFilter] = getIcon("at.png")
        self._filterIconByFilterType[ProjectFilter] = getIcon("plus.png")

        self._filterIconByFilterType[DueTodayFilter] = getIcon("due_today.png")
        self._filterIconByFilterType[DueTomorrowFilter] = getIcon("due_tomorrow.png")
        self._filterIconByFilterType[DueThisWeekFilter] = getIcon("due.png")
        self._filterIconByFilterType[DueThisMonthFilter] = getIcon("due_this_month.png")
        self._filterIconByFilterType[DueOverdueFilter] = getIcon("due_overdue.png")

        self._treeItemByFilterType[IncompleteTasksFilter] = self._incompleteTasksItem
        self._treeItemByFilterType[UncategorizedTasksFilter] = self._uncategorizedTasksItem
        self._treeItemByFilterType[CompleteTasksFilter] = self._completeTasksItem
        self._treeItemByFilterType[HasProjectsFilter] = self._projectsItem
        self._treeItemByFilterType[HasDueDateFilter] = self._dueItem
        self._treeItemByFilterType[HasContextsFilter] = self._contextsItem
Пример #36
0
    def _initFilterTypeMappings(self):
        self._filterItemByFilterType[ContextFilter] = self._contextsItem
        self._filterItemByFilterType[ProjectFilter] = self._projectsItem
        self._filterItemByFilterType[DueFilter] = self._dueItem

        self._filterIconByFilterType[ContextFilter] = getIcon('FilterContexts.png')
        self._filterIconByFilterType[ProjectFilter] = getIcon('FilterProjects.png')

        self._filterIconByFilterType[DueTodayFilter] = getIcon('FilterDueToday.png')
        self._filterIconByFilterType[DueTomorrowFilter] = getIcon('FilterDueTomorrow.png')
        self._filterIconByFilterType[DueThisWeekFilter] = getIcon('FilterDueWeek.png')
        self._filterIconByFilterType[DueThisMonthFilter] = getIcon('FilterDueMonth.png')
        self._filterIconByFilterType[DueOverdueFilter] = getIcon('FilterDueOverdue.png')

        self._treeItemByFilterType[AllTasksFilter] = self._allTasksItem
        self._treeItemByFilterType[UncategorizedTasksFilter] = self._uncategorizedTasksItem
        self._treeItemByFilterType[CompleteTasksFilter] = self._completeTasksItem
        self._treeItemByFilterType[HasProjectsFilter] = self._projectsItem
        self._treeItemByFilterType[HasDueDateFilter] = self._dueItem
        self._treeItemByFilterType[HasContextsFilter] = self._contextsItem
Пример #37
0
 def _initIcon(self):
     view = self._controller.getView()
     icon = getIcon('qtodotxt.png')
     QtGui.QSystemTrayIcon.__init__(self, icon, view)
     self.activated.connect(self._onActivated)
     self.setToolTip('QTodoTxt')
Пример #38
0
 def _initEditTaskAction(self):
     action = QtWidgets.QAction(getIcon('TaskEdit.png'), '&Edit Task', self)
     action.setShortcuts(['Ctrl+E'])
     action.triggered.connect(self.editTask)
     self._view.addListAction(action)
     self.editTaskAction = action
Пример #39
0
 def _createRevertAction(self):
     action = QtGui.QAction(getIcon('arrow_rotate_clockwise.png'), '&Revert', self)
     action.triggered.connect(self._main_controller.revert)
     self.revertAction = action
     return action
Пример #40
0
 def _createSaveAction(self):
     action = QtGui.QAction(getIcon('disk.png'), '&Save', self)
     action.setShortcuts(["Ctrl+S"])
     action.triggered.connect(self._main_controller.save)
     self.saveAction = action
     return action
Пример #41
0
 def _initCompleteSelectedTasksAction(self):
     action = QtGui.QAction(getIcon('x.png'), 'C&omplete Selected Tasks', self)
     action.setShortcuts(['x', 'c'])
     action.triggered.connect(self._completeSelectedTasks)
     self._view.addListAction(action)
     self.completeSelectedTasksAction = action
Пример #42
0
 def _initIncreasePrioritySelectedTasksAction(self):
     action = QtGui.QAction(getIcon('increase.png'), 'Increase priority', self)
     action.setShortcuts(['+', '>'])
     action.triggered.connect(self._increasePriority)
     self._view.addListAction(action)
     self.increasePrioritySelectedTasksAction = action
Пример #43
0
 def _createExitAction(self):
     action = QtWidgets.QAction(getIcon('ApplicationExit.png'), 'E&xit', self)
     action.setShortcuts(["Ctrl+Q"])
     action.triggered.connect(self._main_controller.exit)
     return action
Пример #44
0
 def _initEditTaskAction(self):
     action = QtWidgets.QAction(getIcon('TaskEdit.png'), '&Edit Task', self)
     action.setShortcuts(['Ctrl+E'])
     action.triggered.connect(self.editTask)
     self.view.addListAction(action)
     self.editTaskAction = action
Пример #45
0
 def _createOpenAction(self):
     action = QtGui.QAction(getIcon('folder.png'), '&Open', self)
     action.setShortcuts(["Ctrl+O"])
     action.triggered.connect(self._main_controller.open)
     return action
Пример #46
0
 def _createSaveAction(self):
     action = QtGui.QAction(getIcon('save.svg'), '&Save', self)
     action.setShortcuts(["Ctrl+S"])
     action.triggered.connect(self._main_controller.save)
     self.saveAction = action
     return action
Пример #47
0
 def _createAboutAction(self):
     action = QtGui.QAction(getIcon('help.png'), '&About', self)
     action.triggered.connect(self._about)
     return action
Пример #48
0
 def _createExitAction(self):
     action = QtWidgets.QAction(getIcon('ApplicationExit.png'), 'E&xit', self)
     action.setShortcuts(["Alt+F4"])
     action.triggered.connect(self._main_controller.exit)
     return action
Пример #49
0
 def _createExitAction(self):
     action = QtGui.QAction(getIcon('door_in.png'), 'E&xit', self)
     action.setShortcuts(["Alt+F4"])
     action.triggered.connect(self._main_controller.exit)
     return action
Пример #50
0
 def _initCreateTaskAction(self):
     action = QtGui.QAction(getIcon('add.png'), '&Create Task', self)
     action.setShortcuts(['Insert', 'Ctrl+I', 'Ctrl+N'])
     action.triggered.connect(self.createTask)
     self._view.addListAction(action)
     self.createTaskAction = action
Пример #51
0
 def _createExitAction(self):
     action = QtGui.QAction(getIcon('door_in.png'), 'E&xit', self)
     action.setShortcuts(["Alt+F4"])
     action.triggered.connect(self._main_controller.exit)
     return action
Пример #52
0
 def _initDeleteSelectedTasksAction(self):
     action = QtGui.QAction(getIcon('delete.png'), '&Delete Selected Tasks', self)
     action.setShortcut('Delete')
     action.triggered.connect(self._deleteSelectedTasks)
     self._view.addListAction(action)
     self.deleteSelectedTasksAction = action
Пример #53
0
 def _createAboutAction(self):
     action = QtGui.QAction(getIcon('help.png'), '&About', self)
     action.triggered.connect(self._about)
     return action
Пример #54
0
 def _initDecreasePrioritySelectedTasksAction(self):
     action = QtGui.QAction(getIcon('decrease.png'), 'Decrease priority', self)
     action.setShortcuts(['-', '<'])
     action.triggered.connect(self._decreasePriority)
     self._view.addListAction(action)
     self.decreasePrioritySelectedTasksAction = action
Пример #55
0
 def _createOpenAction(self):
     action = QtGui.QAction(getIcon('folder.png'), '&Open', self)
     action.setShortcuts(["Ctrl+O"])
     action.triggered.connect(self._main_controller.open)
     return action
Пример #56
0
 def _createRevertAction(self):
     action = QtGui.QAction(getIcon('arrow_rotate_clockwise.png'), '&Revert', self)
     action.triggered.connect(self._main_controller.revert)
     self.revertAction = action
     return action
Пример #57
0
 def _createRevertAction(self):
     action = QtWidgets.QAction(getIcon('FileRevert.png'), '&Revert', self)
     action.triggered.connect(self._main_controller.revert)
     self.revertAction = action
     return action