1209 |
1209 |
1210 def addSideWidget(self, side, widget, icon, label): |
1210 def addSideWidget(self, side, widget, icon, label): |
1211 """ |
1211 """ |
1212 Public method to add a widget to the sides. |
1212 Public method to add a widget to the sides. |
1213 |
1213 |
1214 @param side side to add the widget to (UserInterface.LeftSide, |
1214 @param side side to add the widget to |
1215 UserInterface.BottomSide) |
1215 @type int (one of UserInterface.LeftSide, UserInterface.BottomSide, |
1216 @param widget reference to the widget to add (QWidget) |
1216 UserInterface.RightSide) |
1217 @param icon icon to be used (QIcon) |
1217 @param widget reference to the widget to add |
1218 @param label label text to be shown (string) |
1218 @type QWidget |
|
1219 @param icon icon to be used |
|
1220 @type QIcon |
|
1221 @param label label text to be shown |
|
1222 @type str |
1219 """ |
1223 """ |
1220 assert side in [UserInterface.LeftSide, UserInterface.BottomSide, |
1224 assert side in [UserInterface.LeftSide, UserInterface.BottomSide, |
1221 UserInterface.RightSide] |
1225 UserInterface.RightSide] |
1222 |
1226 |
1223 if self.__layoutType == "Toolboxes": |
1227 if self.__layoutType == "Toolboxes": |
1232 self.leftSidebar.addTab(widget, icon, label) |
1236 self.leftSidebar.addTab(widget, icon, label) |
1233 elif side == UserInterface.BottomSide: |
1237 elif side == UserInterface.BottomSide: |
1234 self.bottomSidebar.addTab(widget, icon, label) |
1238 self.bottomSidebar.addTab(widget, icon, label) |
1235 elif side == UserInterface.RightSide: |
1239 elif side == UserInterface.RightSide: |
1236 self.rightSidebar.addTab(widget, icon, label) |
1240 self.rightSidebar.addTab(widget, icon, label) |
1237 |
1241 |
1238 def removeSideWidget(self, widget): |
1242 def removeSideWidget(self, widget): |
1239 """ |
1243 """ |
1240 Public method to remove a widget added using addSideWidget(). |
1244 Public method to remove a widget added using addSideWidget(). |
1241 |
1245 |
1242 @param widget reference to the widget to remove (QWidget) |
1246 @param widget reference to the widget to remove |
|
1247 @type QWidget |
1243 """ |
1248 """ |
1244 if self.__layoutType == "Toolboxes": |
1249 if self.__layoutType == "Toolboxes": |
1245 for container in [self.lToolbox, self.hToolbox, self.rToolbox]: |
1250 for container in [self.lToolbox, self.hToolbox, self.rToolbox]: |
1246 index = container.indexOf(widget) |
1251 index = container.indexOf(widget) |
1247 if index != -1: |
1252 if index != -1: |
1250 for container in [self.leftSidebar, self.bottomSidebar, |
1255 for container in [self.leftSidebar, self.bottomSidebar, |
1251 self.rightSidebar]: |
1256 self.rightSidebar]: |
1252 index = container.indexOf(widget) |
1257 index = container.indexOf(widget) |
1253 if index != -1: |
1258 if index != -1: |
1254 container.removeTab(index) |
1259 container.removeTab(index) |
1255 |
1260 |
|
1261 def showSideWidget(self, widget): |
|
1262 """ |
|
1263 Public method to show a specific widget placed in the side widgets. |
|
1264 |
|
1265 @param widget reference to the widget to be shown |
|
1266 @type QWidget |
|
1267 """ |
|
1268 if self.__layoutType == "Toolboxes": |
|
1269 for dock in [self.lToolboxDock, self.hToolboxDock, |
|
1270 self.rToolboxDock]: |
|
1271 container = dock.widget() |
|
1272 index = container.indexOf(widget) |
|
1273 if index != -1: |
|
1274 dock.show() |
|
1275 container.setCurrentIndex(index) |
|
1276 dock.raise_() |
|
1277 elif self.__layoutType == "Sidebars": |
|
1278 for container in [self.leftSidebar, self.bottomSidebar, |
|
1279 self.rightSidebar]: |
|
1280 index = container.indexOf(widget) |
|
1281 if index != -1: |
|
1282 container.show() |
|
1283 container.setCurrentIndex(index) |
|
1284 container.raise_() |
|
1285 if container.isAutoHiding(): |
|
1286 container.setFocus() |
|
1287 |
1256 def showLogViewer(self): |
1288 def showLogViewer(self): |
1257 """ |
1289 """ |
1258 Public method to show the Log-Viewer. |
1290 Public method to show the Log-Viewer. |
1259 """ |
1291 """ |
1260 if Preferences.getUI("LogViewerAutoRaise"): |
1292 if Preferences.getUI("LogViewerAutoRaise"): |