diff --git a/jaxaEarthApiDialog.py b/jaxaEarthApiDialog.py index 98c79be..f8a667b 100644 --- a/jaxaEarthApiDialog.py +++ b/jaxaEarthApiDialog.py @@ -15,6 +15,7 @@ import os import json import datetime +import webbrowser # QGIS-API from qgis.PyQt import uic @@ -133,13 +134,14 @@ def init_gui(self): ) self.loadButton.clicked.connect(lambda: self.load_dataset()) + self.detailsButton.clicked.connect(lambda: self.show_details()) - self.datasetCombobox.currentIndexChanged.connect( - lambda: self.loadButton.setEnabled(self.is_executable()) - ) - self.bandCombobox.currentIndexChanged.connect( - lambda: self.loadButton.setEnabled(self.is_executable()) - ) + self.datasetCombobox.currentIndexChanged.connect(self.on_dataset_changed) + self.bandCombobox.currentIndexChanged.connect(self.on_dataset_changed) + + def on_dataset_changed(self): + self.loadButton.setEnabled(self.is_executable()) + self.detailsButton.setEnabled(self.is_executable()) self.adjustSize() @@ -330,3 +332,8 @@ def load_dataset(self): QgsProject.instance().addMapLayer(layer, False) layer_node = group_node.addLayer(layer) layer_node.setExpanded(False) + + def show_details(self): + dataset_name = self.datasetCombobox.currentData()["key"] + webbrowser.open(f"https://data.earth.jaxa.jp/en/datasets/#/id/{dataset_name}") + return diff --git a/jaxaEarthApiDialog.ui b/jaxaEarthApiDialog.ui index f3154a3..5e05587 100644 --- a/jaxaEarthApiDialog.ui +++ b/jaxaEarthApiDialog.ui @@ -37,7 +37,23 @@ - + + + + false + + + + 0 + 0 + + + + Details + + + + false