Fri, 19 Oct 2012 13:06:56 +0200
Added a few source files.
# -*- coding: utf-8 -*- # Copyright (c) 2012 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the time tracker widget. """ from PyQt4.QtCore import pyqtSlot, QPoint from PyQt4.QtGui import QWidget, QMenu from .Ui_TimeTrackerWidget import Ui_TimeTrackerWidget class TimeTrackerWidget(QWidget, Ui_TimeTrackerWidget): """ Class implementing the time tracker widget. """ def __init__(self, tracker, parent=None): """ Constructor @param tracker reference to the time tracker (TimeTracker) @param parent reference to the parent widget (QWidget) """ super().__init__(parent) self.setupUi(self) self.__tracker = tracker @pyqtSlot(str) def on_taskCombo_editTextChanged(self, p0): """ Slot documentation goes here. """ # TODO: not implemented yet raise NotImplementedError @pyqtSlot(str) def on_commentCombo_editTextChanged(self, p0): """ Slot documentation goes here. """ # TODO: not implemented yet raise NotImplementedError @pyqtSlot(bool) def on_pauseButton_toggled(self, checked): """ Slot documentation goes here. """ # TODO: not implemented yet raise NotImplementedError @pyqtSlot() def on_newButton_clicked(self): """ Slot documentation goes here. """ # TODO: not implemented yet raise NotImplementedError @pyqtSlot(QPoint) def on_entriesList_customContextMenuRequested(self, pos): """ Private slot to create the context menu and show it. @param pos position the menu should be shown at (QPoint) """ menu = QMenu() menu.addAction(self.tr("Edit"), self.__editEntry).setEnabled( len(self.entriesList.selectedItems()) == 1) menu.addAction(self.tr("Delete"), self.__deleteSelectedEntries) menu.addSeparator() menu.addAction(self.tr("Save"), self.__saveEntries) menu.addSeparator() menu.addAction(self.tr("Import"), self.__importEntries) menu.addAction(self.tr("Export Selected"), self.__exportSelectedEntries) menu.addAction(self.tr("Export All"), self.__exportAllEntries) def __editEntry(self): """ Private slot to edit the selected tracker entry. """ # TODO: not implemented yet raise NotImplementedError def __deleteSelectedEntries(self): """ Private slot to delete the selected tracker entries. """ # TODO: not implemented yet raise NotImplementedError def __saveEntries(self): """ Private slot to save the tracker entries. """ # TODO: not implemented yet raise NotImplementedError def __importEntries(self): """ Private slot to import tracker entries. """ # TODO: not implemented yet raise NotImplementedError def __exportSelectedEntries(self): """ Private slot to export the selected tracker entries. """ # TODO: not implemented yet raise NotImplementedError def __exportAllEntries(self): """ Private slot to export all tracker entries. """ # TODO: not implemented yet raise NotImplementedError