Skip to content

Commit

Permalink
COMMIT added the code for showing error message box when treewidget i…
Browse files Browse the repository at this point in the history
…s empty
  • Loading branch information
Preetam-Das26 committed Oct 11, 2024
1 parent 3f5f546 commit 8173163
Showing 1 changed file with 12 additions and 2 deletions.
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

0 comments on commit 8173163

Please sign in to comment.