E5Gui/E5ToolBarManager.py

changeset 2084
d3f083dd0222
parent 1509
c0b5e693b0eb
child 2095
5bf2d8a73173
equal deleted inserted replaced
2083:3005ae4463aa 2084:d3f083dd0222
7 Module implementing a toolbar manager class. 7 Module implementing a toolbar manager class.
8 """ 8 """
9 9
10 from PyQt4.QtCore import QObject, QByteArray, QDataStream, QIODevice 10 from PyQt4.QtCore import QObject, QByteArray, QDataStream, QIODevice
11 from PyQt4.QtGui import QToolBar 11 from PyQt4.QtGui import QToolBar
12
13 import Utilities
12 14
13 15
14 class E5ToolBarManager(QObject): 16 class E5ToolBarManager(QObject):
15 """ 17 """
16 Class implementing a toolbar manager. 18 Class implementing a toolbar manager.
508 if tmarker != E5ToolBarManager.ToolBarMarker: 510 if tmarker != E5ToolBarManager.ToolBarMarker:
509 return False 511 return False
510 512
511 toolBarCount = stream.readUInt16() 513 toolBarCount = stream.readUInt16()
512 for i in range(toolBarCount): 514 for i in range(toolBarCount):
513 objectName = stream.readString().decode() 515 objectName = Utilities.readStringFromStream(stream)
514 actionCount = stream.readUInt16() 516 actionCount = stream.readUInt16()
515 actions = [] 517 actions = []
516 for j in range(actionCount): 518 for j in range(actionCount):
517 actionName = stream.readString().decode() 519 actionName = Utilities.readStringFromStream(stream)
518 if actionName: 520 if actionName:
519 action = self.__findAction(actionName) 521 action = self.__findAction(actionName)
520 if action is not None: 522 if action is not None:
521 actions.append(action) 523 actions.append(action)
522 else: 524 else:
531 533
532 oldCustomToolBars = self.__customToolBars[:] 534 oldCustomToolBars = self.__customToolBars[:]
533 535
534 toolBarCount = stream.readUInt16() 536 toolBarCount = stream.readUInt16()
535 for i in range(toolBarCount): 537 for i in range(toolBarCount):
536 objectName = stream.readString().decode() 538 objectName = Utilities.readStringFromStream(stream)
537 toolBarTitle = stream.readString().decode() 539 toolBarTitle = Utilities.readStringFromStream(stream)
538 actionCount = stream.readUInt16() 540 actionCount = stream.readUInt16()
539 actions = [] 541 actions = []
540 for j in range(actionCount): 542 for j in range(actionCount):
541 actionName = stream.readString().decode() 543 actionName = Utilities.readStringFromStream(stream)
542 if actionName: 544 if actionName:
543 action = self.__findAction(actionName) 545 action = self.__findAction(actionName)
544 if action is not None: 546 if action is not None:
545 actions.append(action) 547 actions.append(action)
546 else: 548 else:

eric ide

mercurial