~ubuntu-branches/ubuntu/karmic/eric/karmic

« back to all changes in this revision

Viewing changes to eric/UI/TaskPropertiesDialog.py

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2008-01-28 18:02:25 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080128180225-6nrox6yrworh2c4v
Tags: 4.0.4-1ubuntu1
* Add python-qt3 to build-depends becuase that's where Ubuntu puts 
  pyqtconfig
* Change maintainer to MOTU

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: utf-8 -*-
2
 
 
3
 
# Copyright (c) 2005 - 2007 Detlev Offenbach <detlev@die-offenbachs.de>
4
 
#
5
 
 
6
 
"""
7
 
Module implementing the task properties dialog.
8
 
"""
9
 
 
10
 
import time
11
 
 
12
 
from qt import *
13
 
 
14
 
from TaskPropertiesForm import TaskPropertiesForm
15
 
 
16
 
 
17
 
class TaskPropertiesDialog(TaskPropertiesForm):
18
 
    """
19
 
    Class implementing the task properties dialog.
20
 
    """
21
 
    def __init__(self, task = None, parent = None, projectOpen = 0):
22
 
        """
23
 
        Constructor
24
 
        
25
 
        @param task the task object to be shown
26
 
        @param parent the parent widget (QWidget)
27
 
        @param projectOpen flag indicating status of the project (boolean)
28
 
        """
29
 
        TaskPropertiesForm.__init__(self, parent, None, 1)
30
 
        
31
 
        if not projectOpen:
32
 
            self.projectCheckBox.setEnabled(0)
33
 
        if task is not None:
34
 
            self.descriptionEdit.setText(task.description)
35
 
            self.creationLabel.setText(time.strftime("%Y-%m-%d, %H:%M:%S", 
36
 
                                                     time.localtime(task.created)))
37
 
            self.priorityCombo.setCurrentItem(task.priority)
38
 
            self.projectCheckBox.setChecked(task._isProjectTask)
39
 
            self.completedCheckBox.setChecked(task.completed)
40
 
            self.filenameEdit.setText(task.filename)
41
 
            if task.lineno:
42
 
                self.linenoEdit.setText(str(task.lineno))
43
 
        else:
44
 
            self.projectCheckBox.setChecked(projectOpen)
45
 
    
46
 
    def setReadOnly(self):
47
 
        """
48
 
        Public slot to set the dialog to read only mode.
49
 
        """
50
 
        self.descriptionEdit.setReadOnly(1)
51
 
        self.completedCheckBox.setEnabled(0)
52
 
        self.priorityCombo.setEnabled(0)
53
 
        
54
 
    def getData(self):
55
 
        """
56
 
        Public method to retrieve the dialogs data.
57
 
        
58
 
        @return tuple of description, priority, completion flag
59
 
                and project flag
60
 
        """
61
 
        return (self.descriptionEdit.text(), self.priorityCombo.currentItem(),
62
 
                self.completedCheckBox.isChecked(), self.projectCheckBox.isChecked())