Skip to content

Commit

Permalink
Merge pull request #432 from mattgibbs/fix_about_tools
Browse files Browse the repository at this point in the history
Fix 'About' Screen Crash
  • Loading branch information
hhslepicka authored Nov 19, 2018
2 parents 44b4a93 + 3b69a0b commit 9a3938c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pydm/about_pydm/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
class AboutWindow(QWidget):
def __init__(self, parent=None):
super(AboutWindow, self).__init__(parent, Qt.Window)
self.app = QApplication.instance()
self.ui = Ui_Form()
self.ui.setupUi(self)
self.ui.pydmVersionLabel.setText(str(self.ui.pydmVersionLabel.text()).format(version=pydm.__version__))
Expand All @@ -33,7 +32,7 @@ def populate_external_tools_list(self):
self.ui.externalToolsTableWidget.setHorizontalHeaderLabels(col_labels)
self.ui.externalToolsTableWidget.horizontalHeader().setStretchLastSection(True)
self.ui.externalToolsTableWidget.verticalHeader().setVisible(False)
self.add_tools_to_list(self.app.tools)
self.add_tools_to_list(pydm.tools.ext_tools)

def add_tools_to_list(self, tools):
for (name, tool) in tools.items():
Expand All @@ -58,7 +57,7 @@ def populate_plugin_list(self):
self.ui.dataPluginsTableWidget.setHorizontalHeaderLabels(col_labels)
self.ui.dataPluginsTableWidget.horizontalHeader().setStretchLastSection(True)
self.ui.dataPluginsTableWidget.verticalHeader().setVisible(False)
for (protocol, plugin) in self.app.plugins.items():
for (protocol, plugin) in pydm.data_plugins.plugin_modules.items():
protocol_item = QTableWidgetItem(protocol)
file_item = QTableWidgetItem(inspect.getfile(plugin.__class__))
new_row = self.ui.dataPluginsTableWidget.rowCount()
Expand Down
6 changes: 6 additions & 0 deletions pydm/tests/test_about_screen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from pydm.about_pydm import AboutWindow
def test_about_window_launches(qtbot):
"""Make sure the About window doesn't crash."""
a = AboutWindow(parent=None)
qtbot.addWidget(a)
a.show()

0 comments on commit 9a3938c

Please sign in to comment.