67 self.setWindowTitle(self.tr("Project Properties")) |
67 self.setWindowTitle(self.tr("Project Properties")) |
68 |
68 |
69 self.nameEdit.setText(project["name"]) |
69 self.nameEdit.setText(project["name"]) |
70 self.filenamePicker.setText(project["file"]) |
70 self.filenamePicker.setText(project["file"]) |
71 self.descriptionEdit.setPlainText(project["description"]) |
71 self.descriptionEdit.setPlainText(project["description"]) |
72 self.masterCheckBox.setChecked(project["master"]) |
72 self.mainCheckBox.setChecked(project["master"]) |
73 index = self.categoryComboBox.findText(project["category"]) |
73 index = self.categoryComboBox.findText(project["category"]) |
74 if index == -1: |
74 if index == -1: |
75 index = 0 |
75 index = 0 |
76 self.categoryComboBox.setCurrentIndex(index) |
76 self.categoryComboBox.setCurrentIndex(index) |
77 self.uid = project["uid"] |
77 self.uid = project["uid"] |
78 |
78 |
79 def getData(self): |
79 def getData(self): |
80 """ |
80 """ |
81 Public slot to retrieve the dialogs data. |
81 Public slot to retrieve the dialogs data. |
82 |
82 |
83 @return tuple of five values (string, string, boolean, string, string) |
83 @return tuple of five values giving the project name, the name of the project |
84 giving the project name, the name of the project file, a flag |
84 file, a flag telling whether the project shall be the main project, a short |
85 telling whether the project shall be the main project, a short |
|
86 description for the project and the project category |
85 description for the project and the project category |
|
86 @rtype tuple of (str, str, bool, str, str) |
87 """ |
87 """ |
88 if not self.uid: |
88 if not self.uid: |
89 # new project entry |
89 # new project entry |
90 self.uid = QUuid.createUuid().toString() |
90 self.uid = QUuid.createUuid().toString() |
91 |
91 |
95 os.path.join(self.startdir, filename) |
95 os.path.join(self.startdir, filename) |
96 ) |
96 ) |
97 return ( |
97 return ( |
98 self.nameEdit.text(), |
98 self.nameEdit.text(), |
99 filename, |
99 filename, |
100 self.masterCheckBox.isChecked(), |
100 self.mainCheckBox.isChecked(), |
101 self.descriptionEdit.toPlainText(), |
101 self.descriptionEdit.toPlainText(), |
102 self.categoryComboBox.currentText(), |
102 self.categoryComboBox.currentText(), |
103 self.uid, |
103 self.uid, |
104 ) |
104 ) |
105 |
105 |
106 @pyqtSlot(str) |
106 @pyqtSlot(str) |
107 def on_nameEdit_textChanged(self, txt): |
107 def on_nameEdit_textChanged(self, txt): |
108 """ |
108 """ |
109 Private slot called when the project name has changed. |
109 Private slot called when the project name has changed. |
110 |
110 |
111 @param txt text of the edit (string) |
111 @param txt text of the edit |
|
112 @type str |
112 """ |
113 """ |
113 self.__updateUi() |
114 self.__updateUi() |
114 |
115 |
115 @pyqtSlot(str) |
116 @pyqtSlot(str) |
116 def on_filenamePicker_textChanged(self, txt): |
117 def on_filenamePicker_textChanged(self, txt): |
117 """ |
118 """ |
118 Private slot called when the project filename has changed. |
119 Private slot called when the project filename has changed. |
119 |
120 |
120 @param txt text of the edit (string) |
121 @param txt text of the edit |
|
122 @type str |
121 """ |
123 """ |
122 self.__updateUi() |
124 self.__updateUi() |
123 |
125 |
124 def __updateUi(self): |
126 def __updateUi(self): |
125 """ |
127 """ |