forked from indeOWS/INDE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathINDE_dialog.py
More file actions
48 lines (41 loc) · 2.16 KB
/
INDE_dialog.py
File metadata and controls
48 lines (41 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- 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