1373 Private method to handle the selection of an encoding. |
1373 Private method to handle the selection of an encoding. |
1374 |
1374 |
1375 @param act reference to the action that was triggered (QAction) |
1375 @param act reference to the action that was triggered (QAction) |
1376 """ |
1376 """ |
1377 encoding = act.data() |
1377 encoding = act.data() |
|
1378 self.setModified(True) |
1378 self.__encodingChanged("{0}-selected".format(encoding)) |
1379 self.__encodingChanged("{0}-selected".format(encoding)) |
1379 |
1380 |
1380 def __checkEncoding(self): |
1381 def __checkEncoding(self): |
1381 """ |
1382 """ |
1382 Private method to check the selected encoding of the encodings submenu. |
1383 Private method to check the selected encoding of the encodings submenu. |
1400 if not self.inEncodingChanged and propagate: |
1401 if not self.inEncodingChanged and propagate: |
1401 self.inEncodingChanged = True |
1402 self.inEncodingChanged = True |
1402 self.encodingChanged.emit(self.encoding) |
1403 self.encodingChanged.emit(self.encoding) |
1403 self.inEncodingChanged = False |
1404 self.inEncodingChanged = False |
1404 |
1405 |
1405 def __normalizedEncoding(self): |
1406 def __normalizedEncoding(self, encoding=""): |
1406 """ |
1407 """ |
1407 Private method to calculate the normalized encoding string. |
1408 Private method to calculate the normalized encoding string. |
1408 |
1409 |
|
1410 @param encoding encoding to be normalized (string) |
1409 @return normalized encoding (string) |
1411 @return normalized encoding (string) |
1410 """ |
1412 """ |
1411 return self.encoding.replace("-default", "")\ |
1413 if not encoding: |
1412 .replace("-guessed", "")\ |
1414 encoding = self.encoding |
1413 .replace("-selected", "") |
1415 return encoding.replace("-default", "")\ |
|
1416 .replace("-guessed", "")\ |
|
1417 .replace("-selected", "") |
1414 |
1418 |
1415 def __showContextMenuEol(self): |
1419 def __showContextMenuEol(self): |
1416 """ |
1420 """ |
1417 Private slot handling the aboutToShow signal of the eol context menu. |
1421 Private slot handling the aboutToShow signal of the eol context menu. |
1418 """ |
1422 """ |