# -*- coding: utf-8 -*-
"""
/***************************************************************************
 INDEDialog
                                 A QGIS plugin
 This plugin allows connection to all ows services available in Brazil National Spatial Data Infrastructure
 Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
                             -------------------
        begin                : 2020-10-26
        git sha              : $Format:%H$
        copyright            : (C) 2020 by Julierme G Pinheiro / Leandro França
        email                : contato@geoone.com.br
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
"""

# INDE_dialog.py
import os, sys
from qgis.PyQt import uic, QtWidgets

# Aponte para o seu arquivo .ui real
UI_FILE = os.path.join(os.path.dirname(__file__), "INDE_dialog_base.ui")  # troque o nome se for outro

# --- Compat: alias 'resources_rc' -> seu 'resources' do plugin ---
try:
    # pacote (quando INDE_dialog.py está no mesmo pacote do plugin)
    from . import resources as resources_rc
except Exception:
    # fallback absoluto (caso de execução diferente)
    import resources as resources_rc

# registra o alias para que qualquer "import resources_rc" do .ui resolva
sys.modules.setdefault("resources_rc", resources_rc)

# --- Classe do diálogo carregando o .ui diretamente ---
class INDEDialog(QtWidgets.QDialog):
    def __init__(self, parent=None):
        super().__init__(parent)
        uic.loadUi(UI_FILE, self)   # <- evita loadUiType e o problema do from_imports

