Skip to content

Commit 6ef655a

Browse files
committed
Documentation
1 parent c18de52 commit 6ef655a

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

activity_browser/ui/menu_bar.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414

1515
class MenuBar(QtWidgets.QMenuBar):
16+
"""
17+
Main menu bar at the top of the Activity Browser window. Contains submenus for different user interaction categories
18+
"""
1619
def __init__(self, window):
1720
super().__init__(parent=window)
1821

@@ -23,10 +26,14 @@ def __init__(self, window):
2326

2427

2528
class ProjectMenu(QtWidgets.QMenu):
29+
"""
30+
Project menu: contains actions related to managing the project, such as project duplication, database importing etc.
31+
"""
32+
2633
def __init__(self, parent=None) -> None:
2734
super().__init__(parent)
2835

29-
self.setTitle("Project")
36+
self.setTitle("&Project")
3037

3138
self.new_proj_action = actions.ProjectNew.get_QAction()
3239
self.dup_proj_action = actions.ProjectDuplicate.get_QAction()
@@ -68,6 +75,10 @@ def biosphere_exists(self) -> None:
6875

6976

7077
class ViewMenu(QtWidgets.QMenu):
78+
"""
79+
View menu: contains actions in regard to hiding and showing specific UI elements.
80+
"""
81+
7182
def __init__(self, parent=None) -> None:
7283
super().__init__(parent)
7384

@@ -91,6 +102,10 @@ def __init__(self, parent=None) -> None:
91102

92103

93104
class ToolsMenu(QtWidgets.QMenu):
105+
"""
106+
Tools Menu: contains actions in regard to special tooling aspects of the AB
107+
"""
108+
94109
def __init__(self, parent=None) -> None:
95110
super().__init__(parent)
96111
self.setTitle("&Tools")
@@ -101,6 +116,10 @@ def __init__(self, parent=None) -> None:
101116

102117

103118
class HelpMenu(QtWidgets.QMenu):
119+
"""
120+
Help Menu: contains actions that show info to the user or redirect them to online resources
121+
"""
122+
104123
def __init__(self, parent=None) -> None:
105124
super().__init__(parent)
106125
self.setTitle("&Help")
@@ -119,6 +138,8 @@ def __init__(self, parent=None) -> None:
119138
)
120139

121140
def about(self):
141+
"""Displays an 'about' window to the user containing e.g. the version of the AB and copyright info"""
142+
# set the window text in html format
122143
text = f"""
123144
Activity Browser - a graphical interface for Brightway2.<br><br>
124145
Application version: <b>{version("activity_browser")}</b><br>
@@ -130,20 +151,24 @@ def about(self):
130151
For license information please see the copyright on <a href="https://github.com/LCA-ActivityBrowser/activity-browser/blob/main/LICENSE.txt">this page</a>.<br><br>
131152
"""
132153

154+
# set up the window
133155
about_window = QtWidgets.QMessageBox(parent=application.main_window)
134156
about_window.setWindowTitle("About the Activity Browser")
135157
about_window.setIconPixmap(qicons.ab.pixmap(QSize(150, 150)))
136158
about_window.setText(text)
137159

160+
# execute
138161
about_window.exec_()
139162

140163
def open_wiki(self):
164+
"""Opens the AB github wiki in the users default browser"""
141165
url = QUrl(
142166
"https://github.com/LCA-ActivityBrowser/activity-browser/wiki"
143167
)
144168
QtGui.QDesktopServices.openUrl(url)
145169

146170
def raise_issue_github(self):
171+
"""Opens the github create issue page in the users default browser"""
147172
url = QUrl(
148173
"https://github.com/LCA-ActivityBrowser/activity-browser/issues/new/choose"
149174
)
@@ -192,6 +217,8 @@ def populate(self):
192217

193218

194219
class MigrationsMenu(QtWidgets.QMenu):
220+
"""Menu that shows actions that regard to brightway migrations"""
221+
195222
def __init__(self, parent=None) -> None:
196223
super().__init__(parent)
197224

0 commit comments

Comments
 (0)