Sat, 06 Jan 2024 13:06:58 +0100
Adapted code to eric 24.2 and newer.
<!DOCTYPE html> <html><head> <title>Plugin_Time_Tracker.TimeTracker.TimeTrackerWidget</title> <meta charset="UTF-8"> <link rel="stylesheet" href="styles.css"> </head> <body> <a NAME="top" ID="top"></a> <h1>Plugin_Time_Tracker.TimeTracker.TimeTrackerWidget</h1> <p> Module implementing the time tracker widget. </p> <h3>Global Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Classes</h3> <table> <tr> <td><a href="#TimeTrackerWidget">TimeTrackerWidget</a></td> <td>Class implementing the time tracker widget.</td> </tr> </table> <h3>Functions</h3> <table> <tr><td>None</td></tr> </table> <hr /> <hr /> <a NAME="TimeTrackerWidget" ID="TimeTrackerWidget"></a> <h2>TimeTrackerWidget</h2> <p> Class implementing the time tracker widget. </p> <h3>Derived from</h3> QWidget, Ui_TimeTrackerWidget <h3>Class Attributes</h3> <table> <tr><td>CommentColumn</td></tr> <tr><td>DurationColumn</td></tr> <tr><td>TaskColumn</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#TimeTrackerWidget.__init__">TimeTrackerWidget</a></td> <td>Constructor</td> </tr> <tr> <td><a href="#TimeTrackerWidget.__addEntry">__addEntry</a></td> <td>Private slot to manually add an entry.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.__deleteSelectedEntries">__deleteSelectedEntries</a></td> <td>Private slot to delete the selected tracker entries.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.__editEntry">__editEntry</a></td> <td>Private slot to edit the selected tracker entry.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.__exportEntries">__exportEntries</a></td> <td>Private method to export all or selected entries.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.__exportSelectedEntries">__exportSelectedEntries</a></td> <td>Private slot to export the selected tracker entries.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.__importEntries">__importEntries</a></td> <td>Private slot to import tracker entries.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.__insertEntry">__insertEntry</a></td> <td>Private method to insert a tracker entry into the list.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.__mergeDuplicates">__mergeDuplicates</a></td> <td>Private slot to merge duplicate entries.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.__removeDuplicates">__removeDuplicates</a></td> <td>Private slot to remove duplicate entries.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.__resizeColumns">__resizeColumns</a></td> <td>Private slot to resize the columns of the entries list.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.__saveEntries">__saveEntries</a></td> <td>Private slot to save the tracker entries.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.clear">clear</a></td> <td>Public method to clear all the data.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.on_commentCombo_editTextChanged">on_commentCombo_editTextChanged</a></td> <td>Private slot handling changes of the comment of the current entry.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.on_entriesList_customContextMenuRequested">on_entriesList_customContextMenuRequested</a></td> <td>Private slot to create the context menu and show it.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.on_newButton_clicked">on_newButton_clicked</a></td> <td>Private slot to end the current timer and start a new one.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.on_pauseButton_toggled">on_pauseButton_toggled</a></td> <td>Private slot to pause the current timing.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.on_taskCombo_editTextChanged">on_taskCombo_editTextChanged</a></td> <td>Private slot handling changes of the task description of the current entry.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.setCurrentEntry">setCurrentEntry</a></td> <td>Public method to set the current entry.</td> </tr> <tr> <td><a href="#TimeTrackerWidget.showTrackerEntries">showTrackerEntries</a></td> <td>Public method to show the tracker entries of the current project.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="TimeTrackerWidget.__init__" ID="TimeTrackerWidget.__init__"></a> <h4>TimeTrackerWidget (Constructor)</h4> <b>TimeTrackerWidget</b>(<i>tracker, parent=None</i>) <p> Constructor </p> <dl> <dt><i>tracker</i> (TimeTracker)</dt> <dd> reference to the time tracker </dd> <dt><i>parent</i> (QWidget)</dt> <dd> reference to the parent widget </dd> </dl> <a NAME="TimeTrackerWidget.__addEntry" ID="TimeTrackerWidget.__addEntry"></a> <h4>TimeTrackerWidget.__addEntry</h4> <b>__addEntry</b>(<i></i>) <p> Private slot to manually add an entry. </p> <a NAME="TimeTrackerWidget.__deleteSelectedEntries" ID="TimeTrackerWidget.__deleteSelectedEntries"></a> <h4>TimeTrackerWidget.__deleteSelectedEntries</h4> <b>__deleteSelectedEntries</b>(<i></i>) <p> Private slot to delete the selected tracker entries. </p> <a NAME="TimeTrackerWidget.__editEntry" ID="TimeTrackerWidget.__editEntry"></a> <h4>TimeTrackerWidget.__editEntry</h4> <b>__editEntry</b>(<i></i>) <p> Private slot to edit the selected tracker entry. </p> <a NAME="TimeTrackerWidget.__exportEntries" ID="TimeTrackerWidget.__exportEntries"></a> <h4>TimeTrackerWidget.__exportEntries</h4> <b>__exportEntries</b>(<i>ids=None</i>) <p> Private method to export all or selected entries. </p> <dl> <dt><i>ids</i> (list of int)</dt> <dd> list of IDs to export or all if empty </dd> </dl> <a NAME="TimeTrackerWidget.__exportSelectedEntries" ID="TimeTrackerWidget.__exportSelectedEntries"></a> <h4>TimeTrackerWidget.__exportSelectedEntries</h4> <b>__exportSelectedEntries</b>(<i></i>) <p> Private slot to export the selected tracker entries. </p> <a NAME="TimeTrackerWidget.__importEntries" ID="TimeTrackerWidget.__importEntries"></a> <h4>TimeTrackerWidget.__importEntries</h4> <b>__importEntries</b>(<i></i>) <p> Private slot to import tracker entries. </p> <a NAME="TimeTrackerWidget.__insertEntry" ID="TimeTrackerWidget.__insertEntry"></a> <h4>TimeTrackerWidget.__insertEntry</h4> <b>__insertEntry</b>(<i>entry, index=-1</i>) <p> Private method to insert a tracker entry into the list. </p> <dl> <dt><i>entry</i> (TimeTrackEntry)</dt> <dd> reference to the tracker entry </dd> <dt><i>index</i> (int)</dt> <dd> index the entry is to be inserted; -1 for at the end </dd> </dl> <a NAME="TimeTrackerWidget.__mergeDuplicates" ID="TimeTrackerWidget.__mergeDuplicates"></a> <h4>TimeTrackerWidget.__mergeDuplicates</h4> <b>__mergeDuplicates</b>(<i></i>) <p> Private slot to merge duplicate entries. </p> <a NAME="TimeTrackerWidget.__removeDuplicates" ID="TimeTrackerWidget.__removeDuplicates"></a> <h4>TimeTrackerWidget.__removeDuplicates</h4> <b>__removeDuplicates</b>(<i></i>) <p> Private slot to remove duplicate entries. </p> <a NAME="TimeTrackerWidget.__resizeColumns" ID="TimeTrackerWidget.__resizeColumns"></a> <h4>TimeTrackerWidget.__resizeColumns</h4> <b>__resizeColumns</b>(<i></i>) <p> Private slot to resize the columns of the entries list. </p> <a NAME="TimeTrackerWidget.__saveEntries" ID="TimeTrackerWidget.__saveEntries"></a> <h4>TimeTrackerWidget.__saveEntries</h4> <b>__saveEntries</b>(<i></i>) <p> Private slot to save the tracker entries. </p> <a NAME="TimeTrackerWidget.clear" ID="TimeTrackerWidget.clear"></a> <h4>TimeTrackerWidget.clear</h4> <b>clear</b>(<i></i>) <p> Public method to clear all the data. </p> <a NAME="TimeTrackerWidget.on_commentCombo_editTextChanged" ID="TimeTrackerWidget.on_commentCombo_editTextChanged"></a> <h4>TimeTrackerWidget.on_commentCombo_editTextChanged</h4> <b>on_commentCombo_editTextChanged</b>(<i>txt</i>) <p> Private slot handling changes of the comment of the current entry. </p> <dl> <dt><i>txt</i> (str)</dt> <dd> new comment </dd> </dl> <a NAME="TimeTrackerWidget.on_entriesList_customContextMenuRequested" ID="TimeTrackerWidget.on_entriesList_customContextMenuRequested"></a> <h4>TimeTrackerWidget.on_entriesList_customContextMenuRequested</h4> <b>on_entriesList_customContextMenuRequested</b>(<i>pos</i>) <p> Private slot to create the context menu and show it. </p> <dl> <dt><i>pos</i> (QPoint)</dt> <dd> position the menu should be shown at </dd> </dl> <a NAME="TimeTrackerWidget.on_newButton_clicked" ID="TimeTrackerWidget.on_newButton_clicked"></a> <h4>TimeTrackerWidget.on_newButton_clicked</h4> <b>on_newButton_clicked</b>(<i></i>) <p> Private slot to end the current timer and start a new one. </p> <a NAME="TimeTrackerWidget.on_pauseButton_toggled" ID="TimeTrackerWidget.on_pauseButton_toggled"></a> <h4>TimeTrackerWidget.on_pauseButton_toggled</h4> <b>on_pauseButton_toggled</b>(<i>checked</i>) <p> Private slot to pause the current timing. </p> <dl> <dt><i>checked</i> (bool)</dt> <dd> flag indicating the checked status of the button </dd> </dl> <a NAME="TimeTrackerWidget.on_taskCombo_editTextChanged" ID="TimeTrackerWidget.on_taskCombo_editTextChanged"></a> <h4>TimeTrackerWidget.on_taskCombo_editTextChanged</h4> <b>on_taskCombo_editTextChanged</b>(<i>txt</i>) <p> Private slot handling changes of the task description of the current entry. </p> <dl> <dt><i>txt</i> (str)</dt> <dd> new task description </dd> </dl> <a NAME="TimeTrackerWidget.setCurrentEntry" ID="TimeTrackerWidget.setCurrentEntry"></a> <h4>TimeTrackerWidget.setCurrentEntry</h4> <b>setCurrentEntry</b>(<i>entry</i>) <p> Public method to set the current entry. </p> <dl> <dt><i>entry</i> (TimeTrackEntry)</dt> <dd> current entry </dd> </dl> <a NAME="TimeTrackerWidget.showTrackerEntries" ID="TimeTrackerWidget.showTrackerEntries"></a> <h4>TimeTrackerWidget.showTrackerEntries</h4> <b>showTrackerEntries</b>(<i>entries</i>) <p> Public method to show the tracker entries of the current project. </p> <dl> <dt><i>entries</i> (list of TimeTrackEntry)</dt> <dd> list of tracker entries </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html>