Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoplot - Add messagebox for emptytreewidget #2562

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions mslib/msui/autoplot_dockwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,12 @@ def add_to_treewidget(self, parent, parent2, config_settings, treewidget, flight
config_settings["automated_plotting_flights"].append([flight, sections, vertical, filename, itime, vtime])
parent.refresh_signal_emit.emit()
if treewidget.objectName() == "autoplotSecsTreeWidget":
if url is None:
if url == "":
QMessageBox.information(
self,
"WARNING",
"Please select the URL, layer, styles and level (row information first)"
)
return
item = QTreeWidgetItem([url, layer, styles, level, self.stime, self.etime, self.intv])
self.autoplotSecsTreeWidget.addTopLevelItem(item)
Expand Down Expand Up @@ -346,7 +351,12 @@ def update_treewidget(self, parent, parent2, config_settings, treewidget, flight
parent.refresh_signal_emit.emit()

if treewidget.objectName() == "autoplotSecsTreeWidget":
if url is None:
if url == "":
QMessageBox.information(
self,
"WARNING",
"Please select the URL, layer, styles and level (row information first)"
)
return
selected_item = self.autoplotSecsTreeWidget.currentItem()
selected_item.setText(0, url)
Expand Down
Loading