192 masterPasswordChanged = pyqtSignal(str, str) |
192 masterPasswordChanged = pyqtSignal(str, str) |
193 |
193 |
194 maxFilePathLen = 100 |
194 maxFilePathLen = 100 |
195 maxSbFilePathLen = 150 |
195 maxSbFilePathLen = 150 |
196 maxMenuFilePathLen = 75 |
196 maxMenuFilePathLen = 75 |
|
197 |
|
198 LeftSide = 1 |
|
199 BottomSide = 2 |
|
200 RightSide = 3 |
197 |
201 |
198 def __init__(self, app, locale, splash, plugin, noOpenAtStartup, restartArguments): |
202 def __init__(self, app, locale, splash, plugin, noOpenAtStartup, restartArguments): |
199 """ |
203 """ |
200 Constructor |
204 Constructor |
201 |
205 |
864 self.setCorner(Qt.TopRightCorner, Qt.TopDockWidgetArea) |
868 self.setCorner(Qt.TopRightCorner, Qt.TopDockWidgetArea) |
865 if Preferences.getUI("BottomRightByRight"): |
869 if Preferences.getUI("BottomRightByRight"): |
866 self.setCorner(Qt.BottomRightCorner, Qt.RightDockWidgetArea) |
870 self.setCorner(Qt.BottomRightCorner, Qt.RightDockWidgetArea) |
867 else: |
871 else: |
868 self.setCorner(Qt.BottomRightCorner, Qt.BottomDockWidgetArea) |
872 self.setCorner(Qt.BottomRightCorner, Qt.BottomDockWidgetArea) |
|
873 |
|
874 def addSideWidget(self, side, widget, icon, label): |
|
875 """ |
|
876 Public method to add a widget to the sides. |
|
877 |
|
878 @param side side to add the widget to (UserInterface.LeftSide, |
|
879 UserInterface.BottomSide) |
|
880 @param widget reference to the widget to add (QWidget) |
|
881 @param icon icon to be used (QIcon) |
|
882 @param label label text to be shown (string) |
|
883 """ |
|
884 assert side in [UserInterface.LeftSide, UserInterface.BottomSide] |
|
885 |
|
886 if self.layout == "Toolboxes": |
|
887 if side == UserInterface.LeftSide: |
|
888 self.vToolbox.addItem(widget, icon, label) |
|
889 elif side == UserInterface.BottomSide: |
|
890 self.hToolbox.addItem(widget, icon, label) |
|
891 elif self.layout == "Sidebars": |
|
892 if side == UserInterface.LeftSide: |
|
893 self.leftSidebar.addTab(widget, icon, label) |
|
894 elif side == UserInterface.BottomSide: |
|
895 self.bottomSidebar.addTab(widget, icon, label) |
|
896 |
|
897 def removeSideWidget(self, widget): |
|
898 """ |
|
899 Public method to remove a widget added using addSideWidget(). |
|
900 |
|
901 @param widget reference to the widget to remove (QWidget) |
|
902 """ |
|
903 if self.layout == "Toolboxes": |
|
904 for container in [self.vToolbox, self.hToolbox]: |
|
905 index = container.indexOf(widget) |
|
906 if index != -1: |
|
907 container.removeItem(index) |
|
908 elif self.layout == "Sidebars": |
|
909 for container in [self.leftSidebar, self.bottomSidebar]: |
|
910 index = container.indexOf(widget) |
|
911 if index != -1: |
|
912 container.removeTab(index) |
869 |
913 |
870 def showLogTab(self, tabname): |
914 def showLogTab(self, tabname): |
871 """ |
915 """ |
872 Public method to show a particular Log-Viewer tab. |
916 Public method to show a particular Log-Viewer tab. |
873 |
917 |