From 81731635ecafb2a678c3d888f3a8aa6fc041d46c Mon Sep 17 00:00:00 2001 From: Preetam-Das26 Date: Fri, 11 Oct 2024 20:35:47 +0530 Subject: [PATCH 1/2] COMMIT added the code for showing error message box when treewidget is empty --- mslib/msui/autoplot_dockwidget.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mslib/msui/autoplot_dockwidget.py b/mslib/msui/autoplot_dockwidget.py index d75bd13f3..1d9d4a60f 100644 --- a/mslib/msui/autoplot_dockwidget.py +++ b/mslib/msui/autoplot_dockwidget.py @@ -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) @@ -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) From 9c1cc7d1648b2e75531e12c3d29bd48b7ef77fe1 Mon Sep 17 00:00:00 2001 From: "Jets@ps2004" <120110796+Preetam-Das26@users.noreply.github.com> Date: Sat, 12 Oct 2024 13:41:10 +0530 Subject: [PATCH 2/2] added the text spaces --- mslib/msui/autoplot_dockwidget.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mslib/msui/autoplot_dockwidget.py b/mslib/msui/autoplot_dockwidget.py index 1d9d4a60f..156756cce 100644 --- a/mslib/msui/autoplot_dockwidget.py +++ b/mslib/msui/autoplot_dockwidget.py @@ -302,7 +302,7 @@ def add_to_treewidget(self, parent, parent2, config_settings, treewidget, flight QMessageBox.information( self, "WARNING", - "Please select the URL,layer,styles and level(row information first)" + "Please select the URL, layer, styles and level (row information first)" ) return item = QTreeWidgetItem([url, layer, styles, level, self.stime, self.etime, self.intv]) @@ -355,7 +355,7 @@ def update_treewidget(self, parent, parent2, config_settings, treewidget, flight QMessageBox.information( self, "WARNING", - "Please select the URL,layer,styles and level(row information first)" + "Please select the URL, layer, styles and level (row information first)" ) return selected_item = self.autoplotSecsTreeWidget.currentItem()