10 import os |
10 import os |
11 |
11 |
12 from PyQt4.QtCore import QSignalMapper, QTimer, QFileInfo, pyqtSignal, QRegExp, \ |
12 from PyQt4.QtCore import QSignalMapper, QTimer, QFileInfo, pyqtSignal, QRegExp, \ |
13 QObject, Qt, QUrl |
13 QObject, Qt, QUrl |
14 from PyQt4.QtGui import QColor, QKeySequence, QLineEdit, QToolBar, QWidgetAction, \ |
14 from PyQt4.QtGui import QColor, QKeySequence, QLineEdit, QToolBar, QWidgetAction, \ |
15 QDialog, QApplication, QMenu, QPalette, QComboBox |
15 QDialog, QApplication, QMenu, QPalette, QComboBox, QPixmap |
16 from PyQt4.Qsci import QsciScintilla |
16 from PyQt4.Qsci import QsciScintilla |
17 |
17 |
18 from E5Gui.E5Application import e5App |
18 from E5Gui.E5Application import e5App |
19 from E5Gui import E5FileDialog, E5MessageBox |
19 from E5Gui import E5FileDialog, E5MessageBox |
20 |
20 |
3978 encoding = '' |
3978 encoding = '' |
3979 self.sbEnc.setText(encoding) |
3979 self.sbEnc.setText(encoding) |
3980 |
3980 |
3981 if language is None: |
3981 if language is None: |
3982 language = '' |
3982 language = '' |
3983 self.sbLang.setText(language) |
3983 pixmap = QScintilla.Lexers.getLanguageIcon(language, True) |
|
3984 self.sbLang.setPixmap(pixmap) |
|
3985 if pixmap.isNull(): |
|
3986 self.sbLang.setText(language) |
|
3987 self.sbLang.setToolTip("") |
|
3988 else: |
|
3989 self.sbLang.setText("") |
|
3990 self.sbLang.setToolTip(QApplication.translate('ViewManager', |
|
3991 'Language: {0}'.format(language))) |
3984 |
3992 |
3985 if eol is None: |
3993 if eol is None: |
3986 eol = '' |
3994 eol = '' |
3987 self.sbEol.setText(eol) |
3995 self.sbEol.setPixmap(self.__eolPixmap(eol)) |
|
3996 self.sbEol.setToolTip(QApplication.translate('ViewManager', |
|
3997 'EOL Mode: {0}'.format(eol))) |
|
3998 |
|
3999 def __eolPixmap(self, eolIndicator): |
|
4000 """ |
|
4001 Private method to get an EOL pixmap for an EOL string. |
|
4002 |
|
4003 @param eolIndicator eol indicator string (string) |
|
4004 @return pixmap for the eol indicator (QPixmap) |
|
4005 """ |
|
4006 if eolIndicator == "LF": |
|
4007 pixmap = UI.PixmapCache.getPixmap("eolLinux.png") |
|
4008 elif eolIndicator == "CR": |
|
4009 pixmap = UI.PixmapCache.getPixmap("eolMac.png") |
|
4010 elif eolIndicator == "CRLF": |
|
4011 pixmap = UI.PixmapCache.getPixmap("eolWindows.png") |
|
4012 else: |
|
4013 pixmap = QPixmap() |
|
4014 return pixmap |
3988 |
4015 |
3989 def unhighlight(self, current=False): |
4016 def unhighlight(self, current=False): |
3990 """ |
4017 """ |
3991 Public method to switch off all highlights. |
4018 Public method to switch off all highlights. |
3992 |
4019 |