diff --git a/plugin/Plugin/Export/export_tab.py b/plugin/Plugin/Export/export_tab.py index 0fa38e9..418a12e 100644 --- a/plugin/Plugin/Export/export_tab.py +++ b/plugin/Plugin/Export/export_tab.py @@ -77,6 +77,7 @@ def setup_ui(self): self.instruction_label.setText( "Configure your project metadata and select an " "export location for the RO-Crate package." + "Fields marked with an asterisk (*) are required." ) self.instruction_label.setWordWrap(True) self.export_layout.addWidget(self.instruction_label) @@ -92,7 +93,7 @@ def setup_ui(self): self.author_layout.setContentsMargins(10, 10, 10, 10) # Author field - self.author_label = QLabel("Author:", self) + self.author_label = QLabel("Author (*):", self) self.author_LineEdit = QLineEdit(self) self.author_LineEdit.setPlaceholderText("Enter author name") self.author_LineEdit.setToolTip("Name of the author") @@ -124,7 +125,7 @@ def setup_ui(self): self.metadata_layout.setContentsMargins(10, 10, 10, 10) # License field - self.license_label = QLabel("License:", self) + self.license_label = QLabel("License (*):", self) self.license_ComboBox = QComboBox(self) self.license_ComboBox.setToolTip( "Select the license for your dataset (required)" @@ -133,14 +134,14 @@ def setup_ui(self): self.metadata_layout.addRow(self.license_label, self.license_ComboBox) # Title field - self.title_label = QLabel("Project Title:", self) + self.title_label = QLabel("Project Title (*):", self) self.title_LineEdit = QLineEdit(self) self.title_LineEdit.setPlaceholderText("Enter project title") self.title_LineEdit.setToolTip("Title for your QGIS project") self.metadata_layout.addRow(self.title_label, self.title_LineEdit) # Description field - self.description_label = QLabel("Description:", self) + self.description_label = QLabel("Description (*):", self) self.description_label.setAlignment( Qt.AlignLeading | Qt.AlignLeft | Qt.AlignTop ) @@ -166,7 +167,7 @@ def setup_ui(self): self.export_path_layout = QHBoxLayout() self.export_path_layout.setSpacing(8) - self.export_path_label = QLabel("Export Path:", self) + self.export_path_label = QLabel("Export Path (*):", self) self.export_path_label.setMinimumSize(QSize(80, 0)) self.export_path_layout.addWidget(self.export_path_label) @@ -281,6 +282,8 @@ def _setup_signal_connections(self): # Field validation connections self.title_LineEdit.textChanged.connect(self.validate_form) + self.description_TextEdit.textChanged.connect(self.validate_form) + self.author_LineEdit.textChanged.connect(self.validate_form) self.export_path_LineEdit.textChanged.connect(self.validate_form) self.license_ComboBox.currentTextChanged.connect(self.validate_form) diff --git a/plugin/Plugin/Layer/layer_metadata_dialog.py b/plugin/Plugin/Layer/layer_metadata_dialog.py index 4666db2..1482e66 100644 --- a/plugin/Plugin/Layer/layer_metadata_dialog.py +++ b/plugin/Plugin/Layer/layer_metadata_dialog.py @@ -52,8 +52,17 @@ def __init__(self, parent=None, layer=None): def setup_ui(self): """Setup the user interface components and layout.""" self.setWindowTitle("Layer Metadata Documentation") - self.setMinimumSize(650, 700) - self.resize(650, 700) + self.setMinimumSize(650, 850) + self.resize(650, 850) + + # Instruction label + self.instruction_label = QLabel(self) + self.instruction_label.setText( + "Fields marked with an asterisk (*) are required." + ) + self.instruction_label.setWordWrap(True) + + # Main layout main_layout = QVBoxLayout() @@ -68,6 +77,8 @@ def setup_ui(self): self._create_external_source_section(main_layout) self._create_button_section(main_layout) + main_layout.addWidget(self.instruction_label) + self.setLayout(main_layout) def setup_logic(self): @@ -145,7 +156,7 @@ def _create_basic_info_section(self, main_layout): self.description_textedit.setToolTip( "Provide a clear description of what this layer contains and its intended use" ) - basic_info_layout.addRow("Description:", self.description_textedit) + basic_info_layout.addRow("Description (*): ", self.description_textedit) basic_info_group.setLayout(basic_info_layout) main_layout.addWidget(basic_info_group) @@ -242,7 +253,7 @@ def _create_external_source_section(self, main_layout): self.source_title_lineedit.setToolTip( "Enter the official name or title of the data source" ) - source_info_layout.addRow("Source Title:", self.source_title_lineedit) + source_info_layout.addRow("Source Title (*): ", self.source_title_lineedit) # Source URL self.source_url_lineedit = QLineEdit() @@ -250,7 +261,7 @@ def _create_external_source_section(self, main_layout): self.source_url_lineedit.setToolTip( "Enter the URL where this data was obtained" ) - source_info_layout.addRow("Source URL:", self.source_url_lineedit) + source_info_layout.addRow("Source URL (*): ", self.source_url_lineedit) # Source Date self.source_date_dateedit = QDateEdit() @@ -350,8 +361,14 @@ def populate_fields(self): # External source fields if hasattr(self.layer, "source_title") and self.layer.source_title: self.source_title_lineedit.setText(self.layer.source_title) + # Set source URL from layer.source_url if available, otherwise use data source if hasattr(self.layer, "source_url") and self.layer.source_url: self.source_url_lineedit.setText(self.layer.source_url) + else: + # Use the data source as the source URL + data_source = str(getattr(self.layer, "source", "")) + if data_source: + self.source_url_lineedit.setText(data_source) if hasattr(self.layer, "source_date") and self.layer.source_date: date = QDate.fromString(self.layer.source_date, "yyyy-MM-dd") if date.isValid():