8 """ |
8 """ |
9 |
9 |
10 import os |
10 import os |
11 |
11 |
12 from PyQt4.QtCore import pyqtSlot, Qt, QDate, QProcess, QTimer, QRegExp, \ |
12 from PyQt4.QtCore import pyqtSlot, Qt, QDate, QProcess, QTimer, QRegExp, \ |
13 QSize, QPoint |
13 QSize, QPoint |
14 from PyQt4.QtGui import QDialog, QDialogButtonBox, QHeaderView, \ |
14 from PyQt4.QtGui import QDialog, QDialogButtonBox, QHeaderView, \ |
15 QTreeWidgetItem, QApplication, QCursor, QLineEdit, QColor, \ |
15 QTreeWidgetItem, QApplication, QCursor, QLineEdit, QColor, \ |
16 QPixmap, QPainter, QPen, QBrush, QIcon |
16 QPixmap, QPainter, QPen, QBrush, QIcon |
17 |
17 |
18 from E5Gui.E5Application import e5App |
18 from E5Gui.E5Application import e5App |
931 """ |
931 """ |
932 self.process.setReadChannel(QProcess.StandardOutput) |
932 self.process.setReadChannel(QProcess.StandardOutput) |
933 |
933 |
934 while self.process.canReadLine(): |
934 while self.process.canReadLine(): |
935 line = str(self.process.readLine(), |
935 line = str(self.process.readLine(), |
936 Preferences.getSystem("IOEncoding"), |
936 Preferences.getSystem("IOEncoding"), |
937 'replace') |
937 'replace') |
938 self.buf.append(line) |
938 self.buf.append(line) |
939 |
939 |
940 def __readStderr(self): |
940 def __readStderr(self): |
941 """ |
941 """ |
942 Private slot to handle the readyReadStandardError signal. |
942 Private slot to handle the readyReadStandardError signal. |
944 It reads the error output of the process and inserts it into the |
944 It reads the error output of the process and inserts it into the |
945 error pane. |
945 error pane. |
946 """ |
946 """ |
947 if self.process is not None: |
947 if self.process is not None: |
948 s = str(self.process.readAllStandardError(), |
948 s = str(self.process.readAllStandardError(), |
949 Preferences.getSystem("IOEncoding"), |
949 Preferences.getSystem("IOEncoding"), |
950 'replace') |
950 'replace') |
951 self.__showError(s) |
951 self.__showError(s) |
952 |
952 |
953 def __showError(self, out): |
953 def __showError(self, out): |
954 """ |
954 """ |
955 Private slot to show some error. |
955 Private slot to show some error. |
1040 public += 1 |
1040 public += 1 |
1041 |
1041 |
1042 # step 2: set the status of the phase button |
1042 # step 2: set the status of the phase button |
1043 if public == 0 and \ |
1043 if public == 0 and \ |
1044 ((secret > 0 and draft == 0) or |
1044 ((secret > 0 and draft == 0) or |
1045 (secret == 0 and draft > 0)): |
1045 (secret == 0 and draft > 0)): |
1046 self.phaseButton.setEnabled(True) |
1046 self.phaseButton.setEnabled(True) |
1047 else: |
1047 else: |
1048 self.phaseButton.setEnabled(False) |
1048 self.phaseButton.setEnabled(False) |
1049 else: |
1049 else: |
1050 self.phaseButton.setEnabled(False) |
1050 self.phaseButton.setEnabled(False) |