eric7/UI/UserInterface.py

branch
eric7
changeset 8812
01775e32d80b
parent 8774
d728227e8ebb
child 8819
982fb074be98
equal deleted inserted replaced
8811:9ff6b1b5f601 8812:01775e32d80b
1020 splitter.addWidget(self.__previewer) 1020 splitter.addWidget(self.__previewer)
1021 1021
1022 splitter.addWidget(self.__astViewer) 1022 splitter.addWidget(self.__astViewer)
1023 1023
1024 splitter.addWidget(self.__disViewer) 1024 splitter.addWidget(self.__disViewer)
1025
1026 # Initialize the widgets of the layouts to None
1027 self.lToolbox = None
1028 self.rToolbox = None
1029 self.hToolbox = None
1030 self.leftSidebar = None
1031 self.rightSidebar = None
1032 self.bottomSidebar = None
1025 1033
1026 # Create layout with toolbox windows embedded in dock windows 1034 # Create layout with toolbox windows embedded in dock windows
1027 if self.__layoutType == "Toolboxes": 1035 if self.__layoutType == "Toolboxes":
1028 logging.debug("Creating toolboxes...") 1036 logging.debug("Creating toolboxes...")
1029 self.__createToolboxesLayout() 1037 self.__createToolboxesLayout()
2025 )) 2033 ))
2026 self.templateViewerActivateAct.triggered.connect( 2034 self.templateViewerActivateAct.triggered.connect(
2027 self.__activateTemplateViewer) 2035 self.__activateTemplateViewer)
2028 self.actions.append(self.templateViewerActivateAct) 2036 self.actions.append(self.templateViewerActivateAct)
2029 self.addAction(self.templateViewerActivateAct) 2037 self.addAction(self.templateViewerActivateAct)
2030 2038
2031 self.ltAct = EricAction( 2039 if self.lToolbox:
2032 self.tr('Left Toolbox'), 2040 self.ltAct = EricAction(
2033 self.tr('&Left Toolbox'), 0, 0, self, 'vertical_toolbox', True) 2041 self.tr('Left Toolbox'),
2034 self.ltAct.setStatusTip(self.tr('Toggle the Left Toolbox window')) 2042 self.tr('&Left Toolbox'), 0, 0, self, 'vertical_toolbox', True)
2035 self.ltAct.setWhatsThis(self.tr( 2043 self.ltAct.setStatusTip(self.tr('Toggle the Left Toolbox window'))
2036 """<b>Toggle the Left Toolbox window</b>""" 2044 self.ltAct.setWhatsThis(self.tr(
2037 """<p>If the Left Toolbox window is hidden then display it.""" 2045 """<b>Toggle the Left Toolbox window</b>"""
2038 """ If it is displayed then close it.</p>""" 2046 """<p>If the Left Toolbox window is hidden then display it."""
2039 )) 2047 """ If it is displayed then close it.</p>"""
2040 self.ltAct.triggered.connect(self.__toggleLeftToolbox) 2048 ))
2041 self.actions.append(self.ltAct) 2049 self.ltAct.triggered.connect(self.__toggleLeftToolbox)
2042 2050 self.actions.append(self.ltAct)
2043 self.rtAct = EricAction( 2051 else:
2044 self.tr('Right Toolbox'), 2052 self.ltAct = None
2045 self.tr('&Right Toolbox'), 2053
2046 0, 0, self, 'vertical_toolbox', True) 2054 if self.rToolbox:
2047 self.rtAct.setStatusTip(self.tr('Toggle the Right Toolbox window')) 2055 self.rtAct = EricAction(
2048 self.rtAct.setWhatsThis(self.tr( 2056 self.tr('Right Toolbox'),
2049 """<b>Toggle the Right Toolbox window</b>""" 2057 self.tr('&Right Toolbox'),
2050 """<p>If the Right Toolbox window is hidden then display it.""" 2058 0, 0, self, 'vertical_toolbox', True)
2051 """ If it is displayed then close it.</p>""" 2059 self.rtAct.setStatusTip(self.tr('Toggle the Right Toolbox window'))
2052 )) 2060 self.rtAct.setWhatsThis(self.tr(
2053 self.rtAct.triggered.connect(self.__toggleRightToolbox) 2061 """<b>Toggle the Right Toolbox window</b>"""
2054 self.actions.append(self.rtAct) 2062 """<p>If the Right Toolbox window is hidden then display it."""
2055 2063 """ If it is displayed then close it.</p>"""
2056 self.htAct = EricAction( 2064 ))
2057 self.tr('Horizontal Toolbox'), 2065 self.rtAct.triggered.connect(self.__toggleRightToolbox)
2058 self.tr('&Horizontal Toolbox'), 0, 0, self, 2066 self.actions.append(self.rtAct)
2059 'horizontal_toolbox', True) 2067 else:
2060 self.htAct.setStatusTip(self.tr( 2068 self.rtAct = None
2061 'Toggle the Horizontal Toolbox window')) 2069
2062 self.htAct.setWhatsThis(self.tr( 2070 if self.hToolbox:
2063 """<b>Toggle the Horizontal Toolbox window</b>""" 2071 self.htAct = EricAction(
2064 """<p>If the Horizontal Toolbox window is hidden then display""" 2072 self.tr('Horizontal Toolbox'),
2065 """ it. If it is displayed then close it.</p>""" 2073 self.tr('&Horizontal Toolbox'), 0, 0, self,
2066 )) 2074 'horizontal_toolbox', True)
2067 self.htAct.triggered.connect(self.__toggleHorizontalToolbox) 2075 self.htAct.setStatusTip(self.tr(
2068 self.actions.append(self.htAct) 2076 'Toggle the Horizontal Toolbox window'))
2069 2077 self.htAct.setWhatsThis(self.tr(
2070 self.lsbAct = EricAction( 2078 """<b>Toggle the Horizontal Toolbox window</b>"""
2071 self.tr('Left Sidebar'), 2079 """<p>If the Horizontal Toolbox window is hidden then"""
2072 self.tr('&Left Sidebar'), 2080 """ display it. If it is displayed then close it.</p>"""
2073 0, 0, self, 'left_sidebar', True) 2081 ))
2074 self.lsbAct.setStatusTip(self.tr('Toggle the left sidebar window')) 2082 self.htAct.triggered.connect(self.__toggleHorizontalToolbox)
2075 self.lsbAct.setWhatsThis(self.tr( 2083 self.actions.append(self.htAct)
2076 """<b>Toggle the left sidebar window</b>""" 2084 else:
2077 """<p>If the left sidebar window is hidden then display it.""" 2085 self.htAct = None
2078 """ If it is displayed then close it.</p>""" 2086
2079 )) 2087 if self.leftSidebar:
2080 self.lsbAct.triggered.connect(self.__toggleLeftSidebar) 2088 self.lsbAct = EricAction(
2081 self.actions.append(self.lsbAct) 2089 self.tr('Left Sidebar'),
2090 self.tr('&Left Sidebar'),
2091 0, 0, self, 'left_sidebar', True)
2092 self.lsbAct.setStatusTip(self.tr('Toggle the left sidebar window'))
2093 self.lsbAct.setWhatsThis(self.tr(
2094 """<b>Toggle the left sidebar window</b>"""
2095 """<p>If the left sidebar window is hidden then display it."""
2096 """ If it is displayed then close it.</p>"""
2097 ))
2098 self.lsbAct.triggered.connect(self.__toggleLeftSidebar)
2099 self.actions.append(self.lsbAct)
2100 else:
2101 self.lsbAct = None
2082 2102
2083 if self.rightSidebar: 2103 if self.rightSidebar:
2084 self.rsbAct = EricAction( 2104 self.rsbAct = EricAction(
2085 self.tr('Right Sidebar'), 2105 self.tr('Right Sidebar'),
2086 self.tr('&Right Sidebar'), 2106 self.tr('&Right Sidebar'),
2095 self.rsbAct.triggered.connect(self.__toggleRightSidebar) 2115 self.rsbAct.triggered.connect(self.__toggleRightSidebar)
2096 self.actions.append(self.rsbAct) 2116 self.actions.append(self.rsbAct)
2097 else: 2117 else:
2098 self.rsbAct = None 2118 self.rsbAct = None
2099 2119
2100 self.bsbAct = EricAction( 2120 if self.bottomSidebar:
2101 self.tr('Bottom Sidebar'), 2121 self.bsbAct = EricAction(
2102 self.tr('&Bottom Sidebar'), 0, 0, self, 2122 self.tr('Bottom Sidebar'),
2103 'bottom_sidebar', True) 2123 self.tr('&Bottom Sidebar'), 0, 0, self,
2104 self.bsbAct.setStatusTip(self.tr( 2124 'bottom_sidebar', True)
2105 'Toggle the bottom sidebar window')) 2125 self.bsbAct.setStatusTip(self.tr(
2106 self.bsbAct.setWhatsThis(self.tr( 2126 'Toggle the bottom sidebar window'))
2107 """<b>Toggle the bottom sidebar window</b>""" 2127 self.bsbAct.setWhatsThis(self.tr(
2108 """<p>If the bottom sidebar window is hidden then display it.""" 2128 """<b>Toggle the bottom sidebar window</b>"""
2109 """ If it is displayed then close it.</p>""" 2129 """<p>If the bottom sidebar window is hidden then display"""
2110 )) 2130 """ it. If it is displayed then close it.</p>"""
2111 self.bsbAct.triggered.connect(self.__toggleBottomSidebar) 2131 ))
2112 self.actions.append(self.bsbAct) 2132 self.bsbAct.triggered.connect(self.__toggleBottomSidebar)
2133 self.actions.append(self.bsbAct)
2134 else:
2135 self.bsbAct = None
2113 2136
2114 if self.cooperation is not None: 2137 if self.cooperation is not None:
2115 self.cooperationViewerActivateAct = EricAction( 2138 self.cooperationViewerActivateAct = EricAction(
2116 self.tr('Cooperation-Viewer'), 2139 self.tr('Cooperation-Viewer'),
2117 self.tr('Co&operation-Viewer'), 2140 self.tr('Co&operation-Viewer'),

eric ide

mercurial